Skip to content

Commit 3ffecdd

Browse files
Panquesito7sfan5
authored andcommittedJul 16, 2019
Replace deprecated functions with newer ones
These commits create compatibility with MT/MTG 5.0.0+. However, these commits may/will break with the 0.4-series.
1 parent 40b49ee commit 3ffecdd

File tree

9 files changed

+16
-5
lines changed

9 files changed

+16
-5
lines changed
 

Diff for: ‎modpack.conf

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name = Minetest-WorldEdit
2+
description = WorldEdit is an in-game world editor. Use it to repair griefing, or just create awesome buildings in seconds.

Diff for: ‎modpack.txt

Whitespace-only changes.

Diff for: ‎worldedit/cuboid.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ end
149149

150150
-- Return the marker that is closest to the player
151151
worldedit.marker_get_closest_to_player = function(name)
152-
local playerpos = minetest.get_player_by_name(name):getpos()
152+
local playerpos = minetest.get_player_by_name(name):get_pos()
153153
local dist1 = vector.distance(playerpos, worldedit.pos1[name])
154154
local dist2 = vector.distance(playerpos, worldedit.pos2[name])
155155

@@ -255,4 +255,4 @@ worldedit.translate_direction = function(name, direction)
255255
end
256256

257257
return resaxis, resdir
258-
end
258+
end

Diff for: ‎worldedit/manipulations.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ function worldedit.clear_objects(pos1, pos2)
638638
-- Avoid players and WorldEdit entities
639639
if not obj:is_player() and (not entity or
640640
not entity.name:find("^worldedit:")) then
641-
local pos = obj:getpos()
641+
local pos = obj:get_pos()
642642
if pos.x >= pos1x and pos.x <= pos2x and
643643
pos.y >= pos1y and pos.y <= pos2y and
644644
pos.z >= pos1z and pos.z <= pos2z then

Diff for: ‎worldedit_brush/mod.conf

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name = worldedit_brush
2+
depends = worldedit, worldedit_commands

Diff for: ‎worldedit_commands/init.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ minetest.register_chatcommand("/pos1", {
257257
description = "Set WorldEdit region position 1 to the player's location",
258258
privs = {worldedit=true},
259259
func = function(name, param)
260-
local pos = minetest.get_player_by_name(name):getpos()
260+
local pos = minetest.get_player_by_name(name):get_pos()
261261
pos.x, pos.y, pos.z = math.floor(pos.x + 0.5), math.floor(pos.y + 0.5), math.floor(pos.z + 0.5)
262262
worldedit.pos1[name] = pos
263263
worldedit.mark_pos1(name)
@@ -270,7 +270,7 @@ minetest.register_chatcommand("/pos2", {
270270
description = "Set WorldEdit region position 2 to the player's location",
271271
privs = {worldedit=true},
272272
func = function(name, param)
273-
local pos = minetest.get_player_by_name(name):getpos()
273+
local pos = minetest.get_player_by_name(name):get_pos()
274274
pos.x, pos.y, pos.z = math.floor(pos.x + 0.5), math.floor(pos.y + 0.5), math.floor(pos.z + 0.5)
275275
worldedit.pos2[name] = pos
276276
worldedit.mark_pos2(name)

Diff for: ‎worldedit_commands/mod.conf

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name = worldedit_commands
2+
depends = worldedit

Diff for: ‎worldedit_gui/mod.conf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name = worldedit_gui
2+
depends = worldedit, worldedit_commands
3+
optional_depends = unified_inventory, inventory_plus, sfinv, creative, smart_inventory

Diff for: ‎worldedit_shortcommands/mod.conf

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name = worldedit_shortcommands
2+
depends = worldedit_commands

0 commit comments

Comments
 (0)