diff options
Diffstat (limited to 'src/main/java/ftbsc/lll/processor/annotations/Target.java')
-rw-r--r-- | src/main/java/ftbsc/lll/processor/annotations/Target.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main/java/ftbsc/lll/processor/annotations/Target.java b/src/main/java/ftbsc/lll/processor/annotations/Target.java index 15967cb..ed5cc0f 100644 --- a/src/main/java/ftbsc/lll/processor/annotations/Target.java +++ b/src/main/java/ftbsc/lll/processor/annotations/Target.java @@ -1,23 +1,33 @@ package ftbsc.lll.processor.annotations; import java.lang.annotation.ElementType; +import java.lang.annotation.Repeatable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Marks a method as the target method. - * The method itself should have the same name, return type and parameters as the desired - * Minecraft method. - * It will also be discarded unless the containing class is annotated with {@link Patch} + * The method annotated with this, called "stub" within the documentation, should have the + * same name and parameters as the method it's supposed to represent. + * It will be discarded unless the containing class is annotated with {@link Patch} * and another method within the class is annotated with {@link Injector}. * @see Patch * @see Injector */ @Retention(RetentionPolicy.CLASS) +@Repeatable(MultipleTargets.class) @java.lang.annotation.Target(ElementType.METHOD) public @interface Target { /** + * Indicates which of the methods annotated with {@link Find} or {@link Injector} + * is targeting this stub. + * @return the name of the element this is supposed to apply to + * @since 0.5.0 + */ + String of() default ""; + + /** * When set to false, tells the processor to first try to match a single method by name, * and to only check parameters if further clarification is needed. * While non-strict mode is more computationally efficient, it's ultimately not |