Annotation Interface AddTo
When a class is annotated with @AddTo, it becomes available not only in the plugin
it belongs to but also in the plugin specified by the value of the annotation. The plugin name
is derived from the ModId annotation of the target plugin.
If the value specified is "Base", the annotated class is integrated directly into
the core of the application (the "Base" plugin). This is a common use case when you want to add
functionality to the core system, such as adding components or features to the Core interface
or other parts of the system.
It is important to note that the "Base" core should not be annotated with this annotation,
as it is the core system itself, and cannot be extended or modified directly via @AddTo.
The name of the core system ("Base") can be retrieved dynamically using the
Core.getName() method.
For example, a class annotated with @AddTo("Base") could add functionality to core
components like Core.getExecutables(), Core.getLabyrinthPanels(), or other components
based on the plugin's design.
The AddTo annotation enables seamless integration of one plugin's functionality into
another, facilitating inter-plugin interaction or extending core system features.
-
Required Element Summary
Required Elements
-
Element Details
-
value
String valueThe name of the plugin or core system to which the annotated class should be added.- Returns:
- the name of the target plugin or core system (e.g., "Base" for the core)
-