Class ChestGUI
java.lang.Object
de.marcely.bedwars.tools.gui.type.ChestGUI
- All Implemented Interfaces:
- ClickableGUI,- GUI
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddCloseListener(Consumer<Player> callback) Adds a close listener to the gui.intaddItem(GUIItem item, @Nullable AddItemCondition condition) Adds the item at the next available slot.booleanReturns if this type allows its items to get moved around and to be droppedvoidclear()Resets its contentvoidcloseAll()Closes this GUI for any playervoidReplaces any slot with the given itemvoidReplaces any empty/air slot with the given itemintReturns the amount of items that fit in a column@Nullable GUIItemgetItem(int slot) Returns the item at the specific slot.intgetNextSpace(@Nullable AddItemCondition condition) Starts at slot 0 and tries to find the next available/empty slot.
 Returns -1 if it didn't find anyReturns the player for whom the GUI is currently opengetTitle()Returns the set titleintgetWidth()Returns the amount of items that fit in a rowbooleanGet whether the given player has the inventory currently openbooleanIgnore it.booleanCopy over everything from another instance to this instance.voidOpens the GUI for the playerbooleanremoveCloseListener(Consumer<Player> callback) Removes a close listener from the gui.voidsetHeight(int height) Resizes the inventory and tries to keep the contentvoidSet an item at a specific slotvoidSet the title of the GUI.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.marcely.bedwars.tools.gui.ClickableGUIaddItem, addItem, addItem, addItem, addItem, calcSlot, fill, fill, fillSpace, fillSpace, formatAnyColumn, formatAnyColumn, formatAnyRow, formatAnyRow, formatColumn, formatColumn, formatRow, formatRow, getItem, getNextSpace, getSize, setItem, setItem, setItem, setItem, setItemMethods inherited from interface de.marcely.bedwars.tools.gui.GUIgetCloseListeners, onClose
- 
Constructor Details- 
ChestGUIpublic ChestGUI()
- 
ChestGUIpublic ChestGUI(int height) 
- 
ChestGUI
- 
ChestGUI
 
- 
- 
Method Details- 
openDescription copied from interface:GUIOpens the GUI for the player
- 
closeAllpublic void closeAll()Description copied from interface:GUICloses this GUI for any player
- 
setTitleDescription copied from interface:GUISet the title of the GUI. Keep in mind that not every type supports this
- 
getTitleDescription copied from interface:GUIReturns the set title
- 
areItemsMoveablepublic boolean areItemsMoveable()Description copied from interface:GUIReturns if this type allows its items to get moved around and to be dropped- Specified by:
- areItemsMoveablein interface- GUI
- Returns:
- If the items are moveable/dragable
 
- 
ignoresCancelEventpublic boolean ignoresCancelEvent()Description copied from interface:GUIIgnore it. Only for internal use- Specified by:
- ignoresCancelEventin interface- GUI
- Returns:
- Something you probably don't need
 
- 
getPlayersDescription copied from interface:GUIReturns the player for whom the GUI is currently open- Specified by:
- getPlayersin interface- GUI
- Returns:
- The players for who the GUI has been opened
 
- 
hasOpenDescription copied from interface:GUIGet whether the given player has the inventory currently open
- 
addCloseListenerDescription copied from interface:GUIAdds a close listener to the gui. This listener will be called when a player closes the gui- Specified by:
- addCloseListenerin interface- GUI
- Parameters:
- callback- the listener that is being added
- Returns:
- if the listener was added successfully
 
- 
removeCloseListenerDescription copied from interface:GUIRemoves a close listener from the gui.- Specified by:
- removeCloseListenerin interface- GUI
- Parameters:
- callback- the listener that is being removed
- Returns:
- if the listener was removed successfully
 
- 
getWidthpublic int getWidth()Description copied from interface:ClickableGUIReturns the amount of items that fit in a row- Specified by:
- getWidthin interface- ClickableGUI
- Returns:
- The width of the GUI
 
- 
getHeightpublic int getHeight()Description copied from interface:ClickableGUIReturns the amount of items that fit in a column- Specified by:
- getHeightin interface- ClickableGUI
- Returns:
- The width of the GUI
 
- 
setItemDescription copied from interface:ClickableGUISet an item at a specific slot- Specified by:
- setItemin interface- ClickableGUI
- Parameters:
- item- The item to be set
- slot- The target slot
 
- 
getItemDescription copied from interface:ClickableGUIReturns the item at the specific slot. May return null if there's none- Specified by:
- getItemin interface- ClickableGUI
- Parameters:
- slot- The slot at which the item may be
- Returns:
- The placed item. May be null
 
- 
setHeightpublic void setHeight(int height) Resizes the inventory and tries to keep the content- Parameters:
- height- The new height
 
- 
clearpublic void clear()Description copied from interface:GUIResets its content
- 
fillDescription copied from interface:ClickableGUIReplaces any slot with the given item- Specified by:
- fillin interface- ClickableGUI
- Parameters:
- item- The given item
 
- 
fillSpaceDescription copied from interface:ClickableGUIReplaces any empty/air slot with the given item- Specified by:
- fillSpacein interface- ClickableGUI
- Parameters:
- item- The given item
 
- 
getNextSpaceDescription copied from interface:ClickableGUIStarts at slot 0 and tries to find the next available/empty slot.
 Returns -1 if it didn't find any- Specified by:
- getNextSpacein interface- ClickableGUI
- Parameters:
- condition- You may specify the search at a specific area
- Returns:
- The next available/empty slot. -1 if the inventory is full
 
- 
addItemAdds the item at the next available slot.Keep in mind that items with the same materials don't get filled up. 
 Also tries to increase height of inventory to make space for items.- Specified by:
- addItemin interface- ClickableGUI
- Parameters:
- item- The item you want to add
- condition- You may specify the search at a specific area
- Returns:
- The slot to which it was added. -1 if the inventory is full
 
- 
mergeFromCopy over everything from another instance to this instance.This is used to display new content while avoiding flicker. - Parameters:
- gui- The GUI from which things shall be copied
- forceRecreate- Different titles and heights require inventory reconstruction. Set this to- falseif you don't want that
- Returns:
- trueif it was successful.- falseif it got cancelled due to- forceRecreatebeing false
 
 
-