當前位置: 首頁>>代碼示例>>Java>>正文


Java WorldGenLakes類代碼示例

本文整理匯總了Java中net.minecraft.world.gen.feature.WorldGenLakes的典型用法代碼示例。如果您正苦於以下問題:Java WorldGenLakes類的具體用法?Java WorldGenLakes怎麽用?Java WorldGenLakes使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WorldGenLakes類屬於net.minecraft.world.gen.feature包,在下文中一共展示了WorldGenLakes類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generateSurface

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
public void generateSurface(World world, Random rand, int chunkX, int chunkZ) {
    if (rand.nextDouble() < ConfigHandler.general.oilGenerationChance / 100D) {
        PneumaticCraftRepressurized.instance.validateFluids(null);
        int y = rand.nextInt(rand.nextInt(128) + 8);
        new WorldGenLakes(FluidRegistry.getFluid(Fluids.OIL.getName()).getBlock()).generate(world, rand, new BlockPos(chunkX + 8, y, chunkZ + 8));
    }

}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:9,代碼來源:WorldGeneratorPneumaticCraft.java

示例2: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
/**
 * Populates chunk with ores etc etc
 */
public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
{
    BlockFalling.fallInstantly = true;
    int k = p_73153_2_ * 16;
    int l = p_73153_3_ * 16;
    BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
    this.rand.setSeed(this.worldObj.getSeed());
    long i1 = this.rand.nextLong() / 2L * 2L + 1L;
    long j1 = this.rand.nextLong() / 2L * 2L + 1L;
    this.rand.setSeed((long)p_73153_2_ * i1 + (long)p_73153_3_ * j1 ^ this.worldObj.getSeed());

    MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false));

    int k1;
    int l1;
    int i2;

    if (this.rand.nextInt(4) == 0)
    {
        k1 = k + this.rand.nextInt(16) + 8;
        l1 = this.rand.nextInt(256);
        i2 = l + this.rand.nextInt(16) + 8;
        (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2);
    }
    
    if (biomegenbase.theBiomeDecorator.currentWorld == null)
    	biomegenbase.decorate(this.worldObj, this.rand, k, l);
    
    if (TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false, ANIMALS))
    {
    	SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
    }
    k += 8;
    l += 8;

    MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, false));

    BlockFalling.fallInstantly = false;
}
 
開發者ID:GhostMonk3408,項目名稱:MidgarCrusade,代碼行數:43,代碼來源:ChunkGeneratorSky.java

示例3: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
@Override
public void populate(IChunkProvider ichunkprovider, int i, int j) {
	BlockSand.fallInstantly = true;
	int k = i * 16;
	int l = j * 16;
	BiomeGenBase biome = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
	this.rand.setSeed(this.worldObj.getSeed());
	long i1 = this.rand.nextLong() / 2L * 2L + 1L;
	long j1 = this.rand.nextLong() / 2L * 2L + 1L;
	this.rand.setSeed((long)i*i1 + (long)j*j1 ^ this.worldObj.getSeed());
	boolean flag = false;
	
	MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(ichunkprovider, worldObj, rand, i, j, flag));

	if(mapFeaturesEnabled){
		this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, rand, i, j);
		this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, rand, i, j);
	}
	
	int k1;
	int l1;
	int i2;
	
	if(biome != BiomeGenBase.desert && biome != BiomeGenBase.desertHills && !flag && this.rand.nextInt(4) == 0 && TerrainGen.populate(ichunkprovider, this.worldObj, rand, i, j, flag, LAKE)){
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(128);
		i2 = l + this.rand.nextInt(16) + 8;
		(new WorldGenLakes(Block.waterStill.blockID)).generate(this.worldObj, this.rand, k1, l1, i2);
	}
	
	biome.decorate(worldObj, rand, k, j);
	 	k+=8;
		l+=8;
		
		MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(ichunkprovider, worldObj, rand, i, j, flag));

		BlockSand.fallInstantly = false;
}
 
開發者ID:MinecraftModArchive,項目名稱:Runes-And-Silver,代碼行數:39,代碼來源:ChunkProviderCustomDimension.java

