@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; }
@Nonnull @Override public Biome getBiomeForCoords(@Nonnull BlockPos pos) { return biomeProvider.getBiome(pos); }
@Override public int[] getBiomesUnZoomed(int[] biomeArray, int x, int z, int x_size, int z_size, OutputType outputType) { this.BiomeArray = this.worldChunkManager.getBiomesForGeneration(this.BiomeArray, x, z, x_size, z_size); 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 BlockPos getNearestStructurePos(World worldIn, BlockPos pos, boolean findUnexplored) { this.world = worldIn; BiomeProvider biomeprovider = worldIn.getBiomeProvider(); return biomeprovider.isFixedBiome() && biomeprovider.getFixedBiome() != Biomes.ROOFED_FOREST ? null : findNearestStructurePosBySpacing(worldIn, this, pos, maxDistance, minDistance, 10387319, true, 100, findUnexplored); }
@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; }
if (biomeProvider.getBiome(new BlockPos(k * 16 + 8, 64, l * 16 + 8), (Biome) null) != Biomes.DEEP_OCEAN) boolean flag = this.world.getBiomeProvider().areBiomesViable(k * 16 + 8, l * 16 + 8, 29, this.monumentSpawnBiomes);
@Override protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) { int i = chunkX; int j = chunkZ; if (chunkX < 0) { i = chunkX - 79; } if (chunkZ < 0) { j = chunkZ - 79; } int k = i / 80; int l = j / 80; Random random = this.world.setRandomSeed(k, l, 10387319); k = k * 80; l = l * 80; k = k + (random.nextInt(60) + random.nextInt(60)) / 2; l = l + (random.nextInt(60) + random.nextInt(60)) / 2; if (chunkX == k && chunkZ == l) { boolean flag = this.world.getBiomeProvider().areBiomesViable(chunkX * 16 + 8, chunkZ * 16 + 8, 32, ALLOWED_BIOMES); if (flag) { return true; } } return false; }
@Override @Nullable public BlockPos findBiomePosition(int x, int z, int range, List<Biome> biomes, Random random) { return original.findBiomePosition(x, z, range, biomes, random); }
@Override public float getTemperatureAtHeight(float p_76939_1_, int p_76939_2_) { return super.getTemperatureAtHeight(p_76939_1_, p_76939_2_); }
@Override protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) { int unadjustedX = chunkX; int unadjustedZ = chunkZ; if (chunkX < 0) { chunkX -= averageSpacing - 1; } if (chunkZ < 0) { chunkZ -= averageSpacing - 1; } // randomize relative positions of village candidate sites int candidateX = chunkX / averageSpacing; int candidateZ = chunkZ / averageSpacing; Random random = world.setRandomSeed(candidateX, candidateZ, 10387312); candidateX = candidateX * averageSpacing; candidateZ = candidateZ * averageSpacing; candidateX = candidateX + random.nextInt(averageSpacing - 8); candidateZ = candidateZ + random.nextInt(averageSpacing - 8); if (unadjustedX == candidateX && unadjustedZ == candidateZ) { // DEBUG System.out.println("Is biome viable for village = "+world.getBiomeProvider().areBiomesViable(unadjustedX * 16 + 8, unadjustedZ * 16 + 8, 0, VILLAGE_SPAWN_BIOMES)); return world.getBiomeProvider().areBiomesViable(unadjustedX * 16 + 8, unadjustedZ * 16 + 8, 0, VILLAGE_SPAWN_BIOMES); } return false; }
@Override public BlockPos getNearestStructurePos(World worldIn, BlockPos pos, boolean findUnexplored) { this.world = worldIn; BiomeProvider biomeprovider = worldIn.getBiomeProvider(); return biomeprovider.isFixedBiome() && biomeprovider.getFixedBiome() != Biomes.ROOFED_FOREST ? null : findNearestStructurePosBySpacing(worldIn, this, pos, 80, 20, 10387319, true, 100, findUnexplored); }
private static ChunkPos isBiomeAt(World world, int x, int z, List<Biome> biomes) { BlockPos pos = world.getBiomeProvider().findBiomePosition(x, z, 32, biomes, new Random()); if (pos != null) { return new ChunkPos(pos.getX() >> 4, pos.getZ() >> 4); } return null; }
@Override public void fillWithRain(World worldIn, BlockPos pos) { if (worldIn.rand.nextInt(2) == 0) { float f = worldIn.getBiome(pos).getTemperature(pos); if (worldIn.getBiomeProvider().getTemperatureAtHeight(f, pos.getY()) >= 0.15F) { IBlockState iblockstate = worldIn.getBlockState(pos); if (((Integer)iblockstate.getValue(LEVEL)).intValue() < 3) { worldIn.setBlockState(pos, iblockstate.cycleProperty(LEVEL), 2); } } } }
@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 Start(BiomeProvider chunkManagerIn, int p_i2104_2_, Random rand, int p_i2104_4_, int p_i2104_5_, List<PixieVillagePieces.PieceWeight> p_i2104_6_, int p_i2104_7_) { super((Start) null, 0, rand, p_i2104_4_, p_i2104_5_); this.worldChunkMngr = chunkManagerIn; this.structureVillageWeightedPieceList = p_i2104_6_; this.terrainType = p_i2104_7_; Biome biome = chunkManagerIn.getBiome(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biomes.DEFAULT); this.biome = biome; this.startPiece = this; this.func_189924_a(this.field_189928_h); this.field_189929_i = rand.nextInt(50) == 0; } }
@Override public Biome[] getBiomesForGeneration(Biome[] biomes, int x, int z, int width, int height) { biomes = original.getBiomesForGeneration(biomes, x, z, width, height); translateList(biomes, x, z, width, height); return biomes; }
boolean canSpawn = this.world.getBiomeProvider().areBiomesViable(var3 * 16 + 8, var4 * 16 + 8, 0, this.villageSpawnBiomes); if (debugrun == 0) { for(int zz = 0; zz < this.villageSpawnBiomes.size(); zz++) {
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 Start(BiomeProvider chunkManagerIn, int p_i2104_2_, Random rand, int p_i2104_4_, int p_i2104_5_, List<SnowVillagePieces.PieceWeight> p_i2104_6_, int p_i2104_7_) { super((Start) null, 0, rand, p_i2104_4_, p_i2104_5_); this.worldChunkMngr = chunkManagerIn; this.structureVillageWeightedPieceList = p_i2104_6_; this.terrainType = p_i2104_7_; Biome biome = chunkManagerIn.getBiome(new BlockPos(p_i2104_4_, 0, p_i2104_5_), Biomes.DEFAULT); this.biome = biome; this.startPiece = this; this.func_189924_a(this.field_189928_h); this.field_189929_i = rand.nextInt(50) == 0; } }
public static BiomeInfo getBiomeInfo(LostCityChunkGenerator provider, ChunkCoord coord) { if (!biomeInfoMap.containsKey(coord)) { BiomeInfo info = new BiomeInfo(); int chunkX = coord.getChunkX(); int chunkZ = coord.getChunkZ(); info.biomesForBiomeCheck = provider.worldObj.getBiomeProvider().getBiomesForGeneration(info.biomesForBiomeCheck, (chunkX - 1) * 4 - 2, chunkZ * 4 - 2, 10, 10); biomeInfoMap.put(coord, info); } return biomeInfoMap.get(coord); }