From 00c8b7fa1f6c23eacb86fd5808cf207325941c87 Mon Sep 17 00:00:00 2001 From: ElCeejo <40281901+ElCeejo@users.noreply.github.com> Date: Wed, 3 Aug 2022 23:40:40 -0700 Subject: [PATCH] Only add wear in survival --- api.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 0c286d1..3512037 100644 --- a/api.lua +++ b/api.lua @@ -441,9 +441,11 @@ function creatura.basic_punch_func(self, puncher, tflp, tool_caps, dir) if not puncher then return end local tool local tool_name = "" + local add_wear = false if puncher:is_player() then tool = puncher:get_wielded_item() tool_name = tool:get_name() + add_wear = not minetest.is_creative_enabled(target) end if (self.immune_to and is_value_in_table(self.immune_to, tool_name)) then @@ -461,7 +463,7 @@ function creatura.basic_punch_func(self, puncher, tflp, tool_caps, dir) } end self:hurt(tool_caps.damage_groups.fleshy) - if tool then + if add_wear then local wear = floor((tool_caps.damage_groups.full_punch_interval / 75) * 9000) tool:add_wear(wear) puncher:set_wielded_item(tool)