]> git.lizzy.rs Git - worldedit.git/commitdiff
Replace deprecated functions with newer ones
authorPanquesito7 <51391473+Panquesito7@users.noreply.github.com>
Sun, 16 Jun 2019 18:30:56 +0000 (13:30 -0500)
committersfan5 <sfan5@live.de>
Tue, 16 Jul 2019 23:23:40 +0000 (01:23 +0200)
These commits create compatibility with MT/MTG 5.0.0+.
However, these commits may/will break with the 0.4-series.

modpack.conf [new file with mode: 0644]
modpack.txt [deleted file]
worldedit/cuboid.lua
worldedit/manipulations.lua
worldedit_brush/mod.conf [new file with mode: 0644]
worldedit_commands/init.lua
worldedit_commands/mod.conf [new file with mode: 0644]
worldedit_gui/mod.conf [new file with mode: 0644]
worldedit_shortcommands/mod.conf [new file with mode: 0644]

diff --git a/modpack.conf b/modpack.conf
new file mode 100644 (file)
index 0000000..4d9e6f5
--- /dev/null
@@ -0,0 +1,2 @@
+name = Minetest-WorldEdit
+description = WorldEdit is an in-game world editor. Use it to repair griefing, or just create awesome buildings in seconds.
diff --git a/modpack.txt b/modpack.txt
deleted file mode 100644 (file)
index e69de29..0000000
index ce207615c768a3abb8c082dcbdad3ef8d18d2777..d98e25c3e16feef5bc9c22f48046eb58e6270e1f 100644 (file)
@@ -149,7 +149,7 @@ end
 
 -- Return the marker that is closest to the player
 worldedit.marker_get_closest_to_player = function(name)
-       local playerpos = minetest.get_player_by_name(name):getpos()
+       local playerpos = minetest.get_player_by_name(name):get_pos()
        local dist1 = vector.distance(playerpos, worldedit.pos1[name])
        local dist2 = vector.distance(playerpos, worldedit.pos2[name])
        
@@ -255,4 +255,4 @@ worldedit.translate_direction = function(name, direction)
        end
        
        return resaxis, resdir
-end
\ No newline at end of file
+end
index a6aad16ac88eba1b3ffca6b3ada4915f33889997..76bb13bea8e7404e7e5fe2701fe03f95a7fc529f 100644 (file)
@@ -638,7 +638,7 @@ function worldedit.clear_objects(pos1, pos2)
                -- Avoid players and WorldEdit entities\r
                if not obj:is_player() and (not entity or\r
                                not entity.name:find("^worldedit:")) then\r
-                       local pos = obj:getpos()\r
+                       local pos = obj:get_pos()\r
                        if pos.x >= pos1x and pos.x <= pos2x and\r
                                        pos.y >= pos1y and pos.y <= pos2y and\r
                                        pos.z >= pos1z and pos.z <= pos2z then\r
diff --git a/worldedit_brush/mod.conf b/worldedit_brush/mod.conf
new file mode 100644 (file)
index 0000000..1a86bd6
--- /dev/null
@@ -0,0 +1,2 @@
+name = worldedit_brush
+depends = worldedit, worldedit_commands
index cc169ee1bab2e237d3d0c4e96554609bcf888f1c..37903d76f7414e751dd73117a4e41b3cc75f9475 100644 (file)
@@ -257,7 +257,7 @@ minetest.register_chatcommand("/pos1", {
        description = "Set WorldEdit region position 1 to the player's location",\r
        privs = {worldedit=true},\r
        func = function(name, param)\r
-               local pos = minetest.get_player_by_name(name):getpos()\r
+               local pos = minetest.get_player_by_name(name):get_pos()\r
                pos.x, pos.y, pos.z = math.floor(pos.x + 0.5), math.floor(pos.y + 0.5), math.floor(pos.z + 0.5)\r
                worldedit.pos1[name] = pos\r
                worldedit.mark_pos1(name)\r
@@ -270,7 +270,7 @@ minetest.register_chatcommand("/pos2", {
        description = "Set WorldEdit region position 2 to the player's location",\r
        privs = {worldedit=true},\r
        func = function(name, param)\r
-               local pos = minetest.get_player_by_name(name):getpos()\r
+               local pos = minetest.get_player_by_name(name):get_pos()\r
                pos.x, pos.y, pos.z = math.floor(pos.x + 0.5), math.floor(pos.y + 0.5), math.floor(pos.z + 0.5)\r
                worldedit.pos2[name] = pos\r
                worldedit.mark_pos2(name)\r
diff --git a/worldedit_commands/mod.conf b/worldedit_commands/mod.conf
new file mode 100644 (file)
index 0000000..e6ffbd2
--- /dev/null
@@ -0,0 +1,2 @@
+name = worldedit_commands
+depends = worldedit
diff --git a/worldedit_gui/mod.conf b/worldedit_gui/mod.conf
new file mode 100644 (file)
index 0000000..8cc015f
--- /dev/null
@@ -0,0 +1,3 @@
+name = worldedit_gui
+depends = worldedit, worldedit_commands
+optional_depends = unified_inventory, inventory_plus, sfinv, creative, smart_inventory
diff --git a/worldedit_shortcommands/mod.conf b/worldedit_shortcommands/mod.conf
new file mode 100644 (file)
index 0000000..2a2d96d
--- /dev/null
@@ -0,0 +1,2 @@
+name = worldedit_shortcommands
+depends = worldedit_commands