PaginatedGuiBuilder

ページネーション付き GUI テンプレートビルダー

player.showPaginatedGui<CustomItem> {
title = "アイテム一覧"
itemsPerPage = 28

items(ItemRegistry.getAllItems())

render { customItem ->
customItem.createItemStack()
}

onItemClick { item, action ->
if (action.isLeftClick) {
player.inventory.addItem(item.createItemStack())
GuiResult.Success(Unit)
} else {
GuiResult.Silent
}
}
}

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun filter(predicate: (T) -> Boolean)

フィルター条件を設定

Link copied to clipboard
fun items(items: List<T>)

表示するアイテムを設定

Link copied to clipboard
fun onBack(handler: (Player) -> Unit)

戻るボタンクリック時のハンドラー 設定すると左下に戻るボタンが表示される

Link copied to clipboard
fun onItemClick(handler: (T, ClickAction) -> GuiResult<Unit>)

アイテムクリック時のハンドラー

Link copied to clipboard
fun render(renderer: (T) -> ItemStack)

アイテムの表示方法を定義