1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2025-06-28 14:16:18 +02:00

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.
This commit is contained in:
Panquesito7
2019-06-16 13:30:56 -05:00
committed by sfan5
parent 40b49ee9bc
commit 3ffecdd9c4
9 changed files with 16 additions and 5 deletions

View File

@ -257,7 +257,7 @@ minetest.register_chatcommand("/pos1", {
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()
local pos = minetest.get_player_by_name(name):get_pos()
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)
@ -270,7 +270,7 @@ minetest.register_chatcommand("/pos2", {
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()
local pos = minetest.get_player_by_name(name):get_pos()
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)

View File

@ -0,0 +1,2 @@
name = worldedit_commands
depends = worldedit