Package io.github.vicen621.guiapi
Class InventoryGUI
Object
InventoryGUI
-
Constructor Summary
ConstructorsConstructorDescriptionInventoryGUI(String id, String title)Constructs a new InventoryGUI with an ID and a titleInventoryGUI(String id, String title, int rowAmount)Constructs a new InventoryGUI with an ID, title and row amount -
Method Summary
Modifier and TypeMethodDescriptionvoidfill(ItemStack item)Fills the inventory with the given ItemStackgetButtonID(int slot)Gets the ID of the button in the given slotInventoryGets the inventory of the InventoryGUIbooleanisButton(int slot)Check if the given slot is a buttonvoidopen(OfflinePlayer p)Opens the inventory to the given playervoidSets a button into the InventoryGUIvoidsetColumn(int column, ItemStack item)Fills the given column with the given ItemStackvoidsetIntersected(ItemStack item1, ItemStack item2)Fill the inventory with the given items in an intersected shapevoidsetRow(int row, ItemStack item)Fills the given row with the given ItemStack
-
Constructor Details
-
InventoryGUI
Constructs a new InventoryGUI with an ID and a title- Parameters:
id- Inventory IDtitle- Title of the inventory
-
InventoryGUI
Constructs a new InventoryGUI with an ID, title and row amount- Parameters:
id- ID of the inventorytitle- Title of the inventoryrowAmount- Rows of the inventory
-
-
Method Details
-
open
public void open(OfflinePlayer p)Opens the inventory to the given player- Parameters:
p- Player to open inventory to- See Also:
- Player
-
setButton
Sets a button into the InventoryGUI- Parameters:
id- ID of the buttonslot- Slot in which the button must gobutton- ItemStack of the button- See Also:
- ItemStack
-
setColumn
public void setColumn(int column, ItemStack item)Fills the given column with the given ItemStack- Parameters:
column- Number of the columnitem- ItemStack with which to be filled- See Also:
- ItemStack
-
setIntersected
public void setIntersected(ItemStack item1, ItemStack item2)Fill the inventory with the given items in an intersected shape- Parameters:
item1- ItemStack in the first slotitem2- ItemStack in the second slot- See Also:
- ItemStack
-
setRow
public void setRow(int row, ItemStack item)Fills the given row with the given ItemStack- Parameters:
row- Number of rowitem- ItemStack with which to be filled- See Also:
- ItemStack
-
fill
public void fill(ItemStack item)Fills the inventory with the given ItemStack- Parameters:
item- ItemStack with which to be filled- See Also:
- ItemStack
-
getInventory
public Inventory getInventory()Gets the inventory of the InventoryGUI- Returns:
- The inventory of the InventoryGUI
- See Also:
- Inventory
-
getButtonID
Gets the ID of the button in the given slot- Parameters:
slot- Slot of the button- Returns:
- The ID of the button
-
isButton
public boolean isButton(int slot)Check if the given slot is a button- Parameters:
slot- Slot of the possible button- Returns:
- True if the slot is a button
-