From 737d46317fbf70b816efbb2ae64b620254a9b356 Mon Sep 17 00:00:00 2001 From: sys4 Date: Mon, 1 Mar 2021 23:36:23 +0100 Subject: [PATCH 1/2] 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 From 3f74c54f8e9a6af7ff67681f4af359d3404492f4 Mon Sep 17 00:00:00 2001 From: sys4 Date: Mon, 1 Mar 2021 23:44:32 +0100 Subject: [PATCH 2/2] Add use_texture_alpha (again) --- build_arrow.lua | 1 + dig_arrow.lua | 1 + fire_arrow.lua | 1 + teleport_arrow.lua | 1 + tnt_arrow.lua | 1 + 5 files changed, 5 insertions(+) diff --git a/build_arrow.lua b/build_arrow.lua index b00fb38..afef690 100644 --- a/build_arrow.lua +++ b/build_arrow.lua @@ -27,6 +27,7 @@ minetest.register_node("throwing:arrow_build_box", { }, tiles = {"throwing_arrow_build.png", "throwing_arrow_build.png", "throwing_arrow_build_back.png", "throwing_arrow_build_front.png", "throwing_arrow_build_2.png", "throwing_arrow_build.png"}, groups = {not_in_creative_inventory=1}, + use_texture_alpha = "opaque", }) local THROWING_ARROW_ENTITY={ diff --git a/dig_arrow.lua b/dig_arrow.lua index 2dc0904..4368965 100644 --- a/dig_arrow.lua +++ b/dig_arrow.lua @@ -27,6 +27,7 @@ minetest.register_node("throwing:arrow_dig_box", { }, tiles = {"throwing_arrow_dig.png", "throwing_arrow_dig.png", "throwing_arrow_dig_back.png", "throwing_arrow_dig_front.png", "throwing_arrow_dig_2.png", "throwing_arrow_dig.png"}, groups = {not_in_creative_inventory=1}, + use_texture_alpha = "opaque", }) local THROWING_ARROW_ENTITY={ diff --git a/fire_arrow.lua b/fire_arrow.lua index b6d3b23..b613b5b 100644 --- a/fire_arrow.lua +++ b/fire_arrow.lua @@ -27,6 +27,7 @@ minetest.register_node("throwing:arrow_fire_box", { }, tiles = {"throwing_arrow_fire.png", "throwing_arrow_fire.png", "throwing_arrow_fire_back.png", "throwing_arrow_fire_front.png", "throwing_arrow_fire_2.png", "throwing_arrow_fire.png"}, groups = {not_in_creative_inventory=1}, + use_texture_alpha = "opaque", }) local THROWING_ARROW_ENTITY={ diff --git a/teleport_arrow.lua b/teleport_arrow.lua index 937af14..8aadbd4 100644 --- a/teleport_arrow.lua +++ b/teleport_arrow.lua @@ -27,6 +27,7 @@ minetest.register_node("throwing:arrow_teleport_box", { }, tiles = {"throwing_arrow_teleport.png", "throwing_arrow_teleport.png", "throwing_arrow_teleport_back.png", "throwing_arrow_teleport_front.png", "throwing_arrow_teleport_2.png", "throwing_arrow_teleport.png"}, groups = {not_in_creative_inventory=1}, + use_texture_alpha = "opaque", }) local THROWING_ARROW_ENTITY={ diff --git a/tnt_arrow.lua b/tnt_arrow.lua index fbc91d7..a514758 100644 --- a/tnt_arrow.lua +++ b/tnt_arrow.lua @@ -27,6 +27,7 @@ minetest.register_node("throwing:arrow_tnt_box", { }, tiles = {"throwing_arrow_tnt.png", "throwing_arrow_tnt.png", "throwing_arrow_tnt_back.png", "throwing_arrow_tnt_front.png", "throwing_arrow_tnt_2.png", "throwing_arrow_tnt.png"}, groups = {not_in_creative_inventory=1}, + use_texture_alpha = "opaque", }) local THROWING_ARROW_ENTITY={