From b7bae0a45d312b34783a20b37fb3e4821e17e1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Art=C5=ABras=20Norkus?= Date: Thu, 11 Feb 2016 14:08:15 +0200 Subject: [PATCH] remove depracated api calls --- functions.lua | 2 +- init.lua | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions.lua b/functions.lua index d8b61b7..0bd0df2 100644 --- a/functions.lua +++ b/functions.lua @@ -24,7 +24,7 @@ function cart_func:velocity_to_dir(v) end function cart_func:is_rail(p) - local nn = minetest.env:get_node(p).name + local nn = minetest.get_node(p).name return minetest.get_item_group(nn, "connect_to_raillike") == minetest.raillike_group("rail") end diff --git a/init.lua b/init.lua index e2c0b13..52cafa5 100644 --- a/init.lua +++ b/init.lua @@ -279,7 +279,7 @@ function cart:on_step(dtime) if dir.y == 0 then if math.abs(self.velocity.x) < 0.1 and math.abs(self.velocity.z) < 0.1 then -- Start the cart if powered from mesecons - local a = tonumber(minetest.env:get_meta(pos):get_string("cart_acceleration")) + local a = tonumber(minetest.get_meta(pos):get_string("cart_acceleration")) if a and a ~= 0 then if self.pre_stop_dir and cart_func.v3:equal(self:get_rail_direction(self.object:getpos(), self.pre_stop_dir), self.pre_stop_dir) then self.velocity = { @@ -372,7 +372,7 @@ function cart:on_step(dtime) dir = cart_func:velocity_to_dir(self.velocity) -- Accelerate or decelerate the cart according to the pitch and acceleration of the rail node - local a = tonumber(minetest.env:get_meta(pos):get_string("cart_acceleration")) + local a = tonumber(minetest.get_meta(pos):get_string("cart_acceleration")) if not a then a = 0 end @@ -484,13 +484,13 @@ minetest.register_craftitem("vcarts:cart", { return end if cart_func:is_rail(pointed_thing.under) then - minetest.env:add_entity(pointed_thing.under, "vcarts:cart") + minetest.add_entity(pointed_thing.under, "vcarts:cart") if not minetest.setting_getbool("creative_mode") then itemstack:take_item() end return itemstack elseif cart_func:is_rail(pointed_thing.above) then - minetest.env:add_entity(pointed_thing.above, "vcarts:cart") + minetest.add_entity(pointed_thing.above, "vcarts:cart") if not minetest.setting_getbool("creative_mode") then itemstack:take_item() end