Package Kyu.GuiAPI_Redone.Item
Class GuiItem
java.lang.Object
Kyu.GuiAPI_Redone.Item.GuiItem
-
Constructor Summary
ConstructorsConstructorDescriptionGuiItem
(org.bukkit.inventory.ItemStack stack) Creates a new Item with the specified ItemStackCreates a new Item with the specified ValuesCreates a new Item with the specified Values -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the link between item and window, that causes the item to refresh this window if changes are made to the itemorg.bukkit.inventory.ItemStack
void
removeWindow
(Window window) Remove the link between item and window, that causes the item not the refresh in the specified window if changes are madevoid
setItemStack
(org.bukkit.inventory.ItemStack itemStack) Sets a new ItemStack and updates all Windows with the itemvoid
setListener
(GuiItemClickListener listener) Manually set the Listener for when the item is clickedvoid
Sets the lore of the Item and updates all Windows with the itemvoid
Change the name of the itemstackwithListener
(GuiItemClickListener listener)
-
Constructor Details
-
GuiItem
public GuiItem(org.bukkit.inventory.ItemStack stack) Creates a new Item with the specified ItemStack- Parameters:
stack
-
-
GuiItem
Creates a new Item with the specified Values- Parameters:
stack
- ItemStack of the Itemtitle
- Name of the Item (will be color translated)lore
- Lore of the item (if wanted), each string is a new line
-
GuiItem
Creates a new Item with the specified Values- Parameters:
material
- Material of the Itemname
- Name of the Item (will be color translated)amountInStack
- Size of the ItemStacklore
- Lore of the item (if wanted), each string is a new line
-
-
Method Details
-
withListener
- Parameters:
listener
- What to be called when the item gets clicked in the inventory- Returns:
- the item again for continued building
-
setListener
Manually set the Listener for when the item is clicked- Parameters:
listener
- What to be called when the item gets clicked in the inventory
-
setItemStack
public void setItemStack(org.bukkit.inventory.ItemStack itemStack) Sets a new ItemStack and updates all Windows with the item- Parameters:
itemStack
- the new ItemStack
-
setLore
Sets the lore of the Item and updates all Windows with the item- Parameters:
lore
- the new lore, each string is a new line (will be color translated)
-
setName
Change the name of the itemstack- Parameters:
name
-
-
getListener
- Returns:
- Listener for when the item gets clicked in the inventory
-
getItemStack
public org.bukkit.inventory.ItemStack getItemStack()- Returns:
- the itemstack of the item
-
addWindow
Add the link between item and window, that causes the item to refresh this window if changes are made to the item- Parameters:
window
-
-
removeWindow
Remove the link between item and window, that causes the item not the refresh in the specified window if changes are made- Parameters:
window
-
-