Update InventoryGUIBuilder.kt
This commit is contained in:
@@ -60,14 +60,14 @@ class InventoryGUIPageBuilder<T : ForInventory>(
|
|||||||
* function is invoked.
|
* function is invoked.
|
||||||
*/
|
*/
|
||||||
fun button(slots: InventorySlotCompound<T>, itemStack: ItemStack, onClick: (InventoryGUIClickEvent<T>) -> Unit) =
|
fun button(slots: InventorySlotCompound<T>, itemStack: ItemStack, onClick: (InventoryGUIClickEvent<T>) -> Unit) =
|
||||||
defineSlots(slots, InventoryGUIButton(InventoryGUIElementData(itemStack), onClick))
|
defineSlots(slots, InventoryGUIButton(itemStack, onClick))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An item protected from any player actions.
|
* An item protected from any player actions.
|
||||||
* This is not a button.
|
* This is not a button.
|
||||||
*/
|
*/
|
||||||
fun placeholder(slots: InventorySlotCompound<T>, itemStack: ItemStack) =
|
fun placeholder(slots: InventorySlotCompound<T>, itemStack: ItemStack) =
|
||||||
defineSlots(slots, InventoryGUIPlaceholder(InventoryGUIElementData(itemStack)))
|
defineSlots(slots, InventoryGUIPlaceholder(itemStack))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A free slot does not block any player actions.
|
* A free slot does not block any player actions.
|
||||||
@@ -87,7 +87,7 @@ class InventoryGUIPageBuilder<T : ForInventory>(
|
|||||||
onChange: ((InventoryGUIClickEvent<T>) -> Unit)? = null
|
onChange: ((InventoryGUIClickEvent<T>) -> Unit)? = null
|
||||||
) = defineSlots(
|
) = defineSlots(
|
||||||
slots, InventoryGUIButtonPageChange(
|
slots, InventoryGUIButtonPageChange(
|
||||||
InventoryGUIElementData(itemStack),
|
itemStack,
|
||||||
InventoryGUIPageChangeCalculator.InventoryGUIConsistentPageCalculator(toPage),
|
InventoryGUIPageChangeCalculator.InventoryGUIConsistentPageCalculator(toPage),
|
||||||
onChange
|
onChange
|
||||||
)
|
)
|
||||||
@@ -104,7 +104,7 @@ class InventoryGUIPageBuilder<T : ForInventory>(
|
|||||||
onChange: ((InventoryGUIClickEvent<T>) -> Unit)? = null
|
onChange: ((InventoryGUIClickEvent<T>) -> Unit)? = null
|
||||||
) = defineSlots(
|
) = defineSlots(
|
||||||
slots, InventoryGUIButtonPageChange(
|
slots, InventoryGUIButtonPageChange(
|
||||||
InventoryGUIElementData(itemStack),
|
itemStack,
|
||||||
InventoryGUIPageChangeCalculator.InventoryGUIPreviousPageCalculator,
|
InventoryGUIPageChangeCalculator.InventoryGUIPreviousPageCalculator,
|
||||||
onChange
|
onChange
|
||||||
)
|
)
|
||||||
@@ -121,7 +121,7 @@ class InventoryGUIPageBuilder<T : ForInventory>(
|
|||||||
onChange: ((InventoryGUIClickEvent<T>) -> Unit)? = null
|
onChange: ((InventoryGUIClickEvent<T>) -> Unit)? = null
|
||||||
) = defineSlots(
|
) = defineSlots(
|
||||||
slots, InventoryGUIButtonPageChange(
|
slots, InventoryGUIButtonPageChange(
|
||||||
InventoryGUIElementData(itemStack),
|
itemStack,
|
||||||
InventoryGUIPageChangeCalculator.InventoryGUINextPageCalculator,
|
InventoryGUIPageChangeCalculator.InventoryGUINextPageCalculator,
|
||||||
onChange
|
onChange
|
||||||
)
|
)
|
||||||
@@ -139,7 +139,7 @@ class InventoryGUIPageBuilder<T : ForInventory>(
|
|||||||
onChange: ((InventoryGUIClickEvent<T>) -> Unit)? = null
|
onChange: ((InventoryGUIClickEvent<T>) -> Unit)? = null
|
||||||
) = defineSlots(
|
) = defineSlots(
|
||||||
slots, InventoryGUIButtonInventoryChange(
|
slots, InventoryGUIButtonInventoryChange(
|
||||||
InventoryGUIElementData(itemStack),
|
itemStack,
|
||||||
newGUI,
|
newGUI,
|
||||||
newPage,
|
newPage,
|
||||||
onChange
|
onChange
|
||||||
|
Reference in New Issue
Block a user