diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExopackInventoryMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExopackInventoryMenu.kt index 6e88d8814..6fbbdb32c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExopackInventoryMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExopackInventoryMenu.kt @@ -195,11 +195,11 @@ class ExopackInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen if (slotIndex == craftingResultSlot.index) { val item = craftingResultSlot.item - val leftover = moveItemStackToSlots(item, playerInventorySlots2, simulate = true) + val leftover = moveItemStackToSlots(item, playerInventorySlots, simulate = true) if (leftover.isEmpty) { val copy = item.copy() - moveItemStackToSlots(item, playerInventorySlots2, simulate = false) + moveItemStackToSlots(item, playerInventorySlots, simulate = false) item.count = 0 craftingResultSlot.onTake(ply, copy) return copy diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryMenu.kt index 99dffd41f..da8c260f3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryMenu.kt @@ -104,7 +104,6 @@ abstract class MatteryMenu( val ply: Player get() = inventory.player private val _playerInventorySlots = ArrayList() - private val _playerInventorySlots2 = ArrayList() private val _playerHotbarSlots = ArrayList() private val _playerMainSlots = ArrayList() private val _playerExoSuitSlots = ArrayList() @@ -189,15 +188,10 @@ abstract class MatteryMenu( fun stringInput(allowSpectators: Boolean = false, handler: (String) -> Unit) = PlayerInput(BinaryStringCodec, allowSpectators, handler) fun intInput(allowSpectators: Boolean = false, handler: (Int) -> Unit) = PlayerInput(VarIntValueCodec, allowSpectators, handler) - /** - * inventory + exosuit + hotbar (in this order) - */ - val playerInventorySlots: List = Collections.unmodifiableList(_playerInventorySlots) - /** * hotbar + inventory + exosuit (in this order) */ - val playerInventorySlots2: List = Collections.unmodifiableList(_playerInventorySlots2) + val playerInventorySlots: List = Collections.unmodifiableList(_playerInventorySlots) /** * hotbar only @@ -368,13 +362,16 @@ abstract class MatteryMenu( mapQuickMoveToInventory(offhandSlot!!) addSlot(offhandSlot!!) - for (i in 9 .. 35) { + for (i in 0 .. 35) { val slot = InventorySlot(inventory, i) _playerInventorySlots.add(slot) - _playerInventorySlots2.add(slot) _playerMainSlots.add(slot) - _playerCombinedInventorySlots.add(slot) + + if (i <= 8) + _playerHotbarSlots.add(slot) + else + _playerCombinedInventorySlots.add(slot) mapQuickMove(slot, equipmentSlots) mapQuickMoveToExternal(slot) @@ -388,7 +385,6 @@ abstract class MatteryMenu( val slot = InventorySlot(mattery.exopackContainer, i) _playerInventorySlots.add(slot) - _playerInventorySlots2.add(slot) _playerExoSuitSlots.add(slot) _playerCombinedInventorySlots.add(slot) @@ -404,18 +400,6 @@ abstract class MatteryMenu( exopackPowerLevel.with(mattery.exopackEnergy) } - - for (i in 0..8) { - val slot = InventorySlot(inventory, i) - - _playerInventorySlots2.add(i, slot) - _playerInventorySlots.add(slot) - _playerHotbarSlots.add(slot) - - mapQuickMove(slot, equipmentSlots) - mapQuickMoveToExternal(slot) - addSlot(slot) - } } private var broadcastOnce = false