Class FurnaceGui
java.lang.Object
com.github.stefvanschie.inventoryframework.gui.type.util.Gui
com.github.stefvanschie.inventoryframework.gui.type.util.NamedGui
com.github.stefvanschie.inventoryframework.gui.type.FurnaceGui
- All Implemented Interfaces:
InventoryBased, InventoryHolder
Represents a gui in the form of a furnace
- Since:
- 0.8.0
-
Field Summary
Fields inherited from class Gui
humanEntityCache, inventory, onBottomClick, onBottomDrag, onClose, onGlobalClick, onGlobalDrag, onOutsideClick, onTopClick, onTopDrag, plugin, updating -
Constructor Summary
ConstructorsConstructorDescriptionFurnaceGui(@NotNull com.github.stefvanschie.inventoryframework.adventuresupport.TextHolder title) Constructs a new GUIFurnaceGui(@NotNull com.github.stefvanschie.inventoryframework.adventuresupport.TextHolder title, @NotNull Plugin plugin) Constructs a new furnace gui for the givenplugin.FurnaceGui(@NotNull String title) Constructs a new GUIFurnaceGui(@NotNull String title, @NotNull Plugin plugin) Constructs a new furnace gui for the givenplugin. -
Method Summary
Modifier and TypeMethodDescriptionvoidclick(@NotNull InventoryClickEvent event) This should delegate the provided inventory click event to the right pane, which can then handle this click event further.@NotNull FurnaceGuicopy()Makes a copy of this gui and returns it.@NotNull InventoryCreates a new inventory of the type of the implementing class.@NotNull GuiComponentGets the gui component representing the fuel@NotNull GuiComponentGets the gui component representing the ingredient@NotNull InventorygetItems()Gets all theGuiIteminstances in this gui.@NotNull GuiComponentGets the gui component representing the output@NotNull GuiComponentGets the gui component representing the player inventoryintGets the count ofHumanEntityinstances that are currently viewing this GUI.@NotNull List<HumanEntity> Gets a mutable snapshot of the currentHumanEntityviewers of this GUI.booleanGets whether the player inventory is currently in use.static @Nullable FurnaceGuiload(@NotNull Object instance, @NotNull InputStream inputStream) Loads a furnace gui from an XML file.static @Nullable FurnaceGuiload(@NotNull Object instance, @NotNull InputStream inputStream, @NotNull Plugin plugin) Loads a furnace gui from an XML file.static @NotNull FurnaceGuiLoads a furnace gui from the specified element, applying code references to the provided instance.static @NotNull FurnaceGuiLoads a furnace gui from the specified element, applying code references to the provided instance.voidshow(@NotNull HumanEntity humanEntity) Shows a gui to a playervoidupdate()Update the gui for everyoneMethods inherited from class NamedGui
getTitle, getTitleHolder, isDirty, markChanges, setTitle, setTitleMethods inherited from class Gui
addInventory, callCallback, callOnBottomClick, callOnBottomDrag, callOnClose, callOnGlobalClick, callOnGlobalDrag, callOnOutsideClick, callOnTopClick, callOnTopDrag, getGui, getHumanEntityCache, initializeOrThrow, isUpdating, loadPane, loadPane, navigateToParent, registerGui, registerPane, registerPane, registerProperty, setOnBottomClick, setOnBottomDrag, setOnClose, setOnGlobalClick, setOnGlobalDrag, setOnOutsideClick, setOnTopClick, setOnTopDrag, setParent
-
Constructor Details
-
FurnaceGui
Constructs a new GUI- Parameters:
title- the title/name of this gui.- Since:
- 0.8.0
-
FurnaceGui
public FurnaceGui(@NotNull @NotNull com.github.stefvanschie.inventoryframework.adventuresupport.TextHolder title) Constructs a new GUI- Parameters:
title- the title/name of this gui.- Since:
- 0.10.0
-
FurnaceGui
-
FurnaceGui
public FurnaceGui(@NotNull @NotNull com.github.stefvanschie.inventoryframework.adventuresupport.TextHolder title, @NotNull @NotNull Plugin plugin) Constructs a new furnace gui for the givenplugin.- Parameters:
title- the title/name of this gui.plugin- the owning plugin of this gui- Since:
- 0.10.8
- See Also:
-
-
Method Details
-
update
-
getItems
-
show
Description copied from class:GuiShows a gui to a player -
copy
Description copied from class:GuiMakes a copy of this gui and returns it. This makes a deep copy of the gui. This entails that the underlying panes will be copied as per theirPane.copy()and miscellaneous data will be copied. The copy of this gui, will however have no viewers even if this gui currently has viewers. With this, cache data for viewers will also be non-existent for the copied gui. The original owning plugin of the gui is preserved, but the plugin will not be deeply copied. The returned gui will never be reference equal to the current gui. -
click
Description copied from class:GuiThis should delegate the provided inventory click event to the right pane, which can then handle this click event further. This should not call any internal click handlers, since those will already have been activated. -
getInventory
- Specified by:
getInventoryin interfaceInventoryHolder
-
isPlayerInventoryUsed
@Contract(pure=true) public boolean isPlayerInventoryUsed()Description copied from class:GuiGets whether the player inventory is currently in use. This means whether the player inventory currently has an item in it.- Specified by:
isPlayerInventoryUsedin classGui- Returns:
- true if the player inventory is occupied, false otherwise
-
createInventory
Description copied from interface:InventoryBasedCreates a new inventory of the type of the implementing class.- Specified by:
createInventoryin interfaceInventoryBased- Returns:
- the new inventory
-
getViewerCount
@Contract(pure=true) public int getViewerCount()Description copied from class:GuiGets the count ofHumanEntityinstances that are currently viewing this GUI.- Specified by:
getViewerCountin classGui- Returns:
- the count of viewers
-
getViewers
Description copied from class:GuiGets a mutable snapshot of the currentHumanEntityviewers of this GUI. This is a snapshot (copy) and not a view, therefore modifications aren't visible.- Specified by:
getViewersin classGui- Returns:
- a snapshot of the current viewers
- See Also:
-
getIngredientComponent
Gets the gui component representing the ingredient- Returns:
- the ingredient component
- Since:
- 0.8.0
-
getFuelComponent
Gets the gui component representing the fuel- Returns:
- the fuel component
- Since:
- 0.8.0
-
getOutputComponent
Gets the gui component representing the output- Returns:
- the output component
- Since:
- 0.8.0
-
getPlayerGuiComponent
Gets the gui component representing the player inventory- Returns:
- the player gui component
- Since:
- 0.8.0
-
load
@Nullable @Contract(pure=true) public static @Nullable FurnaceGui load(@NotNull @NotNull Object instance, @NotNull @NotNull InputStream inputStream, @NotNull @NotNull Plugin plugin) Loads a furnace gui from an XML file.- Parameters:
instance- the instance on which to reference fields and methodsinputStream- the input stream containing the XML dataplugin- the plugin that will be the owner of the created gui- Returns:
- the loaded furnace gui
- Since:
- 0.10.8
- See Also:
-
load
@NotNull public static @NotNull FurnaceGui load(@NotNull @NotNull Object instance, @NotNull @NotNull Element element, @NotNull @NotNull Plugin plugin) Loads a furnace gui from the specified element, applying code references to the provided instance.- Parameters:
instance- the instance on which to reference fields and methodselement- the element to load the gui fromplugin- the plugin that will be the owner of the created gui- Returns:
- the loaded furnace gui
- Since:
- 0.10.8
- See Also:
-
load
@Nullable @Contract(pure=true) public static @Nullable FurnaceGui load(@NotNull @NotNull Object instance, @NotNull @NotNull InputStream inputStream) Loads a furnace gui from an XML file.- Parameters:
instance- the instance on which to reference fields and methodsinputStream- the input stream containing the XML data- Returns:
- the loaded furnace gui
- Since:
- 0.8.0
-
load
@NotNull public static @NotNull FurnaceGui load(@NotNull @NotNull Object instance, @NotNull @NotNull Element element) Loads a furnace gui from the specified element, applying code references to the provided instance.- Parameters:
instance- the instance on which to reference fields and methodselement- the element to load the gui from- Returns:
- the loaded furnace gui
- Since:
- 0.8.0
-