From 1024eace6f342a340ef84583b2c0c97d657ad326 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 24 Oct 2014 15:27:41 -0400 Subject: [PATCH] Use "we-" prefix for commands --- Chat Commands.md | 386 ++++++++++++++++--------------- README.md | 10 +- Tutorial.md | 18 +- worldedit_commands/init.lua | 90 +++---- worldedit_commands/safe.lua | 6 +- worldedit_shortcommands/init.lua | 72 +++--- 6 files changed, 292 insertions(+), 290 deletions(-) diff --git a/Chat Commands.md b/Chat Commands.md index 07bcfd6..590856e 100644 --- a/Chat Commands.md +++ b/Chat Commands.md @@ -2,375 +2,377 @@ Chat Commands ------------- For more information, see the [README](README.md). -Many commands also have shorter names that can be typed faster. For example, if we wanted to use `//move ? 5`, we could instead type `//m ? 5`. All shortened names are listed below: +Many commands also have shorter names that can be typed faster. For example, +if we wanted to use `/we-move ? 5`, we could instead type `/m ? 5`. +All shortened names are listed below: -| Short Name | Original Name | -|:-----------|:-------------------| -| `//i` | `//inspect` | -| `//rst` | `//reset` | -| `//mk` | `//mark` | -| `//umk` | `//unmark` | -| `//1` | `//pos1` | -| `//2` | `//pos2` | -| `//fp` | `//fixedpos` | -| `//v` | `//volume` | -| `//s` | `//set` | -| `//r` | `//replace` | -| `//ri` | `//replaceinverse` | -| `//hspr` | `//hollowsphere` | -| `//spr` | `//sphere` | -| `//hdo` | `//hollowdome` | -| `//do` | `//dome` | -| `//hcyl` | `//hollowcylinder` | +| Short Name | Original Name | +|:-----------|:--------------------| +| `i` | `we-inspect` | +| `rst` | `we-reset` | +| `mk` | `we-mark` | +| `umk` | `we-unmark` | +| `1` | `we-pos1` | +| `2` | `we-pos2` | +| `fp` | `we-fixedpos` | +| `v` | `we-volume` | +| `s` | `we-set` | +| `r` | `we-replace` | +| `ri` | `we-replaceinverse` | +| `hspr` | `we-hollowsphere` | +| `spr` | `we-sphere` | +| `hdo` | `we-hollowdome` | +| `do` | `we-dome` | +| `hcyl` | `we-hollowcylinder` | -### `//about` +### `/we-about` Get information about the mod. - //about + /we-about -### `//inspect on/off/1/0/true/false/yes/no/enable/disable/` +### `/we-inspect on/off/1/0/true/false/yes/no/enable/disable/` Enable or disable node inspection. - //inspect on - //inspect off - //inspect 1 - //inspect 0 - //inspect true - //inspect false - //inspect yes - //inspect no - //inspect enable - //inspect disable - //inspect + /we-inspect on + /we-inspect off + /we-inspect 1 + /we-inspect 0 + /we-inspect true + /we-inspect false + /we-inspect yes + /we-inspect no + /we-inspect enable + /we-inspect disable + /we-inspect -### `//reset` +### `/we-reset` Reset the region so that it is empty. - //reset + /we-reset -### `//mark` +### `/we-mark` Show markers at the region positions. - //mark + /we-mark -### `//unmark` +### `/we-unmark` Hide markers if currently shown. - //unmark + /we-unmark -### `//pos1` +### `/we-pos1` Set WorldEdit region position 1 to the player's location. - //pos1 + /we-pos1 -### `//pos2` +### `/we-pos2` Set WorldEdit region position 2 to the player's location. - //pos2 + /we-pos2 -### `//p set/set1/set2/get` +### `/we-p set/set1/set2/get` Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region. - //p set - //p set1 - //p set2 - //p get + /we-p set + /we-p set1 + /we-p set2 + /we-p get -### `//fixedpos set1 x y z` +### `/we-fixedpos set1 x y z` Set a WorldEdit region position to the position at (``, ``, ``). - //fixedpos set1 0 0 0 - //fixedpos set1 -30 5 28 - //fixedpos set2 1004 -200 432 + /we-fixedpos set1 0 0 0 + /we-fixedpos set1 -30 5 28 + /we-fixedpos set2 1004 -200 432 -### `//volume` +### `/we-volume` Display the volume of the current WorldEdit region. - //volume + /we-volume -### `//set ` +### `/we-set ` Set the current WorldEdit region to ``. - //set air - //set cactus - //set Blue Lightstone - //set dirt with grass + /we-set air + /we-set cactus + /we-set Blue Lightstone + /we-set dirt with grass -### `//mix ...` +### `/we-mix ...` Fill the current WorldEdit region with a random mix of ``, `...`. - //mix air - //mix cactus stone glass sandstone - //mix Bronze - //mix default:cobble air + /we-mix air + /we-mix cactus stone glass sandstone + /we-mix Bronze + /we-mix default:cobble air -### `//replace ` +### `/we-replace ` Replace all instances of `` with `` in the current WorldEdit region. - //replace Cobblestone air - //replace lightstone_blue glass - //replace dirt Bronze Block - //replace mesecons:wire_00000000_off flowers:flower_tulip + /we-replace Cobblestone air + /we-replace lightstone_blue glass + /we-replace dirt Bronze Block + /we-replace mesecons:wire_00000000_off flowers:flower_tulip -### `//replaceinverse ` +### `/we-replaceinverse ` Replace all nodes other than `` with `` in the current WorldEdit region. - //replaceinverse Cobblestone air - //replaceinverse flowers:flower_waterlily glass - //replaceinverse dirt Bronze Block - //replaceinverse mesecons:wire_00000000_off flowers:flower_tulip + /we-replaceinverse Cobblestone air + /we-replaceinverse flowers:flower_waterlily glass + /we-replaceinverse dirt Bronze Block + /we-replaceinverse mesecons:wire_00000000_off flowers:flower_tulip -### `//hollowsphere ` +### `/we-hollowsphere ` Add hollow sphere centered at WorldEdit position 1 with radius ``, composed of ``. - //hollowsphere 5 Diamond Block - //hollowsphere 12 glass - //hollowsphere 17 mesecons:wire_00000000_off + /we-hollowsphere 5 Diamond Block + /we-hollowsphere 12 glass + /we-hollowsphere 17 mesecons:wire_00000000_off -### `//sphere ` +### `/we-sphere ` Add sphere centered at WorldEdit position 1 with radius ``, composed of ``. - //sphere 5 Diamond Block - //sphere 12 glass - //sphere 17 mesecons:wire_00000000_off + /we-sphere 5 Diamond Block + /we-sphere 12 glass + /we-sphere 17 mesecons:wire_00000000_off -### `//hollowdome ` +### `/we-hollowdome ` Add hollow dome centered at WorldEdit position 1 with radius ``, composed of ``. - //hollowdome 5 Diamond Block - //hollowdome -12 glass - //hollowdome 17 mesecons:wire_00000000_off + /we-hollowdome 5 Diamond Block + /we-hollowdome -12 glass + /we-hollowdome 17 mesecons:wire_00000000_off -### `//dome ` +### `/we-dome ` Add dome centered at WorldEdit position 1 with radius ``, composed of ``. - //dome 5 Diamond Block - //dome -12 glass - //dome 17 mesecons:wire_00000000_off + /we-dome 5 Diamond Block + /we-dome -12 glass + /we-dome 17 mesecons:wire_00000000_off -### `//hollowcylinder x/y/z/? ` +### `/we-hollowcylinder x/y/z/? ` Add hollow cylinder at WorldEdit position 1 along the x/y/z/? axis with length `` and radius ``, composed of ``. - //hollowcylinder x +5 8 Bronze Block - //hollowcylinder y 28 10 glass - //hollowcylinder z -12 3 mesecons:wire_00000000_off - //hollowcylinder ? 2 4 default:stone + /we-hollowcylinder x +5 8 Bronze Block + /we-hollowcylinder y 28 10 glass + /we-hollowcylinder z -12 3 mesecons:wire_00000000_off + /we-hollowcylinder ? 2 4 default:stone -### `//cylinder x/y/z/? ` +### `/we-cylinder x/y/z/? ` Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length `` and radius ``, composed of ``. - //cylinder x +5 8 Bronze Block - //cylinder y 28 10 glass - //cylinder z -12 3 mesecons:wire_00000000_off - //cylinder ? 2 4 default:stone + /we-cylinder x +5 8 Bronze Block + /we-cylinder y 28 10 glass + /we-cylinder z -12 3 mesecons:wire_00000000_off + /we-cylinder ? 2 4 default:stone -### `//pyramid x/y/z? ` +### `/we-pyramid x/y/z? ` Add pyramid centered at WorldEdit position 1 along the x/y/z/? axis with height ``, composed of ``. - //pyramid x 8 Diamond Block - //pyramid y -5 glass - //pyramid z 2 mesecons:wire_00000000_off - //pyramid ? 12 mesecons:wire_00000000_off + /we-pyramid x 8 Diamond Block + /we-pyramid y -5 glass + /we-pyramid z 2 mesecons:wire_00000000_off + /we-pyramid ? 12 mesecons:wire_00000000_off -### `//spiral ` +### `/we-spiral ` Add spiral centered at WorldEdit position 1 with side length ``, height ``, space between walls ``, composed of ``. - //spiral 20 5 3 Diamond Block - //spiral 5 2 1 glass - //spiral 7 1 5 mesecons:wire_00000000_off + /we-spiral 20 5 3 Diamond Block + /we-spiral 5 2 1 glass + /we-spiral 7 1 5 mesecons:wire_00000000_off -### `//copy x/y/z/? ` +### `/we-copy x/y/z/? ` Copy the current WorldEdit region along the x/y/z/? axis by `` nodes. - //copy x 15 - //copy y -7 - //copy z +4 - //copy ? 8 + /we-copy x 15 + /we-copy y -7 + /we-copy z +4 + /we-copy ? 8 -### `//move x/y/z/? ` +### `/we-move x/y/z/? ` Move the current WorldEdit positions and region along the x/y/z/? axis by `` nodes. - //move x 15 - //move y -7 - //move z +4 - //move ? -1 + /we-move x 15 + /we-move y -7 + /we-move z +4 + /we-move ? -1 -### `//stack x/y/z/? ` +### `/we-stack x/y/z/? ` Stack the current WorldEdit region along the x/y/z/? axis `` times. - //stack x 3 - //stack y -1 - //stack z +5 - //stack ? 12 + /we-stack x 3 + /we-stack y -1 + /we-stack z +5 + /we-stack ? 12 -### `//stack2 ` +### `/we-stack2 ` Stack the current WorldEdit region `` times by offset ``, ``, ``. - //stack2 5 3 8 2 - //stack2 1 -1 -1 -1 + /we-stack2 5 3 8 2 + /we-stack2 1 -1 -1 -1 -### `//scale ` +### `/we-scale ` Scale the current WorldEdit positions and region by a factor of positive integer `` with position 1 as the origin. - //scale 2 - //scale 1 - //scale 10 + /we-scale 2 + /we-scale 1 + /we-scale 10 -### `//transpose x/y/z/? x/y/z/?` +### `/we-transpose x/y/z/? x/y/z/?` Transpose the current WorldEdit positions and region along the x/y/z/? and x/y/z/? axes. - //transpose x y - //transpose x z - //transpose y z - //transpose ? y + /we-transpose x y + /we-transpose x z + /we-transpose y z + /we-transpose ? y -### `//flip x/y/z/?` +### `/we-flip x/y/z/?` Flip the current WorldEdit region along the x/y/z/? axis. - //flip x - //flip y - //flip z - //flip ? + /we-flip x + /we-flip y + /we-flip z + /we-flip ? -### `//rotate x/y/z/? ` +### `/we-rotate x/y/z/? ` Rotate the current WorldEdit positions and region along the x/y/z/? axis by angle `` (90 degree increment). - //rotate x 90 - //rotate y 180 - //rotate z 270 - //rotate ? -90 + /we-rotate x 90 + /we-rotate y 180 + /we-rotate z 270 + /we-rotate ? -90 -### `//orient ` +### `/we-orient ` Rotate oriented nodes in the current WorldEdit region around the Y axis by angle `` (90 degree increment) - //orient 90 - //orient 180 - //orient 270 - //orient -90 + /we-orient 90 + /we-orient 180 + /we-orient 270 + /we-orient -90 -### `//fixlight` +### `/we-fixlight` Fixes the lighting in the current WorldEdit region. - //fixlight + /we-fixlight -### `//hide` +### `/we-hide` Hide all nodes in the current WorldEdit region non-destructively. - //hide + /we-hide -### `//suppress ` +### `/we-suppress ` Suppress all in the current WorldEdit region non-destructively. - //suppress Diamond Block - //suppress glass - //suppress mesecons:wire_00000000_off + /we-suppress Diamond Block + /we-suppress glass + /we-suppress mesecons:wire_00000000_off -### `//highlight ` +### `/we-highlight ` Highlight in the current WorldEdit region by hiding everything else non-destructively. - //highlight Diamond Block - //highlight glass - //highlight mesecons:wire_00000000_off + /we-highlight Diamond Block + /we-highlight glass + /we-highlight mesecons:wire_00000000_off -### `//restore` +### `/we-restore` Restores nodes hidden with WorldEdit in the current WorldEdit region. - //restore + /we-restore -### `//save ` +### `/we-save ` Save the current WorldEdit region to "(world folder)/schems/``.we". - //save some random filename - //save huge_base + /we-save some random filename + /we-save huge_base -### `//allocate ` +### `/we-allocate ` Set the region defined by nodes from "(world folder)/schems/``.we" as the current WorldEdit region. - //allocate some random filename - //allocate huge_base + /we-allocate some random filename + /we-allocate huge_base -### `//load ` +### `/we-load ` Load nodes from "(world folder)/schems/``.we" with position 1 of the current WorldEdit region as the origin. - //load some random filename - //load huge_base + /we-load some random filename + /we-load huge_base -### `//lua ` +### `/we-lua ` Executes `` as a Lua chunk in the global namespace. - //lua worldedit.pos1["singleplayer"] = {x=0, y=0, z=0} - //lua worldedit.rotate(worldedit.pos1["singleplayer"], worldedit.pos2["singleplayer"], "y", 90) + /we-lua worldedit.pos1["singleplayer"] = {x=0, y=0, z=0} + /we-lua worldedit.rotate(worldedit.pos1["singleplayer"], worldedit.pos2["singleplayer"], "y", 90) -### `//luatransform ` +### `/we-luatransform ` Executes `` as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region. - //luatransform minetest.add_node(pos, {name="default:stone"}) - //luatransform if minetest.get_node(pos).name == "air" then minetest.add_node(pos, {name="default:water_source"}) + /we-luatransform minetest.add_node(pos, {name="default:stone"}) + /we-luatransform if minetest.get_node(pos).name == "air" then minetest.add_node(pos, {name="default:water_source"}) -### `//mtschemcreate ` +### `/we-mtschemcreate ` Save the current WorldEdit region using the Minetest Schematic format to "(world folder)/schems/``.mts". - //mtschemcreate some random filename - //mtschemcreate huge_base + /we-mtschemcreate some random filename + /we-mtschemcreate huge_base -### `//mtschemplace ` +### `/we-mtschemplace ` Load nodes from "(world folder)/schems/``.mts" with position 1 of the current WorldEdit region as the origin. - //mtschemplace some random filename - //mtschemplace huge_base + /we-mtschemplace some random filename + /we-mtschemplace huge_base -### `//mtschemprob start/finish/get` +### `/we-mtschemprob start/finish/get` -After using `//mtschemprob start` all nodes punched will bring up a text field where a probablity can be entered. -This mode can be left with `//mtschemprob finish`. `//mtschemprob get` will display the probabilities saved for the nodes. +After using `/we-mtschemprob start` all nodes punched will bring up a text field where a probablity can be entered. +This mode can be left with `/we-mtschemprob finish`. `/we-mtschemprob get` will display the probabilities saved for the nodes. - //mtschemprob get + /we-mtschemprob get -### `//clearobjects` +### `/we-clearobjects` Clears all objects within the WorldEdit region. - //clearobjects + /we-clearobjects diff --git a/README.md b/README.md index 224059e..4e447be 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ WorldEdit works primarily through the WorldEdit GUI and chat commands. Depending WorldEdit has a huge potential for abuse by untrusted players. Therefore, users will not be able to use WorldEdit unless they have the `worldedit` privelege. This is available by default in single player, but in multiplayer the permission must be explicitly given by someone with the right credentials, using the follwoing chat command: `/grant worldedit`. This privelege can later be removed using the following chat command: `/revoke worldedit`. -Certain functions/commands such as WorldEdit GUI's "Run Lua" function (equivalent to the `//lua` and `//luatransform` chat command) additionally require the `server` privilege. This is because it is extremely dangerous to give access to these commands to untrusted players, since they essentially are able to control the computer the server is running on. Give this privilege only to people you trust with your computer. +Certain functions/commands such as WorldEdit GUI's "Run Lua" function (equivalent to the `/we-lua` and `/we-luatransform` chat commands) additionally only work for the server administrator. This is because it is extremely dangerous to give access to these commands to untrusted players, since they essentially are able to control the computer the server is running on. For in-game information about these commands, type `/help ` in the chat. For example, to learn more about the `//copy` command, simply type `/help /copy` to display information relevant to copying a region. @@ -81,13 +81,13 @@ Nodes ----- Node names are required for many types of commands that identify or modify specific types of nodes. They can be specified in a number of ways. -First, by description - the tooltip that appears when hovering over the item in an inventory. This is case insensitive and includes values such as "Cobblestone" and "bronze block". Note that certain commands (namely, `//replace` and `//replaceinverse`) do not support descriptions that contain spaces in the `` field. +First, by description - the tooltip that appears when hovering over the item in an inventory. This is case insensitive and includes values such as "Cobblestone" and "bronze block". Note that certain commands (namely, `/we-replace` and `/we-replaceinverse`) do not support descriptions that contain spaces in the `` field. Second, by name - the node name that is defined by code, but without the mod name prefix. This is case sensitive and includes values such as "piston_normal_off" and "cactus". Nodes defined in the `default` mod always take precedence over other nodes when searching for the correct one, and if there are multiple possible nodes (such as "a:celery" and "b:celery"), one is chosen in no particular order. Finally, by full name - the unambiguous identifier of the node, prefixes and all. This is case sensitive and includes values such as "default:stone" and "mesecons:wire_00000000_off". -The node name "air" can be used anywhere a normal node name can, and acts as a blank node. This is useful for clearing or removing nodes. For example, `//set air` would remove all the nodes in the current WorldEdit region. Similarly, `//sphere 10 air`, when WorldEdit position 1 underground, would dig a large sphere out of the ground. +The node name "air" can be used anywhere a normal node name can, and acts as a blank node. This is useful for clearing or removing nodes. For example, `/we-set air` would remove all the nodes in the current WorldEdit region. Similarly, `/we-sphere 10 air`, when WorldEdit position 1 underground, would dig a large sphere out of the ground. Regions ------- @@ -126,9 +126,9 @@ The current version of the WorldEdit Schematic format, internally known as versi The ordering of the values and minor aspects of the syntax, such as trailing commas or newlines, are not guaranteed to stay the same in future versions. -The WorldEdit Schematic format is accessed via the WorldEdit API, or WorldEdit serialization chat commands such as `//serialize` and `//deserialize`. +The WorldEdit Schematic format is accessed via the WorldEdit API, or WorldEdit serialization chat commands such as `/save` and `/load`. -The second is the Minetest Schematic format (MTS). The details of this format may be found in the Minetest documentation and are out of the scope of this document. Access to this format is done via specialized MTS commands such as `//mtschemcreate` and `//mtschemplace`. +The second is the Minetest Schematic format (MTS). The details of this format may be found in the Minetest documentation and are out of the scope of this document. Access to this format is done via specialized MTS commands such as `/we-mtschemcreate` and `/we-mtschemplace`. Authors ------- diff --git a/Tutorial.md b/Tutorial.md index abe554a..411236b 100644 --- a/Tutorial.md +++ b/Tutorial.md @@ -29,7 +29,7 @@ Step 1: Selecting a region -------------------------- ### Chat Commands -In the chat prompt, enter `//p set`. In the chat, you are prompted to punch two nodes to set the positions of the two markers. +In the chat prompt, enter `/we-p set`. In the chat, you are prompted to punch two nodes to set the positions of the two markers. Punch a nearby node. Be careful of breakable ones such as torches. A black cube reading "1" will appear around the node. This is the marker for WorldEdit position 1. @@ -53,13 +53,13 @@ Step 2: Region commands ----------------------- ### Chat Commands -In the chat prompt, enter `//set mese`. In the chat, you will see a message showing the number of nodes set after a small delay. +In the chat prompt, enter `/we-set mese`. In the chat, you will see a message showing the number of nodes set after a small delay. Look at the place between the two markers: it is now filled with MESE blocks! -The `//set ` command fills the region with whatever node you want. It is a region-oriented command, which means it works inside the WorldEdit region only. +The `/we-set ` command fills the region with whatever node you want. It is a region-oriented command, which means it works inside the WorldEdit region only. -Now, try a few different variations, such as `//set torch`, `//set cobble`, and `//set water`. +Now, try a few different variations, such as `/we-set torch`, `/we-set cobble`, and `/we-set water`. ### WorldEdit GUI @@ -81,11 +81,11 @@ Step 3: Position commands ------------------------- ### Chat Commands -In the chat prompt, enter `//hollowdome 30 glass`. In the chat, you will see a message showing the number of nodes set after a small delay. +In the chat prompt, enter `/we-hollowdome 30 glass`. In the chat, you will see a message showing the number of nodes set after a small delay. Look around marker 1: it is now surrounded by a hollow glass dome! -The `//hollowdome ` command creates a hollow dome centered around marker 1, made of any node you want. It is a position-oriented command, which means it works around marker 1 and can go outside the WorldEdit region. +The `/we-hollowdome ` command creates a hollow dome centered around marker 1, made of any node you want. It is a position-oriented command, which means it works around marker 1 and can go outside the WorldEdit region. ### WorldEdit GUI @@ -109,12 +109,12 @@ Step 4: Other commands There are many more commands than what is shown here. See the [Chat Commands Reference](Chat Commands.md) for a detailed list of them, along with descriptions and examples for every single one. -If you're in-game and forgot how a command works, just use the `/help ` command, without the first forward slash. For example, to see some information about the `//set ` command mentioned earlier, simply use `/help /set`. +If you're in-game and forgot how a command works, just use the `/help ` command, without the first forward slash. For example, to see some information about the `/we-set ` command mentioned earlier, simply use `/help /set`. -A very useful command to check out is the `//save ` command, which can save everything inside the WorldEdit region to a file, stored on the computer hosting the server (the player's computer, in single player mode). You can then later use `//load ` to load the data in a file into a world, even another world on another computer. +A very useful command to check out is the `/we-save ` command, which can save everything inside the WorldEdit region to a file, stored on the computer hosting the server (the player's computer, in single player mode). You can then later use `/we-load ` to load the data in a file into a world, even another world on another computer. ### WorldEdit GUI This only scratches the surface of what WorldEdit is capable of. Most of the functions in the WorldEdit GUI correspond to chat commands, and so the [Chat Commands Reference](Chat Commands.md) may be useful if you get stuck. -It is helpful to explore the various buttons in the interface and check out what they do. Learning the chat command interface is also useful if you use WorldEdit intensively - an experienced chat command user can usually work faster than an experienced WorldEdit GUI user. \ No newline at end of file +It is helpful to explore the various buttons in the interface and check out what they do. Learning the chat command interface is also useful if you use WorldEdit intensively - an experienced chat command user can usually work faster than an experienced WorldEdit GUI user. diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 7d347c9..3a5fa61 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -72,7 +72,7 @@ worldedit.player_axis = function(name) return "z", dir.z > 0 and 1 or -1 end -minetest.register_chatcommand("/about", { +minetest.register_chatcommand("we-about", { params = "", description = "Get information about the mod", func = function(name, param) @@ -80,7 +80,7 @@ minetest.register_chatcommand("/about", { end, }) -minetest.register_chatcommand("/inspect", { +minetest.register_chatcommand("we-inspect", { params = "on/off/1/0/true/false/yes/no/enable/disable/", description = "Enable or disable node inspection", privs = {worldedit=true}, @@ -113,7 +113,7 @@ minetest.register_on_punchnode(function(pos, node, puncher) end end) -minetest.register_chatcommand("/reset", { +minetest.register_chatcommand("we-reset", { params = "", description = "Reset the region so that it is empty", privs = {worldedit=true}, @@ -127,7 +127,7 @@ minetest.register_chatcommand("/reset", { end, }) -minetest.register_chatcommand("/mark", { +minetest.register_chatcommand("we-mark", { params = "", description = "Show markers at the region positions", privs = {worldedit=true}, @@ -138,7 +138,7 @@ minetest.register_chatcommand("/mark", { end, }) -minetest.register_chatcommand("/unmark", { +minetest.register_chatcommand("we-unmark", { params = "", description = "Hide markers if currently shown", privs = {worldedit=true}, @@ -154,7 +154,7 @@ minetest.register_chatcommand("/unmark", { end, }) -minetest.register_chatcommand("/pos1", { +minetest.register_chatcommand("we-pos1", { params = "", description = "Set WorldEdit region position 1 to the player's location", privs = {worldedit=true}, @@ -167,7 +167,7 @@ minetest.register_chatcommand("/pos1", { end, }) -minetest.register_chatcommand("/pos2", { +minetest.register_chatcommand("we-pos2", { params = "", description = "Set WorldEdit region position 2 to the player's location", privs = {worldedit=true}, @@ -180,7 +180,7 @@ minetest.register_chatcommand("/pos2", { end, }) -minetest.register_chatcommand("/p", { +minetest.register_chatcommand("we-p", { params = "set/set1/set2/get", description = "Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region", privs = {worldedit=true}, @@ -211,7 +211,7 @@ minetest.register_chatcommand("/p", { end, }) -minetest.register_chatcommand("/fixedpos", { +minetest.register_chatcommand("we-fixedpos", { params = "set1/set2 x y z", description = "Set a WorldEdit region position to the position at (, , )", privs = {worldedit=true}, @@ -259,7 +259,7 @@ minetest.register_on_punchnode(function(pos, node, puncher) end end) -minetest.register_chatcommand("/volume", { +minetest.register_chatcommand("we-volume", { params = "", description = "Display the volume of the current WorldEdit region", privs = {worldedit=true}, @@ -279,7 +279,7 @@ minetest.register_chatcommand("/volume", { end, }) -minetest.register_chatcommand("/set", { +minetest.register_chatcommand("we-set", { params = "", description = "Set the current WorldEdit region to ", privs = {worldedit=true}, @@ -295,7 +295,7 @@ minetest.register_chatcommand("/set", { end, check_region), }) -minetest.register_chatcommand("/mix", { +minetest.register_chatcommand("we-mix", { params = " ...", description = "Fill the current WorldEdit region with a random mix of , ...", privs = {worldedit=true}, @@ -335,7 +335,7 @@ local check_replace = function(name, param) return check_region(name, param) end -minetest.register_chatcommand("/replace", { +minetest.register_chatcommand("we-replace", { params = " ", description = "Replace all instances of with in the current WorldEdit region", privs = {worldedit=true}, @@ -348,7 +348,7 @@ minetest.register_chatcommand("/replace", { end, check_replace), }) -minetest.register_chatcommand("/replaceinverse", { +minetest.register_chatcommand("we-replaceinverse", { params = " ", description = "Replace all nodes other than with in the current WorldEdit region", privs = {worldedit=true}, @@ -376,7 +376,7 @@ local check_sphere = function(name, param) return math.ceil((4 * math.pi * (tonumber(radius) ^ 3)) / 3) --volume of sphere end -minetest.register_chatcommand("/hollowsphere", { +minetest.register_chatcommand("we-hollowsphere", { params = " ", description = "Add hollow sphere centered at WorldEdit position 1 with radius , composed of ", privs = {worldedit=true}, @@ -388,7 +388,7 @@ minetest.register_chatcommand("/hollowsphere", { end, check_sphere), }) -minetest.register_chatcommand("/sphere", { +minetest.register_chatcommand("we-sphere", { params = " ", description = "Add sphere centered at WorldEdit position 1 with radius , composed of ", privs = {worldedit=true}, @@ -415,7 +415,7 @@ local check_dome = function(name, param) return math.ceil((2 * math.pi * (tonumber(radius) ^ 3)) / 3) --volume of dome end -minetest.register_chatcommand("/hollowdome", { +minetest.register_chatcommand("we-hollowdome", { params = " ", description = "Add hollow dome centered at WorldEdit position 1 with radius , composed of ", privs = {worldedit=true}, @@ -427,7 +427,7 @@ minetest.register_chatcommand("/hollowdome", { end, check_dome), }) -minetest.register_chatcommand("/dome", { +minetest.register_chatcommand("we-dome", { params = " ", description = "Add dome centered at WorldEdit position 1 with radius , composed of ", privs = {worldedit=true}, @@ -454,7 +454,7 @@ local check_cylinder = function(name, param) return math.ceil(math.pi * (tonumber(radius) ^ 2) * tonumber(length)) end -minetest.register_chatcommand("/hollowcylinder", { +minetest.register_chatcommand("we-hollowcylinder", { params = "x/y/z/? ", description = "Add hollow cylinder at WorldEdit position 1 along the x/y/z/? axis with length and radius , composed of ", privs = {worldedit=true}, @@ -471,7 +471,7 @@ minetest.register_chatcommand("/hollowcylinder", { end, check_cylinder), }) -minetest.register_chatcommand("/cylinder", { +minetest.register_chatcommand("we-cylinder", { params = "x/y/z/? ", description = "Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length and radius , composed of ", privs = {worldedit=true}, @@ -488,7 +488,7 @@ minetest.register_chatcommand("/cylinder", { end, check_cylinder), }) -minetest.register_chatcommand("/pyramid", { +minetest.register_chatcommand("we-pyramid", { params = "x/y/z/? ", description = "Add pyramid centered at WorldEdit position 1 along the x/y/z/? axis with height , composed of ", privs = {worldedit=true}, @@ -520,7 +520,7 @@ minetest.register_chatcommand("/pyramid", { end), }) -minetest.register_chatcommand("/spiral", { +minetest.register_chatcommand("we-spiral", { params = " ", description = "Add spiral centered at WorldEdit position 1 with side length , height , space between walls , composed of ", privs = {worldedit=true}, @@ -546,7 +546,7 @@ minetest.register_chatcommand("/spiral", { end), }) -minetest.register_chatcommand("/copy", { +minetest.register_chatcommand("we-copy", { params = "x/y/z/? ", description = "Copy the current WorldEdit region along the x/y/z/? axis by nodes", privs = {worldedit=true}, @@ -571,7 +571,7 @@ minetest.register_chatcommand("/copy", { end), }) -minetest.register_chatcommand("/move", { +minetest.register_chatcommand("we-move", { params = "x/y/z/? ", description = "Move the current WorldEdit region along the x/y/z/? axis by nodes", privs = {worldedit=true}, @@ -598,7 +598,7 @@ minetest.register_chatcommand("/move", { end, check_region), }) -minetest.register_chatcommand("/stack", { +minetest.register_chatcommand("we-stack", { params = "x/y/z/? ", description = "Stack the current WorldEdit region along the x/y/z/? axis times", privs = {worldedit=true}, @@ -624,7 +624,7 @@ minetest.register_chatcommand("/stack", { end), }) -minetest.register_chatcommand("/stack2", { +minetest.register_chatcommand("we-stack2", { params = " ", description = "Stack the current WorldEdit region times by offset , , ", privs = {worldedit=true}, @@ -660,7 +660,7 @@ minetest.register_chatcommand("/stack2", { }) -minetest.register_chatcommand("/stretch", { +minetest.register_chatcommand("we-stretch", { params = " ", description = "Scale the current WorldEdit positions and region by a factor of , , along the X, Y, and Z axes, repectively, with position 1 as the origin", privs = {worldedit=true}, @@ -694,7 +694,7 @@ minetest.register_chatcommand("/stretch", { end), }) -minetest.register_chatcommand("/transpose", { +minetest.register_chatcommand("we-transpose", { params = "x/y/z/? x/y/z/?", description = "Transpose the current WorldEdit region along the x/y/z/? and x/y/z/? axes", privs = {worldedit=true}, @@ -727,7 +727,7 @@ minetest.register_chatcommand("/transpose", { end), }) -minetest.register_chatcommand("/flip", { +minetest.register_chatcommand("we-flip", { params = "x/y/z/?", description = "Flip the current WorldEdit region along the x/y/z/? axis", privs = {worldedit=true}, @@ -745,7 +745,7 @@ minetest.register_chatcommand("/flip", { end), }) -minetest.register_chatcommand("/rotate", { +minetest.register_chatcommand("we-rotate", { params = " ", description = "Rotate the current WorldEdit region around the axis by angle (90 degree increment)", privs = {worldedit=true}, @@ -777,7 +777,7 @@ minetest.register_chatcommand("/rotate", { end), }) -minetest.register_chatcommand("/orient", { +minetest.register_chatcommand("we-orient", { params = "", description = "Rotate oriented nodes in the current WorldEdit region around the Y axis by angle (90 degree increment)", privs = {worldedit=true}, @@ -800,7 +800,7 @@ minetest.register_chatcommand("/orient", { end), }) -minetest.register_chatcommand("/fixlight", { +minetest.register_chatcommand("we-fixlight", { params = "", description = "Fix the lighting in the current WorldEdit region", privs = {worldedit=true}, @@ -810,7 +810,7 @@ minetest.register_chatcommand("/fixlight", { end), }) -minetest.register_chatcommand("/hide", { +minetest.register_chatcommand("we-hide", { params = "", description = "Hide all nodes in the current WorldEdit region non-destructively", privs = {worldedit=true}, @@ -820,7 +820,7 @@ minetest.register_chatcommand("/hide", { end), }) -minetest.register_chatcommand("/suppress", { +minetest.register_chatcommand("we-suppress", { params = "", description = "Suppress all in the current WorldEdit region non-destructively", privs = {worldedit=true}, @@ -831,7 +831,7 @@ minetest.register_chatcommand("/suppress", { end, check_set), }) -minetest.register_chatcommand("/highlight", { +minetest.register_chatcommand("we-highlight", { params = "", description = "Highlight in the current WorldEdit region by hiding everything else non-destructively", privs = {worldedit=true}, @@ -842,7 +842,7 @@ minetest.register_chatcommand("/highlight", { end, check_set), }) -minetest.register_chatcommand("/restore", { +minetest.register_chatcommand("we-restore", { params = "", description = "Restores nodes hidden with WorldEdit in the current WorldEdit region", privs = {worldedit=true}, @@ -852,7 +852,7 @@ minetest.register_chatcommand("/restore", { end), }) -minetest.register_chatcommand("/save", { +minetest.register_chatcommand("we-save", { params = "", description = "Save the current WorldEdit region to \"(world folder)/schems/.we\"", privs = {worldedit=true}, @@ -885,7 +885,7 @@ minetest.register_chatcommand("/save", { end), }) -minetest.register_chatcommand("/allocate", { +minetest.register_chatcommand("we-allocate", { params = "", description = "Set the region defined by nodes from \"(world folder)/schems/.we\" as the current WorldEdit region", privs = {worldedit=true}, @@ -926,7 +926,7 @@ minetest.register_chatcommand("/allocate", { end, }) -minetest.register_chatcommand("/load", { +minetest.register_chatcommand("we-load", { params = "", description = "Load nodes from \"(world folder)/schems/[.we[m]]\" with position 1 of the current WorldEdit region as the origin", privs = {worldedit=true}, @@ -974,7 +974,7 @@ minetest.register_chatcommand("/load", { end, }) -minetest.register_chatcommand("/lua", { +minetest.register_chatcommand("we-lua", { params = "", description = "Executes as a Lua chunk in the global namespace", privs = {worldedit=true, server=true}, @@ -993,7 +993,7 @@ minetest.register_chatcommand("/lua", { end, }) -minetest.register_chatcommand("/luatransform", { +minetest.register_chatcommand("we-luatransform", { params = "", description = "Executes as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region", privs = {worldedit=true, server=true}, @@ -1013,7 +1013,7 @@ minetest.register_chatcommand("/luatransform", { end), }) -minetest.register_chatcommand("/mtschemcreate", { +minetest.register_chatcommand("we-mtschemcreate", { params = "", description = "Save the current WorldEdit region using the Minetest Schematic format to \"(world folder)/schems/.mts\"", privs = {worldedit=true}, @@ -1038,7 +1038,7 @@ minetest.register_chatcommand("/mtschemcreate", { end), }) -minetest.register_chatcommand("/mtschemplace", { +minetest.register_chatcommand("we-mtschemplace", { params = "", description = "Load nodes from \"(world folder)/schems/.mts\" with position 1 of the current WorldEdit region as the origin", privs = {worldedit=true}, @@ -1061,7 +1061,7 @@ minetest.register_chatcommand("/mtschemplace", { end, }) -minetest.register_chatcommand("/mtschemprob", { +minetest.register_chatcommand("we-mtschemprob", { params = "start/finish/get", description = "Begins node probability entry for Minetest schematics, gets the nodes that have probabilities set, or ends node probability entry", privs = {worldedit=true}, @@ -1102,7 +1102,7 @@ minetest.register_on_player_receive_fields( end ) -minetest.register_chatcommand("/clearobjects", { +minetest.register_chatcommand("we-clearobjects", { params = "", description = "Clears all objects within the WorldEdit region", privs = {worldedit=true}, diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua index c6751c1..10652c7 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -26,11 +26,11 @@ safe_region = function(callback, nodes_needed) --save callback to call later safe_region_callback[name], safe_region_param[name] = callback, param - worldedit.player_notify(name, "WARNING: this operation could affect up to " .. count .. " nodes; type //y to continue or //n to cancel") + worldedit.player_notify(name, "WARNING: this operation could affect up to " .. count .. " nodes; type /we-y to continue or /we-n to cancel") end end -minetest.register_chatcommand("/y", { +minetest.register_chatcommand("we-y", { params = "", description = "Confirm a pending operation", func = function(name) @@ -52,7 +52,7 @@ minetest.register_chatcommand("/y", { end, }) -minetest.register_chatcommand("/n", { +minetest.register_chatcommand("we-n", { params = "", description = "Confirm a pending operation", func = function(name) diff --git a/worldedit_shortcommands/init.lua b/worldedit_shortcommands/init.lua index a3cbb67..77dea97 100644 --- a/worldedit_shortcommands/init.lua +++ b/worldedit_shortcommands/init.lua @@ -2,7 +2,7 @@ --returns true if command could not be aliased, false otherwise worldedit.alias_chatcommand = function(alias, original_command) - if not minetest.chatcommands[original_command] then + if not minetest.chatcommands["we-"..original_command] then minetest.log("error", "worldedit_shortcommands: original command " .. original_command .. " does not exist") return true end @@ -10,41 +10,41 @@ worldedit.alias_chatcommand = function(alias, original_command) minetest.log("error", "worldedit_shortcommands: alias " .. alias .. " already exists") return true end - minetest.register_chatcommand(alias, minetest.chatcommands[original_command]) + minetest.register_chatcommand(alias, minetest.chatcommands["we-"..original_command]) return false end -worldedit.alias_chatcommand("/i", "/inspect") -worldedit.alias_chatcommand("/rst", "/reset") -worldedit.alias_chatcommand("/mk", "/mark") -worldedit.alias_chatcommand("/umk", "/unmark") -worldedit.alias_chatcommand("/1", "/pos1") -worldedit.alias_chatcommand("/2", "/pos2") -worldedit.alias_chatcommand("/fp", "/fixedpos") -worldedit.alias_chatcommand("/v", "/volume") -worldedit.alias_chatcommand("/s", "/set") -worldedit.alias_chatcommand("/r", "/replace") -worldedit.alias_chatcommand("/ri", "/replaceinverse") -worldedit.alias_chatcommand("/hspr", "/hollowsphere") -worldedit.alias_chatcommand("/spr", "/sphere") -worldedit.alias_chatcommand("/hdo", "/hollowdome") -worldedit.alias_chatcommand("/do", "/dome") -worldedit.alias_chatcommand("/hcyl", "/hollowcylinder") -worldedit.alias_chatcommand("/cyl", "/cylinder") -worldedit.alias_chatcommand("/pyr", "/pyramid") -worldedit.alias_chatcommand("/spl", "/spiral") -worldedit.alias_chatcommand("/m", "/move") -worldedit.alias_chatcommand("/c", "/copy") -worldedit.alias_chatcommand("/stk", "/stack") -worldedit.alias_chatcommand("/sch", "/stretch") -worldedit.alias_chatcommand("/tps", "/transpose") -worldedit.alias_chatcommand("/fl", "/flip") -worldedit.alias_chatcommand("/rot", "/rotate") -worldedit.alias_chatcommand("/ort", "/orient") -worldedit.alias_chatcommand("/hi", "/hide") -worldedit.alias_chatcommand("/sup", "/suppress") -worldedit.alias_chatcommand("/hlt", "/highlight") -worldedit.alias_chatcommand("/rsr", "/restore") -worldedit.alias_chatcommand("/l", "/lua") -worldedit.alias_chatcommand("/lt", "/luatransform") -worldedit.alias_chatcommand("/clro", "/clearobjects") \ No newline at end of file +worldedit.alias_chatcommand("i", "inspect") +worldedit.alias_chatcommand("rst", "reset") +worldedit.alias_chatcommand("mk", "mark") +worldedit.alias_chatcommand("umk", "unmark") +worldedit.alias_chatcommand("1", "pos1") +worldedit.alias_chatcommand("2", "pos2") +worldedit.alias_chatcommand("fp", "fixedpos") +worldedit.alias_chatcommand("v", "volume") +worldedit.alias_chatcommand("s", "set") +worldedit.alias_chatcommand("r", "replace") +worldedit.alias_chatcommand("ri", "replaceinverse") +worldedit.alias_chatcommand("hspr", "hollowsphere") +worldedit.alias_chatcommand("spr", "sphere") +worldedit.alias_chatcommand("hdo", "hollowdome") +worldedit.alias_chatcommand("do", "dome") +worldedit.alias_chatcommand("hcyl", "hollowcylinder") +worldedit.alias_chatcommand("cyl", "cylinder") +worldedit.alias_chatcommand("pyr", "pyramid") +worldedit.alias_chatcommand("spl", "spiral") +worldedit.alias_chatcommand("m", "move") +worldedit.alias_chatcommand("c", "copy") +worldedit.alias_chatcommand("stk", "stack") +worldedit.alias_chatcommand("sch", "stretch") +worldedit.alias_chatcommand("tps", "transpose") +worldedit.alias_chatcommand("fl", "flip") +worldedit.alias_chatcommand("rot", "rotate") +worldedit.alias_chatcommand("ort", "orient") +worldedit.alias_chatcommand("hi", "hide") +worldedit.alias_chatcommand("sup", "suppress") +worldedit.alias_chatcommand("hlt", "highlight") +worldedit.alias_chatcommand("rsr", "restore") +worldedit.alias_chatcommand("l", "lua") +worldedit.alias_chatcommand("lt", "luatransform") +worldedit.alias_chatcommand("clro", "clearobjects")