Java Code Examples for cn.nukkit.level.format.FullChunk#setBiomeId()
The following examples show how to use
cn.nukkit.level.format.FullChunk#setBiomeId() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Flat.java From Jupiter with GNU General Public License v3.0 | 6 votes |
private void generateChunk(FullChunk chunk) { chunk.setGenerated(); int c = Biome.getBiome(biome).getColor(); int R = c >> 16; int G = (c >> 8) & 0xff; int B = c & 0xff; for (int Z = 0; Z < 16; ++Z) { for (int X = 0; X < 16; ++X) { chunk.setBiomeId(X, Z, biome); chunk.setBiomeColor(X, Z, R, G, B); for (int y = 0; y < 256; ++y) { int k = this.structure[y][0]; int l = this.structure[y][1]; chunk.setBlock(X, y, Z, this.structure[y][0], this.structure[y][1]); } } } }
Example 2
Source File: Flat.java From Nukkit with GNU General Public License v3.0 | 6 votes |
private void generateChunk(FullChunk chunk) { chunk.setGenerated(); int c = Biome.getBiome(biome).getColor(); int R = c >> 16; int G = (c >> 8) & 0xff; int B = c & 0xff; for (int Z = 0; Z < 16; ++Z) { for (int X = 0; X < 16; ++X) { chunk.setBiomeId(X, Z, biome); chunk.setBiomeColor(X, Z, R, G, B); for (int y = 0; y < 256; ++y) { int k = this.structure[y][0]; int l = this.structure[y][1]; chunk.setBlock(X, y, Z, this.structure[y][0], this.structure[y][1]); } } } }
Example 3
Source File: Nether.java From Jupiter with GNU General Public License v3.0 | 5 votes |
@Override public void generateChunk(int chunkX, int chunkZ) { this.nukkitRandom.setSeed(chunkX * localSeed1 ^ chunkZ * localSeed2 ^ this.level.getSeed()); double[][][] noise = Generator.getFastNoise3D(this.noiseBase, 16, 128, 16, 4, 8, 4, chunkX * 16, 0, chunkZ * 16); FullChunk chunk = this.level.getChunk(chunkX, chunkZ); for (int x = 0; x < 16; ++x) { for (int z = 0; z < 16; ++z) { Biome biome = Biome.getBiome(Biome.HELL); chunk.setBiomeId(x, z, Biome.HELL); int biomecolor = biome.getColor(); chunk.setBiomeColor(x, z, (biomecolor >> 16), (biomecolor >> 8) & 0xff, (biomecolor & 0xff)); chunk.setBlockId(x, 0, z, Block.BEDROCK); chunk.setBlockId(x, 127, z, Block.BEDROCK); for (int y = 1; y <= bedrockDepth; y++) { if (nukkitRandom.nextRange(1, 5) == 1) { chunk.setBlockId(x, y, z, Block.BEDROCK); chunk.setBlockId(x, 127 - y, z, Block.BEDROCK); } } for (int y = 1; y < 127; ++y) { double noiseValue = (Math.abs(this.emptyHeight - y) / this.emptyHeight) * this.emptyAmplitude - noise[x][z][y]; noiseValue -= 1 - this.density; if (noiseValue > 0) { chunk.setBlockId(x, y, z, Block.NETHERRACK); } else if (y <= this.waterHeight) { chunk.setBlockId(x, y, z, Block.STILL_LAVA); chunk.setBlockLight(x, y + 1, z, 15); } } } } for (Populator populator : this.generationPopulators) { populator.populate(this.level, chunkX, chunkZ, this.nukkitRandom); } }
Example 4
Source File: Flat.java From Nukkit with GNU General Public License v3.0 | 5 votes |
private void generateChunk(FullChunk chunk) { chunk.setGenerated(); for (int Z = 0; Z < 16; ++Z) { for (int X = 0; X < 16; ++X) { chunk.setBiomeId(X, Z, biome); for (int y = 0; y < 256; ++y) { int k = this.structure[y][0]; int l = this.structure[y][1]; chunk.setBlock(X, y, Z, this.structure[y][0], this.structure[y][1]); } } } }
Example 5
Source File: Nether.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public void generateChunk(int chunkX, int chunkZ) { this.nukkitRandom.setSeed(chunkX * localSeed1 ^ chunkZ * localSeed2 ^ this.level.getSeed()); double[][][] noise = Generator.getFastNoise3D(this.noiseBase, 16, 128, 16, 4, 8, 4, chunkX * 16, 0, chunkZ * 16); FullChunk chunk = this.level.getChunk(chunkX, chunkZ); for (int x = 0; x < 16; ++x) { for (int z = 0; z < 16; ++z) { Biome biome = Biome.getBiome(Biome.HELL); chunk.setBiomeId(x, z, Biome.HELL); int biomecolor = biome.getColor(); chunk.setBiomeColor(x, z, (biomecolor >> 16), (biomecolor >> 8) & 0xff, (biomecolor & 0xff)); chunk.setBlockId(x, 0, z, Block.BEDROCK); chunk.setBlockId(x, 127, z, Block.BEDROCK); for (int y = 1; y <= bedrockDepth; y++) { if (nukkitRandom.nextRange(1, 5) == 1) { chunk.setBlockId(x, y, z, Block.BEDROCK); chunk.setBlockId(x, 127 - y, z, Block.BEDROCK); } } for (int y = 1; y < 127; ++y) { double noiseValue = (Math.abs(this.emptyHeight - y) / this.emptyHeight) * this.emptyAmplitude - noise[x][z][y]; noiseValue -= 1 - this.density; if (noiseValue > 0) { chunk.setBlockId(x, y, z, Block.NETHERRACK); } else if (y <= this.waterHeight) { chunk.setBlockId(x, y, z, Block.STILL_LAVA); chunk.setBlockLight(x, y + 1, z, 15); } } } } for (Populator populator : this.generationPopulators) { populator.populate(this.level, chunkX, chunkZ, this.nukkitRandom); } }