From 737d46317fbf70b816efbb2ae64b620254a9b356 Mon Sep 17 00:00:00 2001 From: sys4 Date: Mon, 1 Mar 2021 23:36:23 +0100 Subject: [PATCH] Fix warnings regarding deprecated functions (again) --- build_arrow.lua | 2 +- tnt_arrow.lua | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build_arrow.lua b/build_arrow.lua index 9585a5a..b00fb38 100644 --- a/build_arrow.lua +++ b/build_arrow.lua @@ -74,7 +74,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) if self.lastpos.x~=nil then if node.name ~= "air" then self.object:remove() - if self.inventory and self.stack and not minetest.setting_getbool("creative_mode") then + if self.inventory and self.stack and not minetest.settings:get_bool("creative_mode") then self.inventory:remove_item("main", {name=self.stack:get_name()}) end if self.stack then diff --git a/tnt_arrow.lua b/tnt_arrow.lua index e42ead5..fbc91d7 100644 --- a/tnt_arrow.lua +++ b/tnt_arrow.lua @@ -47,7 +47,7 @@ local loss_prob = {} loss_prob["default:cobble"] = 3 loss_prob["default:dirt"] = 4 -local radius = tonumber(minetest.setting_get("tnt_radius") or 3) +local radius = tonumber(minetest.settings:get("tnt_radius") or 3) -- Fill a list with data for content IDs, after all nodes are registered local cid_data = {} @@ -82,8 +82,8 @@ local function eject_drops(drops, pos, radius) local obj = minetest.add_item(drop_pos, item) if obj then obj:get_luaentity().collect = true - obj:setacceleration({x=0, y=-10, z=0}) - obj:setvelocity({x=math.random(-3, 3), y=10, + obj:set_acceleration({x=0, y=-10, z=0}) + obj:set_velocity({x=math.random(-3, 3), y=10, z=math.random(-3, 3)}) end count = count - max @@ -152,7 +152,7 @@ local function entity_physics(pos, radius) local dist = math.max(1, vector.distance(pos, obj_pos)) if obj_vel ~= nil then - obj:setvelocity(calc_velocity(pos, obj_pos, + obj:set_velocity(calc_velocity(pos, obj_pos, obj_vel, radius * 10)) end