Fix @ObjectHolderRegistry not properly detecting vanilla class level references. Closes #5958

This commit is contained in:
LexManos committed 2019-07-25 17:59:08 -07:00
1 parent 7411b444d3
commit 731e1920d2
2 files changed
+5 -2

No files matched your search

@@ -1,10 +1,13 @@
--- a/net/minecraft/world/biome/Biomes.java
+++ b/net/minecraft/world/biome/Biomes.java
@@ -4,6 +4,7 @@
@@ -4,8 +4,10 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;
[email protected]("minecraft")
public abstract class Biomes {
public static final Biome field_76771_b = func_222369_a(0, "ocean", new OceanBiome());
+ @net.minecraftforge.registries.ObjectHolder("minecraft:ocean")
public static final Biome field_180279_ad = field_76771_b;
public static final Biome field_76772_c = func_222369_a(1, "plains", new PlainsBiome());
public static final Biome field_76769_d = func_222369_a(2, "desert", new DesertBiome());
@@ -105,7 +105,7 @@ public class ObjectHolderRegistry
// double pass - get all the class level annotations first, then the field level annotations
annotations.stream().filter(a -> OBJECT_HOLDER.equals(a.getAnnotationType())).filter(a -> a.getTargetType() == ElementType.TYPE)
.forEach(data -> scanTarget(classModIds, classCache, data.getClassType(), null, (String)data.getAnnotationData().get("value"), true, data.getClassType().getClassName().startsWith("net.minecraft.init")));
.forEach(data -> scanTarget(classModIds, classCache, data.getClassType(), null, (String)data.getAnnotationData().get("value"), true, data.getClassType().getClassName().startsWith("net.minecraft.")));
annotations.stream().filter(a -> OBJECT_HOLDER.equals(a.getAnnotationType())).filter(a -> a.getTargetType() == ElementType.FIELD)
.forEach(data -> scanTarget(classModIds, classCache, data.getClassType(), data.getMemberName(), (String)data.getAnnotationData().get("value"), false, false));