pipeworks commands
This commit is contained in:
parent
17f7790590
commit
5b5222f5fe
@ -31,6 +31,7 @@ read_globals = {
|
||||
-- Deps
|
||||
"default", "advtrains",
|
||||
"letters", "player_monoids",
|
||||
"pipeworks",
|
||||
|
||||
-- optional mods
|
||||
"xban"
|
||||
|
@ -25,3 +25,4 @@ ccompass?
|
||||
charcoal?
|
||||
castle_weapons?
|
||||
player_monoids?
|
||||
pipeworks?
|
||||
|
5
init.lua
5
init.lua
@ -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
28
pipeworks.lua
Normal 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
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user