Class PluginRegistry
java.lang.Object
com.github.pinont.singularitylib.api.registry.PluginRegistry
Runtime registry of every loaded Singularity plugin and its components.
Each CorePlugin registers itself (and, when available, its component
lists) during onEnable. This is the discovery surface consumed by
Singularity-DevTool's plugin auto-discovery: enumerate plugins, then inspect a
plugin's commands, listeners and custom items.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordImmutable snapshot of a plugin's registered components. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clears the registry (used between MockBukkit test runs).static @NotNull PluginRegistry.RegisteredComponentscomponentsOf(@Nullable CorePlugin plugin) Returns a plugin's registered components (empty record if none recorded).static intcount()static @NotNull Optional<CorePlugin> Looks up a registered plugin by its plugin name (optional-friendly).static @Nullable CorePluginLooks up a registered plugin by its plugin name.static @NotNull Collection<CorePlugin> plugins()static voidregister(CorePlugin plugin) Called by CorePlugin lifecycle.static voidregisterComponents(CorePlugin plugin, Collection<? extends SimpleCommand> commands, Collection<? extends org.bukkit.event.Listener> listeners, Collection<? extends CustomItem> items) Records a plugin's classified components (from its Register).static voidunregister(CorePlugin plugin) Called by CorePlugin lifecycle.
-
Method Details
-
register
Called by CorePlugin lifecycle. Internal use. -
registerComponents
public static void registerComponents(CorePlugin plugin, Collection<? extends SimpleCommand> commands, Collection<? extends org.bukkit.event.Listener> listeners, Collection<? extends CustomItem> items) Records a plugin's classified components (from its Register). -
unregister
Called by CorePlugin lifecycle. Internal use. -
plugins
- Returns:
- all registered Singularity plugins (name -> instance), insertion-ordered
-
get
Looks up a registered plugin by its plugin name. -
find
Looks up a registered plugin by its plugin name (optional-friendly). -
componentsOf
@NotNull public static @NotNull PluginRegistry.RegisteredComponents componentsOf(@Nullable @Nullable CorePlugin plugin) Returns a plugin's registered components (empty record if none recorded). -
count
public static int count()- Returns:
- the number of loaded Singularity plugins
-
clear
public static void clear()Clears the registry (used between MockBukkit test runs).
-