X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=WorldEdit%20API.md;h=fc9cf652e0bda75d020d8a9842d9431beefd8f61;hb=HEAD;hp=f50b5062c8dd192df55051758ee2eb83c24430c6;hpb=bb8456b71119ca6303b9e9706829a84dc7f81ab3;p=worldedit.git diff --git a/WorldEdit API.md b/WorldEdit API.md index f50b506..fc9cf65 100644 --- a/WorldEdit API.md +++ b/WorldEdit API.md @@ -24,6 +24,13 @@ Contained in manipulations.lua, this module allows several node operations to be ### count = worldedit.set(pos1, pos2, node_name) Sets a region defined by positions `pos1` and `pos2` to `node_name`. To clear a region, use "air" as the value of `node_name`. +If `node_name` is a list of nodes, each set node is randomly picked from it. + +Returns the number of nodes set. + +### `count = worldedit.set_param2(pos1, pos2, param2)` + +Sets the param2 values of all nodes in a region defined by positions `pos1` and `pos2` to `param2`. Returns the number of nodes set. @@ -45,6 +52,13 @@ Copies the region defined by positions `pos1` and `pos2` along the `axis` axis ( Returns the number of nodes copied. +### count = worldedit.copy2(pos1, pos2, off) + +Copies the region defined by positions `pos1` and `pos2` by the offset vector `off`. +Note that the offset needs to be big enough that there is no overlap. + +Returns the number of nodes copied. + ### count = 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. @@ -60,6 +74,7 @@ Returns the number of nodes stacked. ### count = worldedit.stack2(pos1, pos2, direction, amount) Duplicates the region defined by positions `pos1` and `pos2` `amount` times with offset vector `direction`. +Note that the offset vector needs to be big enough that there is no overlap. Returns the number of nodes stacked. @@ -109,6 +124,12 @@ Primitives ---------- Contained in primitives.lua, this module allows the creation of several geometric primitives. +### count = worldedit.cube(pos, width, height, length, node_name, hollow) + +Adds a cube with its ground level centered at `pos`, the dimensions `width` x `height` x `length`, composed of `node_name`. + +Returns the number of nodes added. + ### count = worldedit.sphere(pos, radius, node_name, hollow) Adds a sphere centered at `pos` with radius `radius`, composed of `node_name`. @@ -121,15 +142,15 @@ Adds a dome centered at `pos` with radius `radius`, composed of `node_name`. Returns the number of nodes added. -### count = worldedit.cylinder(pos, axis, length, radius, node_name, hollow) +### count = worldedit.cylinder(pos, axis, length, radius1, radius2, node_name, hollow) -Adds a cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `length` and radius `radius`, composed of `node_name`. +Adds a cylinder-like at `pos` along the `axis` axis ("x" or "y" or "z") with length `length`, base radius `radius1` and top radius `radius2`, composed of `node_name`. Returns the number of nodes added. -### count = worldedit.pyramid(pos, axis, height, node_name) +### count = worldedit.pyramid(pos, axis, height, node_name, hollow) -Adds a pyramid centered at `pos` along the `axis` axis ("x" or "y" or "z") with height `height`. +Adds a pyramid centered at `pos` along the `axis` axis ("x" or "y" or "z") with height `height`, composed of `node_name`. Returns the number of nodes added. @@ -175,7 +196,7 @@ 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. +Contained in serialization.lua, this module allows regions of nodes to be serialized and deserialized to formats suitable for use outside Minetest. ### version, extra_fields, content = worldedit.read_header(value)