本文整理匯總了Java中org.bukkit.generator.ChunkGenerator.BiomeGrid方法的典型用法代碼示例。如果您正苦於以下問題:Java ChunkGenerator.BiomeGrid方法的具體用法?Java ChunkGenerator.BiomeGrid怎麽用?Java ChunkGenerator.BiomeGrid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.generator.ChunkGenerator
的用法示例。
在下文中一共展示了ChunkGenerator.BiomeGrid方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateChunkData
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
@Override
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, ChunkGenerator.BiomeGrid biomeGrid) {
if (world.getEnvironment().equals(World.Environment.NETHER)) {
return generateNetherChunks(world, random, chunkX, chunkZ, biomeGrid);
}
ChunkData result = createChunkData(world);
if (Settings.seaHeight != 0) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = 0; y < Settings.seaHeight; y++) {
result.setBlock(x, y, z, Material.STATIONARY_WATER);
}
}
}
}
return result;
}
示例2: generate
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
public void generate(byte[][] chunk, World world, int chunkX, int chunkZ, ChunkGenerator.BiomeGrid grid) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
int realX = x + chunkX * 16;
int realZ = z + chunkZ * 16;
grid.setBiome(x, z, null);
// Generate basic terrain
double height = baseHeight + generateSea(realX, realZ, grid) + generateHugeMountain(realX, realZ) + terrainAmplitude1 * terrainGenerator1.noise(realX * terrainFreq1, realZ * terrainFreq1) + terrainAmplitude2 * terrainGenerator2.noise(realX * terrainFreq2, realZ * terrainFreq2);
double humidity = 50D + 50D * humidityGenerator.noise(realX * humidityFreq, realZ * humidityFreq);
double temperature = 8D + 24D * temperatureGenerator.noise(realX * temperatureFreq, realZ * temperatureFreq);
if (height > baseHeight)
grid.setBiome(x, z, null);
for (int y = 1; y < 256; y++) {
if (grid.getBiome(x, z) != null) {
if (y < height) setBlock(x, y, z, chunk, Material.STONE);
else if (y < baseHeight) setBlock(x, y, z, chunk, Material.WATER);
else setBlock(x, y, z, chunk, Material.AIR);
} else if (y <= height) setBlock(x, y, z, chunk, Material.STONE);
}
}
}
}
示例3: generateSea
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
private double generateSea(int x, int z, ChunkGenerator.BiomeGrid grid) {
double height = seaAmplitude * seaGenerator.noise(x * seaFreq, z * seaFreq);
if (height < -0.05) {
grid.setBiome((x % 16 + 16) % 16, (z % 16 + 16) % 16, Biome.OCEAN);
if (height < -0.2) grid.setBiome((x % 16 + 16) % 16, (z % 16 + 16) % 16, Biome.DEEP_OCEAN);
}
return height > 0 ? 0 : height;
}
示例4: generateBlockSections
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
@Override
@Deprecated
public byte[][] generateBlockSections(World world, Random random, int chunkX, int chunkZ, ChunkGenerator.BiomeGrid biomeGrid) {
byte[][] result = new byte[world.getMaxHeight() / 16][];
if ((chunkX == 0) && (chunkZ == 0)) {
setBlock(result, 0, 64, 0, (byte) 7);
}
return result;
}
示例5: generateChunkData
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
@Override
public ChunkGenerator.ChunkData generateChunkData(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biome) {
return wrappedGenerator.generateChunkData(world, random, x, z, biome);
}
示例6: generateExtBlockSections
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
@Deprecated
public short[][] generateExtBlockSections(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biomes) {
return wrappedGenerator.generateExtBlockSections(world, random, x, z, biomes);
}
示例7: generateBlockSections
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
@Deprecated
public byte[][] generateBlockSections(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biomes) {
return wrappedGenerator.generateBlockSections(world, random, x, z, biomes);
}
示例8: generateChunkData
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
@Override
public ChunkData generateChunkData(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biome) {
ChunkData chunkData = createChunkData(world);
GeneratorEvent.Generation event = new GeneratorEvent.Generation(world, random, x, z, chunkData, biome);
functionality.generation.ifPresent(triggerItem -> TriggerItem.walk(triggerItem, event));
return chunkData;
}
示例9: Generation
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
public Generation(World world, Random random, Integer x, Integer z, ChunkGenerator.ChunkData chunkData, ChunkGenerator.BiomeGrid biomeGrid) {
super(world, random);
this.x = x;
this.z = z;
this.chunkData = chunkData;
this.biomeGrid = biomeGrid;
}
示例10: generateExtBlockSections
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
@Deprecated public short[][] generateExtBlockSections(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biomes) {
return null;
}
示例11: generateBlockSections
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
@Deprecated public byte[][] generateBlockSections(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biomes) {
return null;
}
示例12: generate
import org.bukkit.generator.ChunkGenerator; //導入方法依賴的package包/類
abstract void generate(byte[][] chunk, World world, int chunkX, int chunkZ, ChunkGenerator.BiomeGrid grid);