Permalink
Browse files

==> KT: Remember that ATs exist.

  • Loading branch information...
kenzierocks committed Dec 24, 2018
1 parent 9b996ed commit 1e3af45ae14fc1d41ba4834a5f8358707a6ca359
@@ -58,22 +58,6 @@ public BiomeData getData(BaseBiome biome) {
*/
private static class ForgeBiomeData implements BiomeData {

private static final Field biomeNameField;
static {
Field field;
try {
field = Biome.class.getDeclaredField("biomeName");
} catch (NoSuchFieldException e) {
// in live environment, try again:
try {
field = Biome.class.getDeclaredField("field_185412_a");
} catch (NoSuchFieldException e1) {
throw new IllegalStateException("Cannot find biomeName field!", e1);
}
}
field.setAccessible(true);
biomeNameField = field;
}
private final Biome biome;

/**
@@ -87,11 +71,8 @@ private ForgeBiomeData(Biome biome) {

@Override
public String getName() {
try {
return (String) biomeNameField.get(biome);
} catch (IllegalArgumentException | IllegalAccessException e) {
throw new RuntimeException(e);
}
// Cannot use getBiomeName, currently Side.CLIENT in 1.12.2
return biome.biomeName;
}
}

@@ -0,0 +1 @@
public net.minecraft.world.biome.Biome field_76791_y # biomeName

0 comments on commit 1e3af45

Please sign in to comment.