Annotation Interface Share
You must provide an ID for the shared value and the annotated parameter's type must be one of the
LocalRef
family.
The parameter's name is irrelevant and only the ID in the annotation is used to share matching values.
The same reference objects will be passed to all handler methods requesting a given ID within a given target method
invocation. By default, IDs are per-mixin, so you don't need to worry about including your modid or anything similar
in them. If you specifically want to share values across mixins, set the namespace().
Note: If a @Shared value is read from before it has been written to, no exception is thrown and it will simply return
the default value for that type (0, 0f, null, etc), much like a field.
See the wiki article for more info.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueThe id for this shared value.
-
-
-
namespace
String namespaceThe namespace for this shared value. By default, this is the fully-qualified name of the enclosing mixin class to ensure uniqueness. If you want to share values between mixin classes, you can set this to something else, e.g. your mod ID.- Default:
- ""
-