示例4: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
@Override
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
    net.minecraft.block.BlockSand.fallInstantly = true;
    int var4 = par2 * 16;
    int var5 = par3 * 16;
    BiomeGenBase var6 = worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
    rand.setSeed(worldObj.getSeed());
    long var7 = rand.nextLong() / 2L * 2L + 1L;
    long var9 = rand.nextLong() / 2L * 2L + 1L;
    rand.setSeed(par2 * var7 + par3 * var9 ^ worldObj.getSeed());
    boolean var11 = false;
    if (mapFeaturesEnabled) {
        mineshaftGenerator.generateStructuresInChunk(worldObj, rand, par2,
                par3);
        var11 = villageGenerator.generateStructuresInChunk(worldObj, rand,
                par2, par3);
        strongholdGenerator.generateStructuresInChunk(worldObj, rand, par2,
                par3);
        scatteredFeatureGenerator.generateStructuresInChunk(worldObj, rand,
                par2, par3);
    }
    if (!var11 && rand.nextInt(4) == 0) {
        int var12 = var4 + rand.nextInt(16) + 8;
        int var13 = rand.nextInt(128);
        int var14 = var5 + rand.nextInt(16) + 8;
        new WorldGenLakes(Block.waterStill.blockID).generate(worldObj,
                rand, var12, var13, var14);
    }

    var6.decorate(worldObj, rand, var4, var5);
    SpawnerAnimals.performWorldGenSpawning(worldObj, var6, var4 + 8,
            var5 + 8, 16, 16, rand);
    var4 += 8;
    var5 += 8;
    net.minecraft.block.BlockSand.fallInstantly = false;
}
 
開發者ID:Minecraft4455,項目名稱:MysticRPG,代碼行數:37,代碼來源:ChunkProviderYirawia.java

示例5: PlaceTraps

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
public PlaceTraps() {
	quicksandPit = new WorldGenLakes(BlockQuickSand.instance);
	wizardTowerTier1 = new StructureApprenticeTower();
	wizardTowerTier1Ancient = new StructureApprenticeTowerAncient();
	wizardTowerTier2 = new StructureJourneymanTower();
	wizardTowerTier2Ancient = new StructureJourneymanTowerAncient();
	wizardTowerTier3 = new StructureMasterTower();
	wizardTowerTier3Ancient = new StructureMasterTowerAncient();
}
 
開發者ID:Draco18s,項目名稱:Artifacts,代碼行數:10,代碼來源:PlaceTraps.java

示例6: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
/**
 * Generate initial structures in this chunk, e.g. mineshafts, temples, lakes, and dungeons
 */
public void populate(int x, int z)
{
    BlockFalling.fallInstantly = true;
    int i = x * 16;
    int j = z * 16;
    BlockPos blockpos = new BlockPos(i, 0, j);
    Biome biome = world.getBiome(blockpos.add(16, 0, 16));
    this.rand.setSeed(this.world.getSeed());
    long k = this.rand.nextLong() / 2L * 2L + 1L;
    long l = this.rand.nextLong() / 2L * 2L + 1L;
    this.rand.setSeed((long)x * k + (long)z * l ^ this.world.getSeed());
    ChunkPos chunkpos = new ChunkPos(x, z);

    net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.world, this.rand, x, z, false);


    if (this.rand.nextInt(1) == 0)
    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE))
    {
        int i1 = this.rand.nextInt(16) + 8;
        int j1 = this.rand.nextInt(256);
        int k1 = this.rand.nextInt(16) + 8;
        (new WorldGenLakes(HarshenFluids.HARSHEN_DIMENSIONAL_FLUID_BLOCK)).generate(this.world, this.rand, blockpos.add(i1, j1, k1));
    }

    if (this.rand.nextInt(5) == 0)
    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA))
    {
        int i2 = this.rand.nextInt(16) + 8;
        int l2 = this.rand.nextInt(this.rand.nextInt(248) + 8);
        int k3 = this.rand.nextInt(16) + 8;

        if (l2 < this.world.getSeaLevel() || this.rand.nextInt(2) == 0)
        {
            (new WorldGenLakes(HarshenFluids.HARSHING_WATER_BLOCK)).generate(this.world, this.rand, blockpos.add(i2, l2, k3));
        }
    }
    biome.decorate(this.world, this.rand, new BlockPos(i, 0, j));
    if (net.minecraftforge.event.terraingen.TerrainGen.populate(this, this.world, this.rand, x, z, false, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS))
    	{
    		performWorldGenSpawning(this.world, EnumCreatureType.CREATURE, new BlockPos(x*16, 100, z*16), i + 8, j + 8, 16, 16, this.rand);
    		performWorldGenSpawning(this.world, EnumCreatureType.MONSTER, new BlockPos(x*16, 100, z*16) , i + 8, j + 8, 16, 16, this.rand);
    	}

    net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.world, this.rand, x, z, false);

    BlockFalling.fallInstantly = false;
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:52,代碼來源:PontusChunkProvider.java

