Fixed the ambiguous /clear command being dangerous (#4026)

Implements #3826

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4026
Co-authored-by: the-real-herowl <wiktor_t-i@proton.me>
Co-committed-by: the-real-herowl <wiktor_t-i@proton.me>
This commit is contained in:
the-real-herowl 2023-11-27 02:22:39 +00:00 committed by the-real-herowl
parent 570ea114ec
commit 1044163717

@ -18,7 +18,7 @@ if minetest.settings:get_bool("mcl_builtin_commands_overide", true) then
register_chatcommand_alias("tell", "msg")
register_chatcommand_alias("w", "msg")
register_chatcommand_alias("tp", "teleport")
rename_chatcommand("clear", "clearinv")
register_chatcommand_alias("clearinventory", "clearinv")
minetest.register_chatcommand("banlist", {
description = S("List bans"),
@ -27,4 +27,14 @@ if minetest.settings:get_bool("mcl_builtin_commands_overide", true) then
return true, S("Ban list: @1", minetest.get_ban_list())
end,
})
end
minetest.register_chatcommand("clear", {
description = S("List clear commands"),
func = function(name)
return true, S("To clear inventory use /clearinv or /clearinventory").."\n"..
S("To clear mobs use /clearmobs").."\n"..
S("To clear the weather use /weather clear").."\n"..
S("Clearing the chat is not possible, you can hide the chat using \"Toggle chat log\" key (default F2) on PC or the chat icon on the mobile version")
end,
})
end