I've tried several different things to get this to work, but I must be missing something incredibly simple because it just plain doesn't work.
Basically, I want to control whether or not an ore spawns in a specific biome. I've gotten the ore to spawn how I like it in every other way (height max, height min, vein size, etc) but whenever I try and base my spawning off of a biome it seems to just.. crap itself. Here's what I have so far.
BiomeGenBase b = world.getBiomeGenForCoords(chunkX, chunkZ);
...
if(b.biomeName=="Plains")
{
System.out.println(b.biomeName);
(new WorldGenMinable(Drore.oreCopper.blockID, 100)).generate(world, random, Xcoord, Ycoord, Zcoord);
}
It seems to partially work. If I change the if to 'true', it works fine. If I remove the if and System.out entirely, it works fine. If I remove the if statement but leave the System.out it will print a lot of different biome names as it loads different chunks from different biomes. If I run it with that code above, it appears to work. It will print out "Plains" a shitload (and no other biomes) whenever I encounter a Plains biome, but the ores will not generate. It seems like it enters the if statement, but fails to execute the generation regardless.
I have also tried b.biomeName.equals("Plains") as well, to no avail.
tl;dr Someone explain how to generate ores differently based on biome because I clearly don't get it.