Class DefaultGuiViewManager
java.lang.Object
io.github.toberocat.guiengine.view.DefaultGuiViewManager
- All Implemented Interfaces:
GuiViewManager
,org.bukkit.event.Listener
public class DefaultGuiViewManager
extends Object
implements org.bukkit.event.Listener, GuiViewManager
An implementation of the GuiViewManager interface for managing GUI views in a Minecraft plugin.
This class keeps track of the opened inventories and handles various inventory-related events.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable GuiView
getGuiView
(@NotNull UUID player) Get the GUI view associated with the given player UUID.boolean
isViewingGui
(@NotNull UUID player) Check if the given player is currently viewing a GUI.void
registerGui
(@NotNull UUID player, @NotNull GuiView guiView) Register a new GUI view for the given player.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.toberocat.guiengine.view.GuiViewManager
getGuiView, isViewingGui
-
Constructor Details
-
DefaultGuiViewManager
public DefaultGuiViewManager()Create a new instance of DefaultGuiViewManager. It initializes the map to store opened inventories.
-
-
Method Details
-
isViewingGui
Check if the given player is currently viewing a GUI.- Specified by:
isViewingGui
in interfaceGuiViewManager
- Parameters:
player
- The UUID of the player.- Returns:
- true if the player is viewing a GUI, false otherwise.
-
registerGui
Register a new GUI view for the given player.- Specified by:
registerGui
in interfaceGuiViewManager
- Parameters:
player
- The UUID of the player.guiView
- The GuiView to be registered.
-
getGuiView
Get the GUI view associated with the given player UUID.- Specified by:
getGuiView
in interfaceGuiViewManager
- Parameters:
player
- The UUID of the player.- Returns:
- The GuiView associated with the player, or null if not found.
-