Class BaseCanvasGUI<C extends GUIPane>
java.lang.Object
de.placeblock.betterinventories.gui.GUI
de.placeblock.betterinventories.gui.impl.BaseCanvasGUI<C>
- Type Parameters:
C- The type of the Canvas
- Direct Known Subclasses:
BaseChestGUI,CanvasGUI
The Base Class for GUIs which only have just one canvas e.g. Chest, Hopper, Crafting...
If you want to instantiate this one use
CanvasGUI.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBaseCanvasGUI.AbstractBuilder<B extends BaseCanvasGUI.AbstractBuilder<B,G, C, P>, G extends BaseCanvasGUI<C>, C extends GUIPane, P extends org.bukkit.plugin.java.JavaPlugin> Builder for creating BaseCanvasGUIsNested classes/interfaces inherited from class de.placeblock.betterinventories.gui.GUI
GUI.Builder<B extends GUI.Builder<B,G, P>, G extends GUI, P extends org.bukkit.plugin.java.JavaPlugin> -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseCanvasGUI(org.bukkit.plugin.Plugin plugin, net.kyori.adventure.text.TextComponent title, org.bukkit.event.inventory.InventoryType type, boolean removeItems) Creates a new BaseCanvasGUI -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.InventoryCreates a new Bukkit Inventory for the GUI when implementedgetSize()intgetSlots()voidprovideItem(org.bukkit.inventory.ItemStack item) Used to provide items to GUIPanes.List<org.bukkit.inventory.ItemStack>Renders the GUI on a listvoidsearchSection(SearchData searchData) Searches the GUI recursively.protected voidSets the canvas for this GUI.Methods inherited from class de.placeblock.betterinventories.gui.GUI
getPlayers, getView, getView, onClose, reloadViews, removePlayer, showPlayer, update, updateTitle
-
Field Details
-
canvas
The main canvas to which Sections can be added
-
-
Constructor Details
-
BaseCanvasGUI
protected BaseCanvasGUI(org.bukkit.plugin.Plugin plugin, net.kyori.adventure.text.TextComponent title, org.bukkit.event.inventory.InventoryType type, boolean removeItems) Creates a new BaseCanvasGUI- Parameters:
plugin- The plugintitle- The title of the GUItype- The type of the GUIremoveItems- Whether to remove loose items on close. The first player that closes the gui gets the items
-
-
Method Details
-
setCanvas
Sets the canvas for this GUI. Should be done before usinggetCanvas()- Parameters:
canvas- The canvas to be set
-
getSlots
public int getSlots() -
createBukkitInventory
public org.bukkit.inventory.Inventory createBukkitInventory()Description copied from class:GUICreates a new Bukkit Inventory for the GUI when implemented- Specified by:
createBukkitInventoryin classGUI- Returns:
- A new Bukkit Inventory matching the size or type of this GUI
-
getSize
- Returns:
- The Size of this GUI as a Vector
-
renderContent
Description copied from class:GUIRenders the GUI on a list- Specified by:
renderContentin classGUI- Returns:
- The rendered representation of the canvas
-
searchSection
Searches the GUI recursively. The SearchData is filled recursively.- Specified by:
searchSectionin classGUI- Parameters:
searchData- The searchData that contains all needed information
-
provideItem
public void provideItem(org.bukkit.inventory.ItemStack item) Description copied from class:GUIUsed to provide items to GUIPanes. The amount of the ItemStack will be modified if a pane accepted an ItemStack.- Specified by:
provideItemin classGUI- Parameters:
item- The ItemStack that is provided.
-
getCanvas
- Returns:
- The main canvas
-