1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add '/clearobjects quick'

This commit is contained in:
Kahrl 2016-02-08 22:20:04 +01:00 committed by paramat
parent 47464c9344
commit b1428ab4bb
6 changed files with 124 additions and 51 deletions

View file

@ -848,14 +848,24 @@ core.register_chatcommand("kick", {
})
core.register_chatcommand("clearobjects", {
params = "[full|quick]",
description = "clear all objects in world",
privs = {server=true},
func = function(name, param)
options = {}
if param == "" or param == "full" then
options.mode = "full"
elseif param == "quick" then
options.mode = "quick"
else
return false, "Invalid usage, see /help clearobjects."
end
core.log("action", name .. " clears all objects.")
core.chat_send_all("Clearing all objects. This may take long."
.. " You may experience a timeout. (by "
.. name .. ")")
core.clear_objects()
core.clear_objects(options)
core.log("action", "Object clearing done.")
core.chat_send_all("*** Cleared all objects.")
end,