2021-05-29 14:12:33 +00:00
|
|
|
local S = minetest.get_translator(minetest.get_current_modname())
|
2021-03-05 08:58:47 +00:00
|
|
|
|
2021-03-05 08:47:48 +00:00
|
|
|
local function register_chatcommand_alias(alias, cmd)
|
|
|
|
local def = minetest.chatcommands[cmd]
|
|
|
|
minetest.register_chatcommand(alias, def)
|
|
|
|
end
|
|
|
|
|
2021-03-05 16:04:49 +00:00
|
|
|
local function rename_chatcommand(newname, cmd)
|
|
|
|
local def = minetest.chatcommands[cmd]
|
|
|
|
minetest.register_chatcommand(newname, def)
|
|
|
|
minetest.unregister_chatcommand(cmd)
|
|
|
|
end
|
|
|
|
|
|
|
|
if minetest.settings:get_bool("mcl_builtin_commands_overide", true) then
|
2021-03-05 08:47:48 +00:00
|
|
|
register_chatcommand_alias("?", "help")
|
|
|
|
register_chatcommand_alias("pardon", "unban")
|
2021-03-05 16:04:49 +00:00
|
|
|
rename_chatcommand("stop", "shutdown")
|
2021-03-05 08:47:48 +00:00
|
|
|
register_chatcommand_alias("tell", "msg")
|
|
|
|
register_chatcommand_alias("w", "msg")
|
|
|
|
register_chatcommand_alias("tp", "teleport")
|
2021-03-05 16:04:49 +00:00
|
|
|
rename_chatcommand("clear", "clearinv")
|
2021-03-05 08:47:48 +00:00
|
|
|
|
|
|
|
minetest.register_chatcommand("banlist", {
|
|
|
|
description = S("List bans"),
|
|
|
|
privs = minetest.chatcommands["ban"].privs,
|
|
|
|
func = function(name)
|
|
|
|
return true, S("Ban list: @1", minetest.get_ban_list())
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
end
|