示例7: func_100008_b

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
public boolean func_100008_b(World world, Random random, int i, int j, int k, int l, boolean flag)
{
    if(j - l <= 0)
    {
        j = l + 1;
    }
    if(j + l >= 127)
    {
        j = 127 - l - 1;
    }

    BlockPos.MutableBlockPos mutablePos = new BlockPos.MutableBlockPos();

    float f = 1.0F;

    for(int i1 = -l; i1 <= l; i1++)
    {
        for(int k1 = l; k1 >= -l; k1--)
        {
            for(int i2 = -l; i2 <= l; i2++)
            {
                int k2 = MathHelper.floor_double((double)i1 / (double)f);
                int i3 = k1;

                if(k1 > 5)
                {
                    i3 = MathHelper.floor_double((double)i3 * 1.375D);
                    i3 -= 2;
                }
                else if(k1 < -5)
                {
                    i3 = MathHelper.floor_double((double)i3 * 1.3500000238418579D);
                    i3 += 2;
                }

                int k3 = MathHelper.floor_double((double)i2 / (double)f);

                if(Math.sqrt(k2 * k2 + i3 * i3 + k3 * k3) <= 8.0D)
                {
                    if(BlocksAether.isGood(world.getBlockState(mutablePos.setPos(i1 + i, k1 + j + 1, i2 + k))) && k1 > 1)
                    {
                        world.setBlockState(new BlockPos.MutableBlockPos(i1 + i, k1 + j, i2 + k), BlocksAether.aether_grass.getDefaultState());
                        world.setBlockState(new BlockPos.MutableBlockPos(i1 + i, (k1 + j) - 1, i2 + k), BlocksAether.aether_dirt.getDefaultState());
                        world.setBlockState(new BlockPos.MutableBlockPos(i1 + i, (k1 + j) - (1 + random.nextInt(2)), i2 + k), BlocksAether.aether_dirt.getDefaultState());

                        if(k1 >= 4)
                        {
                            int l3 = random.nextInt(64);

                            if(l3 == 0)
                            {
                                new AetherGenOakTree().generate(world, random, new BlockPos.MutableBlockPos(i1 + i, k1 + j + 1, i2 + k));
                            }
                            else if(l3 == 5)
                            {
                                if(random.nextInt(3) == 0)
                                {
                                    new WorldGenLakes(Blocks.FLOWING_WATER).generate(world, random, new BlockPos.MutableBlockPos((i1 + i + random.nextInt(3)) - random.nextInt(3), k1 + j, (i2 + k + random.nextInt(3)) - random.nextInt(3)));
                                }
                            }
                        }
                    } 
                    else if(BlocksAether.isGood(world.getBlockState(mutablePos.setPos(i1 + i, k1 + j, i2 + k))))
                    {
                        world.setBlockState(new BlockPos.MutableBlockPos(i1 + i, k1 + j, i2 + k), BlocksAether.holystone.getDefaultState(), 2);
                    }
                }
            }

        }

    }

    return true;
}
 
開發者ID:Modding-Legacy,項目名稱:Aether-Legacy,代碼行數:76,代碼來源:AetherGenGoldenIsland.java

示例8: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
/**
 * Populates chunk with ores etc etc
 */
