summaryrefslogtreecommitdiff
path: root/worldedit
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 21:00:20 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 21:10:04 -0400
commit888b0ebfec8c2eff9015163549a7e47443cb8665 (patch)
tree915080159bfaa6ba6e226087c7ce0e8d5464b518 /worldedit
parentda66780a569712c23ae4f2996cfb4608a9f9d69d (diff)
downloaddreambuilder_modpack-888b0ebfec8c2eff9015163549a7e47443cb8665.tar
dreambuilder_modpack-888b0ebfec8c2eff9015163549a7e47443cb8665.tar.gz
dreambuilder_modpack-888b0ebfec8c2eff9015163549a7e47443cb8665.tar.bz2
dreambuilder_modpack-888b0ebfec8c2eff9015163549a7e47443cb8665.tar.xz
dreambuilder_modpack-888b0ebfec8c2eff9015163549a7e47443cb8665.zip
"explode" all modpacks into their individual components
(you can't have a modpack buried inside a modpack)
Diffstat (limited to 'worldedit')
-rw-r--r--worldedit/ChatCommands.md382
-rw-r--r--worldedit/LICENSE.txt661
-rw-r--r--worldedit/README.md160
-rw-r--r--worldedit/Tutorial.md120
-rw-r--r--worldedit/WorldEdit API.md225
-rw-r--r--worldedit/code.lua (renamed from worldedit/worldedit/code.lua)0
-rw-r--r--worldedit/common.lua (renamed from worldedit/worldedit/common.lua)0
-rw-r--r--worldedit/compatibility.lua (renamed from worldedit/worldedit/compatibility.lua)0
-rw-r--r--worldedit/config.ld12
-rw-r--r--worldedit/init.lua (renamed from worldedit/worldedit/init.lua)0
-rw-r--r--worldedit/manipulations.lua (renamed from worldedit/worldedit/manipulations.lua)0
-rw-r--r--worldedit/modpack.txt0
-rw-r--r--worldedit/primitives.lua (renamed from worldedit/worldedit/primitives.lua)0
-rw-r--r--worldedit/serialization.lua (renamed from worldedit/worldedit/serialization.lua)0
-rw-r--r--worldedit/visualization.lua (renamed from worldedit/worldedit/visualization.lua)0
-rw-r--r--worldedit/worldedit_commands/depends.txt1
-rw-r--r--worldedit/worldedit_commands/init.lua1160
-rw-r--r--worldedit/worldedit_commands/mark.lua162
-rw-r--r--worldedit/worldedit_commands/safe.lua68
-rw-r--r--worldedit/worldedit_commands/textures/worldedit_cube.pngbin147 -> 0 bytes
-rw-r--r--worldedit/worldedit_commands/textures/worldedit_pos1.pngbin142 -> 0 bytes
-rw-r--r--worldedit/worldedit_commands/textures/worldedit_pos2.pngbin157 -> 0 bytes
-rw-r--r--worldedit/worldedit_gui/depends.txt5
-rw-r--r--worldedit/worldedit_gui/functionality.lua707
-rw-r--r--worldedit/worldedit_gui/init.lua249
-rw-r--r--worldedit/worldedit_gui/textures/inventory_plus_worldedit_gui.pngbin25175 -> 0 bytes
-rw-r--r--worldedit/worldedit_infinity/depends.txt1
-rw-r--r--worldedit/worldedit_infinity/init.lua103
-rw-r--r--worldedit/worldedit_limited/depends.txt1
-rw-r--r--worldedit/worldedit_limited/init.lua120
-rw-r--r--worldedit/worldedit_shortcommands/depends.txt1
-rw-r--r--worldedit/worldedit_shortcommands/init.lua50
32 files changed, 0 insertions, 4188 deletions
diff --git a/worldedit/ChatCommands.md b/worldedit/ChatCommands.md
deleted file mode 100644
index d3ed7db..0000000
--- a/worldedit/ChatCommands.md
+++ /dev/null
@@ -1,382 +0,0 @@
-Chat Commands
--------------
-For more information, see the [README](README.md).
-
-Many commands also have shorter names that can be typed faster. For example, if we wanted to use `//move ? 5`, we could instead type `//m ? 5`. All shortened names are listed below:
-
-| Short Name | Original Name |
-|:-----------|:-------------------|
-| `//i` | `//inspect` |
-| `//rst` | `//reset` |
-| `//mk` | `//mark` |
-| `//umk` | `//unmark` |
-| `//1` | `//pos1` |
-| `//2` | `//pos2` |
-| `//fp` | `//fixedpos` |
-| `//v` | `//volume` |
-| `//s` | `//set` |
-| `//r` | `//replace` |
-| `//ri` | `//replaceinverse` |
-| `//hspr` | `//hollowsphere` |
-| `//spr` | `//sphere` |
-| `//hdo` | `//hollowdome` |
-| `//do` | `//dome` |
-| `//hcyl` | `//hollowcylinder` |
-
-### `//about`
-
-Get information about the mod.
-
- //about
-
-### `//inspect on/off/1/0/true/false/yes/no/enable/disable/<blank>`
-
-Enable or disable node inspection.
-
- //inspect on
- //inspect off
- //inspect 1
- //inspect 0
- //inspect true
- //inspect false
- //inspect yes
- //inspect no
- //inspect enable
- //inspect disable
- //inspect
-
-### `//reset`
-
-Reset the region so that it is empty.
-
- //reset
-
-### `//mark`
-
-Show markers at the region positions.
-
- //mark
-
-### `//unmark`
-
-Hide markers if currently shown.
-
- //unmark
-
-### `//pos1`
-
-Set WorldEdit region position 1 to the player's location.
-
- //pos1
-
-### `//pos2`
-
-Set WorldEdit region position 2 to the player's location.
-
- //pos2
-
-### `//p set/set1/set2/get`
-
-Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region.
-
- //p set
- //p set1
- //p set2
- //p get
-
-### `//fixedpos set1 x y z`
-
-Set a WorldEdit region position to the position at (`<x>`, `<y>`, `<z>`).
-
- //fixedpos set1 0 0 0
- //fixedpos set1 -30 5 28
- //fixedpos set2 1004 -200 432
-
-### `//volume`
-
-Display the volume of the current WorldEdit region.
-
- //volume
-
-### `//deleteblocks`
-
-Delete the MapBlocks (16x16x16 units) that contain the selected region. This means that mapgen will be invoked for that area. As only whole MapBlocks get removed, the deleted area is usually larger than the selected one. Also, mapgen can trigger mechanisms like mud reflow or cavegen, which affects nodes (up to 112 nodes away) outside the MapBlock, so dont use this near buildings. Note that active entities are not part of a MapBlock and do not get deleted.
-
- //deleteblocks
-
-### `//set <node>`
-
-Set the current WorldEdit region to `<node>`.
-
- //set air
- //set cactus
- //set Blue Lightstone
- //set dirt with grass
-
-### `//mix <node1> ...`
-
-Fill the current WorldEdit region with a random mix of `<node1>`, `...`.
-
- //mix air
- //mix cactus stone glass sandstone
- //mix Bronze
- //mix default:cobble air
-
-### `//replace <search node> <replace node>`
-
-Replace all instances of `<search node>` with `<replace node>` in the current WorldEdit region.
-
- //replace Cobblestone air
- //replace lightstone_blue glass
- //replace dirt Bronze Block
- //replace mesecons:wire_00000000_off flowers:flower_tulip
-
-### `//replaceinverse <search node> <replace node>`
-
-Replace all nodes other than `<search node>` with `<replace node>` in the current WorldEdit region.
-
- //replaceinverse Cobblestone air
- //replaceinverse flowers:flower_waterlily glass
- //replaceinverse dirt Bronze Block
- //replaceinverse mesecons:wire_00000000_off flowers:flower_tulip
-
-### `//hollowsphere <radius> <node>`
-
-Add hollow sphere centered at WorldEdit position 1 with radius `<radius>`, composed of `<node>`.
-
- //hollowsphere 5 Diamond Block
- //hollowsphere 12 glass
- //hollowsphere 17 mesecons:wire_00000000_off
-
-### `//sphere <radius> <node>`
-
-Add sphere centered at WorldEdit position 1 with radius `<radius>`, composed of `<node>`.
-
- //sphere 5 Diamond Block
- //sphere 12 glass
- //sphere 17 mesecons:wire_00000000_off
-
-### `//hollowdome <radius> <node>`
-
-Add hollow dome centered at WorldEdit position 1 with radius `<radius>`, composed of `<node>`.
-
- //hollowdome 5 Diamond Block
- //hollowdome -12 glass
- //hollowdome 17 mesecons:wire_00000000_off
-
-### `//dome <radius> <node>`
-
-Add dome centered at WorldEdit position 1 with radius `<radius>`, composed of `<node>`.
-
- //dome 5 Diamond Block
- //dome -12 glass
- //dome 17 mesecons:wire_00000000_off
-
-### `//hollowcylinder x/y/z/? <length> <radius> <node>`
-
-Add hollow cylinder at WorldEdit position 1 along the x/y/z/? axis with length `<length>` and radius `<radius>`, composed of `<node>`.
-
- //hollowcylinder x +5 8 Bronze Block
- //hollowcylinder y 28 10 glass
- //hollowcylinder z -12 3 mesecons:wire_00000000_off
- //hollowcylinder ? 2 4 default:stone
-
-### `//cylinder x/y/z/? <length> <radius> <node>`
-
-Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length `<length>` and radius `<radius>`, composed of `<node>`.
-
- //cylinder x +5 8 Bronze Block
- //cylinder y 28 10 glass
- //cylinder z -12 3 mesecons:wire_00000000_off
- //cylinder ? 2 4 default:stone
-
-### `//pyramid x/y/z? <height> <node>`
-
-Add pyramid centered at WorldEdit position 1 along the x/y/z/? axis with height `<height>`, composed of `<node>`.
-
- //pyramid x 8 Diamond Block
- //pyramid y -5 glass
- //pyramid z 2 mesecons:wire_00000000_off
- //pyramid ? 12 mesecons:wire_00000000_off
-
-### `//spiral <length> <height> <spacer> <node>`
-
-Add spiral centered at WorldEdit position 1 with side length `<length>`, height `<height>`, space between walls `<spacer>`, composed of `<node>`.
-
- //spiral 20 5 3 Diamond Block
- //spiral 5 2 1 glass
- //spiral 7 1 5 mesecons:wire_00000000_off
-
-### `//copy x/y/z/? <amount>`
-
-Copy the current WorldEdit region along the x/y/z/? axis by `<amount>` nodes.
-
- //copy x 15
- //copy y -7
- //copy z +4
- //copy ? 8
-
-### `//move x/y/z/? <amount>`
-
-Move the current WorldEdit positions and region along the x/y/z/? axis by `<amount>` nodes.
-
- //move x 15
- //move y -7
- //move z +4
- //move ? -1
-
-### `//stack x/y/z/? <count>`
-
-Stack the current WorldEdit region along the x/y/z/? axis `<count>` times.
-
- //stack x 3
- //stack y -1
- //stack z +5
- //stack ? 12
-
-### `//stack2 <count> <x> <y> <z>`
-
-Stack the current WorldEdit region `<count>` times by offset `<x>`, `<y>`, `<z>`.
-
- //stack2 5 3 8 2
- //stack2 1 -1 -1 -1
-
-### `//scale <factor>`
-
-Scale the current WorldEdit positions and region by a factor of positive integer `<factor>` with position 1 as the origin.
-
- //scale 2
- //scale 1
- //scale 10
-
-### `//transpose x/y/z/? x/y/z/?`
-
-Transpose the current WorldEdit positions and region along the x/y/z/? and x/y/z/? axes.
-
- //transpose x y
- //transpose x z
- //transpose y z
- //transpose ? y
-
-### `//flip x/y/z/?`
-
-Flip the current WorldEdit region along the x/y/z/? axis.
-
- //flip x
- //flip y
- //flip z
- //flip ?
-
-### `//rotate x/y/z/? <angle>`
-
-Rotate the current WorldEdit positions and region along the x/y/z/? axis by angle `<angle>` (90 degree increment).
-
- //rotate x 90
- //rotate y 180
- //rotate z 270
- //rotate ? -90
-
-### `//orient <angle>`
-
-Rotate oriented nodes in the current WorldEdit region around the Y axis by angle `<angle>` (90 degree increment)
-
- //orient 90
- //orient 180
- //orient 270
- //orient -90
-
-### `//fixlight`
-
-Fixes the lighting in the current WorldEdit region.
-
- //fixlight
-
-### `//hide`
-
-Hide all nodes in the current WorldEdit region non-destructively.
-
- //hide
-
-### `//suppress <node>`
-
-Suppress all <node> in the current WorldEdit region non-destructively.
-
- //suppress Diamond Block
- //suppress glass
- //suppress mesecons:wire_00000000_off
-
-### `//highlight <node>`
-
-Highlight <node> in the current WorldEdit region by hiding everything else non-destructively.
-
- //highlight Diamond Block
- //highlight glass
- //highlight mesecons:wire_00000000_off
-
-### `//restore`
-
-Restores nodes hidden with WorldEdit in the current WorldEdit region.
-
- //restore
-
-### `//save <file>`
-
-Save the current WorldEdit region to "(world folder)/schems/`<file>`.we".
-
- //save some random filename
- //save huge_base
-
-### `//allocate <file>`
-
-Set the region defined by nodes from "(world folder)/schems/`<file>`.we" as the current WorldEdit region.
-
- //allocate some random filename
- //allocate huge_base
-
-### `//load <file>`
-
-Load nodes from "(world folder)/schems/`<file>`.we" with position 1 of the current WorldEdit region as the origin.
-
- //load some random filename
- //load huge_base
-
-### `//lua <code>`
-
-Executes `<code>` as a Lua chunk in the global namespace.
-
- //lua worldedit.pos1["singleplayer"] = {x=0, y=0, z=0}
- //lua worldedit.rotate(worldedit.pos1["singleplayer"], worldedit.pos2["singleplayer"], "y", 90)
-
-### `//luatransform <code>`
-
-Executes `<code>` as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region.
-
- //luatransform minetest.add_node(pos, {name="default:stone"})
- //luatransform if minetest.get_node(pos).name == "air" then minetest.add_node(pos, {name="default:water_source"})
-
-### `//mtschemcreate <file>`
-
-Save the current WorldEdit region using the Minetest Schematic format to "(world folder)/schems/`<file>`.mts".
-
- //mtschemcreate some random filename
- //mtschemcreate huge_base
-
-### `//mtschemplace <file>`
-
-Load nodes from "(world folder)/schems/`<file>`.mts" with position 1 of the current WorldEdit region as the origin.
-
- //mtschemplace some random filename
- //mtschemplace huge_base
-
-### `//mtschemprob start/finish/get`
-
-After using `//mtschemprob start` all nodes punched will bring up a text field where a probablity can be entered.
-This mode can be left with `//mtschemprob finish`. `//mtschemprob get` will display the probabilities saved for the nodes.
-
- //mtschemprob get
-
-### `//clearobjects`
-
-Clears all objects within the WorldEdit region.
-
- //clearobjects
diff --git a/worldedit/LICENSE.txt b/worldedit/LICENSE.txt
deleted file mode 100644
index dba13ed..0000000
--- a/worldedit/LICENSE.txt
+++ /dev/null
@@ -1,661 +0,0 @@
- GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
- A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate. Many developers of free software are heartened and
-encouraged by the resulting cooperation. However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
- The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community. It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server. Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
- An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals. This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU Affero General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Remote Network Interaction; Use with the GNU General Public License.
-
- Notwithstanding any other provision of this License, if you modify the
-Program, your modified version must prominently offer all users
-interacting with it remotely through a computer network (if your version
-supports such interaction) an opportunity to receive the Corresponding
-Source of your version by providing access to the Corresponding Source
-from a network server at no charge, through some standard or customary
-means of facilitating copying of software. This Corresponding Source
-shall include the Corresponding Source for any work covered by version 3
-of the GNU General Public License that is incorporated pursuant to the
-following paragraph.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the work with which it is combined will remain governed by version
-3 of the GNU General Public License.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU Affero General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU Affero General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU Affero General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU Affero General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If your software can interact with users remotely through a computer
-network, you should also make sure that it provides a way for users to
-get its source. For example, if your program is a web application, its
-interface could display a "Source" link that leads users to an archive
-of the code. There are many ways you could offer source, and different
-solutions will be better for different programs; see section 13 for the
-specific requirements.
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU AGPL, see
-<http://www.gnu.org/licenses/>.
diff --git a/worldedit/README.md b/worldedit/README.md
deleted file mode 100644
index 22dd7c7..0000000
--- a/worldedit/README.md
+++ /dev/null
@@ -1,160 +0,0 @@
-WorldEdit v1.1 for Minetest 0.4.8+
-==================================
-The ultimate in-game world editing tool for [Minetest](http://minetest.net/)! Tons of functionality to help with building, fixing, and more.
-
-For more information, see the [forum topic](https://forum.minetest.net/viewtopic.php?id=572) at the Minetest forums.
-
-# New users should see the [tutorial](Tutorial.md).
-
-![Screenshot](http://i.imgur.com/lwhodrv.png)
-
-Installing
-----------
-
-If you are using Windows, consider installing this mod using [MODSTER](https://forum.minetest.net/viewtopic.php?id=6497), a super simple mod installer that will take care of everything for you. If you are using MODSTER, skip directly to step 6 in the instructions below.
-
-There is a nice installation guide over at the [Minetest Wiki](http://wiki.minetest.com/wiki/Installing_mods). Here is a short summary:
-
-1. Download the mod from the [official releases page](https://github.com/Uberi/Minetest-WorldEdit/releases). The download links are labelled "Source Code". If you are using Windows, you will probably want to download the ZIP version.
-2. You should have a file named `SOMETHING.zip` or `SOMETHING.tar.gz`.
-3. Extract this file using your archiver of choice. If you are using Windows, open the ZIP file and move the folder inside to a safe place outside of the ZIP file.
-4. Make sure that you now have a folder with a file named README.md inside it. If you just have another folder inside this folder, use this nested folder instead.
-5. Move this folder into the `MINETEST_FOLDER/mods` folder, where `MINETEST_FOLDER` is the folder Minetest is located in.
-6. Open Minetest to a world selection screen.
-7. Select a world you want to use WorldEdit in by left clicking on it once, and press the **Configure** button.
-8. You should have a mod selection screen. Select the one named something like `Minetest-WorldEdit` by left clicking once and press the **Enable MP** button.
-9. Press the **Save** button. You can now use WorldEdit in that world. Repeat steps 7 to 9 to enable WorldEdit for other worlds too.
-
-If you are having trouble, try asking for help in the [IRC channel](http://webchat.freenode.net/?channels=#minetest) (faster but may not always have helpers online) or ask on the [forum topic](https://forum.minetest.net/viewtopic.php?id=572) (slower but more likely to get help).
-
-Usage
------
-WorldEdit works primarily through the WorldEdit GUI and chat commands. Depending on your key bindings, you can invoke chat entry with the "t" key, and open the chat console with the "F10" key.
-
-WorldEdit has a huge potential for abuse by untrusted players. Therefore, users will not be able to use WorldEdit unless they have the `worldedit` privelege. This is available by default in single player, but in multiplayer the permission must be explicitly given by someone with the right credentials, using the follwoing chat command: `/grant <player name> worldedit`. This privelege can later be removed using the following chat command: `/revoke <player name> worldedit`.
-
-Certain functions/commands such as WorldEdit GUI's "Run Lua" function (equivalent to the `//lua` and `//luatransform` chat command) additionally require the `server` privilege. This is because it is extremely dangerous to give access to these commands to untrusted players, since they essentially are able to control the computer the server is running on. Give this privilege only to people you trust with your computer.
-
-For in-game information about these commands, type `/help <command name>` in the chat. For example, to learn more about the `//copy` command, simply type `/help /copy` to display information relevant to copying a region.
-
-Interface
----------
-WorldEdit is accessed in-game in two main ways.
-
-The GUI adds a screen to each player's inventory that gives access to various WorldEdit functions. The [tutorial](Tutorial.md) and the [Chat Commands Reference](ChatCommands.md) may be helpful in learning to use it.
-
-The chat interface adds many chat commands that perform various WorldEdit powered tasks. It is documented in the [Chat Commands Reference](ChatCommands.md).
-
-Compatibility
--------------
-This mod supports Minetest versions 0.4.8 and newer. Older versions of WorldEdit may work with older versions of Minetest, but are not recommended or supported.
-
-WorldEdit works quite well with other mods, and does not have any known mod conflicts.
-
-WorldEdit GUI works with [Unified Inventory](https://forum.minetest.net/viewtopic.php?id=3933) and [Inventory++](https://forum.minetest.net/viewtopic.php?id=6204), but these are not required to use the mod.
-
-If you use any other inventory manager mods, note that they may conflict with the WorldEdit GUI. If this is the case, it may be necessary to disable them.
-
-WorldEdit API
--------------
-WorldEdit exposes all significant functionality in a simple Lua interface. Adding WorldEdit to the file "depends.txt" in your mod gives you access to all of the `worldedit` functions. The API is useful for tasks such as high-performance node manipulation, alternative interfaces, and map creation.
-
-If you don't add WorldEdit to your "depends.txt" file, each file in the WorldEdit mod is also independent. For example, one may import the WorldEdit primitives API using the following code:
-
- dofile(minetest.get_modpath("worldedit").."/primitives.lua")
-
-AGPLv3 compatible mods may further include WorldEdit files in their own mods. This may be useful if a modder wishes to completely avoid any dependencies on WorldEdit. Note that it is required to give credit to the authors.
-
-This API is documented in the [WorldEdit API Reference](WorldEdit API.md).
-
-Axes
-----
-The coordinate system is the same as that used by Minetest; positive Y is upwards, positive X is rightwards, and positive Z is forwards, if a player is facing North (positive Z axis).
-
-When an axis is specified in a WorldEdit chat command, it is specified as one of the following values: `x`, `y`, `z`, or `?`.
-
-In the GUI, there is a dropdown menu for this purpose. The "Look direction" option has the same effect as `?` does in chat commands.
-
-The value `?` represents the axis the player is currently facing. If the player is facing more than one axis, the axis the player face direction is closest to will be used.
-
-Nodes
------
-Node names are required for many types of commands that identify or modify specific types of nodes. They can be specified in a number of ways.
-
-First, by description - the tooltip that appears when hovering over the item in an inventory. This is case insensitive and includes values such as "Cobblestone" and "bronze block". Note that certain commands (namely, `//replace` and `//replaceinverse`) do not support descriptions that contain spaces in the `<searchnode>` field.
-
-Second, by name - the node name that is defined by code, but without the mod name prefix. This is case sensitive and includes values such as "piston_normal_off" and "cactus". Nodes defined in the `default` mod always take precedence over other nodes when searching for the correct one, and if there are multiple possible nodes (such as "a:celery" and "b:celery"), one is chosen in no particular order.
-
-Finally, by full name - the unambiguous identifier of the node, prefixes and all. This is case sensitive and includes values such as "default:stone" and "mesecons:wire_00000000_off".
-
-The node name "air" can be used anywhere a normal node name can, and acts as a blank node. This is useful for clearing or removing nodes. For example, `//set air` would remove all the nodes in the current WorldEdit region. Similarly, `//sphere 10 air`, when WorldEdit position 1 underground, would dig a large sphere out of the ground.
-
-Regions
--------
-Most WorldEdit commands operate on regions. Regions are a set of two positions that define a 3D cuboid. They are local to each player and chat commands affect only the region for the player giving the commands.
-
-Each positions together define two opposing corners of the cube. With two opposing corners it is possible to determine both the location and dimensions of the region.
-
-Regions are not saved between server restarts. They start off as empty regions, and cannot be used with most WorldEdit commands until they are set to valid values.
-
-Markers
--------
-Entities are used to mark the location of the WorldEdit regions. They appear as boxes containing the number 1 or 2, and represent position 1 and 2 of the WorldEdit region, respectively.
-
-To remove the entities, simply punch them. This does not reset the positions themselves.
-
-Schematics
-----------
-WorldEdit supports two different types of schematics.
-
-The first is the WorldEdit Schematic format, with the file extension ".we", and in some older versions, ".wem". There have been several previous versions of the WorldEdit Schematic format, but WorldEdit is capable of loading any past versions, and will always support them - there is no need to worry about schematics becoming obselete.
-
-As of version 5, WorldEdit schematics include a header. The header is seperated from the content by a colon (`:`). It contains fields seperated by commas (`,`). Currently only one field is used, which contains the version in ASCII decimal.
-
-The current version of the WorldEdit Schematic format is essentially an array of node data tables in Lua 5.1 table syntax preceded by a header.
-Specifically it looks like this:
-
- 5:return {
- {
- y = <y-axis coordinate>,
- x = <x-axis coordinate>,
- z = <z-axis coordinate>,
- name = <node name>,
- param1 = <param1 value>,
- param2 = <param2 value>,
- meta = <metadata table>,
- },
- <...>
- }
-
-
-The ordering of the values and minor aspects of the syntax, such as trailing commas or newlines, are not guaranteed to stay the same in future versions.
-
-The WorldEdit Schematic format is accessed via the WorldEdit API, or WorldEdit serialization chat commands such as `//serialize` and `//deserialize`.
-
-The second is the Minetest Schematic format (MTS). The details of this format may be found in the Minetest documentation and are out of the scope of this document. Access to this format is done via specialized MTS commands such as `//mtschemcreate` and `//mtschemplace`.
-
-Authors
--------
-WorldEdit would not be possible without the contributions of many developers and designers. Below, they are listed alphabetically:
-
- cheapie
- cornernote
- cyisfor
- electricface
- kaeza
- khonkhortisan
- sfan5
- ShadowNinja
- spillz
- Uberi/Temperest
-
-License
--------
-Copyright 2013 sfan5, Anthony Zhang (Uberi/Temperest), and Brett O'Donnell (cornernote).
-
-This mod is licensed under the [GNU Affero General Public License](http://www.gnu.org/licenses/agpl-3.0.html).
-
-Basically, this means everyone is free to use, modify, and distribute the files, as long as these modifications are also licensed the same way.
-
-Most importantly, the Affero variant of the GPL requires you to publish your modifications in source form, even if the mod is run only on the server, and not distributed.
diff --git a/worldedit/Tutorial.md b/worldedit/Tutorial.md
deleted file mode 100644
index 1ed3998..0000000
--- a/worldedit/Tutorial.md
+++ /dev/null
@@ -1,120 +0,0 @@
-WorldEdit Tutorial
-==================
-This is a step-by-step tutorial outlining the basic usage of WorldEdit. For more information, see the [README](README.md).
-
-Let's start with a few assumptions:
-
-* You have a compatible version of Minetest working.
- * See the [README](README.md) for compatibility information.
-* You have WorldEdit installed as a mod.
- * If using Windows, [MODSTER](https://forum.minetest.net/viewtopic.php?pid=101463) makes installing mods totally painless.
- * Simply download the file, extract the archive, and move it to the correct mod folder for Minetest.
- * See the installation instructions in [README](README.md) if you need more details.
-* You are familiar with the basics of the game.
- * How to walk, jump, and climb.
- * How to dig, place, and punch blocks.
- * One of the following:
- * How to type into the chat and read text from it.
- * How to open the inventory screen and press buttons on it.
-
-Overview
---------
-WorldEdit has a "region", which is simply a cuboid area defined by two markers, both of which the player can move around. Every player can have their own region with their own two markers.
-
-WorldEdit GUI buttons and chat commands generally work inside the region selected, or around the first marker.
-
-If you are using the chat commands, follow the steps under **Chat Commands**. If you are using the WorldEdit GUI, follow the steps under **WorldEdit GUI**.
-
-Step 1: Selecting a region
---------------------------
-### Chat Commands
-
-In the chat prompt, enter `//p set`. In the chat, you are prompted to punch two nodes to set the positions of the two markers.
-
-Punch a nearby node. Be careful of breakable ones such as torches. A black cube reading "1" will appear around the node. This is the marker for WorldEdit position 1.
-
-Walk away from the node you just punched. Now, punch another node. A black cube reading "2" will appear around the node. This is the marker for WorldEdit position 2.
-
-### WorldEdit GUI
-
-Open the main WorldEdit GUI from your inventory screen. The icon looks like a globe with a red dot in the center.
-
-Press the "Get/Set Positions" button. On the new screen, press the "Set Position 1" button. The inventory screen should close.
-
-Punch a nearby node. Be careful of breakable ones such as torches. A black cube reading "1" will appear around the node. This is the marker for WorldEdit position 1.
-
-Walk away from the node you just punched. Open your inventory again. It should be on the same page as it was before.
-
-Press the "Set Position 2" button. The inventory screen should close.
-
-Now, punch another node. A black cube reading "2" will appear around the node. This is the marker for WorldEdit position 2.
-
-Step 2: Region commands
------------------------
-### Chat Commands
-
-In the chat prompt, enter `//set mese`. In the chat, you will see a message showing the number of nodes set after a small delay.
-
-Look at the place between the two markers: it is now filled with MESE blocks!
-
-The `//set <node>` command fills the region with whatever node you want. It is a region-oriented command, which means it works inside the WorldEdit region only.
-
-Now, try a few different variations, such as `//set torch`, `//set cobble`, and `//set water`.
-
-### WorldEdit GUI
-
-Open the main WorldEdit GUI from your inventory screen.
-
-Press the "Set Nodes" button. You should see a new screen with various options for setting nodes.
-
-Enter "mese" in the "Name" field. Press Search if you would like to see what the node you just entered looks like.
-
-Press the "Set Nodes" button on this screen. In the chat, you will see a message showing the number of nodes set after a small delay.
-
-Look at the place between the two markers: it is now filled with MESE blocks!
-
-The "Set Nodes" function fills the region with whatever node you want. It is a region-oriented command, which means it works inside the WorldEdit region only.
-
-Now, try a few different variations on the node name, such as "torch", "cobble", and "water".
-
-Step 3: Position commands
--------------------------
-### Chat Commands
-
-In the chat prompt, enter `//hollowdome 30 glass`. In the chat, you will see a message showing the number of nodes set after a small delay.
-
-Look around marker 1: it is now surrounded by a hollow glass dome!
-
-The `//hollowdome <radius> <node>` command creates a hollow dome centered around marker 1, made of any node you want. It is a position-oriented command, which means it works around marker 1 and can go outside the WorldEdit region.
-
-### WorldEdit GUI
-
-Open the main WorldEdit GUI from your inventory screen.
-
-Press the "Sphere/Dome" button. You should see a new screen with various options for making spheres or domes.
-
-Enter "glass" in the "Name" field. Press Search if you would like to see what the node you just entered looks like.
-
-Enter "30" in the "Radius" field.
-
-Press the "Hollow Dome" button on this screen. In the chat, you will see a message showing the number of nodes added after a small delay.
-
-Look around marker 1: it is now surrounded by a hollow glass dome!
-
-The "Hollow Dome" function creates a hollow dome centered around marker 1, made of any node you want. It is a position-oriented command, which means it works around marker 1 and can go outside the WorldEdit region.
-
-Step 4: Other commands
-----------------------
-### Chat Commands
-
-There are many more commands than what is shown here. See the [Chat Commands Reference](ChatCommands.md) for a detailed list of them, along with descriptions and examples for every single one.
-
-If you're in-game and forgot how a command works, just use the `/help <command name>` command, without the first forward slash. For example, to see some information about the `//set <node>` command mentioned earlier, simply use `/help /set`.
-
-A very useful command to check out is the `//save <schematic>` command, which can save everything inside the WorldEdit region to a file, stored on the computer hosting the server (the player's computer, in single player mode). You can then later use `//load <schematic>` to load the data in a file into a world, even another world on another computer.
-
-### WorldEdit GUI
-
-This only scratches the surface of what WorldEdit is capable of. Most of the functions in the WorldEdit GUI correspond to chat commands, and so the [Chat Commands Reference](ChatCommands.md) may be useful if you get stuck.
-
-It is helpful to explore the various buttons in the interface and check out what they do. Learning the chat command interface is also useful if you use WorldEdit intensively - an experienced chat command user can usually work faster than an experienced WorldEdit GUI user. \ No newline at end of file
diff --git a/worldedit/WorldEdit API.md b/worldedit/WorldEdit API.md
deleted file mode 100644
index 7b99c8b..0000000
--- a/worldedit/WorldEdit API.md
+++ /dev/null
@@ -1,225 +0,0 @@
-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.
-
-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.
-
-For more information, see the [README](README.md).
-
-General
--------
-
-### value = worldedit.version
-
-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.
-
-### value = worldedit.version_string
-
-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.
-
-Manipulations
--------------
-Contained in manipulations.lua, this module allows several node operations to be applied over a region.
-
-### 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`.
-
-Returns the number of nodes set.
-
-### count = worldedit.replace(pos1, pos2, searchnode, replacenode)
-
-Replaces all instances of `searchnode` with `replacenode` in a region defined by positions `pos1` and `pos2`.
-
-Returns the number of nodes replaced.
-
-### count = worldedit.replaceinverse(pos1, pos2, searchnode, replacenode)
-
-Replaces all nodes other than `searchnode` with `replacenode` in a region defined by positions `pos1` and `pos2`.
-
-Returns the number of nodes replaced.
-
-### count = 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.
-
-### count = worldedit.copy2(pos1, pos2, off)
-
-Copies the region defined by positions `pos1` and `pos2` by the offset vector `off`.
-
-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.
-
-Returns the number of nodes moved.
-
-### count = 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.
-
-### count = worldedit.stack2(pos1, pos2, direction, amount)
-
-Duplicates the region defined by positions `pos1` and `pos2` `amount` times with offset vector `direction`.
-
-Returns the number of nodes stacked.
-
-### count, newpos1, newpos2 = worldedit.stretch(pos1, pos2, stretchx, stretchy, stretchz)
-
-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.
-
-Returns the number of nodes stretched, the new scaled position 1, and the new scaled position 2.
-
-### count, newpos1, newpos2 = 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, the new transposed position 1, and the new transposed position 2.
-
-### count = 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.
-
-### count, newpos2, newpos2 = 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, the new position 1, and the new position 2.
-
-### count = worldedit.orient(pos1, pos2, angle)
-
-Rotates all oriented nodes in a region defined by the positions `pos1` and `pos2` by `angle` degrees clockwise (90 degree increment) around the Y axis.
-
-Returns the number of nodes oriented.
-
-### count = worldedit.fixlight(pos1, pos2)
-
-Fixes the lighting in a region defined by positions `pos1` and `pos2`.
-
-Returns the number of nodes updated.
-
-### count = worldedit.clearobjects(pos1, pos2)
-
-Clears all objects in a region defined by the positions `pos1` and `pos2`.
-
-Returns the number of objects cleared.
-
-Primitives
-----------
-Contained in primitives.lua, this module allows the creation of several geometric primitives.
-
-### count = worldedit.sphere(pos, radius, node_name, hollow)
-
-Adds a sphere centered at `pos` with radius `radius`, composed of `node_name`.
-
-Returns the number of nodes added.
-
-### count = worldedit.dome(pos, radius, node_name, hollow)
-
-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)
-
-Adds a cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `length` and radius `radius`, composed of `node_name`.
-
-Returns the number of nodes added.
-
-### count = worldedit.pyramid(pos, axis, height, node_name)
-
-Adds a pyramid centered at `pos` along the `axis` axis ("x" or "y" or "z") with height `height`.
-
-Returns the number of nodes added.
-
-### count = worldedit.spiral(pos, length, height, spacer, node_name)
-
-Adds a spiral centered at `pos` with side length `length`, height `height`, space between walls `spacer`, composed of `node_name`.
-
-Returns the number of nodes added.
-
-Visualization
--------------
-Contained in visualization.lua, this module allows nodes to be visualized in different ways.
-
-### volume = worldedit.volume(pos1, pos2)
-
-Determines the volume of the region defined by positions `pos1` and `pos2`.
-
-Returns the volume.
-
-### count = 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.
-
-### count = worldedit.suppress(pos1, pos2, node_name)
-
-Suppresses all instances of `node_name` in a region defined by positions `pos1` and `pos2` by non-destructively replacing them with invisible nodes.
-
-Returns the number of nodes suppressed.
-
-### count = worldedit.highlight(pos1, pos2, node_name)
-
-Highlights all instances of `node_name` in a region defined by positions `pos1` and `pos2` by non-destructively hiding all other nodes.
-
-Returns the number of nodes found.
-
-### count = 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.
-
-### version, extra_fields, content = worldedit.read_header(value)
-
-Reads the header from serialized data `value`.
-
-Returns the version as a positive integer (nil for unknown versions),
-extra header fields (nil if not supported), and the content after the header.
-
-### data, count = worldedit.serialize(pos1, pos2)
-
-Converts the region defined by positions `pos1` and `pos2` into a single string.
-
-Returns the serialized data and the number of nodes serialized, or nil.
-
-### pos1, pos2, count = worldedit.allocate(origin_pos, value)
-
-Determines the volume the nodes represented by string `value` would occupy if deserialized at `origin_pos`.
-
-Returns the two corner positions and the number of nodes, or nil.
-
-### count = worldedit.deserialize(origin_pos, value)
-
-Loads the nodes represented by string `value` at position `origin_pos`.
-
-Returns the number of nodes deserialized or nil.
-
-Code
-----
-Contained in code.lua, this module allows arbitrary Lua code to be used with WorldEdit.
-
-### error = worldedit.lua(code)
-
-Executes `code` as a Lua chunk in the global namespace.
-
-Returns an error if the code fails or nil otherwise.
-
-### error = worldedit.luatransform(pos1, pos2, code)
-
-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`.
-
-Returns an error if the code fails or nil otherwise.
diff --git a/worldedit/worldedit/code.lua b/worldedit/code.lua
index a939deb..a939deb 100644
--- a/worldedit/worldedit/code.lua
+++ b/worldedit/code.lua
diff --git a/worldedit/worldedit/common.lua b/worldedit/common.lua
index be9a2c9..be9a2c9 100644
--- a/worldedit/worldedit/common.lua
+++ b/worldedit/common.lua
diff --git a/worldedit/worldedit/compatibility.lua b/worldedit/compatibility.lua
index c989a05..c989a05 100644
--- a/worldedit/worldedit/compatibility.lua
+++ b/worldedit/compatibility.lua
diff --git a/worldedit/config.ld b/worldedit/config.ld
deleted file mode 100644
index 69be224..0000000
--- a/worldedit/config.ld
+++ /dev/null
@@ -1,12 +0,0 @@
-project = "WorldEdit"
-title = "WorldEdit API Documentation"
-description = "Minetest mod to mass-modify nodes"
-format = "markdown"
-file = {"worldedit"}
-topics = {
- "README.md",
- "Tutorial.md",
- "ChatCommands.md",
- "LICENSE.txt"
-}
-
diff --git a/worldedit/worldedit/init.lua b/worldedit/init.lua
index e193454..e193454 100644
--- a/worldedit/worldedit/init.lua
+++ b/worldedit/init.lua
diff --git a/worldedit/worldedit/manipulations.lua b/worldedit/manipulations.lua
index cf95517..cf95517 100644
--- a/worldedit/worldedit/manipulations.lua
+++ b/worldedit/manipulations.lua
diff --git a/worldedit/modpack.txt b/worldedit/modpack.txt
deleted file mode 100644
index e69de29..0000000
--- a/worldedit/modpack.txt
+++ /dev/null
diff --git a/worldedit/worldedit/primitives.lua b/worldedit/primitives.lua
index 962a02f..962a02f 100644
--- a/worldedit/worldedit/primitives.lua
+++ b/worldedit/primitives.lua
diff --git a/worldedit/worldedit/serialization.lua b/worldedit/serialization.lua
index 00d984d..00d984d 100644
--- a/worldedit/worldedit/serialization.lua
+++ b/worldedit/serialization.lua
diff --git a/worldedit/worldedit/visualization.lua b/worldedit/visualization.lua
index 5ac49f3..5ac49f3 100644
--- a/worldedit/worldedit/visualization.lua
+++ b/worldedit/visualization.lua
diff --git a/worldedit/worldedit_commands/depends.txt b/worldedit/worldedit_commands/depends.txt
deleted file mode 100644
index df8caff..0000000
--- a/worldedit/worldedit_commands/depends.txt
+++ /dev/null
@@ -1 +0,0 @@
-worldedit \ No newline at end of file
diff --git a/worldedit/worldedit_commands/init.lua b/worldedit/worldedit_commands/init.lua
deleted file mode 100644
index 83a127e..0000000
--- a/worldedit/worldedit_commands/init.lua
+++ /dev/null
@@ -1,1160 +0,0 @@
-minetest.register_privilege("worldedit", "Can use WorldEdit commands")
-
-worldedit.set_pos = {}
-worldedit.inspect = {}
-
-worldedit.pos1 = {}
-worldedit.pos2 = {}
-if minetest.place_schematic then
- worldedit.prob_pos = {}
- worldedit.prob_list = {}
-end
-
-dofile(minetest.get_modpath("worldedit_commands") .. "/mark.lua")
-local safe_region, check_region = dofile(minetest.get_modpath("worldedit_commands") .. "/safe.lua")
-
-local function get_position(name) --position 1 retrieval function for when not using `safe_region`
- local pos1 = worldedit.pos1[name]
- if pos1 == nil then
- worldedit.player_notify(name, "no position 1 selected")
- end
- return pos1
-end
-
-local function get_node(name, nodename)
- local node = worldedit.normalize_nodename(nodename)
- if not node then
- worldedit.player_notify(name, "invalid node name: " .. nodename)
- return nil
- end
- return node
-end
-
-function worldedit.player_notify(name, message)
- minetest.chat_send_player(name, "WorldEdit -!- " .. message, false)
-end
-
---determines whether `nodename` is a valid node name, returning a boolean
-worldedit.normalize_nodename = function(nodename)
- nodename = nodename:gsub("^%s*(.-)%s*$", "%1")
- if nodename == "" then return nil end
- local fullname = ItemStack({name=nodename}):get_name() --resolve aliases of node names to full names
- if minetest.registered_nodes[fullname] or fullname == "air" then --directly found node name or alias of nodename
- return fullname
- end
- for key, value in pairs(minetest.registered_nodes) do
- if key:find(":" .. nodename, 1, true) then --found in mod
- return key
- end
- end
- nodename = nodename:lower() --lowercase both for case insensitive comparison
- for key, value in pairs(minetest.registered_nodes) do
- if value.description:lower() == nodename then --found in description
- return key
- end
- end
- return nil
-end
-
--- Determines the axis in which a player is facing, returning an axis ("x", "y", or "z") and the sign (1 or -1)
-function worldedit.player_axis(name)
- local dir = minetest.get_player_by_name(name):get_look_dir()
- local x, y, z = math.abs(dir.x), math.abs(dir.y), math.abs(dir.z)
- if x > y then
- if x > z then
- return "x", dir.x > 0 and 1 or -1
- end
- elseif y > z then
- return "y", dir.y > 0 and 1 or -1
- end
- return "z", dir.z > 0 and 1 or -1
-end
-
-local function mkdir(path)
- if minetest.mkdir then
- minetest.mkdir(path)
- else
- os.execute('mkdir "' .. path .. '"')
- end
-end
-
-local function check_filename(name)
- return name:find("^[%w%s%^&'@{}%[%],%$=!%-#%(%)%%%.%+~_]+$") ~= nil
-end
-
-
-minetest.register_chatcommand("/about", {
- params = "",
- description = "Get information about the mod",
- func = function(name, param)
- 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/")
- end,
-})
-
-minetest.register_chatcommand("/inspect", {
- params = "on/off/1/0/true/false/yes/no/enable/disable/<blank>",
- description = "Enable or disable node inspection",
- privs = {worldedit=true},
- func = function(name, param)
- if param == "on" or param == "1" or param == "true" or param == "yes" or param == "enable" or param == "" then
- worldedit.inspect[name] = true
- local axis, sign = worldedit.player_axis(name)
- worldedit.player_notify(name, string.format("inspector: inspection enabled for %s, currently facing the %s axis",
- name, axis .. (sign > 0 and "+" or "-")))
- elseif param == "off" or param == "0" or param == "false" or param == "no" or param == "disable" then
- worldedit.inspect[name] = nil
- worldedit.player_notify(name, "inspector: inspection disabled")
- else
- worldedit.player_notify(name, "invalid usage: " .. param)
- end
- end,
-})
-
-minetest.register_on_punchnode(function(pos, node, puncher)
- local name = puncher:get_player_name()
- if worldedit.inspect[name] then
- if minetest.check_player_privs(name, {worldedit=true}) then
- local axis, sign = worldedit.player_axis(name)
- message = string.format("inspector: %s at %s (param1=%d, param2=%d) punched by %s facing the %s axis",
- node.name, minetest.pos_to_string(pos), node.param1, node.param2, name, axis .. (sign > 0 and "+" or "-"))
- else
- message = "inspector: worldedit privileges required"
- end
- worldedit.player_notify(name, message)
- end
-end)
-
-minetest.register_chatcommand("/reset", {
- params = "",
- description = "Reset the region so that it is empty",
- privs = {worldedit=true},
- func = function(name, param)
- worldedit.pos1[name] = nil
- worldedit.pos2[name] = nil
- worldedit.mark_pos1(name)
- worldedit.mark_pos2(name)
- worldedit.set_pos[name] = nil
- worldedit.player_notify(name, "region reset")
- end,
-})
-
-minetest.register_chatcommand("/mark", {
- params = "",
- description = "Show markers at the region positions",
- privs = {worldedit=true},
- func = function(name, param)
- worldedit.mark_pos1(name)
- worldedit.mark_pos2(name)
- worldedit.player_notify(name, "region marked")
- end,
-})
-
-minetest.register_chatcommand("/unmark", {
- params = "",
- description = "Hide markers if currently shown",
- privs = {worldedit=true},
- func = function(name, param)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- worldedit.pos1[name] = nil
- worldedit.pos2[name] = nil
- worldedit.mark_pos1(name)
- worldedit.mark_pos2(name)
- worldedit.pos1[name] = pos1
- worldedit.pos2[name] = pos2
- worldedit.player_notify(name, "region unmarked")
- end,
-})
-
-minetest.register_chatcommand("/pos1", {
- params = "",
- description = "Set WorldEdit region position 1 to the player's location",
- privs = {worldedit=true},
- func = function(name, param)
- local pos = minetest.get_player_by_name(name):getpos()
- pos.x, pos.y, pos.z = math.floor(pos.x + 0.5), math.floor(pos.y + 0.5), math.floor(pos.z + 0.5)
- worldedit.pos1[name] = pos
- worldedit.mark_pos1(name)
- worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos))
- end,
-})
-
-minetest.register_chatcommand("/pos2", {
- params = "",
- description = "Set WorldEdit region position 2 to the player's location",
- privs = {worldedit=true},
- func = function(name, param)
- local pos = minetest.get_player_by_name(name):getpos()
- pos.x, pos.y, pos.z = math.floor(pos.x + 0.5), math.floor(pos.y + 0.5), math.floor(pos.z + 0.5)
- worldedit.pos2[name] = pos
- worldedit.mark_pos2(name)
- worldedit.player_notify(name, "position 2 set to " .. minetest.pos_to_string(pos))
- end,
-})
-
-minetest.register_chatcommand("/p", {
- params = "set/set1/set2/get",
- description = "Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region",
- privs = {worldedit=true},
- func = function(name, param)
- if param == "set" then --set both WorldEdit positions
- worldedit.set_pos[name] = "pos1"
- worldedit.player_notify(name, "select positions by punching two nodes")
- elseif param == "set1" then --set WorldEdit position 1
- worldedit.set_pos[name] = "pos1only"
- worldedit.player_notify(name, "select position 1 by punching a node")
- elseif param == "set2" then --set WorldEdit position 2
- worldedit.set_pos[name] = "pos2"
- worldedit.player_notify(name, "select position 2 by punching a node")
- elseif param == "get" then --display current WorldEdit positions
- if worldedit.pos1[name] ~= nil then
- worldedit.player_notify(name, "position 1: " .. minetest.pos_to_string(worldedit.pos1[name]))
- else
- worldedit.player_notify(name, "position 1 not set")
- end
- if worldedit.pos2[name] ~= nil then
- worldedit.player_notify(name, "position 2: " .. minetest.pos_to_string(worldedit.pos2[name]))
- else
- worldedit.player_notify(name, "position 2 not set")
- end
- else
- worldedit.player_notify(name, "unknown subcommand: " .. param)
- end
- end,
-})
-
-minetest.register_chatcommand("/fixedpos", {
- params = "set1/set2 x y z",
- description = "Set a WorldEdit region position to the position at (<x>, <y>, <z>)",
- privs = {worldedit=true},
- func = function(name, param)
- local found, _, flag, x, y, z = param:find("^(set[12])%s+([+-]?%d+)%s+([+-]?%d+)%s+([+-]?%d+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return
- end
- local pos = {x=tonumber(x), y=tonumber(y), z=tonumber(z)}
- if flag == "set1" then
- worldedit.pos1[name] = pos
- worldedit.mark_pos1(name)
- worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos))
- else --flag == "set2"
- worldedit.pos2[name] = pos
- worldedit.mark_pos2(name)
- worldedit.player_notify(name, "position 2 set to " .. minetest.pos_to_string(pos))
- end
- end,
-})
-
-minetest.register_on_punchnode(function(pos, node, puncher)
- local name = puncher:get_player_name()
- if name ~= "" and worldedit.set_pos[name] ~= nil then --currently setting position
- if worldedit.set_pos[name] == "pos1" then --setting position 1
- worldedit.pos1[name] = pos
- worldedit.mark_pos1(name)
- worldedit.set_pos[name] = "pos2" --set position 2 on the next invocation
- worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos))
- elseif worldedit.set_pos[name] == "pos1only" then --setting position 1 only
- worldedit.pos1[name] = pos
- worldedit.mark_pos1(name)
- worldedit.set_pos[name] = nil --finished setting positions
- worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos))
- elseif worldedit.set_pos[name] == "pos2" then --setting position 2
- worldedit.pos2[name] = pos
- worldedit.mark_pos2(name)
- worldedit.set_pos[name] = nil --finished setting positions
- worldedit.player_notify(name, "position 2 set to " .. minetest.pos_to_string(pos))
- elseif worldedit.set_pos[name] == "prob" then --setting Minetest schematic node probabilities
- worldedit.prob_pos[name] = pos
- minetest.show_formspec(puncher:get_player_name(), "prob_val_enter", "field[text;;]")
- end
- end
-end)
-
-minetest.register_chatcommand("/volume", {
- params = "",
- description = "Display the volume of the current WorldEdit region",
- privs = {worldedit=true},
- func = function(name, param)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- if pos1 == nil or pos2 == nil then
- worldedit.player_notify(name, "no region selected")
- return nil
- end
-
- local volume = worldedit.volume(pos1, pos2)
- local abs = math.abs
- worldedit.player_notify(name, "current region has a volume of " .. volume .. " nodes ("
- .. abs(pos2.x - pos1.x) + 1 .. "*"
- .. abs(pos2.y - pos1.y) + 1 .. "*"
- .. abs(pos2.z - pos1.z) + 1 .. ")")
- end,
-})
-
-minetest.register_chatcommand("/deleteblocks", {
- params = "",
- description = "remove all MapBlocks (16x16x16) containing the selected area from the map",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- local success = minetest.delete_area(pos1, pos2)
- if success then
- worldedit.player_notify(name, "Area deleted.")
- else
- worldedit.player_notify(name, "There was an error during deletion of the area.")
- end
- end),
-})
-
-minetest.register_chatcommand("/set", {
- params = "<node>",
- description = "Set the current WorldEdit region to <node>",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local node = get_node(name, param)
- if not node then
- worldedit.player_notify(name, "Could not identify node \"" .. param .. "\"")
- return
- end
-
- local count = worldedit.set(worldedit.pos1[name], worldedit.pos2[name], node)
- worldedit.player_notify(name, count .. " nodes set")
- end, check_region),
-})
-
-minetest.register_chatcommand("/mix", {
- params = "<node1> ...",
- description = "Fill the current WorldEdit region with a random mix of <node1>, ...",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local nodes = {}
- for nodename in param:gmatch("[^%s]+") do
- local node = get_node(name, nodename)
- if not node then
- worldedit.player_notify(name, "Could not identify node \"" .. name .. "\"")
- return
- end
- nodes[#nodes + 1] = node
- end
-
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- local count = worldedit.set(pos1, pos2, nodes)
- worldedit.player_notify(name, count .. " nodes set")
- end, check_region),
-})
-
-local check_replace = function(name, param)
- local found, _, searchnode, replacenode = param:find("^([^%s]+)%s+(.+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- local newsearchnode = worldedit.normalize_nodename(searchnode)
- if not newsearchnode then
- worldedit.player_notify(name, "invalid search node name: " .. searchnode)
- return nil
- end
- local newreplacenode = worldedit.normalize_nodename(replacenode)
- if not newreplacenode then
- worldedit.player_notify(name, "invalid replace node name: " .. replacenode)
- return nil
- end
- return check_region(name, param)
-end
-
-minetest.register_chatcommand("/replace", {
- params = "<search node> <replace node>",
- description = "Replace all instances of <search node> with <replace node> in the current WorldEdit region",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, search_node, replace_node = param:find("^([^%s]+)%s+(.+)$")
- local norm_search_node = worldedit.normalize_nodename(search_node)
- local norm_replace_node = worldedit.normalize_nodename(replace_node)
- local count = worldedit.replace(worldedit.pos1[name], worldedit.pos2[name],
- norm_search_node, norm_replace_node)
- worldedit.player_notify(name, count .. " nodes replaced")
- end, check_replace),
-})
-
-minetest.register_chatcommand("/replaceinverse", {
- params = "<search node> <replace node>",
- description = "Replace all nodes other than <search node> with <replace node> in the current WorldEdit region",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, search_node, replace_node = param:find("^([^%s]+)%s+(.+)$")
- local norm_search_node = worldedit.normalize_nodename(search_node)
- local norm_replace_node = worldedit.normalize_nodename(replace_node)
- local count = worldedit.replace(worldedit.pos1[name], worldedit.pos2[name],
- norm_search_node, norm_replace_node, true)
- worldedit.player_notify(name, count .. " nodes replaced")
- end, check_replace),
-})
-
-local check_sphere = function(name, param)
- if worldedit.pos1[name] == nil then
- worldedit.player_notify(name, "no position 1 selected")
- return nil
- end
- local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- local node = get_node(name, nodename)
- if not node then return nil end
- return math.ceil((4 * math.pi * (tonumber(radius) ^ 3)) / 3) --volume of sphere
-end
-
-minetest.register_chatcommand("/hollowsphere", {
- params = "<radius> <node>",
- description = "Add hollow sphere centered at WorldEdit position 1 with radius <radius>, composed of <node>",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$")
- local node = get_node(name, nodename)
- local count = worldedit.sphere(worldedit.pos1[name], tonumber(radius), node, true)
- worldedit.player_notify(name, count .. " nodes added")
- end, check_sphere),
-})
-
-minetest.register_chatcommand("/sphere", {
- params = "<radius> <node>",
- description = "Add sphere centered at WorldEdit position 1 with radius <radius>, composed of <node>",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$")
- local node = get_node(name, nodename)
- local count = worldedit.sphere(worldedit.pos1[name], tonumber(radius), node)
- worldedit.player_notify(name, count .. " nodes added")
- end, check_sphere),
-})
-
-local check_dome = function(name, param)
- if worldedit.pos1[name] == nil then
- worldedit.player_notify(name, "no position 1 selected")
- return nil
- end
- local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- local node = get_node(name, nodename)
- if not node then return nil end
- return math.ceil((2 * math.pi * (tonumber(radius) ^ 3)) / 3) --volume of dome
-end
-
-minetest.register_chatcommand("/hollowdome", {
- params = "<radius> <node>",
- description = "Add hollow dome centered at WorldEdit position 1 with radius <radius>, composed of <node>",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$")
- local node = get_node(name, nodename)
- local count = worldedit.dome(worldedit.pos1[name], tonumber(radius), node, true)
- worldedit.player_notify(name, count .. " nodes added")
- end, check_dome),
-})
-
-minetest.register_chatcommand("/dome", {
- params = "<radius> <node>",
- description = "Add dome centered at WorldEdit position 1 with radius <radius>, composed of <node>",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$")
- local node = get_node(name, nodename)
- local count = worldedit.dome(worldedit.pos1[name], tonumber(radius), node)
- worldedit.player_notify(name, count .. " nodes added")
- end, check_dome),
-})
-
-local check_cylinder = function(name, param)
- if worldedit.pos1[name] == nil then
- worldedit.player_notify(name, "no position 1 selected")
- return nil
- end
- local found, _, axis, length, radius, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- local node = get_node(name, nodename)
- if not node then return nil end
- return math.ceil(math.pi * (tonumber(radius) ^ 2) * tonumber(length))
-end
-
-minetest.register_chatcommand("/hollowcylinder", {
- params = "x/y/z/? <length> <radius> <node>",
- description = "Add hollow cylinder at WorldEdit position 1 along the x/y/z/? axis with length <length> and radius <radius>, composed of <node>",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, axis, length, radius, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$")
- length = tonumber(length)
- if axis == "?" then
- axis, sign = worldedit.player_axis(name)
- length = length * sign
- end
- local node = get_node(name, nodename)
- local count = worldedit.cylinder(worldedit.pos1[name], axis, length, tonumber(radius), node, true)
- worldedit.player_notify(name, count .. " nodes added")
- end, check_cylinder),
-})
-
-minetest.register_chatcommand("/cylinder", {
- params = "x/y/z/? <length> <radius> <node>",
- description = "Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length <length> and radius <radius>, composed of <node>",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, axis, length, radius, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$")
- length = tonumber(length)
- if axis == "?" then
- axis, sign = worldedit.player_axis(name)
- length = length * sign
- end
- local node = get_node(name, nodename)
- local count = worldedit.cylinder(worldedit.pos1[name], axis, length, tonumber(radius), node)
- worldedit.player_notify(name, count .. " nodes added")
- end, check_cylinder),
-})
-
-minetest.register_chatcommand("/pyramid", {
- params = "x/y/z/? <height> <node>",
- description = "Add pyramid centered at WorldEdit position 1 along the x/y/z/? axis with height <height>, composed of <node>",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, axis, height, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(.+)$")
- height = tonumber(height)
- if axis == "?" then
- axis, sign = worldedit.player_axis(name)
- height = height * sign
- end
- local node = get_node(name, nodename)
- local count = worldedit.pyramid(worldedit.pos1[name], axis, height, node)
- worldedit.player_notify(name, count .. " nodes added")
- end,
- function(name, param)
- if worldedit.pos1[name] == nil then
- worldedit.player_notify(name, "no position 1 selected")
- return nil
- end
- local found, _, axis, height, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(.+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- local node = get_node(name, nodename)
- if not node then return nil end
- height = tonumber(height)
- return math.ceil(((height * 2 + 1) ^ 2) * height / 3)
- end),
-})
-
-minetest.register_chatcommand("/spiral", {
- params = "<length> <height> <space> <node>",
- description = "Add spiral centered at WorldEdit position 1 with side length <length>, height <height>, space between walls <space>, composed of <node>",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, length, height, space, nodename = param:find("^(%d+)%s+(%d+)%s+(%d+)%s+(.+)$")
- local node = get_node(name, nodename)
- local count = worldedit.spiral(worldedit.pos1[name], tonumber(length), tonumber(height), tonumber(space), node)
- worldedit.player_notify(name, count .. " nodes added")
- end,
- function(name, param)
- if worldedit.pos1[name] == nil then
- worldedit.player_notify(name, "no position 1 selected")
- return nil
- end
- local found, _, length, height, space, nodename = param:find("^(%d+)%s+(%d+)%s+(%d+)%s+(.+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- local node = get_node(name, nodename)
- if not node then return nil end
- return check_region(name, param)
- end),
-})
-
-minetest.register_chatcommand("/copy", {
- params = "x/y/z/? <amount>",
- description = "Copy the current WorldEdit region along the x/y/z/? axis by <amount> nodes",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, axis, amount = param:find("^([xyz%?])%s+([+-]?%d+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return
- end
- amount = tonumber(amount)
- if axis == "?" then
- axis, sign = worldedit.player_axis(name)
- amount = amount * sign
- end
-
- local count = worldedit.copy(worldedit.pos1[name], worldedit.pos2[name], axis, amount)
- worldedit.player_notify(name, count .. " nodes copied")
- end,
- function(name, param)
- local volume = check_region(name, param)
- return volume and volume * 2 or volume
- end),
-})
-
-minetest.register_chatcommand("/move", {
- params = "x/y/z/? <amount>",
- description = "Move the current WorldEdit region along the x/y/z/? axis by <amount> nodes",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- local found, _, axis, amount = param:find("^([xyz%?])%s+([+-]?%d+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return
- end
- amount = tonumber(amount)
- if axis == "?" then
- axis, sign = worldedit.player_axis(name)
- amount = amount * sign
- end
-
- local count = worldedit.move(pos1, pos2, axis, amount)
-
- pos1[axis] = pos1[axis] + amount
- pos2[axis] = pos2[axis] + amount
- worldedit.mark_pos1(name)
- worldedit.mark_pos2(name)
- worldedit.player_notify(name, count .. " nodes moved")
- end, check_region),
-})
-
-minetest.register_chatcommand("/stack", {
- params = "x/y/z/? <count>",
- description = "Stack the current WorldEdit region along the x/y/z/? axis <count> times",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, axis, repetitions = param:find("^([xyz%?])%s+([+-]?%d+)$")
- repetitions = tonumber(repetitions)
- if axis == "?" then
- axis, sign = worldedit.player_axis(name)
- repetitions = repetitions * sign
- end
- local count = worldedit.stack(worldedit.pos1[name], worldedit.pos2[name], axis, repetitions)
- worldedit.player_notify(name, count .. " nodes stacked")
- end,
- function(name, param)
- local found, _, axis, repetitions = param:find("^([xyz%?])%s+([+-]?%d+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return
- end
- local count = check_region(name, param)
- if count then return (tonumber(repetitions) + 1) * count end
- return nil
- end),
-})
-
-minetest.register_chatcommand("/stack2", {
- params = "<count> <x> <y> <z>",
- description = "Stack the current WorldEdit region <count> times by offset <x>, <y>, <z>",
- privs = {worldedit=true},
- func = function(name, param)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- if pos1 == nil or pos2 == nil then
- worldedit.player_notify(name, "Select a position first!")
- return
- end
- local repetitions, incs = param:match("(%d+)%s*(.+)")
- if repetitions == nil then
- worldedit.player_notify(name, "invalid count: " .. param)
- return
- end
- repetitions = tonumber(repetitions)
-
- local x, y, z = incs:match("([+-]?%d+) ([+-]?%d+) ([+-]?%d+)")
- if x == nil then
- worldedit.player_notify(name, "invalid increments: " .. param)
- return
- end
- x, y, z = tonumber(x), tonumber(y), tonumber(z)
-
- local count = worldedit.volume(pos1, pos2) * repetitions
-
- return safe_region(function()
- worldedit.stack2(pos1, pos2, {x=x, y=y, z=z}, repetitions,
- function() worldedit.player_notify(name, count .. " nodes stacked") end)
- end, function()
- return count
- end)(name,param) -- more hax --wip: clean this up a little bit
- end
-})
-
-
-minetest.register_chatcommand("/stretch", {
- params = "<stretchx> <stretchy> <stretchz>",
- description = "Scale the current WorldEdit positions and region by a factor of <stretchx>, <stretchy>, <stretchz> along the X, Y, and Z axes, repectively, with position 1 as the origin",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- local found, _, stretchx, stretchy, stretchz = param:find("^(%d+)%s+(%d+)%s+(%d+)$")
- stretchx, stretchy, stretchz = tonumber(stretchx), tonumber(stretchy), tonumber(stretchz)
- local count, pos1, pos2 = worldedit.stretch(pos1, pos2, stretchx, stretchy, stretchz)
-
- --reset markers to scaled positions
- worldedit.pos1[name] = pos1
- worldedit.pos2[name] = pos2
- worldedit.mark_pos1(name)
- worldedit.mark_pos2(name)
-
- worldedit.player_notify(name, count .. " nodes stretched")
- end,
- function(name, param)
- local found, _, stretchx, stretchy, stretchz = param:find("^(%d+)%s+(%d+)%s+(%d+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- stretchx, stretchy, stretchz = tonumber(stretchx), tonumber(stretchy), tonumber(stretchz)
- if stretchx == 0 or stretchy == 0 or stretchz == 0 then
- worldedit.player_notify(name, "invalid scaling factors: " .. param)
- end
- local count = check_region(name, param)
- if count then return tonumber(stretchx) * tonumber(stretchy) * tonumber(stretchz) * count end
- return nil
- end),
-})
-
-minetest.register_chatcommand("/transpose", {
- params = "x/y/z/? x/y/z/?",
- description = "Transpose the current WorldEdit region along the x/y/z/? and x/y/z/? axes",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- local found, _, axis1, axis2 = param:find("^([xyz%?])%s+([xyz%?])$")
- if axis1 == "?" then axis1 = worldedit.player_axis(name) end
- if axis2 == "?" then axis2 = worldedit.player_axis(name) end
- local count, pos1, pos2 = worldedit.transpose(pos1, pos2, axis1, axis2)
-
- --reset markers to transposed positions
- worldedit.pos1[name] = pos1
- worldedit.pos2[name] = pos2
- worldedit.mark_pos1(name)
- worldedit.mark_pos2(name)
-
- worldedit.player_notify(name, count .. " nodes transposed")
- end,
- function(name, param)
- local found, _, axis1, axis2 = param:find("^([xyz%?])%s+([xyz%?])$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- if axis1 == axis2 then
- worldedit.player_notify(name, "invalid usage: axes must be different")
- return nil
- end
- return check_region(name, param)
- end),
-})
-
-minetest.register_chatcommand("/flip", {
- params = "x/y/z/?",
- description = "Flip the current WorldEdit region along the x/y/z/? axis",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- if param == "?" then param = worldedit.player_axis(name) end
- local count = worldedit.flip(worldedit.pos1[name], worldedit.pos2[name], param)
- worldedit.player_notify(name, count .. " nodes flipped")
- end,
- function(name, param)
- if param ~= "x" and param ~= "y" and param ~= "z" and param ~= "?" then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- return check_region(name, param)
- end),
-})
-
-minetest.register_chatcommand("/rotate", {
- params = "<axis> <angle>",
- description = "Rotate the current WorldEdit region around the axis <axis> by angle <angle> (90 degree increment)",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- local found, _, axis, angle = param:find("^([xyz%?])%s+([+-]?%d+)$")
- if axis == "?" then axis = worldedit.player_axis(name) end
- local count, pos1, pos2 = worldedit.rotate(pos1, pos2, axis, angle)
-
- --reset markers to rotated positions
- worldedit.pos1[name] = pos1
- worldedit.pos2[name] = pos2
- worldedit.mark_pos1(name)
- worldedit.mark_pos2(name)
-
- worldedit.player_notify(name, count .. " nodes rotated")
- end,
- function(name, param)
- local found, _, axis, angle = param:find("^([xyz%?])%s+([+-]?%d+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- if angle % 90 ~= 0 then
- worldedit.player_notify(name, "invalid usage: angle must be multiple of 90")
- return nil
- end
- return check_region(name, param)
- end),
-})
-
-minetest.register_chatcommand("/orient", {
- params = "<angle>",
- description = "Rotate oriented nodes in the current WorldEdit region around the Y axis by angle <angle> (90 degree increment)",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local found, _, angle = param:find("^([+-]?%d+)$")
- local count = worldedit.orient(worldedit.pos1[name], worldedit.pos2[name], angle)
- worldedit.player_notify(name, count .. " nodes oriented")
- end,
- function(name, param)
- local found, _, angle = param:find("^([+-]?%d+)$")
- if found == nil then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return nil
- end
- if angle % 90 ~= 0 then
- worldedit.player_notify(name, "invalid usage: angle must be multiple of 90")
- return nil
- end
- return check_region(name, param)
- end),
-})
-
-minetest.register_chatcommand("/fixlight", {
- params = "",
- description = "Fix the lighting in the current WorldEdit region",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local count = worldedit.fixlight(worldedit.pos1[name], worldedit.pos2[name])
- worldedit.player_notify(name, count .. " nodes updated")
- end),
-})
-
-minetest.register_chatcommand("/hide", {
- params = "",
- description = "Hide all nodes in the current WorldEdit region non-destructively",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local count = worldedit.hide(worldedit.pos1[name], worldedit.pos2[name])
- worldedit.player_notify(name, count .. " nodes hidden")
- end),
-})
-
-minetest.register_chatcommand("/suppress", {
- params = "<node>",
- description = "Suppress all <node> in the current WorldEdit region non-destructively",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local node = get_node(name, param)
- local count = worldedit.suppress(worldedit.pos1[name], worldedit.pos2[name], node)
- worldedit.player_notify(name, count .. " nodes suppressed")
- end, check_region),
-})
-
-minetest.register_chatcommand("/highlight", {
- params = "<node>",
- description = "Highlight <node> in the current WorldEdit region by hiding everything else non-destructively",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local node = get_node(name, param)
- local count = worldedit.highlight(worldedit.pos1[name], worldedit.pos2[name], node)
- worldedit.player_notify(name, count .. " nodes highlighted")
- end, check_region),
-})
-
-minetest.register_chatcommand("/restore", {
- params = "",
- description = "Restores nodes hidden with WorldEdit in the current WorldEdit region",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local count = worldedit.restore(worldedit.pos1[name], worldedit.pos2[name])
- worldedit.player_notify(name, count .. " nodes restored")
- end),
-})
-
-minetest.register_chatcommand("/save", {
- params = "<file>",
- description = "Save the current WorldEdit region to \"(world folder)/schems/<file>.we\"",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- if param == "" then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return
- end
- if not check_filename(param) then
- worldedit.player_notify(name, "Disallowed file name: " .. param)
- return
- end
- local result, count = worldedit.serialize(worldedit.pos1[name],
- worldedit.pos2[name])
-
- local path = minetest.get_worldpath() .. "/schems"
- -- Create directory if it does not already exist
- mkdir(path)
-
- local filename = path .. "/" .. param .. ".we"
- local file, err = io.open(filename, "wb")
- if err ~= nil then
- worldedit.player_notify(name, "Could not save file to \"" .. filename .. "\"")
- return
- end
- file:write(result)
- file:flush()
- file:close()
-
- worldedit.player_notify(name, count .. " nodes saved")
- end),
-})
-
-minetest.register_chatcommand("/allocate", {
- params = "<file>",
- description = "Set the region defined by nodes from \"(world folder)/schems/<file>.we\" as the current WorldEdit region",
- privs = {worldedit=true},
- func = function(name, param)
- local pos = get_position(name)
- if pos == nil then return end
-
- if param == "" then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return
- end
- if not check_filename(param) then
- worldedit.player_notify(name, "Disallowed file name: " .. param)
- return
- end
-
- local filename = minetest.get_worldpath() .. "/schems/" .. param .. ".we"
- local file, err = io.open(filename, "rb")
- if err ~= nil then
- worldedit.player_notify(name, "could not open file \"" .. filename .. "\"")
- return
- end
- local value = file:read("*a")
- file:close()
-
- local version = worldedit.read_header(value)
- if version == 0 then
- worldedit.player_notify(name, "File is invalid!")
- return
- elseif version > worldedit.LATEST_SERIALIZATION_VERSION then
- worldedit.player_notify(name, "File was created with newer version of WorldEdit!")
- end
- local nodepos1, nodepos2, count = worldedit.allocate(pos, value)
-
- worldedit.pos1[name] = nodepos1
- worldedit.mark_pos1(name)
- worldedit.pos2[name] = nodepos2
- worldedit.mark_pos2(name)
-
- worldedit.player_notify(name, count .. " nodes allocated")
- end,
-})
-
-minetest.register_chatcommand("/load", {
- params = "<file>",
- description = "Load nodes from \"(world folder)/schems/<file>[.we[m]]\" with position 1 of the current WorldEdit region as the origin",
- privs = {worldedit=true},
- func = function(name, param)
- local pos = get_position(name)
- if pos == nil then return end
-
- if param == "" then
- worldedit.player_notify(name, "invalid usage: " .. param)
- return
- end
- if not string.find(param, "^[%w \t.,+-_=!@#$%%^&*()%[%]{};'\"]+$") then
- worldedit.player_notify(name, "invalid file name: " .. param)
- return
- end
-
- --find the file in the world path
- local testpaths = {
- minetest.get_worldpath() .. "/schems/" .. param,
- minetest.get_worldpath() .. "/schems/" .. param .. ".we",
- minetest.get_worldpath() .. "/schems/" .. param .. ".wem",
- }
- local file, err
- for index, path in ipairs(testpaths) do
- file, err = io.open(path, "rb")
- if not err then
- break
- end
- end
- if err then
- worldedit.player_notify(name, "could not open file \"" .. param .. "\"")
- return
- end
- local value = file:read("*a")
- file:close()
-
- local version = worldedit.read_header(value)
- if version == 0 then
- worldedit.player_notify(name, "File is invalid!")
- return
- elseif version > worldedit.LATEST_SERIALIZATION_VERSION then
- worldedit.player_notify(name, "File was created with newer version of WorldEdit!")
- return
- end
-
- local count = worldedit.deserialize(pos, value)
-
- worldedit.player_notify(name, count .. " nodes loaded")
- end,
-})
-
-minetest.register_chatcommand("/lua", {
- params = "<code>",
- description = "Executes <code> as a Lua chunk in the global namespace",
- privs = {worldedit=true, server=true},
- func = function(name, param)
- local admin = minetest.setting_get("name")
- if not admin or not name == admin then
- worldedit.player_notify(name, "this command can only be run by the server administrator")
- return
- end
- local err = worldedit.lua(param)
- if err then
- worldedit.player_notify(name, "code error: " .. err)
- else
- worldedit.player_notify(name, "code successfully executed", false)
- end
- end,
-})
-
-minetest.register_chatcommand("/luatransform", {
- params = "<code>",
- description = "Executes <code> as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region",
- privs = {worldedit=true, server=true},
- func = safe_region(function(name, param)
- local admin = minetest.setting_get("name")
- if not admin or not name == admin then
- worldedit.player_notify(name, "this command can only be run by the server administrator")
- return
- end
-
- local err = worldedit.luatransform(worldedit.pos1[name], worldedit.pos2[name], param)
- if err then
- worldedit.player_notify(name, "code error: " .. err, false)
- else
- worldedit.player_notify(name, "code successfully executed", false)
- end
- end),
-})
-
-minetest.register_chatcommand("/mtschemcreate", {
- params = "<file>",
- description = "Save the current WorldEdit region using the Minetest "..
- "Schematic format to \"(world folder)/schems/<filename>.mts\"",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- if param == nil then
- worldedit.player_notify(name, "No filename specified")
- return
- end
- if not check_filename(param) then
- worldedit.player_notify(name, "Disallowed file name: " .. param)
- return
- end
-
- local path = minetest.get_worldpath() .. "/schems"
- -- Create directory if it does not already exist
- mkdir(path)
-
- local filename = path .. "/" .. param .. ".mts"
- local ret = minetest.create_schematic(worldedit.pos1[name],
- worldedit.pos2[name], worldedit.prob_list[name],
- filename)
- if ret == nil then
- worldedit.player_notify(name, "Failed to create Minetest schematic", false)
- else
- worldedit.player_notify(name, "Saved Minetest schematic to " .. param, false)
- end
- worldedit.prob_list[name] = {}
- end),
-})
-
-minetest.register_chatcommand("/mtschemplace", {
- params = "<file>",
- description = "Load nodes from \"(world folder)/schems/<file>.mts\" with position 1 of the current WorldEdit region as the origin",
- privs = {worldedit=true},
- func = function(name, param)
- if param == "" then
- worldedit.player_notify(name, "no filename specified")
- return
- end
- if not check_filename(param) then
- worldedit.player_notify(name, "Disallowed file name: " .. param)
- return
- end
-
- local pos = get_position(name)
- if pos == nil then return end
-
- local path = minetest.get_worldpath() .. "/schems/" .. param .. ".mts"
- if minetest.place_schematic(pos, path) == nil then
- worldedit.player_notify(name, "failed to place Minetest schematic", false)
- else
- worldedit.player_notify(name, "placed Minetest schematic " .. param ..
- " at " .. minetest.pos_to_string(pos), false)
- end
- end,
-})
-
-minetest.register_chatcommand("/mtschemprob", {
- params = "start/finish/get",
- description = "Begins node probability entry for Minetest schematics, gets the nodes that have probabilities set, or ends node probability entry",
- privs = {worldedit=true},
- func = function(name, param)
- if param == "start" then --start probability setting
- worldedit.set_pos[name] = "prob"
- worldedit.prob_list[name] = {}
- worldedit.player_notify(name, "select Minetest schematic probability values by punching nodes")
- elseif param == "finish" then --finish probability setting
- worldedit.set_pos[name] = nil
- worldedit.player_notify(name, "finished Minetest schematic probability selection")
- elseif param == "get" then --get all nodes that had probabilities set on them
- local text = ""
- local problist = worldedit.prob_list[name]
- if problist == nil then
- return
- end
- for k,v in pairs(problist) do
- local prob = math.floor(((v["prob"] / 256) * 100) * 100 + 0.5) / 100
- text = text .. minetest.pos_to_string(v["pos"]) .. ": " .. prob .. "% | "
- end
- worldedit.player_notify(name, "currently set node probabilities:")
- worldedit.player_notify(name, text)
- else
- worldedit.player_notify(name, "unknown subcommand: " .. param)
- end
- end,
-})
-
-minetest.register_on_player_receive_fields(
- function(player, formname, fields)
- if (formname == "prob_val_enter") and (fields.text ~= "") then
- local name = player:get_player_name()
- local prob_entry = {pos=worldedit.prob_pos[name], prob=tonumber(fields.text)}
- local index = table.getn(worldedit.prob_list[name]) + 1
- worldedit.prob_list[name][index] = prob_entry
- end
- end
-)
-
-minetest.register_chatcommand("/clearobjects", {
- params = "",
- description = "Clears all objects within the WorldEdit region",
- privs = {worldedit=true},
- func = safe_region(function(name, param)
- local count = worldedit.clear_objects(worldedit.pos1[name], worldedit.pos2[name])
- worldedit.player_notify(name, count .. " objects cleared")
- end),
-})
diff --git a/worldedit/worldedit_commands/mark.lua b/worldedit/worldedit_commands/mark.lua
deleted file mode 100644
index 4062cae..0000000
--- a/worldedit/worldedit_commands/mark.lua
+++ /dev/null
@@ -1,162 +0,0 @@
-worldedit.marker1 = {}
-worldedit.marker2 = {}
-worldedit.marker_region = {}
-
---marks worldedit region position 1
-worldedit.mark_pos1 = function(name)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
-
- if pos1 ~= nil then
- --make area stay loaded
- local manip = minetest.get_voxel_manip()
- manip:read_from_map(pos1, pos1)
- end
- if worldedit.marker1[name] ~= nil then --marker already exists
- worldedit.marker1[name]:remove() --remove marker
- worldedit.marker1[name] = nil
- end
- if pos1 ~= nil then
- --add marker
- worldedit.marker1[name] = minetest.add_entity(pos1, "worldedit:pos1")
- if worldedit.marker1[name] ~= nil then
- worldedit.marker1[name]:get_luaentity().player_name = name
- end
- end
- worldedit.mark_region(name)
-end
-
---marks worldedit region position 2
-worldedit.mark_pos2 = function(name)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
-
- if pos2 ~= nil then
- --make area stay loaded
- local manip = minetest.get_voxel_manip()
- manip:read_from_map(pos2, pos2)
- end
- if worldedit.marker2[name] ~= nil then --marker already exists
- worldedit.marker2[name]:remove() --remove marker
- worldedit.marker2[name] = nil
- end
- if pos2 ~= nil then
- --add marker
- worldedit.marker2[name] = minetest.add_entity(pos2, "worldedit:pos2")
- if worldedit.marker2[name] ~= nil then
- worldedit.marker2[name]:get_luaentity().player_name = name
- end
- end
- worldedit.mark_region(name)
-end
-
-worldedit.mark_region = function(name)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
-
- if worldedit.marker_region[name] ~= nil then --marker already exists
- --wip: make the area stay loaded somehow
- for _, entity in ipairs(worldedit.marker_region[name]) do
- entity:remove()
- end
- worldedit.marker_region[name] = nil
- end
- if pos1 ~= nil and pos2 ~= nil then
- local pos1, pos2 = worldedit.sort_pos(pos1, pos2)
- local thickness = 0.2
- local sizex, sizey, sizez = (1 + pos2.x - pos1.x) / 2, (1 + pos2.y - pos1.y) / 2, (1 + pos2.z - pos1.z) / 2
-
- --make area stay loaded
- local manip = minetest.get_voxel_manip()
- manip:read_from_map(pos1, pos2)
-
- local markers = {}
-
- --XY plane markers
- for _, z in ipairs({pos1.z - 0.5, pos2.z + 0.5}) do
- local marker = minetest.add_entity({x=pos1.x + sizex - 0.5, y=pos1.y + sizey - 0.5, z=z}, "worldedit:region_cube")
- marker:set_properties({
- visual_size={x=sizex * 2, y=sizey * 2},
- collisionbox = {-sizex, -sizey, -thickness, sizex, sizey, thickness},
- })
- marker:get_luaentity().player_name = name
- table.insert(markers, marker)
- end
-
- --YZ plane markers
- for _, x in ipairs({pos1.x - 0.5, pos2.x + 0.5}) do
- local marker = minetest.add_entity({x=x, y=pos1.y + sizey - 0.5, z=pos1.z + sizez - 0.5}, "worldedit:region_cube")
- marker:set_properties({
- visual_size={x=sizez * 2, y=sizey * 2},
- collisionbox = {-thickness, -sizey, -sizez, thickness, sizey, sizez},
- })
- marker:setyaw(math.pi / 2)
- marker:get_luaentity().player_name = name
- table.insert(markers, marker)
- end
-
- worldedit.marker_region[name] = markers
- end
-end
-
-minetest.register_entity(":worldedit:pos1", {
- initial_properties = {
- visual = "cube",
- visual_size = {x=1.1, y=1.1},
- textures = {"worldedit_pos1.png", "worldedit_pos1.png",
- "worldedit_pos1.png", "worldedit_pos1.png",
- "worldedit_pos1.png", "worldedit_pos1.png"},
- collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
- physical = false,
- },
- on_step = function(self, dtime)
- if worldedit.marker1[self.player_name] == nil then
- self.object:remove()
- end
- end,
- on_punch = function(self, hitter)
- self.object:remove()
- worldedit.marker1[self.player_name] = nil
- end,
-})
-
-minetest.register_entity(":worldedit:pos2", {
- initial_properties = {
- visual = "cube",
- visual_size = {x=1.1, y=1.1},
- textures = {"worldedit_pos2.png", "worldedit_pos2.png",
- "worldedit_pos2.png", "worldedit_pos2.png",
- "worldedit_pos2.png", "worldedit_pos2.png"},
- collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55},
- physical = false,
- },
- on_step = function(self, dtime)
- if worldedit.marker2[self.player_name] == nil then
- self.object:remove()
- end
- end,
- on_punch = function(self, hitter)
- self.object:remove()
- worldedit.marker2[self.player_name] = nil
- end,
-})
-
-minetest.register_entity(":worldedit:region_cube", {
- initial_properties = {
- visual = "upright_sprite",
- visual_size = {x=1.1, y=1.1},
- textures = {"worldedit_cube.png"},
- visual_size = {x=10, y=10},
- physical = false,
- },
- on_step = function(self, dtime)
- if worldedit.marker_region[self.player_name] == nil then
- self.object:remove()
- return
- end
- end,
- on_punch = function(self, hitter)
- for _, entity in ipairs(worldedit.marker_region[self.player_name]) do
- entity:remove()
- end
- worldedit.marker_region[self.player_name] = nil
- end,
-})
-
diff --git a/worldedit/worldedit_commands/safe.lua b/worldedit/worldedit_commands/safe.lua
deleted file mode 100644
index e640853..0000000
--- a/worldedit/worldedit_commands/safe.lua
+++ /dev/null
@@ -1,68 +0,0 @@
-local safe_region_callback = {}
-local safe_region_param = {}
-
-local function check_region(name, param)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] --obtain positions
- if pos1 == nil or pos2 == nil then
- worldedit.player_notify(name, "no region selected")
- return nil
- end
- return worldedit.volume(pos1, pos2)
-end
-
---`callback` is a callback to run when the user confirms
---`nodes_needed` is a function accepting `param`, `pos1`, and `pos2` to calculate the number of nodes needed
-local function safe_region(callback, nodes_needed)
- --default node volume calculation
- nodes_needed = nodes_needed or check_region
-
- return function(name, param)
- --check if the operation applies to a safe number of nodes
- local count = nodes_needed(name, param)
- if count == nil then return end --invalid command
- if count < 10000 then
- return callback(name, param)
- end
-
- --save callback to call later
- safe_region_callback[name], safe_region_param[name] = callback, param
- worldedit.player_notify(name, "WARNING: this operation could affect up to " .. count .. " nodes; type //y to continue or //n to cancel")
- end
-end
-
-minetest.register_chatcommand("/y", {
- params = "",
- description = "Confirm a pending operation",
- func = function(name)
- local callback, param = safe_region_callback[name], safe_region_param[name]
- if not callback then
- worldedit.player_notify(name, "no operation pending")
- return
- end
-
- --obtain positions
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- if pos1 == nil or pos2 == nil then
- worldedit.player_notify(name, "no region selected")
- return
- end
-
- safe_region_callback[name], safe_region_param[name] = nil, nil --reset pending operation
- callback(name, param, pos1, pos2)
- end,
-})
-
-minetest.register_chatcommand("/n", {
- params = "",
- description = "Confirm a pending operation",
- func = function(name)
- if not safe_region_callback[name] then
- worldedit.player_notify(name, "no operation pending")
- return
- end
- safe_region_callback[name], safe_region_param[name] = nil, nil
- end,
-})
-
-return safe_region, check_region
-
diff --git a/worldedit/worldedit_commands/textures/worldedit_cube.png b/worldedit/worldedit_commands/textures/worldedit_cube.png
deleted file mode 100644
index fde36a8..0000000
--- a/worldedit/worldedit_commands/textures/worldedit_cube.png
+++ /dev/null
Binary files differ
diff --git a/worldedit/worldedit_commands/textures/worldedit_pos1.png b/worldedit/worldedit_commands/textures/worldedit_pos1.png
deleted file mode 100644
index 4c304aa..0000000
--- a/worldedit/worldedit_commands/textures/worldedit_pos1.png
+++ /dev/null
Binary files differ
diff --git a/worldedit/worldedit_commands/textures/worldedit_pos2.png b/worldedit/worldedit_commands/textures/worldedit_pos2.png
deleted file mode 100644
index 1502f16..0000000
--- a/worldedit/worldedit_commands/textures/worldedit_pos2.png
+++ /dev/null
Binary files differ
diff --git a/worldedit/worldedit_gui/depends.txt b/worldedit/worldedit_gui/depends.txt
deleted file mode 100644
index d603ac9..0000000
--- a/worldedit/worldedit_gui/depends.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-worldedit
-worldedit_commands
-unified_inventory?
-inventory_plus?
-creative? \ No newline at end of file
diff --git a/worldedit/worldedit_gui/functionality.lua b/worldedit/worldedit_gui/functionality.lua
deleted file mode 100644
index c358a8c..0000000
--- a/worldedit/worldedit_gui/functionality.lua
+++ /dev/null
@@ -1,707 +0,0 @@
---saved state for each player
-local gui_nodename1 = {} --mapping of player names to node names (arbitrary strings may also appear as values)
-local gui_nodename2 = {} --mapping of player names to node names (arbitrary strings may also appear as values)
-local gui_axis1 = {} --mapping of player names to axes (one of 1, 2, 3, or 4, representing the axes in the `axis_indices` table below)
-local gui_axis2 = {} --mapping of player names to axes (one of 1, 2, 3, or 4, representing the axes in the `axis_indices` table below)
-local gui_distance1 = {} --mapping of player names to a distance (arbitrary strings may also appear as values)
-local gui_distance2 = {} --mapping of player names to a distance (arbitrary strings may also appear as values)
-local gui_distance3 = {} --mapping of player names to a distance (arbitrary strings may also appear as values)
-local gui_count1 = {} --mapping of player names to a quantity (arbitrary strings may also appear as values)
-local gui_count2 = {} --mapping of player names to a quantity (arbitrary strings may also appear as values)
-local gui_count3 = {} --mapping of player names to a quantity (arbitrary strings may also appear as values)
-local gui_angle = {} --mapping of player names to an angle (one of 90, 180, 270, representing the angle in degrees clockwise)
-local gui_filename = {} --mapping of player names to file names (arbitrary strings may also appear as values)
-local gui_formspec = {} --mapping of player names to formspecs
-local gui_code = {} --mapping of player names to formspecs
-
---set default values
-setmetatable(gui_nodename1, {__index = function() return "Cobblestone" end})
-setmetatable(gui_nodename2, {__index = function() return "Stone" end})
-setmetatable(gui_axis1, {__index = function() return 4 end})
-setmetatable(gui_axis2, {__index = function() return 1 end})
-setmetatable(gui_distance1, {__index = function() return "10" end})
-setmetatable(gui_distance2, {__index = function() return "5" end})
-setmetatable(gui_distance3, {__index = function() return "2" end})
-setmetatable(gui_count1, {__index = function() return "3" end})
-setmetatable(gui_count2, {__index = function() return "6" end})
-setmetatable(gui_count3, {__index = function() return "4" end})
-setmetatable(gui_angle, {__index = function() return 90 end})
-setmetatable(gui_filename, {__index = function() return "building" end})
-setmetatable(gui_formspec, {__index = function() return "size[5,5]\nlabel[0,0;Hello, world!]" end})
-setmetatable(gui_code, {__index = function() return "minetest.chat_send_player(\"singleplayer\", \"Hello, world!\")" end})
-
-local axis_indices = {["X axis"]=1, ["Y axis"]=2, ["Z axis"]=3, ["Look direction"]=4}
-local axis_values = {"x", "y", "z", "?"}
-setmetatable(axis_indices, {__index = function () return 4 end})
-setmetatable(axis_values, {__index = function () return "?" end})
-
-local angle_indices = {["90 degrees"]=1, ["180 degrees"]=2, ["270 degrees"]=3}
-local angle_values = {90, 180, 270}
-setmetatable(angle_indices, {__index = function () return 1 end})
-setmetatable(angle_values, {__index = function () return 90 end})
-
---given multiple sets of privileges, produces a single set of privs that would have the same effect as requiring all of them at the same time
-local combine_privs = function(...)
- local result = {}
- for i, privs in ipairs({...}) do
- for name, value in pairs(privs) do
- if result[name] ~= nil and result[name] ~= value then --the priv must be both true and false, which can never happen
- return {__fake_priv_that_nobody_has__=true} --priviledge table that can never be satisfied
- end
- result[name] = value
- end
- end
- return result
-end
-
-worldedit.register_gui_function("worldedit_gui_about", {
- name = "About", privs = minetest.chatcommands["/about"].privs,
- on_select = function(name)
- minetest.chatcommands["/about"].func(name, "")
- end,
-})
-
-worldedit.register_gui_function("worldedit_gui_inspect", {
- name = "Toggle Inspect", privs = minetest.chatcommands["/inspect"].privs,
- on_select = function(name)
- minetest.chatcommands["/inspect"].func(name, worldedit.inspect[name] and "disable" or "enable")
- end,
-})
-
-worldedit.register_gui_function("worldedit_gui_region", {
- name = "Get/Set Region", privs = combine_privs(minetest.chatcommands["/p"].privs, minetest.chatcommands["/pos1"].privs, minetest.chatcommands["/pos2"].privs, minetest.chatcommands["/reset"].privs, minetest.chatcommands["/mark"].privs, minetest.chatcommands["/unmark"].privs, minetest.chatcommands["/volume"].privs, minetest.chatcommands["/fixedpos"].privs),
- get_formspec = function(name)
- local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
- return "size[9,7]" .. worldedit.get_formspec_header("worldedit_gui_region") ..
- "button_exit[0,1;3,0.8;worldedit_gui_p_get;Get Positions]" ..
- "button_exit[3,1;3,0.8;worldedit_gui_p_set1;Choose Position 1]" ..
- "button_exit[6,1;3,0.8;worldedit_gui_p_set2;Choose Position 2]" ..
- "button_exit[0,2;3,0.8;worldedit_gui_pos1;Position 1 Here]" ..
- "button_exit[3,2;3,0.8;worldedit_gui_pos2;Position 2 Here]" ..
- "button_exit[6,2;3,0.8;worldedit_gui_reset;Reset Region]" ..
- "button_exit[0,3;3,0.8;worldedit_gui_mark;Mark Region]" ..
- "button_exit[3,3;3,0.8;worldedit_gui_unmark;Unmark Region]" ..
- "button_exit[6,3;3,0.8;worldedit_gui_volume;Region Volume]" ..
- "label[0,4.7;Position 1]" ..
- string.format("field[2,5;1.5,0.8;worldedit_gui_fixedpos_pos1x;X ;%s]", pos1 and pos1.x or "") ..
- string.format("field[3.5,5;1.5,0.8;worldedit_gui_fixedpos_pos1y;Y ;%s]", pos1 and pos1.y or "") ..
- string.format("field[5,5;1.5,0.8;worldedit_gui_fixedpos_pos1z;Z ;%s]", pos1 and pos1.z or "") ..
- "button_exit[6.5,4.68;2.5,0.8;worldedit_gui_fixedpos_pos1_submit;Set Position 1]" ..
- "label[0,6.2;Position 2]" ..
- string.format("field[2,6.5;1.5,0.8;worldedit_gui_fixedpos_pos2x;X ;%s]", pos2 and pos2.x or "") ..
- string.format("field[3.5,6.5;1.5,0.8;worldedit_gui_fixedpos_pos2y;Y ;%s]", pos2 and pos2.y or "") ..
- string.format("field[5,6.5;1.5,0.8;worldedit_gui_fixedpos_pos2z;Z ;%s]", pos2 and pos2.z or "") ..
- "button_exit[6.5,6.18;2.5,0.8;worldedit_gui_fixedpos_pos2_submit;Set Position 2]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_region", function(name, fields)
- if fields.worldedit_gui_p_get then
- minetest.chatcommands["/p"].func(name, "get")
- return true
- elseif fields.worldedit_gui_p_set1 then
- minetest.chatcommands["/p"].func(name, "set1")
- return true
- elseif fields.worldedit_gui_p_set2 then
- minetest.chatcommands["/p"].func(name, "set2")
- return true
- elseif fields.worldedit_gui_pos1 then
- minetest.chatcommands["/pos1"].func(name, "")
- worldedit.show_page(name, "worldedit_gui_region")
- return true
- elseif fields.worldedit_gui_pos2 then
- minetest.chatcommands["/pos2"].func(name, "")
- worldedit.show_page(name, "worldedit_gui_region")
- return true
- elseif fields.worldedit_gui_reset then
- minetest.chatcommands["/reset"].func(name, "")
- worldedit.show_page(name, "worldedit_gui_region")
- return true
- elseif fields.worldedit_gui_mark then
- minetest.chatcommands["/mark"].func(name, "")
- worldedit.show_page(name, "worldedit_gui_region")
- return true
- elseif fields.worldedit_gui_unmark then
- minetest.chatcommands["/unmark"].func(name, "")
- worldedit.show_page(name, "worldedit_gui_region")
- return true
- elseif fields.worldedit_gui_volume then
- minetest.chatcommands["/volume"].func(name, "")
- worldedit.show_page(name, "worldedit_gui_region")
- return true
- elseif fields.worldedit_gui_fixedpos_pos1_submit then
- minetest.chatcommands["/fixedpos"].func(name, string.format("set1 %s %s %s",
- tostring(fields.worldedit_gui_fixedpos_pos1x),
- tostring(fields.worldedit_gui_fixedpos_pos1y),
- tostring(fields.worldedit_gui_fixedpos_pos1z)))
- worldedit.show_page(name, "worldedit_gui_region")
- return true
- elseif fields.worldedit_gui_fixedpos_pos2_submit then
- minetest.chatcommands["/fixedpos"].func(name, string.format("set2 %s %s %s",
- tostring(fields.worldedit_gui_fixedpos_pos2x),
- tostring(fields.worldedit_gui_fixedpos_pos2y),
- tostring(fields.worldedit_gui_fixedpos_pos2z)))
- worldedit.show_page(name, "worldedit_gui_region")
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_set", {
- name = "Set Nodes", privs = minetest.chatcommands["/set"].privs,
- get_formspec = function(name)
- local node = gui_nodename1[name]
- local nodename = worldedit.normalize_nodename(node)
- return "size[6.5,3]" .. worldedit.get_formspec_header("worldedit_gui_set") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_set_node;Name;%s]", minetest.formspec_escape(node)) ..
- "button[4,1.18;1.5,0.8;worldedit_gui_set_search;Search]" ..
- (nodename and string.format("item_image[5.5,1.1;1,1;%s]", nodename)
- or "image[5.5,1.1;1,1;unknown_node.png]") ..
- "button_exit[0,2.5;3,0.8;worldedit_gui_set_submit;Set Nodes]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_set", function(name, fields)
- if fields.worldedit_gui_set_search or fields.worldedit_gui_set_submit then
- gui_nodename1[name] = tostring(fields.worldedit_gui_set_node)
- worldedit.show_page(name, "worldedit_gui_set")
- if fields.worldedit_gui_set_submit then
- minetest.chatcommands["/set"].func(name, gui_nodename1[name])
- end
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_replace", {
- name = "Replace Nodes", privs = combine_privs(minetest.chatcommands["/replace"].privs, minetest.chatcommands["/replaceinverse"].privs),
- get_formspec = function(name)
- local search, replace = gui_nodename1[name], gui_nodename2[name]
- local search_nodename, replace_nodename = worldedit.normalize_nodename(search), worldedit.normalize_nodename(replace)
- return "size[6.5,4]" .. worldedit.get_formspec_header("worldedit_gui_replace") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_replace_search;Name;%s]", minetest.formspec_escape(search)) ..
- "button[4,1.18;1.5,0.8;worldedit_gui_replace_search_search;Search]" ..
- (search_nodename and string.format("item_image[5.5,1.1;1,1;%s]", search_nodename)
- or "image[5.5,1.1;1,1;unknown_node.png]") ..
- string.format("field[0.5,2.5;4,0.8;worldedit_gui_replace_replace;Name;%s]", minetest.formspec_escape(replace)) ..
- "button[4,2.18;1.5,0.8;worldedit_gui_replace_replace_search;Search]" ..
- (replace_nodename and string.format("item_image[5.5,2.1;1,1;%s]", replace_nodename)
- or "image[5.5,2.1;1,1;unknown_node.png]") ..
- "button_exit[0,3.5;3,0.8;worldedit_gui_replace_submit;Replace Nodes]" ..
- "button_exit[3.5,3.5;3,0.8;worldedit_gui_replace_submit_inverse;Replace Inverse]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_replace", function(name, fields)
- if fields.worldedit_gui_replace_search_search or fields.worldedit_gui_replace_replace_search
- or fields.worldedit_gui_replace_submit or fields.worldedit_gui_replace_submit_inverse then
- gui_nodename1[name] = tostring(fields.worldedit_gui_replace_search)
- gui_nodename2[name] = tostring(fields.worldedit_gui_replace_replace)
- worldedit.show_page(name, "worldedit_gui_replace")
- if fields.worldedit_gui_replace_submit then
- minetest.chatcommands["/replace"].func(name, string.format("%s %s", gui_nodename1[name], gui_nodename2[name]))
- elseif fields.worldedit_gui_replace_submit_inverse then
- minetest.chatcommands["/replaceinverse"].func(name, string.format("%s %s", gui_nodename1[name], gui_nodename2[name]))
- end
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_sphere_dome", {
- name = "Sphere/Dome", privs = combine_privs(minetest.chatcommands["/hollowsphere"].privs, minetest.chatcommands["/sphere"].privs, minetest.chatcommands["/hollowdome"].privs, minetest.chatcommands["/dome"].privs),
- get_formspec = function(name)
- local node, radius = gui_nodename1[name], gui_distance2[name]
- local nodename = worldedit.normalize_nodename(node)
- return "size[6.5,5]" .. worldedit.get_formspec_header("worldedit_gui_sphere_dome") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_sphere_dome_node;Name;%s]", minetest.formspec_escape(node)) ..
- "button[4,1.18;1.5,0.8;worldedit_gui_sphere_dome_search;Search]" ..
- (nodename and string.format("item_image[5.5,1.1;1,1;%s]", nodename)
- or "image[5.5,1.1;1,1;unknown_node.png]") ..
- string.format("field[0.5,2.5;4,0.8;worldedit_gui_sphere_dome_radius;Radius;%s]", minetest.formspec_escape(radius)) ..
- "button_exit[0,3.5;3,0.8;worldedit_gui_sphere_dome_submit_hollow;Hollow Sphere]" ..
- "button_exit[3.5,3.5;3,0.8;worldedit_gui_sphere_dome_submit_solid;Solid Sphere]" ..
- "button_exit[0,4.5;3,0.8;worldedit_gui_sphere_dome_submit_hollow_dome;Hollow Dome]" ..
- "button_exit[3.5,4.5;3,0.8;worldedit_gui_sphere_dome_submit_solid_dome;Solid Dome]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_sphere_dome", function(name, fields)
- if fields.worldedit_gui_sphere_dome_search
- or fields.worldedit_gui_sphere_dome_submit_hollow or fields.worldedit_gui_sphere_dome_submit_solid
- or fields.worldedit_gui_sphere_dome_submit_hollow_dome or fields.worldedit_gui_sphere_dome_submit_solid_dome then
- gui_nodename1[name] = tostring(fields.worldedit_gui_sphere_dome_node)
- gui_distance2[name] = tostring(fields.worldedit_gui_sphere_dome_radius)
- worldedit.show_page(name, "worldedit_gui_sphere_dome")
- if fields.worldedit_gui_sphere_dome_submit_hollow then
- minetest.chatcommands["/hollowsphere"].func(name, string.format("%s %s", gui_distance2[name], gui_nodename1[name]))
- elseif fields.worldedit_gui_sphere_dome_submit_solid then
- minetest.chatcommands["/sphere"].func(name, string.format("%s %s", gui_distance2[name], gui_nodename1[name]))
- elseif fields.worldedit_gui_sphere_dome_submit_hollow_dome then
- minetest.chatcommands["/hollowdome"].func(name, string.format("%s %s", gui_distance2[name], gui_nodename1[name]))
- elseif fields.worldedit_gui_sphere_dome_submit_solid_dome then
- minetest.chatcommands["/dome"].func(name, string.format("%s %s", gui_distance2[name], gui_nodename1[name]))
- end
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_cylinder", {
- name = "Cylinder", privs = combine_privs(minetest.chatcommands["/hollowcylinder"].privs, minetest.chatcommands["/cylinder"].privs),
- get_formspec = function(name)
- local node, axis, length, radius = gui_nodename1[name], gui_axis1[name], gui_distance1[name], gui_distance2[name]
- local nodename = worldedit.normalize_nodename(node)
- return "size[6.5,5]" .. worldedit.get_formspec_header("worldedit_gui_cylinder") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_cylinder_node;Name;%s]", minetest.formspec_escape(node)) ..
- "button[4,1.18;1.5,0.8;worldedit_gui_cylinder_search;Search]" ..
- (nodename and string.format("item_image[5.5,1.1;1,1;%s]", nodename)
- or "image[5.5,1.1;1,1;unknown_node.png]") ..
- string.format("field[0.5,2.5;4,0.8;worldedit_gui_cylinder_length;Length;%s]", minetest.formspec_escape(length)) ..
- string.format("dropdown[4,2.18;2.5;worldedit_gui_cylinder_axis;X axis,Y axis,Z axis,Look direction;%d]", axis) ..
- string.format("field[0.5,3.5;4,0.8;worldedit_gui_cylinder_radius;Radius;%s]", minetest.formspec_escape(radius)) ..
- "button_exit[0,4.5;3,0.8;worldedit_gui_cylinder_submit_hollow;Hollow Cylinder]" ..
- "button_exit[3.5,4.5;3,0.8;worldedit_gui_cylinder_submit_solid;Solid Cylinder]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_cylinder", function(name, fields)
- if fields.worldedit_gui_cylinder_search
- or fields.worldedit_gui_cylinder_submit_hollow or fields.worldedit_gui_cylinder_submit_solid then
- gui_nodename1[name] = tostring(fields.worldedit_gui_cylinder_node)
- gui_axis1[name] = axis_indices[fields.worldedit_gui_cylinder_axis]
- gui_distance1[name] = tostring(fields.worldedit_gui_cylinder_length)
- gui_distance2[name] = tostring(fields.worldedit_gui_cylinder_radius)
- worldedit.show_page(name, "worldedit_gui_cylinder")
- if fields.worldedit_gui_cylinder_submit_hollow then
- minetest.chatcommands["/hollowcylinder"].func(name, string.format("%s %s %s %s", axis_values[gui_axis1[name]], gui_distance1[name], gui_distance2[name], gui_nodename1[name]))
- elseif fields.worldedit_gui_cylinder_submit_solid then
- minetest.chatcommands["/cylinder"].func(name, string.format("%s %s %s %s", axis_values[gui_axis1[name]], gui_distance1[name], gui_distance2[name], gui_nodename1[name]))
- end
- return true
- end
- if fields.worldedit_gui_cylinder_axis then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_cylinder_axis]
- worldedit.show_page(name, "worldedit_gui_cylinder")
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_pyramid", {
- name = "Pyramid", privs = minetest.chatcommands["/pyramid"].privs,
- get_formspec = function(name)
- local node, axis, length = gui_nodename1[name], gui_axis1[name], gui_distance1[name]
- local nodename = worldedit.normalize_nodename(node)
- return "size[6.5,4]" .. worldedit.get_formspec_header("worldedit_gui_pyramid") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_pyramid_node;Name;%s]", minetest.formspec_escape(node)) ..
- "button[4,1.18;1.5,0.8;worldedit_gui_pyramid_search;Search]" ..
- (nodename and string.format("item_image[5.5,1.1;1,1;%s]", nodename)
- or "image[5.5,1.1;1,1;unknown_node.png]") ..
- string.format("field[0.5,2.5;4,0.8;worldedit_gui_pyramid_length;Length;%s]", minetest.formspec_escape(length)) ..
- string.format("dropdown[4,2.18;2.5;worldedit_gui_pyramid_axis;X axis,Y axis,Z axis,Look direction;%d]", axis) ..
- "button_exit[0,3.5;3,0.8;worldedit_gui_pyramid_submit;Pyramid]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_pyramid", function(name, fields)
- if fields.worldedit_gui_pyramid_search or fields.worldedit_gui_pyramid_submit then
- gui_nodename1[name] = tostring(fields.worldedit_gui_pyramid_node)
- gui_axis1[name] = axis_indices[fields.worldedit_gui_pyramid_axis]
- gui_distance1[name] = tostring(fields.worldedit_gui_pyramid_length)
- worldedit.show_page(name, "worldedit_gui_pyramid")
- if fields.worldedit_gui_pyramid_submit then
- minetest.chatcommands["/pyramid"].func(name, string.format("%s %s %s", axis_values[gui_axis1[name]], gui_distance1[name], gui_nodename1[name]))
- end
- return true
- end
- if fields.worldedit_gui_pyramid_axis then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_pyramid_axis]
- worldedit.show_page(name, "worldedit_gui_pyramid")
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_spiral", {
- name = "Spiral", privs = minetest.chatcommands["/spiral"].privs,
- get_formspec = function(name)
- local node, length, height, space = gui_nodename1[name], gui_distance1[name], gui_distance2[name], gui_distance3[name]
- local nodename = worldedit.normalize_nodename(node)
- return "size[6.5,6]" .. worldedit.get_formspec_header("worldedit_gui_spiral") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_spiral_node;Name;%s]", minetest.formspec_escape(node)) ..
- "button[4,1.18;1.5,0.8;worldedit_gui_spiral_search;Search]" ..
- (nodename and string.format("item_image[5.5,1.1;1,1;%s]", nodename)
- or "image[5.5,1.1;1,1;unknown_node.png]") ..
- string.format("field[0.5,2.5;4,0.8;worldedit_gui_spiral_length;Side Length;%s]", minetest.formspec_escape(length)) ..
- string.format("field[0.5,3.5;4,0.8;worldedit_gui_spiral_height;Height;%s]", minetest.formspec_escape(height)) ..
- string.format("field[0.5,4.5;4,0.8;worldedit_gui_spiral_space;Wall Spacing;%s]", minetest.formspec_escape(space)) ..
- "button_exit[0,5.5;3,0.8;worldedit_gui_spiral_submit;Spiral]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_spiral", function(name, fields)
- if fields.worldedit_gui_spiral_search or fields.worldedit_gui_spiral_submit then
- gui_nodename1[name] = fields.worldedit_gui_spiral_node
- gui_distance1[name] = tostring(fields.worldedit_gui_spiral_length)
- gui_distance2[name] = tostring(fields.worldedit_gui_spiral_height)
- gui_distance3[name] = tostring(fields.worldedit_gui_spiral_space)
- worldedit.show_page(name, "worldedit_gui_spiral")
- if fields.worldedit_gui_spiral_submit then
- minetest.chatcommands["/spiral"].func(name, string.format("%s %s %s %s", gui_distance1[name], gui_distance2[name], gui_distance3[name], gui_nodename1[name]))
- end
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_copy_move", {
- name = "Copy/Move", privs = combine_privs(minetest.chatcommands["/copy"].privs, minetest.chatcommands["/move"].privs),
- get_formspec = function(name)
- local axis = gui_axis1[name] or 4
- local amount = gui_distance1[name] or "10"
- return "size[6.5,3]" .. worldedit.get_formspec_header("worldedit_gui_copy_move") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_copy_move_amount;Amount;%s]", minetest.formspec_escape(amount)) ..
- string.format("dropdown[4,1.18;2.5;worldedit_gui_copy_move_axis;X axis,Y axis,Z axis,Look direction;%d]", axis) ..
- "button_exit[0,2.5;3,0.8;worldedit_gui_copy_move_copy;Copy Region]" ..
- "button_exit[3.5,2.5;3,0.8;worldedit_gui_copy_move_move;Move Region]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_copy_move", function(name, fields)
- if fields.worldedit_gui_copy_move_copy or fields.worldedit_gui_copy_move_move then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_copy_move_axis] or 4
- gui_distance1[name] = tostring(fields.worldedit_gui_copy_move_amount)
- worldedit.show_page(name, "worldedit_gui_copy_move")
- if fields.worldedit_gui_copy_move_copy then
- minetest.chatcommands["/copy"].func(name, string.format("%s %s", axis_values[gui_axis1[name]], gui_distance1[name]))
- else --fields.worldedit_gui_copy_move_move
- minetest.chatcommands["/move"].func(name, string.format("%s %s", axis_values[gui_axis1[name]], gui_distance1[name]))
- end
- return true
- end
- if fields.worldedit_gui_copy_move_axis then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_copy_move_axis] or 4
- worldedit.show_page(name, "worldedit_gui_copy_move")
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_stack", {
- name = "Stack", privs = minetest.chatcommands["/stack"].privs,
- get_formspec = function(name)
- local axis, count = gui_axis1[name], gui_count1[name]
- return "size[6.5,3]" .. worldedit.get_formspec_header("worldedit_gui_stack") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_stack_count;Count;%s]", minetest.formspec_escape(count)) ..
- string.format("dropdown[4,1.18;2.5;worldedit_gui_stack_axis;X axis,Y axis,Z axis,Look direction;%d]", axis) ..
- "button_exit[0,2.5;3,0.8;worldedit_gui_stack_submit;Stack]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_stack", function(name, fields)
- if fields.worldedit_gui_stack_submit then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_stack_axis]
- gui_count1[name] = tostring(fields.worldedit_gui_stack_count)
- worldedit.show_page(name, "worldedit_gui_stack")
- minetest.chatcommands["/stack"].func(name, string.format("%s %s", axis_values[gui_axis1[name]], gui_count1[name]))
- return true
- end
- if fields.worldedit_gui_stack_axis then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_stack_axis]
- worldedit.show_page(name, "worldedit_gui_stack")
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_stretch", {
- name = "Stretch", privs = minetest.chatcommands["/stretch"].privs,
- get_formspec = function(name)
- local stretchx, stretchy, stretchz = gui_count1[name], gui_count2[name], gui_count3[name]
- return "size[5,5]" .. worldedit.get_formspec_header("worldedit_gui_stretch") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_stretch_x;Stretch X;%s]", minetest.formspec_escape(stretchx)) ..
- string.format("field[0.5,2.5;4,0.8;worldedit_gui_stretch_y;Stretch Y;%s]", minetest.formspec_escape(stretchy)) ..
- string.format("field[0.5,3.5;4,0.8;worldedit_gui_stretch_z;Stretch Z;%s]", minetest.formspec_escape(stretchz)) ..
- "button_exit[0,4.5;3,0.8;worldedit_gui_stretch_submit;Stretch]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_stretch", function(name, fields)
- if fields.worldedit_gui_stretch_submit then
- gui_count1[name] = tostring(fields.worldedit_gui_stretch_x)
- gui_count2[name] = tostring(fields.worldedit_gui_stretch_y)
- gui_count3[name] = tostring(fields.worldedit_gui_stretch_z)
- worldedit.show_page(name, "worldedit_gui_stretch")
- minetest.chatcommands["/stretch"].func(name, string.format("%s %s %s", gui_count1[name], gui_count2[name], gui_count3[name]))
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_transpose", {
- name = "Transpose", privs = minetest.chatcommands["/transpose"].privs,
- get_formspec = function(name)
- local axis1, axis2 = gui_axis1[name], gui_axis2[name]
- return "size[5.5,3]" .. worldedit.get_formspec_header("worldedit_gui_transpose") ..
- string.format("dropdown[0,1;2.5;worldedit_gui_transpose_axis1;X axis,Y axis,Z axis,Look direction;%d]", axis1) ..
- string.format("dropdown[3,1;2.5;worldedit_gui_transpose_axis2;X axis,Y axis,Z axis,Look direction;%d]", axis2) ..
- "button_exit[0,2.5;3,0.8;worldedit_gui_transpose_submit;Transpose]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_transpose", function(name, fields)
- if fields.worldedit_gui_transpose_submit then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_transpose_axis1]
- gui_axis2[name] = axis_indices[fields.worldedit_gui_transpose_axis2]
- worldedit.show_page(name, "worldedit_gui_transpose")
- minetest.chatcommands["/transpose"].func(name, string.format("%s %s", axis_values[gui_axis1[name]], axis_values[gui_axis2[name]]))
- return true
- end
- if fields.worldedit_gui_transpose_axis1 then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_transpose_axis1]
- worldedit.show_page(name, "worldedit_gui_transpose")
- return true
- end
- if fields.worldedit_gui_transpose_axis2 then
- gui_axis2[name] = axis_indices[fields.worldedit_gui_transpose_axis2]
- worldedit.show_page(name, "worldedit_gui_transpose")
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_flip", {
- name = "Flip", privs = minetest.chatcommands["/flip"].privs,
- get_formspec = function(name)
- local axis = gui_axis1[name]
- return "size[5,3]" .. worldedit.get_formspec_header("worldedit_gui_flip") ..
- string.format("dropdown[0,1;2.5;worldedit_gui_flip_axis;X axis,Y axis,Z axis,Look direction;%d]", axis) ..
- "button_exit[0,2.5;3,0.8;worldedit_gui_flip_submit;Flip]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_flip", function(name, fields)
- if fields.worldedit_gui_flip_submit then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_flip_axis]
- worldedit.show_page(name, "worldedit_gui_flip")
- minetest.chatcommands["/flip"].func(name, axis_values[gui_axis1[name]])
- return true
- end
- if fields.worldedit_gui_flip_axis then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_flip_axis]
- worldedit.show_page(name, "worldedit_gui_flip")
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_rotate", {
- name = "Rotate", privs = minetest.chatcommands["/rotate"].privs,
- get_formspec = function(name)
- local axis, angle = gui_axis1[name], gui_angle[name]
- return "size[5.5,3]" .. worldedit.get_formspec_header("worldedit_gui_rotate") ..
- string.format("dropdown[0,1;2.5;worldedit_gui_rotate_angle;90 degrees,180 degrees,270 degrees;%s]", angle) ..
- string.format("dropdown[3,1;2.5;worldedit_gui_rotate_axis;X axis,Y axis,Z axis,Look direction;%d]", axis) ..
- "button_exit[0,2.5;3,0.8;worldedit_gui_rotate_submit;Rotate]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_rotate", function(name, fields)
- if fields.worldedit_gui_rotate_submit then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_rotate_axis]
- gui_angle[name] = angle_indices[fields.worldedit_gui_rotate_angle]
- worldedit.show_page(name, "worldedit_gui_rotate")
- minetest.chatcommands["/rotate"].func(name, string.format("%s %s", axis_values[gui_axis1[name]], angle_values[gui_angle[name]]))
- return true
- end
- if fields.worldedit_gui_rotate_axis then
- gui_axis1[name] = axis_indices[fields.worldedit_gui_rotate_axis]
- worldedit.show_page(name, "worldedit_gui_rotate")
- return true
- end
- if fields.worldedit_gui_rotate_angle then
- gui_angle[name] = angle_indices[fields.worldedit_gui_rotate_angle]
- worldedit.show_page(name, "worldedit_gui_rotate")
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_orient", {
- name = "Orient", privs = minetest.chatcommands["/orient"].privs,
- get_formspec = function(name)
- local angle = gui_angle[name]
- return "size[5,3]" .. worldedit.get_formspec_header("worldedit_gui_orient") ..
- string.format("dropdown[0,1;2.5;worldedit_gui_orient_angle;90 degrees,180 degrees,270 degrees;%s]", angle) ..
- "button_exit[0,2.5;3,0.8;worldedit_gui_orient_submit;Orient]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_orient", function(name, fields)
- if fields.worldedit_gui_orient_submit then
- gui_angle[name] = angle_indices[fields.worldedit_gui_orient_angle]
- worldedit.show_page(name, "worldedit_gui_orient")
- minetest.chatcommands["/orient"].func(name, tostring(angle_values[gui_angle[name]]))
- return true
- end
- if fields.worldedit_gui_orient_angle then
- gui_angle[name] = angle_indices[fields.worldedit_gui_orient_angle]
- worldedit.show_page(name, "worldedit_gui_orient")
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_fixlight", {
- name = "Fix Lighting", privs = minetest.chatcommands["/fixlight"].privs,
- on_select = function(name)
- minetest.chatcommands["/fixlight"].func(name, "")
- end,
-})
-
-worldedit.register_gui_function("worldedit_gui_hide", {
- name = "Hide Region", privs = minetest.chatcommands["/hide"].privs,
- on_select = function(name)
- minetest.chatcommands["/hide"].func(name, "")
- end,
-})
-
-worldedit.register_gui_function("worldedit_gui_suppress", {
- name = "Suppress Nodes", privs = minetest.chatcommands["/suppress"].privs,
- get_formspec = function(name)
- local node = gui_nodename1[name]
- local nodename = worldedit.normalize_nodename(node)
- return "size[6.5,3]" .. worldedit.get_formspec_header("worldedit_gui_suppress") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_suppress_node;Name;%s]", minetest.formspec_escape(node)) ..
- "button[4,1.18;1.5,0.8;worldedit_gui_suppress_search;Search]" ..
- (nodename and string.format("item_image[5.5,1.1;1,1;%s]", nodename)
- or "image[5.5,1.1;1,1;unknown_node.png]") ..
- "button_exit[0,2.5;3,0.8;worldedit_gui_suppress_submit;Suppress Nodes]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_suppress", function(name, fields)
- if fields.worldedit_gui_suppress_search or fields.worldedit_gui_suppress_submit then
- gui_nodename1[name] = tostring(fields.worldedit_gui_suppress_node)
- worldedit.show_page(name, "worldedit_gui_suppress")
- if fields.worldedit_gui_suppress_submit then
- minetest.chatcommands["/suppress"].func(name, gui_nodename1[name])
- end
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_highlight", {
- name = "Highlight Nodes", privs = minetest.chatcommands["/highlight"].privs,
- get_formspec = function(name)
- local node = gui_nodename1[name]
- local nodename = worldedit.normalize_nodename(node)
- return "size[6.5,3]" .. worldedit.get_formspec_header("worldedit_gui_highlight") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_highlight_node;Name;%s]", minetest.formspec_escape(node)) ..
- "button[4,1.18;1.5,0.8;worldedit_gui_highlight_search;Search]" ..
- (nodename and string.format("item_image[5.5,1.1;1,1;%s]", nodename)
- or "image[5.5,1.1;1,1;unknown_node.png]") ..
- "button_exit[0,2.5;3,0.8;worldedit_gui_highlight_submit;Highlight Nodes]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_highlight", function(name, fields)
- if fields.worldedit_gui_highlight_search or fields.worldedit_gui_highlight_submit then
- gui_nodename1[name] = tostring(fields.worldedit_gui_highlight_node)
- worldedit.show_page(name, "worldedit_gui_highlight")
- if fields.worldedit_gui_highlight_submit then
- minetest.chatcommands["/highlight"].func(name, gui_nodename1[name])
- end
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_restore", {
- name = "Restore Region", privs = minetest.chatcommands["/restore"].privs,
- on_select = function(name)
- minetest.chatcommands["/restore"].func(name, "")
- end,
-})
-
-worldedit.register_gui_function("worldedit_gui_save_load", {
- name = "Save/Load", privs = combine_privs(minetest.chatcommands["/save"].privs, minetest.chatcommands["/allocate"].privs, minetest.chatcommands["/load"].privs),
- get_formspec = function(name)
- local filename = gui_filename[name]
- return "size[6,4]" .. worldedit.get_formspec_header("worldedit_gui_save_load") ..
- string.format("field[0.5,1.5;4,0.8;worldedit_gui_save_filename;Filename;%s]", minetest.formspec_escape(filename)) ..
- "button_exit[0,2.5;3,0.8;worldedit_gui_save_load_submit_save;Save]" ..
- "button_exit[3,2.5;3,0.8;worldedit_gui_save_load_submit_allocate;Allocate]" ..
- "button_exit[0,3.5;3,0.8;worldedit_gui_save_load_submit_load;Load]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_save_load", function(name, fields)
- if fields.worldedit_gui_save_load_submit_save or fields.worldedit_gui_save_load_submit_allocate or fields.worldedit_gui_save_load_submit_load then
- gui_filename[name] = tostring(fields.worldedit_gui_save_filename)
- worldedit.show_page(name, "worldedit_gui_save_load")
- if fields.worldedit_gui_save_load_submit_save then
- minetest.chatcommands["/save"].func(name, gui_filename[name])
- elseif fields.worldedit_gui_save_load_submit_allocate then
- minetest.chatcommands["/allocate"].func(name, gui_filename[name])
- else --fields.worldedit_gui_save_load_submit_load
- minetest.chatcommands["/load"].func(name, gui_filename[name])
- end
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_lua", {
- name = "Run Lua",
- get_formspec = function(name)
- local code = gui_code[name]
- return "size[8,6.5]" .. worldedit.get_formspec_header("worldedit_gui_lua") ..
- string.format("textarea[0.5,1;7.5,5.5;worldedit_gui_lua_code;Lua Code;%s]", minetest.formspec_escape(code)) ..
- "button_exit[0,6;3,0.8;worldedit_gui_lua_run;Run Lua]" ..
- "button_exit[5,6;3,0.8;worldedit_gui_lua_transform;Lua Transform]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_lua", function(name, fields)
- if fields.worldedit_gui_lua_run or fields.worldedit_gui_lua_transform then
- gui_code[name] = fields.worldedit_gui_lua_value
- worldedit.show_page(name, "worldedit_gui_lua")
- if fields.worldedit_gui_lua_run then
- minetest.chatcommands["/lua"].func(name, gui_code[name])
- else --fields.worldedit_gui_lua_transform
- minetest.chatcommands["/luatransform"].func(name, gui_code[name])
- end
- return true
- end
- return false
-end)
-
-worldedit.register_gui_function("worldedit_gui_clearobjects", {
- name = "Clear Objects", privs = minetest.chatcommands["/clearobjects"].privs,
- on_select = function(name)
- minetest.chatcommands["/clearobjects"].func(name, "")
- end,
-})
-
-worldedit.register_gui_function("worldedit_gui_formspec_tester", {
- name = "Formspec Tester",
- get_formspec = function(name)
- local value = gui_formspec[name]
- return "size[8,6.5]" .. worldedit.get_formspec_header("worldedit_gui_formspec_tester") ..
- string.format("textarea[0.5,1;7.5,5.5;worldedit_gui_formspec_tester_value;Formspec Code;%s]", minetest.formspec_escape(value)) ..
- "button_exit[0,6;3,0.8;worldedit_gui_formspec_tester_show;Show Formspec]"
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui_formspec_tester", function(name, fields)
- if fields.worldedit_gui_formspec_tester_show then
- gui_formspec[name] = fields.worldedit_gui_formspec_tester_value or ""
- worldedit.show_page(name, "worldedit_gui_formspec_tester")
- minetest.show_formspec(name, "worldedit:formspec_tester", gui_formspec[name])
- return true
- end
- return false
-end)
diff --git a/worldedit/worldedit_gui/init.lua b/worldedit/worldedit_gui/init.lua
deleted file mode 100644
index da54f7b..0000000
--- a/worldedit/worldedit_gui/init.lua
+++ /dev/null
@@ -1,249 +0,0 @@
-worldedit = worldedit or {}
-
---[[
-Example:
-
- worldedit.register_gui_function("worldedit_gui_hollow_cylinder", {
- name = "Make Hollow Cylinder",
- privs = {worldedit=true},
- get_formspec = function(name) return "some formspec here" end,
- on_select = function(name) print(name .. " clicked the button!") end,
- })
-
-Use `nil` for the `options` parameter to unregister the function associated with the given identifier.
-
-Use `nil` for the `get_formspec` field to denote that the function does not have its own screen.
-
-Use `nil` for the `privs` field to denote that no special privileges are required to use the function.
-
-If the identifier is already registered to another function, it will be replaced by the new one.
-
-The `on_select` function must not call `worldedit.show_page`
-]]
-
-worldedit.pages = {} --mapping of identifiers to options
-local identifiers = {} --ordered list of identifiers
-worldedit.register_gui_function = function(identifier, options)
- worldedit.pages[identifier] = options
- table.insert(identifiers, identifier)
-end
-
---[[
-Example:
-
- worldedit.register_gui_handler("worldedit_gui_hollow_cylinder", function(name, fields)
- print(minetest.serialize(fields))
- end)
-]]
-
-worldedit.register_gui_handler = function(identifier, handler)
- local enabled = true
- minetest.register_on_player_receive_fields(function(player, formname, fields)
- if not enabled then return false end
- enabled = false
- minetest.after(0.2, function() enabled = true end)
- local name = player:get_player_name()
-
- --ensure the player has permission to perform the action
- local entry = worldedit.pages[identifier]
- if entry and minetest.check_player_privs(name, entry.privs or {}) then
- return handler(name, fields)
- end
- return false
- end)
-end
-
-worldedit.get_formspec_header = function(identifier)
- local entry = worldedit.pages[identifier] or {}
- return "button[0,0;2,0.5;worldedit_gui;Back]" ..
- string.format("label[2,0;WorldEdit GUI > %s]", entry.name or "")
-end
-
-local get_formspec = function(name, identifier)
- if worldedit.pages[identifier] then
- return worldedit.pages[identifier].get_formspec(name)
- end
- return worldedit.pages["worldedit_gui"].get_formspec(name) --default to showing main page if an unknown page is given
-end
-
---implement worldedit.show_page(name, page) in different ways depending on the available APIs
-if rawget(_G, "unified_inventory") then --unified inventory installed
- local old_func = worldedit.register_gui_function
- worldedit.register_gui_function = function(identifier, options)
- old_func(identifier, options)
- unified_inventory.register_page(identifier, {get_formspec=function(player) return {formspec=options.get_formspec(player:get_player_name())} end})
- end
-
- unified_inventory.register_button("worldedit_gui", {
- type = "image",
- image = "inventory_plus_worldedit_gui.png",
- })
-
- minetest.register_on_player_receive_fields(function(player, formname, fields)
- local name = player:get_player_name()
- if fields.worldedit_gui then --main page
- worldedit.show_page(name, "worldedit_gui")
- return true
- elseif fields.worldedit_gui_exit then --return to original page
- local player = minetest.get_player_by_name(name)
- if player then
- unified_inventory.set_inventory_formspec(player, "craft")
- end
- return true
- end
- return false
- end)
-
- worldedit.show_page = function(name, page)
- local player = minetest.get_player_by_name(name)
- if player then
- player:set_inventory_formspec(get_formspec(name, page))
- end
- end
-elseif rawget(_G, "inventory_plus") then --inventory++ installed
- minetest.register_on_joinplayer(function(player)
- local can_worldedit = minetest.check_player_privs(player:get_player_name(), {worldedit=true})
- if can_worldedit then
- inventory_plus.register_button(player, "worldedit_gui", "WorldEdit")
- end
- end)
-
- --show the form when the button is pressed and hide it when done
- local gui_player_formspecs = {}
- minetest.register_on_player_receive_fields(function(player, formname, fields)
- local name = player:get_player_name()
- if fields.worldedit_gui then --main page
- gui_player_formspecs[name] = player:get_inventory_formspec()
- worldedit.show_page(name, "worldedit_gui")
- return true
- elseif fields.worldedit_gui_exit then --return to original page
- if gui_player_formspecs[name] then
- inventory_plus.set_inventory_formspec(player, gui_player_formspecs[name])
- end
- return true
- end
- return false
- end)
-
- worldedit.show_page = function(name, page)
- local player = minetest.get_player_by_name(name)
- if player then
- inventory_plus.set_inventory_formspec(player, get_formspec(name, page))
- end
- end
-else --fallback button
- local player_formspecs = {}
-
- local update_main_formspec = function(name)
- local formspec = player_formspecs[name]
- if not formspec then
- return
- end
- local player = minetest.get_player_by_name(name)
- if not player then --this is in case the player signs off while the media is loading
- return
- end
- if (minetest.check_player_privs(name, {creative=true}) or minetest.setting_getbool("creative_mode")) and creative_inventory then --creative_inventory is active, add button to modified formspec
- formspec = player:get_inventory_formspec() .. "image_button[6,0;1,1;inventory_plus_worldedit_gui.png;worldedit_gui;]"
- else
- formspec = formspec .. "image_button[0,0;1,1;inventory_plus_worldedit_gui.png;worldedit_gui;]"
- end
- player:set_inventory_formspec(formspec)
- end
-
- minetest.register_on_joinplayer(function(player)
- local name = player:get_player_name()
- minetest.after(1, function()
- if minetest.get_player_by_name(name) then --ensure the player is still signed in
- player_formspecs[name] = player:get_inventory_formspec()
- minetest.after(0.01, function()
- update_main_formspec(name)
- end)
- end
- end)
- end)
-
- minetest.register_on_leaveplayer(function(player)
- player_formspecs[player:get_player_name()] = nil
- end)
-
- local gui_player_formspecs = {}
- minetest.register_on_player_receive_fields(function(player, formname, fields)
- local name = player:get_player_name()
- if fields.worldedit_gui then --main page
- gui_player_formspecs[name] = player:get_inventory_formspec()
- worldedit.show_page(name, "worldedit_gui")
- return true
- elseif fields.worldedit_gui_exit then --return to original page
- if gui_player_formspecs[name] then
- player:set_inventory_formspec(gui_player_formspecs[name])
- end
- return true
- else --deal with creative_inventory setting the formspec on every single message
- minetest.after(0.01,function()
- update_main_formspec(name)
- end)
- return false --continue processing in creative inventory
- end
- end)
-
- worldedit.show_page = function(name, page)
- local player = minetest.get_player_by_name(name)
- if player then
- player:set_inventory_formspec(get_formspec(name, page))
- end
- end
-end
-
-worldedit.register_gui_function("worldedit_gui", {
- name = "WorldEdit GUI",
- get_formspec = function(name)
- --create a form with all the buttons arranged in a grid
- local buttons, x, y, index = {}, 0, 1, 0
- local width, height = 3, 0.8
- local columns = 5
- for i, identifier in pairs(identifiers) do
- if identifier ~= "worldedit_gui" then
- local entry = worldedit.pages[identifier]
- table.insert(buttons, string.format((entry.get_formspec and "button" or "button_exit") ..
- "[%g,%g;%g,%g;%s;%s]", x, y, width, height, identifier, minetest.formspec_escape(entry.name)))
-
- index, x = index + 1, x + width
- if index == columns then --row is full
- x, y = 0, y + height
- index = 0
- end
- end
- end
- if index == 0 then --empty row
- y = y - height
- end
- return string.format("size[%g,%g]", math.max(columns * width, 5), math.max(y + 0.5, 3)) ..
- "button[0,0;2,0.5;worldedit_gui_exit;Back]" ..
- "label[2,0;WorldEdit GUI]" ..
- table.concat(buttons)
- end,
-})
-
-worldedit.register_gui_handler("worldedit_gui", function(name, fields)
- for identifier, entry in pairs(worldedit.pages) do --check for WorldEdit GUI main formspec button selection
- if fields[identifier] and identifier ~= "worldedit_gui" then
- --ensure player has permission to perform action
- local has_privs, missing_privs = minetest.check_player_privs(name, entry.privs or {})
- if not has_privs then
- worldedit.player_notify(name, "you are not allowed to use this function (missing privileges: " .. table.concat(missing_privs, ", ") .. ")")
- return false
- end
- if entry.on_select then
- entry.on_select(name)
- end
- if entry.get_formspec then
- worldedit.show_page(name, identifier)
- end
- return true
- end
- end
- return false
-end)
-
-dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/functionality.lua")
diff --git a/worldedit/worldedit_gui/textures/inventory_plus_worldedit_gui.png b/worldedit/worldedit_gui/textures/inventory_plus_worldedit_gui.png
deleted file mode 100644
index fbc1abc..0000000
--- a/worldedit/worldedit_gui/textures/inventory_plus_worldedit_gui.png
+++ /dev/null
Binary files differ
diff --git a/worldedit/worldedit_infinity/depends.txt b/worldedit/worldedit_infinity/depends.txt
deleted file mode 100644
index c4f6871..0000000
--- a/worldedit/worldedit_infinity/depends.txt
+++ /dev/null
@@ -1 +0,0 @@
-worldedit?
diff --git a/worldedit/worldedit_infinity/init.lua b/worldedit/worldedit_infinity/init.lua
deleted file mode 100644
index 8bd3a05..0000000
--- a/worldedit/worldedit_infinity/init.lua
+++ /dev/null
@@ -1,103 +0,0 @@
-worldedit = rawget(_G, "worldedit") or {}
-local minetest = minetest --local copy of global
-
-local get_pointed = function(pos, nearest, distance)
- if distance > 100 then
- return false
- end
-
- --check for collision with node
- local nodename = minetest.get_node(pos).name
- if nodename ~= "air"
- and nodename ~= "default:water_source"
- and nodename ~= "default:water_flowing" then
- if nodename ~= "ignore" then
- return nearest
- end
- return false
- end
-end
-
-local use = function(itemstack, user, pointed_thing)
- if pointed_thing.type == "nothing" then --pointing at nothing
- local placepos = worldedit.raytrace(user:getpos(), user:get_look_dir(), get_pointed)
- if placepos then --extended reach
- pointed_thing.type = "node"
- pointed_thing.under = nil --wip
- pointed_thing.above = nil --wip
- end
- end
- return minetest.item_place_node(itemstack, user, pointed_thing)
-end
---
-
-worldedit.raytrace = function(pos, dir, callback)
- local base = {x=math.floor(pos.x), y=math.floor(pos.y), z=math.floor(pos.z)}
- local stepx, stepy, stepz = 0, 0, 0
- local componentx, componenty, componentz = 0, 0, 0
- local intersectx, intersecty, intersectz = 0, 0, 0
-
- if dir.x == 0 then
- intersectx = math.huge
- elseif dir.x > 0 then
- stepx = 1
- componentx = 1 / dir.x
- intersectx = ((base.x - pos.x) + 1) * componentx
- else
- stepx = -1
- componentx = 1 / -dir.x
- intersectx = (pos.x - base.x) * componentx
- end
- if dir.y == 0 then
- intersecty = math.huge
- elseif dir.y > 0 then
- stepy = 1
- componenty = 1 / dir.y
- intersecty = ((base.y - pos.y) + 1) * componenty
- else
- stepy = -1
- componenty = 1 / -dir.y
- intersecty = (pos.y - base.y) * componenty
- end
- if dir.z == 0 then
- intersectz = math.huge
- elseif dir.z > 0 then
- stepz = 1
- componentz = 1 / dir.z
- intersectz = ((base.z - pos.z) + 1) * componentz
- else
- stepz = -1
- componentz = 1 / -dir.z
- intersectz = (pos.z - base.z) * componentz
- end
-
- local distance = 0
- local nearest = {x=base.x, y=base.y, z=base.z}
- while true do
- local values = {callback(base, nearest, distance)}
- if #values > 0 then
- return unpack(values)
- end
-
- nearest.x, nearest.y, nearest.z = base.x, base.y, base.z
- if intersectx < intersecty then
- if intersectx < intersectz then
- base.x = base.x + stepx
- distance = intersectx
- intersectx = intersectx + componentx
- else
- base.z = base.z + stepz
- distance = intersectz
- intersectz = intersectz + componentz
- end
- elseif intersecty < intersectz then
- base.y = base.y + stepy
- distance = intersecty
- intersecty = intersecty + componenty
- else
- base.z = base.z + stepz
- distance = intersectz
- intersectz = intersectz + componentz
- end
- end
-end
diff --git a/worldedit/worldedit_limited/depends.txt b/worldedit/worldedit_limited/depends.txt
deleted file mode 100644
index 74054c6..0000000
--- a/worldedit/worldedit_limited/depends.txt
+++ /dev/null
@@ -1 +0,0 @@
-worldedit
diff --git a/worldedit/worldedit_limited/init.lua b/worldedit/worldedit_limited/init.lua
deleted file mode 100644
index 801e19c..0000000
--- a/worldedit/worldedit_limited/init.lua
+++ /dev/null
@@ -1,120 +0,0 @@
-do return end
-do
- local MAX_VOLUME = 30 * 30 * 30
-
- local we = worldedit
- local volume = we.volume
- local safewrap = function(func)
- return function(pos1, pos2, ...)
- if validbox(pos1, pos2) then
- return func(pos1, pos2, ...)
- end
- return 0, pos1, pos2
- end
- end
-
- local validbox = function(pos1, pos2)
- tpos1, tpos2 = we.sort_pos(pos1, pos2)
-
- if volume(tpos1, tpos2) > MAX_VOLUME then
- return false
- end
-
- --check for ownership of area if ownership mod is installed
- if owner_defs then
- local inside = false
- for _, def in pairs(owner_defs) do
- --sort positions
- local tdef = {x1=def.x1, x2 = def.x2, y1=def.y1, y2=def.y2, z1=def.z1, z2=def.z2}
- if tdef.x1 > tdef.x2 then
- tdef.x1, tdef.x2 = tdef.x2, tdef.x1
- end
- if tdef.y1 > tdef.y2 then
- tdef.y1, tdef.y2 = tdef.y2, tdef.y1
- end
- if tdef.z1 > tdef.z2 then
- tdef.z1, tdef.z2 = tdef.z2, tdef.z1
- end
-
- --check ownership
- if tpos1.x >= tdef.x1 and tpos1.x <= tdef.x2
- and tpos2.x >= tdef.x1 and tpos2.x <= tdef.x2
- and tpos1.y >= tdef.y1 and tpos1.y <= tdef.y2
- and tpos2.y >= tdef.y1 and tpos2.y <= tdef.y2
- and tpos1.z >= tdef.z1 and tpos1.z <= tdef.z2
- and tpos2.z >= tdef.z1 and tpos2.z <= tdef.z2
- and name == def.owner then --wip: name isn't available here
- inside = true
- break
- end
- end
- if not inside then
- return false
- end
- end
-
- return true
- end
-
- worldedit = {
- sort_pos = we.sort_pos,
-
- set = safewrap(we.set),
- replace = safewrap(we.replace),
- replaceinverse = safewrap(we.replaceinverse),
- copy = function(pos1, pos2, axis, amount)
- tpos1, tpos2 = we.sort_pos(pos1, pos2)
- tpos1[axis] = tpos1[axis] + amount
- tpos2[axis] = tpos2[axis] + amount
- if validbox(pos1, pos2) and validbox(tpos1, tpos2) then
- we.copy(pos1, pos2, axis, amount)
- else
- return 0
- end
- end,
- move = function(pos1, pos2, axis, amount)
- tpos1, tpos2 = we.sort_pos(pos1, pos2)
- tpos1[axis] = tpos1[axis] + amount
- tpos2[axis] = tpos2[axis] + amount
- if validbox(pos1, pos2) and validbox(tpos1, tpos2) then
- we.move(pos1, pos2, axis, amount)
- else
- return 0
- end
- end,
- stack = function(pos1, pos2, axis, count)
- tpos1, tpos2 = we.sort_pos(pos1, pos2)
- local length = (tpos2[axis] - tpos1[axis] + 1) * count
- if count < 0 then
- tpos1[axis] = tpos1[axis] + length
- else
- tpos2[axis] = tpos2[axis] + length
- end
- if validbox(tpos1, tpos2) then
- we.stack(pos1, pos2, axis, amount)
- else
- return 0
- end
- end,
- --wip: add transpose, rotate safely
- flip = safewrap(we.flip),
- orient = safewrap(we.orient),
- fixlight = safewrap(we.fixlight),
- --wip: add primitives here
- volume = we.volume,
- hide = safewrap(we.hide),
- suppress = safewrap(we.suppress),
- highlight = safewrap(we.highlight),
- restore = safewrap(we.restore),
- serialize = safewrap(we.serialize),
- allocate = we.allocate,
- deserialize = function(originpos, value)
- local tpos1, tpos2 = we.allocate(originpos, value)
- if validbox(tpos1, tpos2) then
- we.deserialize(originpos, value)
- else
- return 0
- end
- end,
- }
-end \ No newline at end of file
diff --git a/worldedit/worldedit_shortcommands/depends.txt b/worldedit/worldedit_shortcommands/depends.txt
deleted file mode 100644
index de1cb6c..0000000
--- a/worldedit/worldedit_shortcommands/depends.txt
+++ /dev/null
@@ -1 +0,0 @@
-worldedit_commands
diff --git a/worldedit/worldedit_shortcommands/init.lua b/worldedit/worldedit_shortcommands/init.lua
deleted file mode 100644
index a3cbb67..0000000
--- a/worldedit/worldedit_shortcommands/init.lua
+++ /dev/null
@@ -1,50 +0,0 @@
---provides shorter names for the commands in `worldedit_commands`
-
---returns true if command could not be aliased, false otherwise
-worldedit.alias_chatcommand = function(alias, original_command)
- if not minetest.chatcommands[original_command] then
- minetest.log("error", "worldedit_shortcommands: original command " .. original_command .. " does not exist")
- return true
- end
- if minetest.chatcommands[alias] then
- minetest.log("error", "worldedit_shortcommands: alias " .. alias .. " already exists")
- return true
- end
- minetest.register_chatcommand(alias, minetest.chatcommands[original_command])
- return false
-end
-
-worldedit.alias_chatcommand("/i", "/inspect")
-worldedit.alias_chatcommand("/rst", "/reset")
-worldedit.alias_chatcommand("/mk", "/mark")
-worldedit.alias_chatcommand("/umk", "/unmark")
-worldedit.alias_chatcommand("/1", "/pos1")
-worldedit.alias_chatcommand("/2", "/pos2")
-worldedit.alias_chatcommand("/fp", "/fixedpos")
-worldedit.alias_chatcommand("/v", "/volume")
-worldedit.alias_chatcommand("/s", "/set")
-worldedit.alias_chatcommand("/r", "/replace")
-worldedit.alias_chatcommand("/ri", "/replaceinverse")
-worldedit.alias_chatcommand("/hspr", "/hollowsphere")
-worldedit.alias_chatcommand("/spr", "/sphere")
-worldedit.alias_chatcommand("/hdo", "/hollowdome")
-worldedit.alias_chatcommand("/do", "/dome")
-worldedit.alias_chatcommand("/hcyl", "/hollowcylinder")
-worldedit.alias_chatcommand("/cyl", "/cylinder")
-worldedit.alias_chatcommand("/pyr", "/pyramid")
-worldedit.alias_chatcommand("/spl", "/spiral")
-worldedit.alias_chatcommand("/m", "/move")
-worldedit.alias_chatcommand("/c", "/copy")
-worldedit.alias_chatcommand("/stk", "/stack")
-worldedit.alias_chatcommand("/sch", "/stretch")
-worldedit.alias_chatcommand("/tps", "/transpose")
-worldedit.alias_chatcommand("/fl", "/flip")
-worldedit.alias_chatcommand("/rot", "/rotate")
-worldedit.alias_chatcommand("/ort", "/orient")
-worldedit.alias_chatcommand("/hi", "/hide")
-worldedit.alias_chatcommand("/sup", "/suppress")
-worldedit.alias_chatcommand("/hlt", "/highlight")
-worldedit.alias_chatcommand("/rsr", "/restore")
-worldedit.alias_chatcommand("/l", "/lua")
-worldedit.alias_chatcommand("/lt", "/luatransform")
-worldedit.alias_chatcommand("/clro", "/clearobjects") \ No newline at end of file