]> git.lizzy.rs Git - worldedit.git/blobdiff - WorldEdit API.md
Update worldedit_gui to work with latest unified_inventory (thanks LazyJ!).
[worldedit.git] / WorldEdit API.md
index 464a719606ca6ef7c7ffdffd0605062d0ee5971b..c05958e84ac6df76c0572ebb7c0469344d6cb751 100644 (file)
@@ -2,15 +2,28 @@ WorldEdit API
 =============\r
 The WorldEdit API is composed of multiple modules, each of which is independent and can be used without the other. Each module is contained within a single file.\r
 \r
+If needed, individual modules such as visualization.lua can be removed without affecting the rest of the program. The only file that cannot be removed is init.lua, which is necessary for the mod to run.\r
+\r
 For more information, see the [README](README.md).\r
 \r
+General\r
+-------\r
+\r
+### value = worldedit.version\r
+\r
+Contains the current version of WorldEdit in a table of the form `{major=MAJOR_INTEGER, minor=MINOR_INTEGER}`, where `MAJOR_INTEGER` is the major version (the number before the period) as an integer, and `MINOR_INTEGER` is the minor version (the number after the period) as an integer. This is intended for version checking purposes.\r
+\r
+### value = worldedit.version_string\r
+\r
+Contains the current version of WorldEdit in the form of a string `"MAJOR_INTEGER.MINOR_INTEGER"`, where `MAJOR_INTEGER` is the major version (the number before the period) as an integer, and `MINOR_INTEGER` is the minor version (the number after the period) as an integer. This is intended for display purposes.\r
+\r
 Manipulations\r
 -------------\r
 Contained in manipulations.lua, this module allows several node operations to be applied over a region.\r
 \r
 ### count = worldedit.set(pos1, pos2, nodename)\r
 \r
-Sets a region defined by positions `pos1` and `pos2` to `nodename`. To clear to region, use "air" as the value of `nodename`.\r
+Sets a region defined by positions `pos1` and `pos2` to `nodename`. To clear a region, use "air" as the value of `nodename`.\r
 \r
 Returns the number of nodes set.\r
 \r
@@ -44,11 +57,17 @@ Duplicates the region defined by positions `pos1` and `pos2` along the `axis` ax
 \r
 Returns the number of nodes stacked.\r
 \r
+### count, newpos1, newpos2 = worldedit.stretch(pos1, pos2, stretchx, stretchy, stretchz)\r
+\r
+Stretches the region defined by positions `pos1` and `pos2` by an factor of positive integers `stretchx`, `stretchy`. and `stretchz` along the X, Y, and Z axes, respectively, with `pos1` as the origin.\r
+\r
+Returns the number of nodes stretched, the new scaled position 1, and the new scaled position 2.\r
+\r
 ### count, newpos1, newpos2 = worldedit.transpose(pos1, pos2, axis1, axis2)\r
 \r
 Transposes a region defined by the positions `pos1` and `pos2` between the `axis1` and `axis2` axes ("x" or "y" or "z").\r
 \r
-Returns the number of nodes transposed, the new position 1, and the new position 2.\r
+Returns the number of nodes transposed, the new transposed position 1, and the new transposed position 2.\r
 \r
 ### count = worldedit.flip(pos1, pos2, axis)\r
 \r
@@ -74,19 +93,37 @@ Fixes the lighting in a region defined by positions `pos1` and `pos2`.
 \r
 Returns the number of nodes updated.\r
 \r
+### count = worldedit.clearobjects(pos1, pos2)\r
+\r
+Clears all objects in a region defined by the positions `pos1` and `pos2`.\r
+\r
+Returns the number of objects cleared.\r
+\r
 Primitives\r
 ----------\r
 Contained in primitives.lua, this module allows the creation of several geometric primitives.\r
 \r
 ### count = worldedit.hollow_sphere(pos, radius, nodename)\r
 \r
-Adds a hollow sphere at `pos` with radius `radius`, composed of `nodename`.\r
+Adds a hollow sphere centered at `pos` with radius `radius`, composed of `nodename`.\r
 \r
 Returns the number of nodes added.\r
 \r
 ### count = worldedit.sphere(pos, radius, nodename)\r
 \r
-Adds a sphere at `pos` with radius `radius`, composed of `nodename`.\r
+Adds a sphere centered at `pos` with radius `radius`, composed of `nodename`.\r
+\r
+Returns the number of nodes added.\r
+\r
+### count = worldedit.hollow_dome(pos, radius, nodename)\r
+\r
+Adds a hollow dome centered at `pos` with radius `radius`, composed of `nodename`.\r
+\r
+Returns the number of nodes added.\r
+\r
+### count = worldedit.dome(pos, radius, nodename)\r
+\r
+Adds a dome centered at `pos` with radius `radius`, composed of `nodename`.\r
 \r
 Returns the number of nodes added.\r
 \r
@@ -102,15 +139,15 @@ Adds a cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `
 \r
 Returns the number of nodes added.\r
 \r
-### count = worldedit.pyramid(pos, height, nodename)\r
+### count = worldedit.pyramid(pos, axis, height, nodename)\r
 \r
-Adds a pyramid at `pos` with height `height`.\r
+Adds a pyramid centered at `pos` along the `axis` axis ("x" or "y" or "z") with height `height`.\r
 \r
 Returns the number of nodes added.\r
 \r
-### count = worldedit.spiral(pos, width, height, spacer, nodename)\r
+### count = worldedit.spiral(pos, length, height, spacer, nodename)\r
 \r
-Adds a spiral at `pos` with width `width`, height `height`, space between walls `spacer`, composed of `nodename`.\r
+Adds a spiral centered at `pos` with side length `length`, height `height`, space between walls `spacer`, composed of `nodename`.\r
 \r
 Returns the number of nodes added.\r
 \r
@@ -188,6 +225,6 @@ Returns an error if the code fails or nil otherwise.
 \r
 ### error = worldedit.luatransform(pos1, pos2, code)\r
 \r
-Executes `code` as a Lua chunk in the global namespace with the variable pos available, for each node in a region defined by positions `pos1` and `pos2`.\r
+Executes `code` as a Lua chunk in the global namespace with the variable `pos` available, for each node in a region defined by positions `pos1` and `pos2`.\r
 \r
 Returns an error if the code fails or nil otherwise.
\ No newline at end of file