Class MagicUtilsConsumerViews
java.lang.Object
dev.ua.theroer.magicutils.bootstrap.MagicUtilsConsumerViews
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 Summary
Modifier and TypeMethodDescriptionliveView(MagicRuntime runtime, IntSupplier rootCommandCount, BooleanSupplier diagnosticsEnabled) Live view backed byruntime.
-
Method Details
-
liveView
public static MagicUtilsConsumerRuntimeView liveView(MagicRuntime runtime, IntSupplier rootCommandCount, BooleanSupplier diagnosticsEnabled) Live view backed byruntime. 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 fromrootCommandCount- live root command count (0 when commands are off)diagnosticsEnabled- live diagnostics-present check
-