fix: suppress `IncompatibleClassChangeError` on paper

Paper plugins don't get run through bytecode fixups by Spigot's Commodore. Spigot changed InventoryView to an interface recently, which causes this to be thrown.
feat/data-edit-commands
William 5 months ago
parent 862177bec7
commit 6c8a577701
No known key found for this signature in database

@ -161,11 +161,15 @@ public abstract class BukkitData implements Data {
}
private void clearInventoryCraftingSlots(@NotNull Player player) {
final org.bukkit.inventory.Inventory inventory = player.getOpenInventory().getTopInventory();
if (inventory.getType() == InventoryType.CRAFTING) {
for (int slot = 0; slot < 5; slot++) {
inventory.setItem(slot, null);
try {
final org.bukkit.inventory.Inventory inventory = player.getOpenInventory().getTopInventory();
if (inventory.getType() == InventoryType.CRAFTING) {
for (int slot = 0; slot < 5; slot++) {
inventory.setItem(slot, null);
}
}
} catch (Throwable e) {
// Ignore any exceptions
}
}

Loading…
Cancel
Save