Skip to content

Commit 07fdf85

Browse files
committed
Fix ARC not respecting unbreakable items
ItemStack.isDamageableItem returns false if the NBT tag Unbreakable is set to true so it should not be used to check if the item theoretically has durability, Item.isDamageable(ItemStack) returns true if the item has maxDamage set to anything more than 0 so it should return true for anything that would have durability, even if Unbreakable is set to true (or a Forbidden & Arcanus Eternal Stella is applied)
1 parent bc7948c commit 07fdf85

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/wayoftime/bloodmagic/common/tile/TileAlchemicalReactionChamber.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,10 @@ public void consumeInventory(int inputCount, boolean consumeInput, boolean break
381381
ItemStack toolStack = getItem(ARC_TOOL_SLOT);
382382
if (!toolStack.isEmpty())
383383
{
384-
if (toolStack.isDamageableItem())
384+
if (toolStack.getItem().isDamageable(toolStack))
385385
{
386386
int unbreakingLevel = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.UNBREAKING, toolStack);
387-
if (unbreakingLevel == 0 || level.random.nextInt(unbreakingLevel + 1) == 0)
387+
if (toolStack.isDamageableItem() && (unbreakingLevel == 0 || level.random.nextInt(unbreakingLevel + 1) == 0))
388388
{
389389
toolStack.setDamageValue(toolStack.getDamageValue() + 1);
390390
if (toolStack.getDamageValue() >= toolStack.getMaxDamage() && breakTool)

0 commit comments

Comments
 (0)