Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- init(PlayerRef)
- clientOpenWindow(Ref, Window, Store)
- openWindow(Ref, Window, Store)
- openWindows(Ref, Store, Window...)
- setWindow(int, Window)
- getWindow(int)
- getWindows()
- updateWindow(Window)
- closeWindow(Ref, int, ComponentAccessor)
- closeAllWindows(Ref, ComponentAccessor)
- markWindowChanged(int)
- updateWindows()
- validateWindows(Ref, ComponentAccessor)
- closeAndRemoveAll(Map)
- toString()
Class WindowManager
java.lang.Object
com.hypixel.hytale.server.core.entity.entities.player.windows.WindowManager
A manager for managing active windows for a player, such as crafting benches and chest containers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclientOpenWindow(Ref<EntityStore> ref, Window window, Store<EntityStore> store) Called to open a given inventory window via this manager.voidcloseAllWindows(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Called to close all windows associated with this manager.static <W extends Window>
voidcloseAndRemoveAll(Map<UUID, W> windows) Called to close and remove all windows from the provided map of windows.closeWindow(Ref<EntityStore> ref, int id, ComponentAccessor<EntityStore> componentAccessor) Called to close the window affiliated with the given ID.getWindow(int id) Called to fetch a specific window instance from the given ID.Called to fetch a collection of all active windows.voidCalled to set the player ref associated with this window manager.voidmarkWindowChanged(int id) Called to mark a specific window as dirty and needing synced.openWindow(Ref<EntityStore> ref, Window window, Store<EntityStore> store) Called to open a specific window instance via this manager.openWindows(Ref<EntityStore> ref, Store<EntityStore> store, Window... windows) Called to open the given collection of windows via this window manager.voidCalled to set the current active window, from the given ID and window instance.toString()voidupdateWindow(Window window) Called to send a window update packet to the associated client player.voidCalled to update each window associated with this manager.voidvalidateWindows(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Called to validate all windows associated with this manager.
-
Constructor Details
-
WindowManager
public WindowManager()
-
-
Method Details
-
init
Called to set the player ref associated with this window manager.- Parameters:
playerRef- The player ref of the associated player.
-
clientOpenWindow
@Nullable public UpdateWindow clientOpenWindow(@Nonnull Ref<EntityStore> ref, @Nonnull Window window, @Nonnull Store<EntityStore> store) Called to open a given inventory window via this manager.- Parameters:
ref- The entity store reference of the player opening the window.window- The window instance to open.store- The entity store of the player opening the window.- Returns:
- an
UpdateWindowpacket to be sent to the client, ornullif the window failed to open.
-
openWindow
@Nullable public OpenWindow openWindow(@Nonnull Ref<EntityStore> ref, @Nonnull Window window, @Nonnull Store<EntityStore> store) Called to open a specific window instance via this manager.- Parameters:
ref- The entity store reference of the player opening the window.window- The window instance to be opened.store- The entity store of the player opening the window.- Returns:
- an
OpenWindowpacket to be sent to the client.
-
openWindows
@Nullable public List<OpenWindow> openWindows(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull Window... windows) Called to open the given collection of windows via this window manager.- Parameters:
ref- The entity store reference of the player opening the windows.store- The entity store of the player opening the windows.windows- The collection of windows to be opened.- Returns:
- a list of
OpenWindowpackets to send to the client.
-
setWindow
Called to set the current active window, from the given ID and window instance.- Parameters:
id- The ID of the window.window- The window instance to set.
-
getWindow
-
getWindows
-
updateWindow
-
closeWindow
@Nonnull public Window closeWindow(@Nonnull Ref<EntityStore> ref, int id, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to close the window affiliated with the given ID.- Parameters:
ref- The entity store reference of the player closing the window.id- The unique ID of the window to close.componentAccessor- The entity store of the player closing the window.- Returns:
- the window that has been closed.
-
closeAllWindows
public void closeAllWindows(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to close all windows associated with this manager.- Parameters:
ref- The entity reference of the affiliated entity.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
markWindowChanged
public void markWindowChanged(int id) Called to mark a specific window as dirty and needing synced.- Parameters:
id- The unique ID of the window.
-
updateWindows
public void updateWindows()Called to update each window associated with this manager. -
validateWindows
public void validateWindows(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to validate all windows associated with this manager. -
closeAndRemoveAll
-
toString
-