Class PageManager

java.lang.Object
com.hypixel.hytale.server.core.entity.entities.player.pages.PageManager

public class PageManager extends Object
Handles the processing and setting of pages for a player.
  • Constructor Details

    • PageManager

      public PageManager()
  • Method Details

    • init

      public void init(@Nonnull PlayerRef playerRef, @Nonnull WindowManager windowManager)
      Called to initialize this page manager, during the initialization of the player.
      Parameters:
      playerRef - The player ref associated with the affiliated player.
      windowManager - The affiliated window manager.
    • clearLegacyCustomPageAcknowledgements

      public void clearLegacyCustomPageAcknowledgements()
      Called to clear the required custom page acknowledgements.
    • getCustomPage

      @Nullable public CustomUIPage getCustomPage()
      Returns:
      the current custom UI page.
    • setPage

      public void setPage(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull Page page)
      Called to set the current active page.
      Parameters:
      ref - The entity reference of the affiliated player entity.
      store - The entity store for component access.
      page - The page to set.
    • setPage

      public void setPage(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull Page page, boolean canCloseThroughInteraction)
      Called to set the current active page.
      Parameters:
      ref - The entity reference of the affiliated player entity.
      store - The entity store for component access.
      page - The page to set.
      canCloseThroughInteraction - Whether the page can be closed via interaction.
    • dev_setPage

      public void dev_setPage(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull UIPage page)
      Sets a Noesis serverside page as the active page for this player. Closes any currently open legacy custom page or serverside page first. The page lifetime controls whether and how the client can dismiss the page. Part of an upcoming feature that is still in development and not yet ready for production use. Do not use. The API is not final and may change.
      Parameters:
      ref - The entity reference of the affiliated player entity.
      store - The entity store for component access.
      page - The serverside page to set.
    • closePage

      public void closePage(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store)
      Closes any currently open page (custom or serverside) and returns the client to the default view.
      Parameters:
      ref - The entity reference of the affiliated player entity.
      store - The entity store for component access.
    • resetPages

      public void resetPages(@Nonnull PlayerRef playerRef)
      Tears down any open legacy or serverside page without sending packets. Use on world change or player reset when the client UI is cleared separately.
      Parameters:
      playerRef - The player whose pages are being reset.
    • getActiveServersidePage

      @Nullable public UIPage getActiveServersidePage()
      Part of an upcoming feature that is still in development and not yet ready for production use. Do not use.
      Returns:
      the currently open Noesis serverside page, or null when none is open.
    • dev_handleServersidePageDismiss

      public void dev_handleServersidePageDismiss(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull DismissServersidePage packet)
      Called when the client closes a serverside page via the player close binding. Runs teardown and lifecycle hooks without sending a redundant SetPage packet back to the client. Do not call this method unless you know what you are doing.

      Part of an upcoming feature that is still in development and not yet ready for production use. Do not use. The API is not final and may change.

      Parameters:
      ref - The entity reference of the affiliated player entity.
      store - The entity store for component access.
      packet - The packet received from the client.
    • dev_handleServersidePageCommand

      public void dev_handleServersidePageCommand(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull ExecuteServersidePageCommand packet)
      Routes an incoming execute-command packet from the client to the active serverside page. Ignores the packet when no page is open or the packet id does not match the open page. Commands emitted by the handler are batched into one update packet. Do not call this method unless you know what you are doing.

      Part of an upcoming feature that is still in development and not yet ready for production use. Do not use. The API is not final and may change.

      Parameters:
      ref - The entity reference of the affiliated player entity.
      store - The entity store for component access.
      packet - The packet received from the client.
    • openCustomPage

      public void openCustomPage(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull CustomUIPage page)
      Called to open the provided custom UI page.
      Parameters:
      ref - The entity ref of the affiliated player.
      store - The entity store for component access.
      page - The custom UI page to open.
    • setPageWithWindows

      public boolean setPageWithWindows(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull Page page, boolean canCloseThroughInteraction, @Nonnull Window... windows)
      Called to set a specific page, associated with the provided windows.
      Parameters:
      ref - The entity ref of the affiliated entity.
      store - The entity store for component access.
      page - The page to set.
      canCloseThroughInteraction - Whether the page can be closed via interaction.
      windows - The collection of windows associated with the page.
      Returns:
      true if the page was set successfully, false otherwise.
    • openCustomPageWithWindows

      public boolean openCustomPageWithWindows(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull CustomUIPage page, @Nonnull Window... windows)
      Called to set a specific custom UI page, associated with the provided windows.
      Parameters:
      ref - The entity ref of the affiliated entity.
      store - The entity store for component access.
      page - The page to set.
      windows - The collection of windows associated with the page.
      Returns:
      true if the page was set successfully, false otherwise.
    • updateLegacyCustomPage

      public void updateLegacyCustomPage(@Nonnull CustomPage page)
      Called to write the given page as a data packet to the associated client player.
      Parameters:
      page - The page instance to send to the client player.
    • handleLegacyCustomPageEvent

      public void handleLegacyCustomPageEvent(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull CustomPageEvent event)
      Called to handle a custom page event for this page manager.
      Parameters:
      ref - The reference to the affiliated entity.
      store - The entity store for component access.
      event - The event to handle.