We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
InventoryCraftResult
1 parent 2341ccc commit 5841779Copy full SHA for 5841779
src/main/java/com/cleanroommc/groovyscript/event/EventHandler.java
@@ -127,8 +127,8 @@ public static void onItemCrafted(PlayerEvent.ItemCraftedEvent event) {
127
Container container = ((InventoryCraftingAccess) inventoryCrafting).getEventHandler();
128
if (container != null) {
129
for (Slot slot : container.inventorySlots) {
130
- if (slot instanceof SlotCrafting) {
131
- craftResult = (InventoryCraftResult) slot.inventory;
+ if (slot instanceof SlotCrafting && slot.inventory instanceof InventoryCraftResult result) {
+ craftResult = result;
132
player = ((SlotCraftingAccess) slot).getPlayer();
133
break;
134
}
0 commit comments