PageBuilder

inner class PageBuilder(val key: String, val number: Int)(source)

Constructors

Link copied to clipboard
constructor(key: String, number: Int)

Properties

Link copied to clipboard

Effect used for transitions from this page. If this is not null and effectTo is null, this will be used as a fallback.

Link copied to clipboard

Effect used for transitions to this page. If this is not null, it will always be used even if effectFrom is not null aswell.

Link copied to clipboard
val key: String
Link copied to clipboard
val number: Int

Functions

Link copied to clipboard
fun button(slots: GuiSlotCompound, icon: GuiIcon, onClick: suspend (GuiClickEvent) -> Unit)

Adds a button. A button has custom onClick logic.

Link copied to clipboard
fun changePageByKey(slots: GuiSlotCompound, icon: GuiIcon, pageKey: Any, shouldChange: suspend (GuiClickEvent) -> Boolean = { true }, onChange: suspend (GuiClickEvent) -> Unit? = null)

Adds a page change button, which will open the specified page when clicked.

Link copied to clipboard
fun changePageByNumber(slots: GuiSlotCompound, icon: GuiIcon, pageNumber: Int, shouldChange: suspend (GuiClickEvent) -> Boolean = { true }, onChange: suspend (GuiClickEvent) -> Unit? = null)

Adds a page change button, which will open the specified page when clicked.

Link copied to clipboard
fun <E> compound(slots: GuiSlotCompound.SlotRange.Rectangle, content: AbstractGuiList<E, List<E>>, iconGenerator: suspend (E) -> ItemStack, onClick: suspend (event: GuiClickEvent, element: E) -> Unit? = null): GuiCompound<E>

Creates a new rectangular compound (startSlot and endSlot define the corners of the compound).

Link copied to clipboard
fun compoundScroll(slots: GuiSlotCompound, icon: GuiIcon, compound: GuiCompound<*>, reverse: Boolean, speed: Duration = 1.ticks, scrollDistance: Int = compound.compoundWidth, scrollTimes: Int = compound.compoundHeight)

Adds a compound scroll button.

Link copied to clipboard
fun compoundScrollBackwards(slots: GuiSlotCompound, icon: GuiIcon, compound: GuiCompound<*>, speed: Duration = 1.ticks, scrollTimes: Int = compound.compoundHeight)

Adds a compound scroll button.

Link copied to clipboard
fun compoundScrollForwards(slots: GuiSlotCompound, icon: GuiIcon, compound: GuiCompound<*>, speed: Duration = 1.ticks, scrollTimes: Int = compound.compoundHeight)

Adds a compound scroll button.

Link copied to clipboard
fun element(guiSlotCompound: GuiSlotCompound, element: GuiElement)

Adds the given element for each given slot to the gui.

Link copied to clipboard
fun freeSlot(slots: GuiSlotCompound, onClick: suspend (GuiClickEvent) -> Unit? = null)

Adds a free slot. A free slot allows player interaction.

Link copied to clipboard
fun nextPage(slots: GuiSlotCompound, icon: GuiIcon, shouldChange: suspend (GuiClickEvent) -> Boolean = { true }, onChange: suspend (GuiClickEvent) -> Unit? = null)

Adds a page change button, which will open the next page when clicked.

Link copied to clipboard

Adds a placeholder. A placeholder ignores any click actions.

Link copied to clipboard
fun previousPage(slots: GuiSlotCompound, icon: GuiIcon, shouldChange: suspend (GuiClickEvent) -> Boolean = { true }, onChange: suspend (GuiClickEvent) -> Unit? = null)

Adds a page change button, which will open the previous page when clicked.

Link copied to clipboard

Sets both effectTo and effectFrom at the same time.