diff --git a/README.md b/README.md index a166acf..4cb46a3 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ The mod includes many different kind of blocks: - Hyperloop Station Book with all available stations (for builders/engineers) - Hyperloop Tube Crowbar to crack/repair tube lines (for admins) - Hyperloop WiFi Tubes for very large distances (optional) +- chat command to repair WorldEdit placed tubes ..and more. @@ -79,10 +80,11 @@ hyperloop_free_tube_placement_enabled = true tubelib2 (![GitHub](https://github.com/joe7575/tubelib2)) default intllib +optional: worldedit # License -Copyright (C) 2017,2018 Joachim Stolberg +Copyright (C) 2017,2019 Joachim Stolberg Code: Licensed under the GNU LGPL version 2.1 or later. See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt Textures: CC0 Display: Derived from the work of kaeza, sofar and others (digilines) LGPLv2.1+ diff --git a/depends.txt b/depends.txt index 6d53aca..c07fe7a 100644 --- a/depends.txt +++ b/depends.txt @@ -1,3 +1,3 @@ tubelib2 default - +worldedit? diff --git a/tubecrowbar.lua b/tubecrowbar.lua index d234180..1ecf762 100644 --- a/tubecrowbar.lua +++ b/tubecrowbar.lua @@ -114,3 +114,15 @@ minetest.register_privilege("hyperloop", {description = "Rights to remove tube nodes by means of the crowbar", give_to_singleplayer = false}) + +if(minetest.get_modpath("worldedit")) ~= nil then + minetest.register_chatcommand("hyperloop_repair_tubes", { + description = "Repair via WorldEdit placed Hyperloop tubes by reusing WorldEdit pos1/pos2", + privs = {worldedit=true}, + func = function(name, param) + local pos1 = worldedit.pos1[name] + local pos2 = worldedit.pos2[name] + Tube:replace_tube_line(pos1, pos2) + end, + }) +end