1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2025-07-01 07:30:39 +02:00

Separate components into separate mods, add visualization API with hide(), suppress(), find(), and restore() for nondestructive node visualization. Corresponding chat commands are //hide, //suppress, //find, and //restore. Commands and functions documented.

This commit is contained in:
Anthony Zhang
2012-10-13 21:45:50 -04:00
parent 12dfbd198d
commit 1c31bd7f0d
13 changed files with 1728 additions and 1399 deletions

View File

@ -1,7 +1,13 @@
WorldEdit API
-------------
=============
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.
For more information, see the [README](README.md).
Manipulations
-------------
Contained in manipulations.lua, this module allows several node operations to be applied over a region.
### worldedit.volume(pos1, pos2)
Determines the volume of the region defined by positions `pos1` and `pos2`.
@ -20,40 +26,6 @@ Replaces all instances of `searchnode` with `replacenode` in a region defined by
Returns the number of nodes replaced.
### worldedit.hollow_sphere = function(pos, radius, nodename)
Adds a hollow sphere at `pos` with radius `radius`, composed of `nodename`.
Returns the number of nodes added.
### worldedit.sphere = function(pos, radius, nodename)
Adds a sphere at `pos` with radius `radius`, composed of `nodename`.
Returns the number of nodes added.
### worldedit.hollow_cylinder(pos, axis, length, radius, nodename)
Adds a hollow cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `length` and radius `radius`, composed of `nodename`.
Returns the number of nodes added.
### worldedit.cylinder(pos, axis, length, radius, nodename)
Adds a cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `length` and radius `radius`, composed of `nodename`.
Returns the number of nodes added.
### worldedit.pyramid(pos, height, nodename)
Adds a pyramid at `pos` with height `height`.
Returns the number of nodes added.
### worldedit.spiral(pos, width, height, spacer, nodename)
Adds a spiral at `pos` with width `width`, height `height`, space between walls `spacer`, composed of `nodename`.
Returns the number of nodes added.
### worldedit.copy(pos1, pos2, axis, amount)
@ -98,6 +70,76 @@ Digs a region defined by positions `pos1` and `pos2`.
Returns the number of nodes dug.
Primitives
----------
Contained in primitives.lua, this module allows the creation of several geometric primitives.
### worldedit.hollow_sphere = function(pos, radius, nodename)
Adds a hollow sphere at `pos` with radius `radius`, composed of `nodename`.
Returns the number of nodes added.
### worldedit.sphere = function(pos, radius, nodename)
Adds a sphere at `pos` with radius `radius`, composed of `nodename`.
Returns the number of nodes added.
### worldedit.hollow_cylinder(pos, axis, length, radius, nodename)
Adds a hollow cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `length` and radius `radius`, composed of `nodename`.
Returns the number of nodes added.
### worldedit.cylinder(pos, axis, length, radius, nodename)
Adds a cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `length` and radius `radius`, composed of `nodename`.
Returns the number of nodes added.
### worldedit.pyramid(pos, height, nodename)
Adds a pyramid at `pos` with height `height`.
Returns the number of nodes added.
### worldedit.spiral(pos, width, height, spacer, nodename)
Adds a spiral at `pos` with width `width`, height `height`, space between walls `spacer`, composed of `nodename`.
Visualization
-------------
Contained in visualization.lua, this module allows nodes to be visualized in different ways.
### worldedit.hide(pos1, pos2)
Hides all nodes in a region defined by positions `pos1` and `pos2` by non-destructively replacing them with invisible nodes.
Returns the number of nodes hidden.
### worldedit.suppress(pos1, pos2, nodename)
Suppresses all instances of `nodename` in a region defined by positions `pos1` and `pos2` by non-destructively replacing them with invisible nodes.
Returns the number of nodes suppressed.
### worldedit.find(pos1, pos2, nodename)
Finds all instances of `nodename` in a region defined by positions `pos1` and `pos2` by non-destructively hiding all other nodes.
Returns the number of nodes found.
### worldedit.restore(pos1, pos2)
Restores all nodes hidden with WorldEdit functions in a region defined by positions `pos1` and `pos2`.
Returns the number of nodes restored.
Serialization
-------------
Contained in serialization.lua, this module allows regions of nodes to be serialized and deserialized to formats suitable for use outside MineTest.
### worldedit.serialize(pos1, pos2)
Converts the region defined by positions `pos1` and `pos2` into a single string.