Skip to content

Commit

Permalink
fix: suppress IncompatibleClassChangeError on paper
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
WiIIiam278 committed Jun 17, 2024
1 parent 862177b commit 6c8a577
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,15 @@ public void apply(@NotNull BukkitUser user, @NotNull BukkitHuskSync plugin) thro
}

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
}
}

Expand Down

0 comments on commit 6c8a577

Please sign in to comment.