\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
+worldedit = worldedit or {}\r
+worldedit.version = {major=1, minor=0}\r
+worldedit.version_string = "1.0"\r
+\r
assert(minetest.get_voxel_manip, string.rep(">", 300) .. "HEY YOU! YES, YOU OVER THERE. THIS VERSION OF WORLDEDIT REQUIRES MINETEST 0.4.8 OR LATER! YOU HAVE AN OLD VERSION." .. string.rep("<", 300))\r
\r
local path = minetest.get_modpath(minetest.get_current_modname())\r
params = "",\r
description = "Get information about the mod",\r
func = function(name, param)\r
- worldedit.player_notify(name, "WorldEdit 1.0 is available on this server. Type /help to get a list of commands, or get more information at https://github.com/Uberi/MineTest-WorldEdit/")\r
+ worldedit.player_notify(name, "WorldEdit " .. worldedit.version_string .. " is available on this server. Type /help to get a list of commands, or get more information at https://github.com/Uberi/MineTest-WorldEdit/")\r
end,\r
})\r
\r
local volume = worldedit.volume(pos1, pos2)\r
local abs = math.abs\r
worldedit.player_notify(name, "current region has a volume of " .. volume .. " nodes ("\r
- .. abs(pos2.x - pos1.x) .. "*"\r
- .. abs(pos2.y - pos1.y) .. "*"\r
- .. abs(pos2.z - pos1.z) .. ")")\r
+ .. abs(pos2.x - pos1.x) + 1 .. "*"\r
+ .. abs(pos2.y - pos1.y) + 1 .. "*"\r
+ .. abs(pos2.z - pos1.z) + 1 .. ")")\r
end,\r
})\r
\r