Skip to content

Commit

Permalink
check that the inventory is InventoryCraftResult (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
WaitingIdly authored Dec 3, 2024
1 parent 2341ccc commit 5841779
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public static void onItemCrafted(PlayerEvent.ItemCraftedEvent event) {
Container container = ((InventoryCraftingAccess) inventoryCrafting).getEventHandler();
if (container != null) {
for (Slot slot : container.inventorySlots) {
if (slot instanceof SlotCrafting) {
craftResult = (InventoryCraftResult) slot.inventory;
if (slot instanceof SlotCrafting && slot.inventory instanceof InventoryCraftResult result) {
craftResult = result;
player = ((SlotCraftingAccess) slot).getPlayer();
break;
}
Expand Down

0 comments on commit 5841779

Please sign in to comment.