init.lua 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --provides shorter names for the commands in `worldedit_commands`
  2. worldedit.alias_command = function(alias, original)
  3. if not worldedit.registered_commands[original] then
  4. minetest.log("error", "worldedit_shortcommands: original " .. original .. " does not exist")
  5. return
  6. end
  7. if minetest.chatcommands["/" .. alias] then
  8. minetest.log("error", "worldedit_shortcommands: alias " .. alias .. " already exists")
  9. return
  10. end
  11. minetest.register_chatcommand("/" .. alias, minetest.chatcommands["/" .. original])
  12. worldedit.registered_commands[alias] = worldedit.registered_commands[original]
  13. end
  14. worldedit.alias_command("i", "inspect")
  15. worldedit.alias_command("rst", "reset")
  16. worldedit.alias_command("mk", "mark")
  17. worldedit.alias_command("umk", "unmark")
  18. worldedit.alias_command("1", "pos1")
  19. worldedit.alias_command("2", "pos2")
  20. worldedit.alias_command("fp", "fixedpos")
  21. worldedit.alias_command("v", "volume")
  22. worldedit.alias_command("s", "set")
  23. worldedit.alias_command("r", "replace")
  24. worldedit.alias_command("ri", "replaceinverse")
  25. worldedit.alias_command("hcube", "hollowcube")
  26. worldedit.alias_command("hspr", "hollowsphere")
  27. worldedit.alias_command("spr", "sphere")
  28. worldedit.alias_command("hdo", "hollowdome")
  29. worldedit.alias_command("do", "dome")
  30. worldedit.alias_command("hcyl", "hollowcylinder")
  31. worldedit.alias_command("cyl", "cylinder")
  32. worldedit.alias_command("hpyr", "hollowpyramid")
  33. worldedit.alias_command("pyr", "pyramid")
  34. worldedit.alias_command("spl", "spiral")
  35. worldedit.alias_command("m", "move")
  36. worldedit.alias_command("c", "copy")
  37. worldedit.alias_command("stk", "stack")
  38. worldedit.alias_command("sch", "stretch")
  39. worldedit.alias_command("tps", "transpose")
  40. worldedit.alias_command("fl", "flip")
  41. worldedit.alias_command("rot", "rotate")
  42. worldedit.alias_command("ort", "orient")
  43. worldedit.alias_command("hi", "hide")
  44. worldedit.alias_command("sup", "suppress")
  45. worldedit.alias_command("hlt", "highlight")
  46. worldedit.alias_command("rsr", "restore")
  47. worldedit.alias_command("l", "lua")
  48. worldedit.alias_command("lt", "luatransform")
  49. worldedit.alias_command("clro", "clearobjects")