Update InventoryGUIBuilder.kt

This commit is contained in:
bluefireoly
2020-10-19 02:27:40 +02:00
parent 5817853096
commit a988535c57

View File

@@ -146,6 +146,17 @@ class InventoryGUIPageBuilder<T : ForInventory>(
)
)
fun <E> compoundSpace(
slots: InventorySlotCompound<T>,
compound: InventoryGUISpaceCompound<T, E>
) {
compound.addSlots(slots)
defineSlots(
slots,
InventoryGUISpaceCompoundElement(compound)
)
}
private fun defineSlots(slots: InventorySlotCompound<T>, element: InventoryGUISlot<T>) =
slots.withInvType(type).forEach { curSlot ->
curSlot.realSlotIn(type.dimensions)?.let { guiSlots[it] = element }