From 9cc9ab9df30fc99f3940fe44a62cd7b6b49d412b Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Tue, 8 Feb 2022 15:21:05 -0400 Subject: [PATCH] revert the commit "possible fixed #57 typo on entity on_punch" to on_punched * related to https://codeberg.org/minenux/minetest-mod-3d_armor/issues/57 * related to https://github.com/minetest-mods/3d_armor/issues/57 --- 3d_armor/api.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3d_armor/api.lua b/3d_armor/api.lua index 86ef48f0..ec13e35e 100644 --- a/3d_armor/api.lua +++ b/3d_armor/api.lua @@ -506,8 +506,8 @@ armor.punch = function(self, player, hitter, time_from_last_punch, tool_capabili local use = minetest.get_item_group(name, "armor_use") or 0 local damage = use > 0 local def = stack:get_definition() or {} - if type(def.on_punch) == "function" then - damage = def.on_punch(player, hitter, time_from_last_punch, + if type(def.on_punched) == "function" then + damage = def.on_punched(player, hitter, time_from_last_punch, tool_capabilities) ~= false and damage == true end if damage == true and tool_capabilities then