Class AssetPackSaveBrowser

java.lang.Object
com.hypixel.hytale.server.core.ui.browser.AssetPackSaveBrowser

public class AssetPackSaveBrowser extends Object
Reusable server-side component for selecting a target asset pack to save into. Displays a scrollable list of mutable packs with search and an inline create-new-pack form. Designed to be composed into pages, not extended.
  • Field Details

  • Constructor Details

  • Method Details

    • setSelectedPackKey

      public void setSelectedPackKey(@Nullable String key)
      Pre-selects a pack by key. Validates that the pack exists, is mutable, and still exists on disk.
    • buildUI

      public void buildUI(@Nonnull UICommandBuilder commandBuilder, @Nonnull UIEventBuilder eventBuilder)
    • buildEventBindings

      public void buildEventBindings(@Nonnull UIEventBuilder eventBuilder, @Nonnull String browseButtonSelector)
      Wires all event bindings for the pack browser, create-pack form, and validation inputs. The only page-specific binding (the browse button) requires its selector to be passed in. Action names match the ACTION_* constants on this class — the consuming page's Action enum must include entries with the same names.
    • buildPackList

      public void buildPackList(@Nonnull UICommandBuilder commandBuilder, @Nonnull UIEventBuilder eventBuilder)
    • handleEvent

      public boolean handleEvent(@Nonnull AssetPackSaveBrowserEventData data)
      Handles a browser event (search, pack selection, validation).
      Returns:
      true if the event was handled internally, false if the page should handle it
    • handleAction

      @Nullable public AssetPackSaveBrowser.ActionResult handleAction(@Nullable String actionName, @Nonnull AssetPackSaveBrowserEventData data, @Nonnull String selectedPackLabelSelector)
      Handles pack-browser actions dispatched from the page's Action enum. Also handles events with no action (search, select, validate-create).
      Parameters:
      actionName - the action enum name, or null for search/select/validate events
      data - the pack browser event data
      selectedPackLabelSelector - the UI selector for the selected pack label (e.g. "#MainPage #SelectedPackLabel")
      Returns:
      a result if the action was handled, or null if the page should handle it
    • getSelectedPack

      @Nullable public AssetPack getSelectedPack()
    • hasSelectedPack

      public boolean hasSelectedPack()
    • getSelectedPackDisplayName

      @Nonnull public String getSelectedPackDisplayName()
    • createPack

      @Nonnull public AssetPackSaveBrowser.CreatePackResult createPack(@Nonnull AssetPackSaveBrowserEventData data)
    • checkDuplicatePack

      public boolean checkDuplicatePack(@Nullable String name, @Nullable String group)
    • buildCreateFormValidation

      public void buildCreateFormValidation(@Nonnull UICommandBuilder commandBuilder, @Nullable String name, @Nullable String group)