pipeworks commands

This commit is contained in:
NatureFreshMilk 2019-08-27 13:39:47 +02:00
parent 17f7790590
commit 5b5222f5fe
4 changed files with 35 additions and 0 deletions

View File

@ -31,6 +31,7 @@ read_globals = {
-- Deps
"default", "advtrains",
"letters", "player_monoids",
"pipeworks",
-- optional mods
"xban"

View File

@ -25,3 +25,4 @@ ccompass?
charcoal?
castle_weapons?
player_monoids?
pipeworks?

View File

@ -40,6 +40,11 @@ if minetest.get_modpath("jumpdrive") then
dofile(MP.."/jumppoints.lua")
end
if minetest.get_modpath("pipeworks") then
-- pipeworks commands
dofile(MP.."/pipeworks.lua")
end
if minetest.get_modpath("telemosaic") then
-- limit telemosaic travel
dofile(MP.."/travel/telemosaic.lua")

28
pipeworks.lua Normal file
View File

@ -0,0 +1,28 @@
minetest.register_chatcommand("pipeworks_flush", {
description = "flushes the pipeworks tubes",
privs = {server=true},
func = function(name)
minetest.log("warning", "Player " .. name .. " flushes the pipeworks tubes")
local count = 0
for id, entity in pairs(pipeworks.luaentity.entities) do
entity:remove()
count = count + 1
end
minetest.log("warning", "Flushed: " .. count .. " items")
return true, "Flushed: " .. count .. " items"
end
})
minetest.register_chatcommand("pipeworks_stats", {
description = "Returns some pipeworks stats",
privs = {interact=true},
func = function(name)
local count = 0
for id, entity in pairs(pipeworks.luaentity.entities) do
count = count + 1
end
return true, "Items in tubes: " .. count
end
})