Class CustomUI

java.lang.Object
fr.hytale.loader.api.ui.CustomUI

public class CustomUI extends Object
Simple wrapper for creating custom UIs in Hytale.

Custom UIs require a `.ui` file in `resources/common/UI/custom/pages/`.

Example Usage:

// Create UI file at: resources/common/UI/custom/pages/MyCustomUI.ui
// Then create a CustomUI instance:

CustomUI ui = new CustomUI("common/UI/custom/pages/MyCustomUI.ui", CustomUILifetime.CAN_DISMISS);
player.openCustomUI(ui);
Since:
1.0.5
Version:
1.0.6
Author:
HytaleLoader
  • Constructor Details

    • CustomUI

      public CustomUI(@Nonnull String uiFilePath, @Nonnull CustomUI.CustomUILifetime lifetime)
      Creates a new custom UI.
      Parameters:
      uiFilePath - Path to the UI file (e.g., "common/UI/custom/pages/MyUI.ui")
      lifetime - UI lifetime behavior
    • CustomUI

      public CustomUI(@Nonnull String uiFilePath)
      Creates a new custom UI with CAN_DISMISS lifetime.
      Parameters:
      uiFilePath - Path to the UI file
  • Method Details

    • getUiFilePath

      public String getUiFilePath()
      Gets the UI file path.
      Returns:
      The UI file path
    • getLifetime

      public CustomUI.CustomUILifetime getLifetime()
      Gets the UI lifetime.
      Returns:
      The UI lifetime
    • createNativePage

      public com.hypixel.hytale.server.core.entity.entities.player.pages.BasicCustomUIPage createNativePage(@Nonnull com.hypixel.hytale.server.core.universe.PlayerRef playerRef)
      Creates the native UI page for this custom UI.
      Parameters:
      playerRef - The player reference
      Returns:
      The native UI page