本文整理匯總了Java中net.minecraft.world.gen.feature.WorldGenMinable.generate方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldGenMinable.generate方法的具體用法?Java WorldGenMinable.generate怎麽用?Java WorldGenMinable.generate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.world.gen.feature.WorldGenMinable
的用法示例。
在下文中一共展示了WorldGenMinable.generate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generate
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
IChunkProvider chunkProvider) {
StabilityHandler.addChunkData(world.provider.getDimension(), new ChunkPos(chunkX, chunkZ), StabilityHandler.generateChunkStability(random));
if (world.provider.getDimensionType() == DimensionType.OVERWORLD) {
WorldGenMinable lodestone = new WorldGenMinable(RegistryManager.lodestone_ore.getDefaultState(), Config.LODESTONE_VEIN_SIZE);
for (int i = 0; i < Config.LODESTONE_FREQUENCY; i++) {
int x = chunkX * 16 + random.nextInt(16);
int y = random.nextInt(Config.LODESTONE_MAX_Y - Config.LODESTONE_MIN_Y) + Config.LODESTONE_MIN_Y;
int z = chunkZ * 16 + random.nextInt(16);
lodestone.generate(world, random, new BlockPos(x, y, z));
}
BlockPos pos = new BlockPos(chunkX * 16, 0, chunkZ * 16);
WorldGenRift rift = new WorldGenRift();
rift.generate(world, random, pos);
}
}
示例2: generateOre
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize,
int maxVienSize, int chance, int minY, int maxY, Block generateIn) {
int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize);
int heightRange = maxY - minY;
WorldGenMinable gen = new WorldGenMinable(block, vienSize, generateIn);
for (int i = 0; i < chance; i++) {
int xRand = chunkX * random.nextInt(16);
int yRand = random.nextInt(heightRange) + minY;
int zRand = chunkZ * random.nextInt(16);
gen.generate(world, random, xRand, yRand, zRand);
}
}
示例3: generateOre
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
private void generateOre(Block block, World world, Random rand, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance, int minY, int maxY, Predicate blockType, boolean generate)
{
if (generate == true)
{
int vienSize = minVienSize + rand.nextInt(maxVienSize - minVienSize);
int heightRange = maxY - minY;
WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), vienSize, blockType);
for (int i = 0; i < chance; i++)
{
int xRand = chunkX * 16 + rand.nextInt(16);
int yRand = rand.nextInt(heightRange) + minY;
int zRand = chunkZ * 16 + rand.nextInt(16);
BlockPos position = new BlockPos(xRand, yRand, zRand);
gen.generate(world, rand, position);
}
}
}
示例4: generateOre
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) {
int deltaY = maxY - minY;
for (int i = 0; i < chances; i++) {
BlockPos pos = new BlockPos(x + random.nextInt(16), minY + random.nextInt(deltaY), z + random.nextInt(16));
WorldGenMinable generator = new WorldGenMinable(ore, size);
generator.generate(world, random, pos);
}
}
示例5: generateOre
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
private void generateOre(World world, Random random, int chunkX, int chunkZ) {
final int heightRange = maxHeight - minHeight;
final int randFactor = (maxOreVeinSize - minOreVeinSize) > 0 ? random.nextInt(maxOreVeinSize - minOreVeinSize) : 0;
final int veinSize = minOreVeinSize + randFactor;
final WorldGenMinable generator = new WorldGenMinable(oreToGen, veinSize, predicate);
for (int i = 0; i < genChance; ++i) {
final int xRandom = chunkX * 16 + random.nextInt(16);
final int yRandom = random.nextInt(heightRange) + minHeight;
final int zRandom = chunkZ * 16 + random.nextInt(16);
generator.generate(world, random, new BlockPos(xRandom, yRandom, zRandom));
}
}
示例6: generateOre
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) {
int deltaY = maxY - minY;
for (int i = 0; i < chances; i++) {
BlockPos pos = new BlockPos(x + random.nextInt(16), minY + random.nextInt(deltaY), z + random.nextInt(16));
WorldGenMinable generator = new WorldGenMinable(ore, size);
generator.generate(world, random, pos);
}
}
示例7: generateOre
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
public void generateOre(Block block, World world, Random random, int chunk_x, int chunk_z, int maxY, int minY, int chancesToSpawn) {
int heightRange = maxY - minY;
WorldGenMinable worldgenminable = new WorldGenMinable(block.getDefaultState(), heightRange);
for (int k1 = 0; k1 < chancesToSpawn; ++k1) {
int xrand = random.nextInt(16);
int yrand = random.nextInt(heightRange) + minY;
int zrand = random.nextInt(16);
BlockPos pos = new BlockPos(chunk_x+xrand, yrand, chunk_z+zrand);
worldgenminable.generate(world, random, pos);
System.out.println("attempted generation");
}
}
示例8: generate
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
public void generate(Random random, int chunkX, int chunkZ, World world, OreConfig config) {
Block block = GameData.getBlockRegistry().getObject(config.getBlock());
Block block2 = GameData.getBlockRegistry().getObject(config.getReplacementBlock());
if (block2 == null) {
block2 = Blocks.STONE;
}
WorldGenMinable worldGenMinable = new WorldGenMinable(block.getDefaultState(), config.veinSize, BlockMatcher.forBlock(block2));
int xPos, yPos, zPos;
for (int i = 0; i < config.veinsPerChunk; i++) {
xPos = chunkX * 16 + random.nextInt(16);
yPos = 10 + random.nextInt(config.maxYHeight - config.minYHeight);
zPos = chunkZ * 16 + random.nextInt(16);
worldGenMinable.generate(world, random, new BlockPos(xPos, yPos, zPos));
}
}
示例9: genOre
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
/**
* Generates ores into the world
* @param world World object
* @param random Random object
* @param chunkX Chunk X coord
* @param chunkZ Chunk Z coord
* @param genCount How many veins to generate per chunk
* @param generator The WorldGenMinable object for the ore
* @param minHeight The minimum height the veins will spawn at
* @param maxHeight The maximum height the veins will spawn at
*/
private void genOre(World world, Random random, int chunkX, int chunkZ, int genCount, WorldGenMinable generator, int minHeight, int maxHeight)
{
//Some vanilla checks for the height limits
if (maxHeight < minHeight)
{
int i = minHeight;
minHeight = maxHeight;
maxHeight = i;
}
else if (maxHeight == minHeight)
{
if (minHeight < 255)
{
++maxHeight;
}
else
{
--minHeight;
}
}
for(int i = 0; i < genCount; i++)
{
//Creates random position in chunk for vein
BlockPos pos = getRandXZInChunk(random, chunkX, random.nextInt(maxHeight - minHeight) + minHeight, chunkZ);
//Generates vein
generator.generate(world, random, pos);
}
}
示例10: generateOre
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
public static void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVeinSize, int maxVeinSize, int chance, int minY, int maxY, Block generateIn) {
int veinSize = minVeinSize + random.nextInt(maxVeinSize - minVeinSize);
int heightRange = maxY - minY;
WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), veinSize, BlockMatcher.forBlock(generateIn));
for(int i = 0; i < chance; i++) {
int xRand = chunkX * 16 + random.nextInt(16);
int yRand = random.nextInt(heightRange) + minY;
int zRand = chunkZ * 16 + random.nextInt(16);
gen.generate(world, random, new BlockPos(xRand, yRand, zRand));
}
}
示例11: addOreSpawn
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
public void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int minVainSize, int maxVainSize, int chancesToSpawn, int minY, int maxY )
{
WorldGenMinable minable = new WorldGenMinable(block.getDefaultState(), (minVainSize + random.nextInt(maxVainSize - minVainSize)));
for(int i = 0; i < chancesToSpawn; i++)
{
int posX = blockXPos + random.nextInt(16);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(16);
minable.generate(world, random, new BlockPos(posX, posY, posZ));
}
}
示例12: addOreSpawn
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
public static void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int minVeinSize, int maxVeinSize, int chancesToSpawn, int minY, int maxY, Block blockgen) {
WorldGenMinable minable = new WorldGenMinable(block.getDefaultState(), (minVeinSize + random.nextInt(maxVeinSize - minVeinSize)), BlockMatcher.forBlock(blockgen));
for(int i = 0; i < chancesToSpawn; i++)
{
int posX = blockXPos + random.nextInt(16);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(16);
minable.generate(world, random, new BlockPos(posX, posY, posZ));
}
}
示例13: addNetherOreSpawn
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
public void addNetherOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int minVeinSize,
int maxVeinSize, int chancesToSpawn, int minY, int maxY) {
WorldGenMinable minable = new WorldGenMinable(block, minVeinSize + random.nextInt(maxVeinSize - minVeinSize), Blocks.netherrack);
for (int i = 0; i < chancesToSpawn; i++) {
int posX = blockXPos + random.nextInt(16);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(16);
minable.generate(world, random, posX, posY, posZ);
}
}
示例14: generateOre
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance, int minY, int maxY, Block generateIn) {
int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize);
int heightRange = maxY - minY;
WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), vienSize);
for (int i = 0; i < chance; i++) {
int xRand = chunkX * 16 + random.nextInt(16);
int yRand = random.nextInt(heightRange) + minY;
int zRand = chunkX * 16 + random.nextInt(16);
gen.generate(world, random, new BlockPos(xRand, yRand, zRand));
}
}
示例15: generateOre
import net.minecraft.world.gen.feature.WorldGenMinable; //導入方法依賴的package包/類
public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance, int minY, int maxY, Block generateIn) {
int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize);
int heightRange = maxY - minY;
WorldGenMinable gen = new WorldGenMinable(block, vienSize, generateIn);
for (int i = 0; i < chance; i++) {
int xRand = chunkX * 16 + random.nextInt(16);
int yRand = random.nextInt(heightRange) + minY;
int zRand = chunkZ * 16 + random.nextInt(16);
gen.generate(world, random, xRand, yRand, zRand);
}
}