From 1c31bd7f0d78447ea35e195b59fc1b2577ebaf18 Mon Sep 17 00:00:00 2001 From: Anthony Zhang Date: Sat, 13 Oct 2012 21:45:50 -0400 Subject: 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. --- WorldEdit API.md | 104 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 73 insertions(+), 31 deletions(-) (limited to 'WorldEdit API.md') diff --git a/WorldEdit API.md b/WorldEdit API.md index 41fab69..30e4437 100644 --- a/WorldEdit API.md +++ b/WorldEdit API.md @@ -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,6 +26,54 @@ Replaces all instances of `searchnode` with `replacenode` in a region defined by Returns the number of nodes replaced. +Returns the number of nodes added. + +### worldedit.copy(pos1, pos2, axis, amount) + +Copies the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes. + +Returns the number of nodes copied. + +### worldedit.move(pos1, pos2, axis, amount) + +Moves the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes. + +Returns the number of nodes moved. + +### worldedit.stack(pos1, pos2, axis, count) + +Duplicates the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") `count` times. + +Returns the number of nodes stacked. + +### worldedit.transpose(pos1, pos2, axis1, axis2) + +Transposes a region defined by the positions `pos1` and `pos2` between the `axis1` and `axis2` axes ("x" or "y" or "z"). + +Returns the number of nodes transposed. + +### worldedit.flip(pos1, pos2, axis) + +Flips a region defined by the positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z"). + +Returns the number of nodes flipped. + +### worldedit.rotate(pos1, pos2, angle) + +Rotates a region defined by the positions `pos1` and `pos2` by `angle` degrees clockwise around the y axis (supporting 90 degree increments only). + +Returns the number of nodes rotated. + +### worldedit.dig(pos1, pos2) + +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`. @@ -54,49 +108,37 @@ Returns the number of nodes added. 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) - -Copies the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes. - -Returns the number of nodes copied. - -### worldedit.move(pos1, pos2, axis, amount) - -Moves the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes. - -Returns the number of nodes moved. - -### worldedit.stack(pos1, pos2, axis, count) - -Duplicates the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") `count` times. +Visualization +------------- +Contained in visualization.lua, this module allows nodes to be visualized in different ways. -Returns the number of nodes stacked. +### worldedit.hide(pos1, pos2) -### worldedit.transpose(pos1, pos2, axis1, axis2) +Hides all nodes in a region defined by positions `pos1` and `pos2` by non-destructively replacing them with invisible nodes. -Transposes a region defined by the positions `pos1` and `pos2` between the `axis1` and `axis2` axes ("x" or "y" or "z"). +Returns the number of nodes hidden. -Returns the number of nodes transposed. +### worldedit.suppress(pos1, pos2, nodename) -### worldedit.flip(pos1, pos2, axis) +Suppresses all instances of `nodename` in a region defined by positions `pos1` and `pos2` by non-destructively replacing them with invisible nodes. -Flips a region defined by the positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z"). +Returns the number of nodes suppressed. -Returns the number of nodes flipped. +### worldedit.find(pos1, pos2, nodename) -### worldedit.rotate(pos1, pos2, angle) +Finds all instances of `nodename` in a region defined by positions `pos1` and `pos2` by non-destructively hiding all other nodes. -Rotates a region defined by the positions `pos1` and `pos2` by `angle` degrees clockwise around the y axis (supporting 90 degree increments only). +Returns the number of nodes found. -Returns the number of nodes rotated. +### worldedit.restore(pos1, pos2) -### worldedit.dig(pos1, pos2) +Restores all nodes hidden with WorldEdit functions in a region defined by positions `pos1` and `pos2`. -Digs a region defined by positions `pos1` and `pos2`. +Returns the number of nodes restored. -Returns the number of nodes dug. +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) -- cgit v1.2.3