chat command "/hyperloop_repair_tubes" added

This commit is contained in:
Joachim Stolberg 2019-01-06 00:20:48 +01:00
parent 063ee294e6
commit a8e3ed9fb6
3 changed files with 16 additions and 2 deletions

View File

@ -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+

View File

@ -1,3 +1,3 @@
tubelib2
default
worldedit?

View File

@ -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