Use constant as capacity
This commit is contained in:
parent
5dbd634215
commit
72aaea3120
@ -24,7 +24,7 @@ class BlockEntityCargoCrate(
|
|||||||
p_155229_: BlockPos,
|
p_155229_: BlockPos,
|
||||||
p_155230_: BlockState
|
p_155230_: BlockState
|
||||||
) : BlockEntityMattery(Registry.BlockEntities.CARGO_CRATE, p_155229_, p_155230_) {
|
) : BlockEntityMattery(Registry.BlockEntities.CARGO_CRATE, p_155229_, p_155230_) {
|
||||||
val container = MatteryContainer(this::setChanged, 9 * 6)
|
val container = MatteryContainer(this::setChanged, CAPACITY)
|
||||||
private var interactingPlayers = 0
|
private var interactingPlayers = 0
|
||||||
val handler = container.handler()
|
val handler = container.handler()
|
||||||
|
|
||||||
@ -77,5 +77,6 @@ class BlockEntityCargoCrate(
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val NAME = TranslatableComponent("block.overdrive_that_matters.cargo_crate")
|
private val NAME = TranslatableComponent("block.overdrive_that_matters.cargo_crate")
|
||||||
|
const val CAPACITY = 9 * 6
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -14,9 +14,9 @@ class CargoCrateMenu @JvmOverloads constructor(
|
|||||||
val crateSlots: Array<MatterySlot>
|
val crateSlots: Array<MatterySlot>
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val container = tile?.container ?: SimpleContainer(9 * 6)
|
val container = tile?.container ?: SimpleContainer(BlockEntityCargoCrate.CAPACITY)
|
||||||
|
|
||||||
crateSlots = Array(9 * 6) {
|
crateSlots = Array(BlockEntityCargoCrate.CAPACITY) {
|
||||||
val slot = MatterySlot(container, it)
|
val slot = MatterySlot(container, it)
|
||||||
addSlot(slot)
|
addSlot(slot)
|
||||||
return@Array slot
|
return@Array slot
|
||||||
|
Loading…
Reference in New Issue
Block a user