Class CustomUIHud

java.lang.Object
com.hypixel.hytale.server.core.entity.entities.player.hud.CustomUIHud
Direct Known Subclasses:
SpectatingHud

public abstract class CustomUIHud extends Object
Represents a custom UI hud for a specific player, allowing for the creation, display and population of custom UI for a client
  • Constructor Details

    • CustomUIHud

      public CustomUIHud(@Nonnull PlayerRef playerRef, @Nonnull String key)
      Constructor for a CustomUIHud instance with a specific key and z-order of 0.
      Parameters:
      playerRef - The PlayerRef instance of the player
      key - The unique key identifying this HUD layer
    • CustomUIHud

      public CustomUIHud(@Nonnull PlayerRef playerRef, @Nonnull String key, int zOrder)
      Constructor for a CustomUIHud instance with a specific key and z-order.
      Parameters:
      playerRef - The PlayerRef instance of the player
      key - The unique key identifying this HUD layer
      zOrder - The z-order for this HUD layer; higher values render on top
  • Method Details

    • show

      public void show()
      Called to show and update the custom UI to the player
    • update

      public void update(boolean clear, @Nonnull UICommandBuilder commandBuilder)
      Called to send an update to the player with the latest contents of the provided command builder
      Parameters:
      clear - Whether to clear the HUD completely
      commandBuilder - The UICommandBuilder that contains the UI instructions for the client
    • getPlayerRef

      @Nonnull public PlayerRef getPlayerRef()
      Returns:
      the PlayerRef instance of the player associated with this custom UI
    • getKey

      @Nonnull public String getKey()
      Returns:
      the unique key identifying this HUD layer
    • getZOrder

      public int getZOrder()
      Returns:
      the z-order for this HUD layer
    • setZOrder

      public void setZOrder(int zOrder)
      Sets the z-order for this HUD layer and sends an update to the client so it can re-sort.
      Parameters:
      zOrder - The new z-order; higher values render on top