SilentChaos512 / Silent-Gear

Modular tool/armor mod (formerly part of Silent's Gems)
https://www.curseforge.com/minecraft/mc-mods/silent-gear
MIT License
81 stars 37 forks source link

Indestructible trait repairs items fully instead of preserving how damaged item is #652

Open vovannn012347 opened 8 months ago

vovannn012347 commented 8 months ago

Versions:

Minecraft 1.18.2

Expected Behavior

Indestructible items retain their durability between save and reload and on using any abilities that drain durability

indestructible trait removes all damage from item it is applied on - some items have abilities that depend on item being damaged or drain durability - item gets repaired totally instead, it is totally wrong behavior and not how indestructible is described to work

Actual Behavior

gear damage was fully reset upon using item-damaging abilities on indestructible item, gear stats did not recalculate upon this happening gear damage was reset on indestructible item upon re-logging, gear stats were recalculated upon this happening

Links/Images

images not required, test it out - set damage functions in gear helper were not changed and that is probably where bug lies

Steps to Reproduce the Problem

1.apply indestructible to already damaged item 2.use ability that decreases durability on said item 3.observe durability fully restored, stats not recalculated

1.apply indestructible to already damaged item 2.exit world and load back in 3.observe durability fully restored, stats not recalculated

P.S. this bug is stricltly localized to few lines of code, though i do not have enough time to either install an another ide, dwelve into minecraft modding to fix it and make a merge or to fiddle with code and tell what is wrong, only localized where bug is and filing bug report instead