hi,
I build a method to get the biome name on server side while world generation:
private static String getBiomeName(World world, int chunkX, int chunkZ)
{
String biomeName = "unknown";
Biome biomeInstance = world.getBiome(new BlockPos(chunkX * 16, 0, chunkZ * 16));
String field = "biomeName";
try
{
Object value = ReflectionHelper.getPrivateValue(Biome.class, biomeInstance, field);
biomeName = (String) value;
}
catch (Exception e)
{
Logger.log(Level.ERROR, "Problem loading value from field " + field, e);
}
return biomeName;
}
when i am run mc server/client in my intellj ide everthings is working well, but after compiling in normal minecraft forge, same version like forge mdk, or newer versions, the launcher crashes and the console freezes. sometimes i get infos befor freeze, that says the biomeName field in (Biome.class) does not exist... i dont know how to fix, because in the ide is no issue while running...
i am using the biomeName to generate ores in specific biomes (like more gold in vanilla mesa or emeralds in extreme hills)
I would be grateful if someone helped me to find out what i am diong wrong using reflection to get the biome name on server side.
thanks!