Change condition order

since players most of time quick move crafting result
This commit is contained in:
DBotThePony 2022-08-31 14:27:16 +07:00
parent c8c4e2931f
commit 6beab09cb6
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -149,17 +149,7 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
return ItemStack.EMPTY return ItemStack.EMPTY
} }
if (combinedInventorySlots.any { it.index == slotIndex }) { if (slotIndex == craftingResultSlot.index) {
val item = slots[slotIndex].item
val copy = item.copy()
moveItemStackTo(item, hotbarSlots)
return copy
} else if (hotbarSlots.any { it.index == slotIndex } || craftingSlots.any { it.index == slotIndex }) {
val item = slots[slotIndex].item
val copy = item.copy()
moveItemStackTo(item, combinedInventorySlots)
return copy
} else if (slotIndex == craftingResultSlot.index) {
val item = craftingResultSlot.item val item = craftingResultSlot.item
val leftover = moveItemStackToSlots(item, combinedInventorySlots, simulate = true) val leftover = moveItemStackToSlots(item, combinedInventorySlots, simulate = true)
@ -172,6 +162,16 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
} }
return ItemStack.EMPTY return ItemStack.EMPTY
} else if (combinedInventorySlots.any { it.index == slotIndex }) {
val item = slots[slotIndex].item
val copy = item.copy()
moveItemStackTo(item, hotbarSlots)
return copy
} else if (hotbarSlots.any { it.index == slotIndex } || craftingSlots.any { it.index == slotIndex }) {
val item = slots[slotIndex].item
val copy = item.copy()
moveItemStackTo(item, combinedInventorySlots)
return copy
} }
return ItemStack.EMPTY return ItemStack.EMPTY