diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModAnnotation.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModAnnotation.java index 0ea6c9ee2..351da16fd 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModAnnotation.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModAnnotation.java @@ -57,10 +57,10 @@ public class ModAnnotation return value; } } - ElementType type; - Type asmType; - String member; - Map values = Maps.newHashMap(); + private final ElementType type; + private final Type asmType; + private final String member; + private final Map values = Maps.newHashMap(); private ArrayList arrayList; private String arrayName; @@ -71,10 +71,17 @@ public class ModAnnotation this.member = member; } + @Deprecated // TODO 1.16 remove this public ModAnnotation(ElementType type, Type asmType, ModAnnotation parent) { - this.type = type; + this(asmType, parent); + } + + public ModAnnotation(Type asmType, ModAnnotation parent) + { + this.type = parent.type; this.asmType = asmType; + this.member = parent.member; } @Override public String toString() @@ -132,7 +139,7 @@ public class ModAnnotation } public ModAnnotation addChildAnnotation(String name, String desc) { - ModAnnotation child = new ModAnnotation(type, Type.getType(desc), this); + ModAnnotation child = new ModAnnotation(Type.getType(desc), this); addProperty(name, child.getValues()); return child; } diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModClassVisitor.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModClassVisitor.java index 20ef9eb0c..f59d66199 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModClassVisitor.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModClassVisitor.java @@ -78,7 +78,7 @@ public class ModClassVisitor extends ClassVisitor public void buildData(final Set classes, final Set annotations) { classes.add(new ModFileScanData.ClassData(this.asmType, this.asmSuperType, this.interfaces)); final List collect = this.annotations.stream(). - filter(ma->ModFileScanData.interestingAnnotations().test(ma.asmType)). + filter(ma->ModFileScanData.interestingAnnotations().test(ma.getASMType())). map(a -> ModAnnotation.fromModAnnotation(this.asmType, a)).collect(Collectors.toList()); annotations.addAll(collect); }