File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed
src/main/kotlin/com/lambda/interaction/material Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,8 @@ object MainHandContainer : MaterialContainer(Rank.MainHand) {
6464 return @inventoryRequest
6565 }
6666
67- val slots = player.currentScreenHandler.slots.filter { it.stack == moveStack }
68-
69- if (slots.isNotEmpty()) swap(player.currentScreenHandler.slots.indexOf(slots.first()), player.inventory.selectedSlot)
70- else throw NotInInventoryException ()
67+ val slot = player.currentScreenHandler.slots.first { it.stack == moveStack } ? : throw NotInInventoryException ()
68+ swap(slot.id, player.inventory.selectedSlot)
7169
7270 if (hand == Hand .OFF_HAND ) swapHands()
7371
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ class SlotTransfer @Ta5kBuilder constructor(
7171 val nextTo = selectedTo.firstOrNull() ? : return @listen
7272
7373 inventoryRequest {
74- // moveSlot(nextFrom.id, nextTo.id)
7574 swap(nextTo.id, 1 )
7675 swap(nextFrom.id, 1 )
7776 onComplete { success() }
You can’t perform that action at this time.
0 commit comments