當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。