Class LiveConfigModule

All Implemented Interfaces:
CommandOwner

public class LiveConfigModule extends JavaPlugin
Core plugin that fetches pre-evaluated feature flags from the live config service and exposes them for gameplay systems to query.

Flags are stored in an immutable LiveConfigSnapshot swapped atomically via a volatile reference. All flag reads are lock-free.

Usage:

var liveConfig = LiveConfigModule.get();
if (liveConfig != null && liveConfig.getBoolFlag("enable_feature", false)) {
    // feature is enabled
}
  • Field Details

  • Constructor Details

    • LiveConfigModule

      public LiveConfigModule(@Nonnull JavaPluginInit init)
  • Method Details

    • get

      @Nullable public static LiveConfigModule get()
    • getBoolFlag

      public boolean getBoolFlag(@Nonnull String name, boolean defaultValue)
    • getIntFlag

      public int getIntFlag(@Nonnull String name, int defaultValue)
    • getStringFlag

      @Nonnull public String getStringFlag(@Nonnull String name, @Nonnull String defaultValue)
    • hasFlag

      public boolean hasFlag(@Nonnull String name)
    • getSnapshot

      @Nonnull public LiveConfigSnapshot getSnapshot()
      Gets the current snapshot. Useful for diagnostics.
    • forceRefresh

      public void forceRefresh()
      Triggers an immediate refresh cycle. Intended for test harness use (via DevTools endpoint) — not for production gameplay code.