mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-09 09:20:21 +01:00
if punch_attack_uses is 0 then dont add wear to tool
This commit is contained in:
parent
d4a25064ea
commit
dd9b3d7add
7
api.lua
7
api.lua
@ -14,7 +14,7 @@ local use_vh1 = minetest.get_modpath("visual_harm_1ndicators")
|
||||
-- Global
|
||||
mobs = {
|
||||
mod = "redo",
|
||||
version = "20240201",
|
||||
version = "20240220",
|
||||
translate = S,
|
||||
invis = minetest.global_exists("invisibility") and invisibility or {},
|
||||
node_snow = minetest.registered_aliases["mapgen_snow"]
|
||||
@ -2870,6 +2870,11 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir, damage)
|
||||
-- toolrank support
|
||||
local wear = floor((punch_interval / 75) * 9000)
|
||||
|
||||
-- check for punch_attack_uses being 0 to negate wear
|
||||
if tool_capabilities.punch_attack_uses == 0 then
|
||||
wear = 0
|
||||
end
|
||||
|
||||
if mobs.is_creative(hitter:get_player_name()) then
|
||||
wear = tr and 1 or 0
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user