Fix forge grindstone hooks allowing stacks of non-stackable items (#9457)

This commit is contained in:
SizableShrimp authored and GitHub committed 2023-04-20 00:19:35 -07:00
1 parent dcef406df8
commit f2aeeeb1fe
7 files changed
+55 -7

No files matched your search

@@ -857,4 +857,12 @@ public interface IForgeItem
return stack.isEnchanted();
}
/**
* {@return true if the given ItemStack can be put into a grindstone to be repaired and/or stripped of its enchantments}
*/
default boolean canGrindstoneRepair(ItemStack stack)
{
// TODO 1.20: Change to return false; this changes the default behavior for all items from opt-out to opt-in.
return true;
}
}
@@ -587,4 +587,11 @@ public interface IForgeItemStack extends ICapabilitySerializable<CompoundTag>
return self().getItem().isNotReplaceableByPickAction(self(), player, inventorySlot);
}
/**
* {@return true if the given ItemStack can be put into a grindstone to be repaired and/or stripped of its enchantments}
*/
default boolean canGrindstoneRepair()
{
return self().getItem().canGrindstoneRepair(self());
}
}