From dd3b5a98ae36bbdffec0d846e44a9ce72643abfe Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 25 May 2021 00:46:39 +0200 Subject: [PATCH] [mcl_falling_nodes] fix warnings --- mods/ENTITIES/mcl_falling_nodes/init.lua | 22 +++++-------------- .../locale/mcl_falling_nodes.de.tr | 3 --- .../locale/mcl_falling_nodes.es.tr | 3 --- .../locale/mcl_falling_nodes.fr.tr | 3 --- .../locale/mcl_falling_nodes.ru.tr | 3 --- .../mcl_falling_nodes/locale/template.txt | 3 --- 6 files changed, 6 insertions(+), 31 deletions(-) delete mode 100644 mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.de.tr delete mode 100644 mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.es.tr delete mode 100644 mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.fr.tr delete mode 100644 mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.ru.tr delete mode 100644 mods/ENTITIES/mcl_falling_nodes/locale/template.txt diff --git a/mods/ENTITIES/mcl_falling_nodes/init.lua b/mods/ENTITIES/mcl_falling_nodes/init.lua index af2c06703..01681a159 100644 --- a/mods/ENTITIES/mcl_falling_nodes/init.lua +++ b/mods/ENTITIES/mcl_falling_nodes/init.lua @@ -1,7 +1,4 @@ -local S = minetest.get_translator("mcl_falling_nodes") -local has_mcl_armor = minetest.get_modpath("mcl_armor") - -local get_falling_depth = function(self) +local function get_falling_depth(self) if not self._startpos then -- Fallback self._startpos = self.object:get_pos() @@ -9,7 +6,7 @@ local get_falling_depth = function(self) return self._startpos.y - vector.round(self.object:get_pos()).y end -local deal_falling_damage = function(self, dtime) +local function deal_falling_damage(self, dtime) if minetest.get_item_group(self.node.name, "falling_node_damage") == 0 then return end @@ -38,7 +35,7 @@ local deal_falling_damage = function(self, dtime) inv:set_stack("armor", 2, helmet) end end - local deathmsg, dmg_type + local dmg_type if minetest.get_item_group(self.node.name, "anvil") ~= 0 then dmg_type = "anvil" else @@ -60,10 +57,8 @@ minetest.register_entity(":__builtin:falling_node", { collide_with_objects = false, collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, }, - node = {}, meta = {}, - set_node = function(self, node, meta) local def = minetest.registered_nodes[node.name] -- Change falling node if definition tells us to @@ -90,7 +85,6 @@ minetest.register_entity(":__builtin:falling_node", { glow = glow, }) end, - get_staticdata = function(self) local meta = self.meta -- Workaround: Save inventory seperately from metadata. @@ -111,7 +105,6 @@ minetest.register_entity(":__builtin:falling_node", { } return minetest.serialize(ds) end, - on_activate = function(self, staticdata) self.object:set_armor_groups({immortal = 1}) @@ -134,7 +127,6 @@ minetest.register_entity(":__builtin:falling_node", { end self._startpos = vector.round(self._startpos) end, - on_step = function(self, dtime) -- Set gravity local acceleration = self.object:get_acceleration() @@ -186,10 +178,9 @@ minetest.register_entity(":__builtin:falling_node", { return end local nd = minetest.registered_nodes[n2.name] - if n2.name == "mcl_portals:portal_end" then - -- TODO: Teleport falling node. - - elseif (nd and nd.buildable_to == true) or minetest.get_item_group(self.node.name, "crush_after_fall") ~= 0 then + --if n2.name == "mcl_portals:portal_end" then + -- TODO: Teleport falling node. + if (nd and nd.buildable_to == true) or minetest.get_item_group(self.node.name, "crush_after_fall") ~= 0 then -- Replace destination node if it's buildable to minetest.remove_node(np) -- Run script hook @@ -256,7 +247,6 @@ minetest.register_entity(":__builtin:falling_node", { self.object:set_pos(npos) end end - deal_falling_damage(self, dtime) end }) diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.de.tr b/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.de.tr deleted file mode 100644 index 71dfa4be9..000000000 --- a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.de.tr +++ /dev/null @@ -1,3 +0,0 @@ -# textdomain: mcl_falling_nodes -@1 was smashed by a falling anvil.=@1 wurde von einem fallenden Amboss zerschmettert. -@1 was smashed by a falling block.=@1 wurde von einem fallenden Block zerschmettert. diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.es.tr b/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.es.tr deleted file mode 100644 index 41cbf61b4..000000000 --- a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.es.tr +++ /dev/null @@ -1,3 +0,0 @@ -# textdomain: mcl_falling_nodes -@1 was smashed by a falling anvil.=@1 fue aplastado por la caída de un yunque. -@1 was smashed by a falling block.=@1 fue aplastado por la caída de un bloque. diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.fr.tr b/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.fr.tr deleted file mode 100644 index 781cd7048..000000000 --- a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.fr.tr +++ /dev/null @@ -1,3 +0,0 @@ -# textdomain: mcl_falling_nodes -@1 was smashed by a falling anvil.=@1 a été écrasé par une enclume qui tombait. -@1 was smashed by a falling block.=@1 a été écrasé par un bloc qui tombait. diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.ru.tr b/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.ru.tr deleted file mode 100644 index 6c8b9375a..000000000 --- a/mods/ENTITIES/mcl_falling_nodes/locale/mcl_falling_nodes.ru.tr +++ /dev/null @@ -1,3 +0,0 @@ -# textdomain: mcl_falling_nodes -@1 was smashed by a falling anvil.=@1 придавило падающей наковальней. -@1 was smashed by a falling block.=@1 раздавило падающим блоком. diff --git a/mods/ENTITIES/mcl_falling_nodes/locale/template.txt b/mods/ENTITIES/mcl_falling_nodes/locale/template.txt deleted file mode 100644 index 4adabaf01..000000000 --- a/mods/ENTITIES/mcl_falling_nodes/locale/template.txt +++ /dev/null @@ -1,3 +0,0 @@ -# textdomain: mcl_falling_nodes -@1 was smashed by a falling anvil.= -@1 was smashed by a falling block.=