The space of a rect slot compound can not be modified anymore

This commit is contained in:
bluefireoly
2020-10-29 20:14:17 +01:00
parent 29d27b43d5
commit b8a44d0df5

View File

@@ -188,13 +188,28 @@ class GUIPageBuilder<T : ForInventory>(
onClick: (clickEvent: GUIClickEvent<T>, element: E) -> Unit
) = GUISpaceCompound(type, iconGenerator, onClick)
/**
* Defines an area where the content of the given compound
* is displayed.
*/
fun <E> compoundSpace(
slots: InventorySlotCompound<T>,
compound: GUISpaceCompound<T, E>
) {
compound.addSlots(slots)
defineSlots(
slots,
GUISpaceCompoundElement(compound)
)
}
/**
* Creates a new compound, holding data which can be displayed
* in any compound space.
* This compound is strictly a rectangle.
* The space is automatically defined.
*/
fun <E> createCompound(
fun <E> createRectCompound(
fromSlot: SingleInventorySlot<out T>,
toSlot: SingleInventorySlot<out T>,
iconGenerator: (E) -> ItemStack,
@@ -215,21 +230,6 @@ class GUIPageBuilder<T : ForInventory>(
}
}
/**
* Defines an area where the content of the given compound
* is displayed.
*/
fun <E> compoundSpace(
slots: InventorySlotCompound<T>,
compound: AbstractGUISpaceCompound<T, E>
) {
compound.addSlots(slots)
defineSlots(
slots,
GUISpaceCompoundElement(compound)
)
}
/**
* By pressing this button,
* the user scrolls forwards or backwards in the compound.