@Override
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
	BlockFalling.fallInstantly = true;
	int k = par2 * 16;
	int l = par3 * 16;
	BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
	this.rand.setSeed(this.worldObj.getSeed());
	long i1 = this.rand.nextLong() / 2L * 2L + 1L;
	long j1 = this.rand.nextLong() / 2L * 2L + 1L;
	this.rand.setSeed((long)par2 * i1 + (long)par3 * j1 ^ this.worldObj.getSeed());
	boolean flag = false;
	MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	//Enable map features ??
	if (this.mapFeaturesEnabled) {
		this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
	}
	int k1;
	int l1;
	int i2;

	//Add Lakes ??
	if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag && this.rand.nextInt(4) == 0
			&& TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE)) {
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(256);
		i2 = l + this.rand.nextInt(16) + 8;
		(new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2);
	}

	//Add Lakes ??
	if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAVA) && !flag && this.rand.nextInt(8) == 0) {
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(this.rand.nextInt(248) + 8);
		i2 = l + this.rand.nextInt(16) + 8;

		if (l1 < 63 || this.rand.nextInt(10) == 0)  {
			(new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, k1, l1, i2);
		}
	}

	//Add Dungeons ??
	boolean doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, DUNGEON);
	for (k1 = 0; doGen && k1 < 8; ++k1) {
		l1 = k + this.rand.nextInt(16) + 8;
		i2 = this.rand.nextInt(256);
		int j2 = l + this.rand.nextInt(16) + 8;
		(new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2);
	}

	//Add Animals ??
	biomegenbase.decorate(this.worldObj, this.rand, k, l);
	if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, ANIMALS)) {
		SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
	}
	k += 8;
	l += 8;

	//Creates snow and ice in world.
	doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, ICE);
	for (k1 = 0; doGen && k1 < 16; ++k1) {
		for (l1 = 0; l1 < 16; ++l1) {
			i2 = this.worldObj.getPrecipitationHeight(k + k1, l + l1);

			if (this.worldObj.isBlockFreezable(k1 + k, i2 - 1, l1 + l)) {
				this.worldObj.setBlock(k1 + k, i2 - 1, l1 + l, Blocks.ice, 0, 2);
			}

			if (this.worldObj.func_147478_e(k1 + k, i2, l1 + l, true)) {
				this.worldObj.setBlock(k1 + k, i2, l1 + l, Blocks.snow_layer, 0, 2);
			}
		}
	}
	MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));
	BlockFalling.fallInstantly = false;
}
 
開發者ID:jtrent238,項目名稱:PopularMMOS-EpicProportions-Mod,代碼行數:80,代碼來源:ChunkProviderEpic.java

示例9: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
/**
 * Populates chunk with ores etc etc
 */
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
    BlockFalling.fallInstantly = true;
    int k = par2 * 16;
    int l = par3 * 16;
    BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(k + 16, 0, l + 16));//warn
    this.rand.setSeed(this.worldObj.getSeed());
    long i1 = this.rand.nextLong() / 2L * 2L + 1L;
    long j1 = this.rand.nextLong() / 2L * 2L + 1L;
    this.rand.setSeed((long)par2 * i1 + (long)par3 * j1 ^ this.worldObj.getSeed());
    boolean flag = false;

    MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));

    int k1;
    int l1;
    int i2;

    if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag && this.rand.nextInt(4) == 0
        && TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE))
    {
        k1 = k + this.rand.nextInt(16) + 8;
        l1 = this.rand.nextInt(256);
        i2 = l + this.rand.nextInt(16) + 8;
        (new WorldGenLakes(Blocks.redstone_block)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
    }

    if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAVA) && !flag && this.rand.nextInt(8) == 0)
    {
        k1 = k + this.rand.nextInt(16) + 8;
        l1 = this.rand.nextInt(this.rand.nextInt(248) + 8);
        i2 = l + this.rand.nextInt(16) + 8;

        if (l1 < 63 || this.rand.nextInt(10) == 0)
        {
            (new WorldGenLakes(Blocks.redstone_block)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
        }
    }
    biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(k, 0, l));
    SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
    k += 8;
    l += 8;

    MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));

    BlockFalling.fallInstantly = false;
}
 
開發者ID:sokratis12GR,項目名稱:MoreDimensions,代碼行數:51,代碼來源:RedstoneDimension.java

