Class MagicUtilsConsumerViews

java.lang.Object
dev.ua.theroer.magicutils.bootstrap.MagicUtilsConsumerViews

public final class MagicUtilsConsumerViews extends Object
Builds live MagicUtilsConsumerRuntimeViews from a consumer's MagicRuntime. Both the Fabric and NeoForge bootstraps register a view here so the component/count extraction is written once. The dynamic bits that live outside core (root command count from the command registry, whether the diagnostics service is present) are passed in as suppliers so core stays free of the commands/diagnostics wiring while still reading them live.
  • Method Details

    • liveView

      public static MagicUtilsConsumerRuntimeView liveView(MagicRuntime runtime, IntSupplier rootCommandCount, BooleanSupplier diagnosticsEnabled)
      Live view backed by runtime. Every accessor reads through to the runtime (or the supplied suppliers) at call time, so the registry always reports the consumer's current state.
      Parameters:
      runtime - the consumer runtime to read components/closed from
      rootCommandCount - live root command count (0 when commands are off)
      diagnosticsEnabled - live diagnostics-present check