类 InventoryGui
java.lang.Object
cn.afternode.commons.bukkit.gui.InventoryGui
- 所有已实现的接口:
IGui
-
构造器概要
构造器构造器说明Create new chest GUI with default size and titleInventoryGui(int size) Create new chest GUI with specified sizeInventoryGui(int size, net.kyori.adventure.text.Component title) Create new chest GUI with specified size and titleInventoryGui(net.kyori.adventure.text.Component title) Create new chest GUi with specified title -
方法概要
修饰符和类型方法说明org.bukkit.inventory.InventorycreateInventory(org.bukkit.entity.Player holder) Create new inventory with specified ownervoiddontBlockOperation(int slot) Set a slot that does not block operationsintgetSize()Get current sizenet.kyori.adventure.text.ComponentgetTitle()Get current inventory titlebooleanisDontBlockOperation(int slot) Get if a slot does not block operationsbooleanonSlotClick(org.bukkit.entity.Player who, org.bukkit.event.inventory.InventoryClickEvent event, OpenedGui gui) Click handlervoidputCallback(int slot, GuiClickCallback callback) Set click callback in specified slotvoidputItem(int slot, org.bukkit.inventory.ItemStack stack) Put item in specified slotvoidsetSize(int size) Set maximum size (may reset contents in current instance)voidsetTitle(net.kyori.adventure.text.Component component) Set inventory title从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.afternode.commons.bukkit.gui.IGui
callbackItem, fill
-
构造器详细资料
-
InventoryGui
public InventoryGui(int size, net.kyori.adventure.text.Component title) Create new chest GUI with specified size and title- 参数:
size- sizetitle- title
-
InventoryGui
public InventoryGui(int size) Create new chest GUI with specified size- 参数:
size- size
-
InventoryGui
public InventoryGui(net.kyori.adventure.text.Component title) Create new chest GUi with specified title- 参数:
title- title
-
InventoryGui
public InventoryGui()Create new chest GUI with default size and title
-
-
方法详细资料
-
putItem
public void putItem(int slot, org.bukkit.inventory.ItemStack stack) 从接口复制的说明:IGuiPut item in specified slot -
putCallback
从接口复制的说明:IGuiSet click callback in specified slot- 指定者:
putCallback在接口中IGui- 参数:
slot- slot numbercallback- callback
-
dontBlockOperation
public void dontBlockOperation(int slot) 从接口复制的说明:IGuiSet a slot that does not block operations- 指定者:
dontBlockOperation在接口中IGui- 参数:
slot- Target slot number
-
isDontBlockOperation
public boolean isDontBlockOperation(int slot) 从接口复制的说明:IGuiGet if a slot does not block operations- 指定者:
isDontBlockOperation在接口中IGui- 参数:
slot- Target slot number- 返回:
- result
-
setTitle
public void setTitle(net.kyori.adventure.text.Component component) 从接口复制的说明:IGuiSet inventory title -
getTitle
public net.kyori.adventure.text.Component getTitle()从接口复制的说明:IGuiGet current inventory title -
setSize
public void setSize(int size) 从接口复制的说明:IGuiSet maximum size (may reset contents in current instance) -
getSize
public int getSize()从接口复制的说明:IGuiGet current size -
createInventory
public org.bukkit.inventory.Inventory createInventory(org.bukkit.entity.Player holder) 从接口复制的说明:IGuiCreate new inventory with specified owner- 指定者:
createInventory在接口中IGui- 参数:
holder- owner- 返回:
- created
-
onSlotClick
public boolean onSlotClick(org.bukkit.entity.Player who, org.bukkit.event.inventory.InventoryClickEvent event, OpenedGui gui) 从接口复制的说明:IGuiClick handler- 指定者:
onSlotClick在接口中IGui- 参数:
who- Who clickedevent- Click eventgui- Opened GUI data- 返回:
- If event cancellation needed
-