Contents
Class Window
java.lang.Object
com.hypixel.hytale.server.core.entity.entities.player.windows.Window
- Direct Known Subclasses:
AbilityBenchWindow, BlockWindow, ContainerWindow, FieldCraftingWindow, ItemStackContainerWindow, MemoriesWindow
Represents a single window that a player has open, such as a crafting bench or chest container
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents an event specifically for window closure -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<WindowType, Supplier<? extends Window>> These are windows the client is able to request to open. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Called to close this window.booleanabstract com.google.gson.JsonObjectgetData()intgetId()getType()voidhandleAction(Ref<EntityStore> ref, Store<EntityStore> store, WindowAction action) Called to handle the given action for this windowinthashCode()voidinit(PlayerRef playerRef, WindowManager manager) Called to initialize this window with the given player and window managerregisterCloseEvent(short priority, Consumer<Window.WindowCloseEvent> consumer) Called to register the given consumer as an event to trigger upon the windows closure, with a set priorityregisterCloseEvent(EventPriority priority, Consumer<Window.WindowCloseEvent> consumer) Called to register the given consumer as an event to trigger upon the windows closure, with a set priorityregisterCloseEvent(Consumer<Window.WindowCloseEvent> consumer) Called to register the given consumer as an event to trigger upon the windows closurevoidsetId(int id) Called to set the unique ID of this window
-
Field Details
-
CLIENT_REQUESTABLE_WINDOW_TYPES
These are windows the client is able to request to open.
-
-
Constructor Details
-
Window
Default Constructor for aWindowinstance- Parameters:
windowType- The type of window that this window is
-
-
Method Details
-
init
Called to initialize this window with the given player and window manager- Parameters:
playerRef- The player ref of the affiliated playermanager- The affiliated window manager
-
getData
@Nonnull public abstract com.google.gson.JsonObject getData()- Returns:
- the
JsonObjectdata affiliated with this window
-
handleAction
public void handleAction(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull WindowAction action) Called to handle the given action for this window- Parameters:
ref- The entity ref of the affiliated entitystore- The entity store for component accessaction- The window action to handle
-
getType
- Returns:
- the window type of this window
-
setId
public void setId(int id) Called to set the unique ID of this window- Parameters:
id- The unique ID to set
-
getId
public int getId()- Returns:
- the unique ID of this window
-
getPlayerRef
- Returns:
- the player ref associated with this window
-
close
public void close(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to close this window. -
registerCloseEvent
@Nonnull public EventRegistration registerCloseEvent(@Nonnull Consumer<Window.WindowCloseEvent> consumer) Called to register the given consumer as an event to trigger upon the windows closure- Parameters:
consumer- The consumer to register- Returns:
- the event registration instance upon registration
-
registerCloseEvent
@Nonnull public EventRegistration registerCloseEvent(short priority, @Nonnull Consumer<Window.WindowCloseEvent> consumer) Called to register the given consumer as an event to trigger upon the windows closure, with a set priority- Parameters:
priority- The priority of this callbackconsumer- The consumer to register- Returns:
- the event registration instance upon registration
-
registerCloseEvent
@Nonnull public EventRegistration registerCloseEvent(@Nonnull EventPriority priority, @Nonnull Consumer<Window.WindowCloseEvent> consumer) Called to register the given consumer as an event to trigger upon the windows closure, with a set priority- Parameters:
priority- The priority of this callbackconsumer- The consumer to register- Returns:
- the event registration instance upon registration
-
equals
-
hashCode
-