File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/main/kotlin/com/lambda/interaction/material/container/containers Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ import com.lambda.interaction.material.StackSelection
2525import com.lambda.interaction.material.container.MaterialContainer
2626import com.lambda.interaction.request.inventory.InventoryRequest.Companion.inventoryRequest
2727import com.lambda.util.item.ItemStackUtils.equal
28- import com.lambda.util.player.SlotUtils.combined
29- import com.lambda.util.player.SlotUtils.storage
3028import com.lambda.util.text.buildText
3129import com.lambda.util.text.literal
3230import net.minecraft.item.ItemStack
@@ -66,9 +64,13 @@ object MainHandContainer : MaterialContainer(Rank.MainHand) {
6664 return @inventoryRequest
6765 }
6866
69- if (moveStack in player.storage) swap(player.combined.indexOf(moveStack), 0 )
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)
7070 else throw NotInInventoryException ()
7171
72+ if (hand == Hand .OFF_HAND ) swapHands()
73+
7274 onComplete { success() }
7375 }.submit(queueIfClosed = false )
7476 }
You can’t perform that action at this time.
0 commit comments