当前位置: 首页>>代码示例>>Java>>正文


Java WorldGenMinable.generate方法代码示例

本文整理汇总了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);
		
	}
	
}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:25,代码来源:EthericWorldGenerator.java

示例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);

	}

}
 
开发者ID:MAPReiff,项目名称:MineMania-Rebirth-1.7.10,代码行数:17,代码来源:UOreGeneration.java

示例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);
		}
	}
}
 
开发者ID:MinestrapTeam,项目名称:Minestrappolation-4,代码行数:18,代码来源:MGenHandler.java

示例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);
    }
}
 
开发者ID:DeflatedPickles-Old-Repositories,项目名称:JustJunk,代码行数:11,代码来源:ModWorldGeneration.java

示例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));
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:14,代码来源:WorldGenOre.java

示例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);
	}
}
 
开发者ID:Error22,项目名称:Thelta,代码行数:11,代码来源:WorldGenerator.java

示例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");
	}
}
 
开发者ID:williambl,项目名称:EssentialFeatures,代码行数:14,代码来源:SlateGen.java

示例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));
	}
}
 
开发者ID:modmuss50,项目名称:OreHotswap,代码行数:16,代码来源:OreGenerator.java

示例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);
    }
}
 
开发者ID:alxnns1,项目名称:MobHunter,代码行数:41,代码来源:WorldGenHandler.java

示例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));
    }
}
 
开发者ID:fabbe50,项目名称:TFICore,代码行数:12,代码来源:OregenHandler.java

示例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));
    }
}
 
开发者ID:Aviv871,项目名称:TombCraft,代码行数:12,代码来源:WorldGeneratorTombCraft.java

示例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));
   }
   }
 
开发者ID:AshIndigo,项目名称:Alloycraft,代码行数:11,代码来源:UtilsWorldgen.java

示例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);
    }
}
 
开发者ID:BRForgers,项目名称:DynamicCraft,代码行数:13,代码来源:WorldGenerator.java

示例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));
    }
}
 
开发者ID:InfinityStudio,项目名称:ExoticPower,代码行数:12,代码来源:EPGenerator.java

示例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);
        }
    }
 
开发者ID:TeamBW,项目名称:NetherEnhancements,代码行数:15,代码来源:OreGeneration.java


注:本文中的net.minecraft.world.gen.feature.WorldGenMinable.generate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。