diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExoSuitInventoryMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExoSuitInventoryMenu.kt index 131e52a6f..295aeec60 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExoSuitInventoryMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ExoSuitInventoryMenu.kt @@ -19,20 +19,6 @@ class ExoSuitInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen var lastScroll = 0 override val storageSlots: Collection get() = listOf() - init { - if (capability.ply is ServerPlayer) { - addSlotListener(capability.ply.containerListener) - } - } - - val armorSlots: List = makeArmorSlots() - - val offhandSlot = object : InventorySlot(capability.ply.inventory, 40) { - override fun getNoItemIcon(): Pair { - return Pair.of(InventoryMenu.BLOCK_ATLAS, InventoryMenu.EMPTY_ARMOR_SLOT_SHIELD) - } - } - val craftingGrid: CraftingContainer val craftingSlots: List @@ -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 = makeArmorSlots() + + val offhandSlot = object : InventorySlot(capability.ply.inventory, 40) { + override fun getNoItemIcon(): Pair { + 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) }