diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExoSuitInventoryMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExoSuitInventoryMenu.kt index dbf2a952d..5e6999657 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExoSuitInventoryMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExoSuitInventoryMenu.kt @@ -108,11 +108,11 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen if (slotIndex == craftingResultSlot.index) { val item = craftingResultSlot.item - val leftover = moveItemStackToSlots(item, playerCombinedInventorySlots, simulate = true) + val leftover = moveItemStackToSlots(item, playerInventorySlots, simulate = true) if (leftover.isEmpty) { val copy = item.copy() - moveItemStackToSlots(item, playerCombinedInventorySlots, simulate = false) + moveItemStackToSlots(item, playerInventorySlots, simulate = false) item.count = 0 craftingResultSlot.onTake(ply, copy) return copy @@ -124,11 +124,16 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen val copy = item.copy() moveItemStackTo(item, playerHotbarSlots) return copy - } else if (playerHotbarSlots.any { it.index == slotIndex } || craftingSlots.any { it.index == slotIndex }) { + } else if (playerHotbarSlots.any { it.index == slotIndex }) { val item = slots[slotIndex].item val copy = item.copy() moveItemStackTo(item, playerCombinedInventorySlots) return copy + } else if (craftingSlots.any { it.index == slotIndex }) { + val item = slots[slotIndex].item + val copy = item.copy() + moveItemStackTo(item, playerInventorySlots) + return copy } return ItemStack.EMPTY