示例10: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
/**
 * Populates chunk with ores etc etc
 */
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
	BlockFalling.fallInstantly = true;
	int k = par2 * 16;
	int l = par3 * 16;
	BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(k + 16, 0, l + 16));// warn
	this.rand.setSeed(this.worldObj.getSeed());
	long i1 = this.rand.nextLong() / 2L * 2L + 1L;
	long j1 = this.rand.nextLong() / 2L * 2L + 1L;
	this.rand.setSeed((long) par2 * i1 + (long) par3 * j1 ^ this.worldObj.getSeed());
	boolean flag = false;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	int k1;
	int l1;
	int i2;

	if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag
			&& this.rand.nextInt(4) == 0
			&& TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE))
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(256);
		i2 = l + this.rand.nextInt(16) + 8;
		(new WorldGenLakes(Blocks.emerald_block)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
	}

	if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAVA) && !flag
			&& this.rand.nextInt(8) == 0)
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(this.rand.nextInt(248) + 8);
		i2 = l + this.rand.nextInt(16) + 8;

		if (l1 < 63 || this.rand.nextInt(10) == 0)
		{
			(new WorldGenLakes(Blocks.emerald_block)).generate(this.worldObj, this.rand,
					new BlockPos(k1, l1, i2));
		}
	}
	biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(k, 0, l));
	SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
	k += 8;
	l += 8;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	BlockFalling.fallInstantly = false;
}
 
開發者ID:sokratis12GR,項目名稱:MoreDimensions,代碼行數:56,代碼來源:EmeraldDimension.java

示例11: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
/**
 * Populates chunk with ores etc etc
 */
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
	BlockFalling.fallInstantly = true;
	int k = par2 * 16;
	int l = par3 * 16;
	BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(k + 16, 0, l + 16));// warn
	this.rand.setSeed(this.worldObj.getSeed());
	long i1 = this.rand.nextLong() / 2L * 2L + 1L;
	long j1 = this.rand.nextLong() / 2L * 2L + 1L;
	this.rand.setSeed((long) par2 * i1 + (long) par3 * j1 ^ this.worldObj.getSeed());
	boolean flag = false;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	int k1;
	int l1;
	int i2;

	if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag
			&& this.rand.nextInt(4) == 0
			&& TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE))
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(256);
		i2 = l + this.rand.nextInt(16) + 8;
		(new WorldGenLakes(Blocks.coal_block)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
	}

	if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAVA) && !flag
			&& this.rand.nextInt(8) == 0)
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(this.rand.nextInt(248) + 8);
		i2 = l + this.rand.nextInt(16) + 8;

		if (l1 < 63 || this.rand.nextInt(10) == 0)
		{
			(new WorldGenLakes(Blocks.coal_block)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
		}
	}
	biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(k, 0, l));
	SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
	k += 8;
	l += 8;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	BlockFalling.fallInstantly = false;
}
 
開發者ID:sokratis12GR,項目名稱:MoreDimensions,代碼行數:55,代碼來源:CoalDimension.java

示例12: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
/**
 * Populates chunk with ores etc etc
 */
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
	BlockFalling.fallInstantly = true;
	int k = par2 * 16;
	int l = par3 * 16;
	BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(k + 16, 0, l + 16));// warn
	this.rand.setSeed(this.worldObj.getSeed());
	long i1 = this.rand.nextLong() / 2L * 2L + 1L;
	long j1 = this.rand.nextLong() / 2L * 2L + 1L;
	this.rand.setSeed((long) par2 * i1 + (long) par3 * j1 ^ this.worldObj.getSeed());
	boolean flag = false;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	int k1;
	int l1;
	int i2;

	if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag
			&& this.rand.nextInt(4) == 0
			&& TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE))
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(256);
		i2 = l + this.rand.nextInt(16) + 8;
		(new WorldGenLakes(Blocks.quartz_block)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
	}

	if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAVA) && !flag
			&& this.rand.nextInt(8) == 0)
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(this.rand.nextInt(248) + 8);
		i2 = l + this.rand.nextInt(16) + 8;

		if (l1 < 63 || this.rand.nextInt(10) == 0)
		{
			(new WorldGenLakes(Blocks.quartz_block)).generate(this.worldObj, this.rand,
					new BlockPos(k1, l1, i2));
		}
	}
	biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(k, 0, l));
	SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
	k += 8;
	l += 8;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	BlockFalling.fallInstantly = false;
}
 
開發者ID:sokratis12GR,項目名稱:MoreDimensions,代碼行數:56,代碼來源:QuartzDimension.java

