21 lines
642 B
Lua
21 lines
642 B
Lua
|
-- https://github.com/Uberi/Minetest-WorldEdit/blob/master/worldedit_shortcommands/init.lua
|
||
|
function alias(short, orig)
|
||
|
if not minetest.chatcommands[orig] then
|
||
|
minetest.log("error", "custom_aliases: original command " .. orig .. " does not exist")
|
||
|
return true
|
||
|
end
|
||
|
if minetest.chatcommands[short] then
|
||
|
minetest.log("error", "custom_aliases: alias " .. short .. " already exists")
|
||
|
return true
|
||
|
end
|
||
|
minetest.register_chatcommand(short, minetest.chatcommands[orig])
|
||
|
return false
|
||
|
end
|
||
|
|
||
|
alias("gim", "giveme")
|
||
|
alias("grm", "grantme")
|
||
|
-- needs to be in minetest game?
|
||
|
-- alias("h", "home")
|
||
|
alias("sd", "shutdown")
|
||
|
alias("t", "teleport")
|