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:
@ -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)
|
||||
|
2
worldedit_commands/mod.conf
Normal file
2
worldedit_commands/mod.conf
Normal file
@ -0,0 +1,2 @@
|
||||
name = worldedit_commands
|
||||
depends = worldedit
|
Reference in New Issue
Block a user