ItemStack repair check API

This commit is contained in:
Jake Potrebic
2021-05-15 22:11:11 -07:00
parent d6b69e74a9
commit 121534e841
2 changed files with 49 additions and 0 deletions

View File

@@ -548,6 +548,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
public int getProtocolVersion() {
return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion();
}
@Override
public boolean isValidRepairItemStack(org.bukkit.inventory.ItemStack itemToBeRepaired, org.bukkit.inventory.ItemStack repairMaterial) {
if (!itemToBeRepaired.getType().isItem() || !repairMaterial.getType().isItem()) {
return false;
}
return CraftItemStack.unwrap(itemToBeRepaired).isValidRepairItem(CraftItemStack.unwrap(repairMaterial));
}
// Paper end
/**