Annotation Interface AddTo


@Retention(RUNTIME) @Target(TYPE) public @interface AddTo
This annotation is used to integrate functionality from one plugin into another.

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.

See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the plugin or core system to which the annotated class should be added.
  • Element Details

    • value

      String value
      The 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)