From 9c80920cd830c04a7f63c039520997ac3feaa0cb Mon Sep 17 00:00:00 2001 From: Sokomine Date: Fri, 8 Dec 2017 22:25:35 +0100 Subject: [PATCH] got rid of minetest.env --- init.lua | 12 ++++++------ inspect.lua | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index 05b7dcd..b602c30 100644 --- a/init.lua +++ b/init.lua @@ -88,7 +88,7 @@ minetest.register_tool( "replacer:replacer", end local pos = minetest.get_pointed_thing_position( pointed_thing, under ); - local node = minetest.env:get_node_or_nil( pos ); + local node = minetest.get_node_or_nil( pos ); --minetest.chat_send_player( name, " Target node: "..minetest.serialize( node ).." at pos "..minetest.serialize( pos ).."."); local metadata = "default:dirt 0 0"; @@ -126,7 +126,7 @@ replacer.replace = function( itemstack, user, pointed_thing, mode ) end local pos = minetest.get_pointed_thing_position( pointed_thing, mode ); - local node = minetest.env:get_node_or_nil( pos ); + local node = minetest.get_node_or_nil( pos ); --minetest.chat_send_player( name, " Target node: "..minetest.serialize( node ).." at pos "..minetest.serialize( pos ).."."); @@ -163,7 +163,7 @@ replacer.replace = function( itemstack, user, pointed_thing, mode ) -- the node itshelf remains the same, but the orientation was changed if( node.param1 ~= daten[2] or node.param2 ~= daten[3] ) then - minetest.env:add_node( pos, { name = node.name, param1 = daten[2], param2 = daten[3] } ); + minetest.add_node( pos, { name = node.name, param1 = daten[2], param2 = daten[3] } ); end return nil; @@ -201,7 +201,7 @@ replacer.replace = function( itemstack, user, pointed_thing, mode ) minetest.node_dig( pos, node, user ); - local digged_node = minetest.env:get_node_or_nil( pos ); + local digged_node = minetest.get_node_or_nil( pos ); if( not( digged_node ) or digged_node.name == node.name ) then @@ -219,8 +219,8 @@ replacer.replace = function( itemstack, user, pointed_thing, mode ) --minetest.chat_send_player( name, "Replacing node '"..( node.name or "air" ).."' with '"..( item[ "metadata"] or "?" ).."'."); - --minetest.env:place_node( pos, { name = item[ "metadata" ] } ); - minetest.env:add_node( pos, { name = daten[1], param1 = daten[2], param2 = daten[3] } ); + --minetest.place_node( pos, { name = item[ "metadata" ] } ); + minetest.add_node( pos, { name = daten[1], param1 = daten[2], param2 = daten[3] } ); return nil; -- no item shall be removed from inventory end diff --git a/inspect.lua b/inspect.lua index 7759610..67b7a80 100644 --- a/inspect.lua +++ b/inspect.lua @@ -101,7 +101,7 @@ replacer.inspect = function( itemstack, user, pointed_thing, mode, show_receipe end local pos = minetest.get_pointed_thing_position( pointed_thing, mode ); - local node = minetest.env:get_node_or_nil( pos ); + local node = minetest.get_node_or_nil( pos ); if( node == nil ) then minetest.chat_send_player( name, "Error: Target node not yet loaded. Please wait a moment for the server to catch up.");