Marwinkas / Mystical-Nature

Mystical Crops is a mod allow growing your resources with crops. Use crops to grow essences used to make materials!
5 stars 2 forks source link

"unbreakable" tag isnt being checked for the paxel from gobber #7

Closed CharCharthemonkey closed 1 year ago

CharCharthemonkey commented 1 year ago

using the paxel in the botanical table it isnt seeing that the paxel is unbreakable but has durability and still breaks it even know it shouldnt be able to

kwpugh commented 1 year ago

Hi,

So this is wonderful in that it allows my unbreakable Gobber End Paxel to be used in the table. Although, the primary reason for this integration is to provide the player with the reward of using an unbreakable multi-tool to do the knife cutting.

Problem is your code does not check to see if the tool has the vanilla "unbreakable" tag in its NBT, so it takes damage with each use.

Would it be possible for you to also check for that? Fortunately, vanilla already has code to do this check

you could update your code to use the isDamageable() method in the ItemStack class 198178633-874010f3-a210-4cac-a78b-32804c829dfb

If you could incorporate a check to see that the stack is supposed to take damage before damaging it, that would solve the issue.

Screen Shot 2022-10-29 at 12 25 02 PM

This would allow any other mods leveraging the c:knives tag with an unbreakable to tool to work as well.

Thank you for considering and the help.

Regards,

kwpugh

Marwinkas commented 1 year ago

Thank you for help. This was fixed in the 1.6.1 beta