mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-09 17:30: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
|
-- Global
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20240201",
|
version = "20240220",
|
||||||
translate = S,
|
translate = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {},
|
invis = minetest.global_exists("invisibility") and invisibility or {},
|
||||||
node_snow = minetest.registered_aliases["mapgen_snow"]
|
node_snow = minetest.registered_aliases["mapgen_snow"]
|
||||||
@ -2870,6 +2870,11 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir, damage)
|
|||||||
-- toolrank support
|
-- toolrank support
|
||||||
local wear = floor((punch_interval / 75) * 9000)
|
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
|
if mobs.is_creative(hitter:get_player_name()) then
|
||||||
wear = tr and 1 or 0
|
wear = tr and 1 or 0
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user