Class GameFlagsResource

java.lang.Object
com.hypixel.hytale.builtin.gameflags.GameFlagsResource

public class GameFlagsResource extends Object
Universe-wide named integer flags, absent = 0: campaign progression and world settings in one shared store, e.g. a feature's earned upgrades (myfeature_lab_*) next to its tunable settings (myfeature_difficulty). Writers pick the semantic per key: raise(String, int) for earned progression (never regresses), set(String, int) for mutable settings. Readers use getLevel(String) from any thread and any world; keys are scoped by a per-feature name prefix, like augment tags. Flags can be read and written from assets through GameFlagCondition and SetGameFlag interactions, and from the console through /gameflags.

Persistence is owned by the universe resource machinery: loaded once at universe start, auto-flushed on a cadence and at shutdown, stored as universe/resources/GameFlags.json.

  • Field Details

  • Constructor Details

    • GameFlagsResource

      public GameFlagsResource()
  • Method Details

    • get

      @Nonnull public static GameFlagsResource get()
    • getLevel

      public int getLevel(@Nonnull String key)
    • set

      public void set(@Nonnull String key, int value)
    • raise

      public void raise(@Nonnull String key, int level)
    • remove

      public void remove(@Nonnull String key)
    • snapshot

      @Nonnull public Map<String,Integer> snapshot()
    • flush

      public static void flush()