本文整理汇总了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);