接口 IGui
- 所有已知实现类:
InventoryGui
public interface IGui
-
方法概要
修饰符和类型方法说明default voidcallbackItem(int slot, org.bukkit.inventory.ItemStack item, GuiClickCallback callback) Put item in specified slot with callbackorg.bukkit.inventory.InventorycreateInventory(org.bukkit.entity.Player holder) Create new inventory with specified ownervoiddontBlockOperation(int slot) Set a slot that does not block operationsdefault voidfill(int start, int end, org.bukkit.inventory.ItemStack item) Fill with specified itemintgetSize()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
-
方法详细资料
-
putItem
void putItem(int slot, org.bukkit.inventory.ItemStack stack) Put item in specified slot- 参数:
slot- slot numberstack- item
-
putCallback
Set click callback in specified slot- 参数:
slot- slot numbercallback- callback
-
callbackItem
Put item in specified slot with callback- 参数:
slot- slot numberitem- itemcallback- callback
-
dontBlockOperation
void dontBlockOperation(int slot) Set a slot that does not block operations- 参数:
slot- Target slot number
-
isDontBlockOperation
boolean isDontBlockOperation(int slot) Get if a slot does not block operations- 参数:
slot- Target slot number- 返回:
- result
-
setTitle
void setTitle(net.kyori.adventure.text.Component component) Set inventory title- 参数:
component- title
-
getTitle
net.kyori.adventure.text.Component getTitle()Get current inventory title- 返回:
- title
-
setSize
void setSize(int size) Set maximum size (may reset contents in current instance)- 参数:
size- Target size
-
getSize
int getSize()Get current size- 返回:
- size
-
fill
default void fill(int start, int end, org.bukkit.inventory.ItemStack item) Fill with specified item- 参数:
start- start slotend- end slotitem- item
-
createInventory
org.bukkit.inventory.Inventory createInventory(org.bukkit.entity.Player holder) Create new inventory with specified owner- 参数:
holder- owner- 返回:
- created
-
onSlotClick
@Internal boolean onSlotClick(org.bukkit.entity.Player who, org.bukkit.event.inventory.InventoryClickEvent event, OpenedGui gui) Click handler- 参数:
who- Who clickedevent- Click eventgui- Opened GUI data- 返回:
- If event cancellation needed
-