Annotation Type Environment


Applied to declare that the annotated element is present only in the specified environment.

Use with caution, as Fabric-loader will remove the annotated element in a mismatched environment!

When the annotated element is removed, bytecode associated with the element will not be removed. For example, if a field is removed, its initializer code will not, and will cause an error on execution.

If an overriding method has this annotation and its overridden method doesn't, unexpected behavior may happen. If an overridden method has this annotation while the overriding method doesn't, it is safe, but the method can be used from the overridden class only in the specified environment.

See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Returns the environment type that the annotated element is only present in.
  • Element Details

    • value

      EnvType value
      Returns the environment type that the annotated element is only present in.