@Override public void generate( Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { BiomeGenBase biome = world.getBiomeGenForCoords(chunkX * 16, chunkZ * 16); BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(biome); if (types.length == 1 && types[0] == BiomeDictionary.Type.PLAINS) { int flaxPlants = 0; while (random.nextFloat() < 0.8f && flaxPlants < 10) flaxPlants++; for (int flower = 0; flower < flaxPlants; ++flower) { int x = chunkX * 16 + random.nextInt(16) + 8; int z = chunkZ * 16 + random.nextInt(16) + 8; int y = random.nextInt(world.getHeightValue(x, z) + 32); plantGen.func_150550_a(YGCBlocks.flaxPlant, 7 - (random.nextFloat() < 0.1f ? 1 : 0)); plantGen.generate(world, random, x, y, z); } } }
private boolean biomeIsExcluded(BiomeGenBase biome, Type[] exclusions) { Type biomeTypes[] = BiomeDictionary.getTypesForBiome(biome); for (Type exclusion : exclusions) { for (Type biomeType : biomeTypes) { if (biomeType == exclusion) return true; } } return false; }