Implement Item.isRepairable in Crafting and Grindstone. Closes #5917

This commit is contained in:
LexManos committed 2019-07-09 18:02:47 -07:00
1 parent 983e0a93db
commit 2cc264645b
5 files changed
+56 -4

No files matched your search

@@ -114,7 +114,7 @@ public interface IForgeItem
*
* @return True if reparable
*/
boolean isRepairable();
boolean isRepairable(ItemStack stack);
/**
* Determines the amount of durability the mending enchantment
@@ -425,4 +425,14 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundNBT>
return !other.isEmpty() && getStack().getCount() == other.getCount() && getStack().getItem() == other.getItem() &&
(limitTags ? getStack().areShareTagsEqual(other) : ItemStack.areItemStackTagsEqual(getStack(), other));
}
/**
* Determines if a item is reparable, used by Repair recipes and Grindstone.
*
* @return True if reparable
*/
default boolean isRepairable()
{
return getStack().getItem().isRepairable(getStack());
}
}