@Override public int[] getBiomes(int[] biomeArray, int x, int z, int x_size, int z_size, OutputType outputType) { this.BiomeArray = this.worldChunkManager.getBiomes(this.BiomeArray, x, z, x_size, z_size, true); if (biomeArray == null || biomeArray.length < x_size * z_size) biomeArray = new int[x_size * z_size]; for (int i = 0; i < x_size * z_size; i++) biomeArray[i] = Biome.getIdForBiome(this.BiomeArray[i]); return biomeArray; }
@Override public Chunk generateChunk(int x, int z) { ChunkPrimer chunkprimer = new ChunkPrimer(); // Setup biomes for terraingen this.biomesForGeneration = this.worldObj.getBiomeProvider().getBiomesForGeneration(this.biomesForGeneration, x * 4 - 2, z * 4 - 2, 10, 10); terraingen.setBiomesForGeneration(biomesForGeneration); terraingen.generate(x, z, chunkprimer); // Setup biomes again for actual biome decoration this.biomesForGeneration = this.worldObj.getBiomeProvider().getBiomes(this.biomesForGeneration, x * 16, z * 16, 16, 16); // This will replace stone with the biome specific stones terraingen.replaceBiomeBlocks(x, z, chunkprimer, this, biomesForGeneration); // Generate caves this.caveGenerator.generate(this.worldObj, x, z, chunkprimer); Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z); byte[] biomeArray = chunk.getBiomeArray(); for (int i = 0; i < biomeArray.length; ++i) { biomeArray[i] = (byte)Biome.getIdForBiome(this.biomesForGeneration[i]); } chunk.generateSkylightMap(); return chunk; }
@Override public Biome[] getBiomes(@Nullable Biome[] oldBiomeList, int x, int z, int width, int depth) { oldBiomeList = original.getBiomes(oldBiomeList, x, z, width, depth); translateList(oldBiomeList, x, z, width, depth); return oldBiomeList; }
public Biome[] getBiomesAlternate(@Nullable Biome[] oldBiomeList, int x, int z, int width, int depth) { oldBiomeList = original.getBiomes(oldBiomeList, x, z, width, depth); for (int i = 0 ; i < oldBiomeList.length ; i++) { oldBiomeList[i] = outsideTranslator.translate(oldBiomeList[i]); } return oldBiomeList; }
public Biome[] provideBiomes(int chunkX, int chunkZ) { return this.world.getBiomeProvider().getBiomes(this.biomeBuffer, chunkX << 4, chunkZ << 4, 16, 16); }
private static BlockPos spiralOutwardsLookingForBiome(World world, Biome biomeToFind, double startX, double startZ, int maxDist, int sampleSpace) { if(maxDist <= 0 || sampleSpace <= 0) throw new IllegalArgumentException("maxDist and sampleSpace must be positive"); BiomeProvider chunkManager = world.getBiomeProvider(); double a = sampleSpace / Math.sqrt(Math.PI); double b = 2 * Math.sqrt(Math.PI); double dist = 0; String biomeName = FMLCommonHandler.instance().getSide() == Side.CLIENT ? biomeToFind.getBiomeName() : "biome"; for (int n = 0; dist < maxDist; ++n) { double rootN = Math.sqrt(n); dist = a * rootN; double x = startX + (dist * Math.sin(b * rootN)); double z = startZ + (dist * Math.cos(b * rootN)); // chunkManager.genBiomes is the first layer returned from initializeAllBiomeGenerators() // chunkManager.biomeIndexLayer is the second layer returned from initializeAllBiomeGenerators(), it's zoomed twice from genBiomes (>> 2) this one is actual size // chunkManager.getBiomeGenAt uses biomeIndexLayer to get the biome Biome[] biomesAtSample = chunkManager.getBiomes(null, (int) x, (int) z, 1, 1, false); if (biomesAtSample[0] == biomeToFind) return new BlockPos((int) x, 0, (int) z); } return null; }
@Override @Nonnull public Chunk provideChunk(int x, int z) { rand.setSeed((long) x * 341873128712L + (long) z * 132897987541L); ChunkPrimer chunkprimer = new ChunkPrimer(); biomesForGeneration = this.world.getBiomeProvider().getBiomes(biomesForGeneration, x * 16, z * 16, 16, 16); season = HFApi.calendar.getDate(world).getSeason(); if (season == null) season = Season.SPRING; setBlocksInChunk(x, z, chunkprimer); Chunk chunk = new Chunk(world, chunkprimer, x, z); byte[] abyte = chunk.getBiomeArray(); for (int i = 0; i < abyte.length; ++i) { abyte[i] = (byte) Biome.getIdForBiome(biomesForGeneration[i]); } chunk.generateSkylightMap(); return chunk; }
@Override public Chunk generateChunk(int x, int z) { rand.setSeed(x * 341873128712L + z * 132897987541L); ChunkPrimer chunkprimer = new ChunkPrimer(); biomesForGeneration = worldObj.getBiomeProvider().getBiomes(biomesForGeneration, x * 16, z * 16, 16, 16); generateTerrain(x, z, chunkprimer); replaceBlocksForBiome(x, z, biomesForGeneration, chunkprimer); caveGenerator.generate(worldObj, x, z, chunkprimer); ravineGenerator.generate(worldObj, x, z, chunkprimer); Chunk chunk = new Chunk(worldObj, chunkprimer, x, z); byte[] biomeArrayReference = chunk.getBiomeArray(); for (int a = 0; a < biomeArrayReference.length; ++a) biomeArrayReference[a] = (byte) Biome.getIdForBiome(biomesForGeneration[a]); chunk.generateSkylightMap(); chunk.resetRelightChecks(); return chunk; }
generateRoughTerrain(chunkX, chunkZ, chunkPrimerIn); world.getBiomeProvider().getBiomes(biomes, chunkX * 16 - 1, chunkZ * 16 - 1, 18, 18);
this.biomesForGeneration = biomeProvider.getBiomes(this.biomesForGeneration, chunkX * 16, chunkZ * 16, 16, 16); terrainGenerator.replaceBlocksForBiome(chunkX, chunkZ, chunkprimer, this.biomesForGeneration);
private int getColor(final int chunkX, final int chunkZ) { if(this.bProvider == null) { final DummyWorld world = new DummyWorld(new WorldInfo(this.worldSettings, this.worldName)); world.provider.setWorld(world); this.bProvider = world.getBiomeProvider(); } this.tempArray[0] = null; final int bId = Biome.getIdForBiome(this.bProvider.getBiomes(this.tempArray, (chunkX << 4) + 8, (chunkZ << 4) + 8, 1, 1, false)[0]); if(this.colorArray[bId] == -1) { LogHelper.info(bId); LogHelper.info(Biome.getBiome(bId)); LogHelper.info(Biome.REGISTRY.getNameForObject(Biome.getBiome(bId)));; this.colorArray[bId] = BiomeColorMappings.getColorForBiome(Biome.REGISTRY.getNameForObject(Biome.getBiome(bId)).toString()); } return this.colorArray[bId]; }