Move crafting result slot to top

This commit is contained in:
DBotThePony 2022-09-06 22:18:53 +07:00
parent 5f649d0d7e
commit 44bb3c2fae
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -19,20 +19,6 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
var lastScroll = 0
override val storageSlots: Collection<Slot> get() = listOf()
init {
if (capability.ply is ServerPlayer) {
addSlotListener(capability.ply.containerListener)
}
}
val armorSlots: List<EquipmentSlot> = makeArmorSlots()
val offhandSlot = object : InventorySlot(capability.ply.inventory, 40) {
override fun getNoItemIcon(): Pair<ResourceLocation, ResourceLocation> {
return Pair.of(InventoryMenu.BLOCK_ATLAS, InventoryMenu.EMPTY_ARMOR_SLOT_SHIELD)
}
}
val craftingGrid: CraftingContainer
val craftingSlots: List<MatterySlot>
@ -50,7 +36,28 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
}
craftingSlots = builder.build()
}
val craftingResultContainer = ResultContainer()
val craftingResultSlot = ResultSlot(capability.ply, craftingGrid, craftingResultContainer, 0, 0, 0)
init {
addSlot(craftingResultSlot)
if (capability.ply is ServerPlayer) {
addSlotListener(capability.ply.containerListener)
}
}
val armorSlots: List<EquipmentSlot> = makeArmorSlots()
val offhandSlot = object : InventorySlot(capability.ply.inventory, 40) {
override fun getNoItemIcon(): Pair<ResourceLocation, ResourceLocation> {
return Pair.of(InventoryMenu.BLOCK_ATLAS, InventoryMenu.EMPTY_ARMOR_SLOT_SHIELD)
}
}
init {
addInventorySlots(autoFrame = false)
craftingSlots.forEach(this::addSlot)
@ -58,9 +65,6 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
armorSlots.forEach(this::addSlot)
}
val craftingResultContainer = ResultContainer()
val craftingResultSlot = ResultSlot(capability.ply, craftingGrid, craftingResultContainer, 0, 0, 0)
override fun slotsChanged(container: Container) {
super.slotsChanged(container)
@ -90,8 +94,6 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
}
init {
addSlot(craftingResultSlot)
if (capability.ply is ServerPlayer) {
setSynchronizer(Companion)
}