示例13: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
/**
 * Populates chunk with ores etc etc
 */
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
	BlockFalling.fallInstantly = true;
	int k = par2 * 16;
	int l = par3 * 16;
	BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(k + 16, 0, l + 16));// warn
	this.rand.setSeed(this.worldObj.getSeed());
	long i1 = this.rand.nextLong() / 2L * 2L + 1L;
	long j1 = this.rand.nextLong() / 2L * 2L + 1L;
	this.rand.setSeed((long) par2 * i1 + (long) par3 * j1 ^ this.worldObj.getSeed());
	boolean flag = false;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	int k1;
	int l1;
	int i2;

	if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag
			&& this.rand.nextInt(4) == 0
			&& TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE))
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(256);
		i2 = l + this.rand.nextInt(16) + 8;
		(new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
	}

	if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAVA) && !flag
			&& this.rand.nextInt(8) == 0)
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(this.rand.nextInt(248) + 8);
		i2 = l + this.rand.nextInt(16) + 8;

		if (l1 < 63 || this.rand.nextInt(10) == 0)
		{
			(new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
		}
	}
	biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(k, 0, l));
	SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
	k += 8;
	l += 8;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	BlockFalling.fallInstantly = false;
}
 
開發者ID:sokratis12GR,項目名稱:MoreDimensions,代碼行數:55,代碼來源:SnowDimension.java

示例14: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
/**
 * Populates chunk with ores etc etc
 */
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
	BlockFalling.fallInstantly = true;
	int k = par2 * 16;
	int l = par3 * 16;
	BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(k + 16, 0, l + 16));// warn
	this.rand.setSeed(this.worldObj.getSeed());
	long i1 = this.rand.nextLong() / 2L * 2L + 1L;
	long j1 = this.rand.nextLong() / 2L * 2L + 1L;
	this.rand.setSeed((long) par2 * i1 + (long) par3 * j1 ^ this.worldObj.getSeed());
	boolean flag = false;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	int k1;
	int l1;
	int i2;

	if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag
			&& this.rand.nextInt(4) == 0
			&& TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE))
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(256);
		i2 = l + this.rand.nextInt(16) + 8;
		(new WorldGenLakes(Blocks.iron_block)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
	}

	if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAVA) && !flag
			&& this.rand.nextInt(8) == 0)
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(this.rand.nextInt(248) + 8);
		i2 = l + this.rand.nextInt(16) + 8;

		if (l1 < 63 || this.rand.nextInt(10) == 0)
		{
			(new WorldGenLakes(Blocks.iron_block)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
		}
	}
	biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(k, 0, l));
	SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
	k += 8;
	l += 8;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	BlockFalling.fallInstantly = false;
}
 
開發者ID:sokratis12GR,項目名稱:MoreDimensions,代碼行數:55,代碼來源:IronDimension.java

示例15: populate

import net.minecraft.world.gen.feature.WorldGenLakes; //導入依賴的package包/類
/**
 * Populates chunk with ores etc etc
 */
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
	BlockFalling.fallInstantly = true;
	int k = par2 * 16;
	int l = par3 * 16;
	BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(new BlockPos(k + 16, 0, l + 16));// warn
	this.rand.setSeed(this.worldObj.getSeed());
	long i1 = this.rand.nextLong() / 2L * 2L + 1L;
	long j1 = this.rand.nextLong() / 2L * 2L + 1L;
	this.rand.setSeed((long) par2 * i1 + (long) par3 * j1 ^ this.worldObj.getSeed());
	boolean flag = false;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	int k1;
	int l1;
	int i2;

	if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag
			&& this.rand.nextInt(4) == 0
			&& TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE))
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(256);
		i2 = l + this.rand.nextInt(16) + 8;
		(new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
	}

	if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAVA) && !flag
			&& this.rand.nextInt(8) == 0)
	{
		k1 = k + this.rand.nextInt(16) + 8;
		l1 = this.rand.nextInt(this.rand.nextInt(248) + 8);
		i2 = l + this.rand.nextInt(16) + 8;

		if (l1 < 63 || this.rand.nextInt(10) == 0)
		{
			(new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, new BlockPos(k1, l1, i2));
		}
	}
	biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(k, 0, l));
	SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
	k += 8;
	l += 8;

	MinecraftForge.EVENT_BUS
			.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));

	BlockFalling.fallInstantly = false;
}
 
開發者ID:sokratis12GR,項目名稱:MoreDimensions,代碼行數:55,代碼來源:ObsidianDimension.java


注:本文中的net.minecraft.world.gen.feature.WorldGenLakes類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。