parent
8a5727233a
commit
1e654ff079
@ -146,11 +146,11 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
|
||||
|
||||
if (slotIndex == craftingResultSlot.index) {
|
||||
val item = craftingResultSlot.item
|
||||
val leftover = moveItemStackToSlots(item, playerInventorySlots, simulate = true)
|
||||
val leftover = moveItemStackToSlots(item, playerInventorySlots2, simulate = true)
|
||||
|
||||
if (leftover.isEmpty) {
|
||||
val copy = item.copy()
|
||||
moveItemStackToSlots(item, playerInventorySlots, simulate = false)
|
||||
moveItemStackToSlots(item, playerInventorySlots2, simulate = false)
|
||||
item.count = 0
|
||||
craftingResultSlot.onTake(ply, copy)
|
||||
return copy
|
||||
|
@ -36,6 +36,7 @@ abstract class MatteryMenu @JvmOverloads protected constructor(
|
||||
val matteryWidgets: List<AbstractWidget> = Collections.unmodifiableList(_matteryWidgets)
|
||||
|
||||
private val _playerInventorySlots = ArrayList<MatterySlot>()
|
||||
private val _playerInventorySlots2 = ArrayList<MatterySlot>()
|
||||
private val _playerHotbarSlots = ArrayList<MatterySlot>()
|
||||
private val _playerMainSlots = ArrayList<MatterySlot>()
|
||||
private val _playerExoSuitSlots = ArrayList<MatterySlot>()
|
||||
@ -46,6 +47,11 @@ abstract class MatteryMenu @JvmOverloads protected constructor(
|
||||
*/
|
||||
val playerInventorySlots: List<MatterySlot> = Collections.unmodifiableList(_playerInventorySlots)
|
||||
|
||||
/**
|
||||
* hotbar + inventory + exosuit (in this order)
|
||||
*/
|
||||
val playerInventorySlots2: List<MatterySlot> = Collections.unmodifiableList(_playerInventorySlots2)
|
||||
|
||||
/**
|
||||
* hotbar only
|
||||
*/
|
||||
@ -166,6 +172,7 @@ abstract class MatteryMenu @JvmOverloads protected constructor(
|
||||
val slot = InventorySlot(inventory, i)
|
||||
|
||||
_playerInventorySlots.add(slot)
|
||||
_playerInventorySlots2.add(slot)
|
||||
_playerMainSlots.add(slot)
|
||||
_playerCombinedInventorySlots.add(slot)
|
||||
addSlot(slot)
|
||||
@ -178,6 +185,7 @@ abstract class MatteryMenu @JvmOverloads protected constructor(
|
||||
val slot = InventorySlot(mattery.exoSuitContainer, i)
|
||||
|
||||
_playerInventorySlots.add(slot)
|
||||
_playerInventorySlots2.add(slot)
|
||||
_playerExoSuitSlots.add(slot)
|
||||
_playerCombinedInventorySlots.add(slot)
|
||||
addSlot(slot)
|
||||
@ -188,6 +196,7 @@ abstract class MatteryMenu @JvmOverloads protected constructor(
|
||||
val slot = InventorySlot(inventory, i)
|
||||
|
||||
addSlot(slot)
|
||||
_playerInventorySlots2.add(i, slot)
|
||||
_playerInventorySlots.add(slot)
|
||||
_playerHotbarSlots.add(slot)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user