Java 类net.minecraft.world.gen.feature.WorldGenLakes 实例源码
项目:pnc-repressurized
文件:WorldGeneratorPneumaticCraft.java
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));
}
}
项目:MidgarCrusade
文件:ChunkGeneratorSky.java
/**
* 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;
}
项目:Runes-And-Silver
文件:ChunkProviderCustomDimension.java
@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;
}
项目:MysticRPG
文件:ChunkProviderYirawia.java
@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;
}
项目:Artifacts
文件:PlaceTraps.java
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();
}
项目:harshencastle
文件:PontusChunkProvider.java
/**
* 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;
}
项目:Aether-Legacy
文件:AetherGenGoldenIsland.java
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;
}
项目:PopularMMOS-EpicProportions-Mod
文件:ChunkProviderEpic.java
/**
* 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;
}
项目:MoreDimensions
文件:RedstoneDimension.java
/**
* 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;
}
项目:MoreDimensions
文件:EmeraldDimension.java
/**
* 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;
}
项目:MoreDimensions
文件:CoalDimension.java
/**
* 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;
}
项目:MoreDimensions
文件:QuartzDimension.java
/**
* 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;
}
项目:MoreDimensions
文件:SnowDimension.java
/**
* 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;
}
项目:MoreDimensions
文件:IronDimension.java
/**
* 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;
}
项目:MoreDimensions
文件:ObsidianDimension.java
/**
* 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;
}
项目:MoreDimensions
文件:LapisDimension.java
/**
* 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.lapis_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.lapis_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;
}
项目:MoreDimensions
文件:GoldDimension.java
/**
* 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.gold_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.gold_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;
}
项目:MoreDimensions
文件:GlassDimension.java
/**
* 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.glass)).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.glass)).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;
}
项目:MoreDimensions
文件:WoodDimension.java
/**
* 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.log)).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.log)).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;
}
项目:MoreDimensions
文件:DiamondDimension.java
/**
* 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.diamond_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.diamond_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;
}
项目:amunra
文件:AmunRaAsteroidsChunkProvider.java
protected void initBlockTypes() {
BlockMetaPair oreAlu = new BlockMetaPair(AsteroidBlocks.blockBasic, (byte) 3);
BlockMetaPair oreTitanium = new BlockMetaPair(AsteroidBlocks.blockBasic, (byte) 4);
BlockMetaPair oreIron = new BlockMetaPair(AsteroidBlocks.blockBasic, (byte) 5);
//BlockMetaPair oreDiamond = new BlockMetaPair(Blocks.diamond_ore, (byte)0);
BlockMetaPair oreSilicon = new BlockMetaPair(GCBlocks.basicBlock, (byte)8);
BlockMetaPair oreMeteorIron= new BlockMetaPair(GCBlocks.basicBlock, (byte)12);
denseIce = new BlockMetaPair(AsteroidBlocks.blockDenseIce, (byte) 0);
dirt = ARBlocks.blockMethaneDirt;
grass = ARBlocks.blockVacuumGrass;
light = new BlockMetaPair(Blocks.glowstone, (byte) 0);
generatorsTrees = new WorldGenData[] {
new WorldGenData(new WorldGenTreeBySapling(false, 5, ARBlocks.blockMethaneSapling), 2)
};
generatorsGrass = new WorldGenData[] {
new WorldGenData(new WorldGenTallgrassMeta(ARBlocks.blockMethaneTGrass), 2)
};
generatorsLakes = new WorldGenData[] {
new WorldGenData(new WorldGenLakes(Blocks.water), 2),
new WorldGenData(new WorldGenLakes(Blocks.lava), 2)
};
addBlockToHandler(coreHandler, asteroidStoneBlocks[2], 5, .3);
addBlockToHandler(coreHandler, asteroidStoneBlocks[1], 7, .3);
addBlockToHandler(coreHandler, asteroidStoneBlocks[0], 1, .25);
// ores
addBlockToHandler(coreHandler, oreAlu, 15, .2);//250
addBlockToHandler(coreHandler, oreTitanium, 10, .15); //400
addBlockToHandler(coreHandler, oreIron, 23, .2); //300
addBlockToHandler(coreHandler, oreSilicon, 12, .15);
addBlockToHandler(coreHandler, oreMeteorIron, 6, .13);
//addBlockToHandler(coreHandler, oreDiamond, 1, .1);
extraOreGen.put(oreTitanium, 400);
extraOreGen.put(oreAlu, 250);
extraOreGen.put(oreIron, 300);
addBlockToHandler(shellHandler, asteroidStoneBlocks[0], 1, .15);
addBlockToHandler(shellHandler, asteroidStoneBlocks[1], 3, .15);
addBlockToHandler(shellHandler, asteroidStoneBlocks[2], 1, .15);
addBlockToHandler(shellHandler, denseIce, 1, .15);
}
项目:Resilience-Client-Source
文件:ChunkProviderFlat.java
public ChunkProviderFlat(World par1World, long par2, boolean par4, String par5Str)
{
this.worldObj = par1World;
this.random = new Random(par2);
this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(par5Str);
if (par4)
{
Map var6 = this.flatWorldGenInfo.getWorldFeatures();
if (var6.containsKey("village"))
{
Map var7 = (Map)var6.get("village");
if (!var7.containsKey("size"))
{
var7.put("size", "1");
}
this.structureGenerators.add(new MapGenVillage(var7));
}
if (var6.containsKey("biome_1"))
{
this.structureGenerators.add(new MapGenScatteredFeature((Map)var6.get("biome_1")));
}
if (var6.containsKey("mineshaft"))
{
this.structureGenerators.add(new MapGenMineshaft((Map)var6.get("mineshaft")));
}
if (var6.containsKey("stronghold"))
{
this.structureGenerators.add(new MapGenStronghold((Map)var6.get("stronghold")));
}
}
this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration");
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake"))
{
this.waterLakeGenerator = new WorldGenLakes(Blocks.water);
}
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake"))
{
this.lavaLakeGenerator = new WorldGenLakes(Blocks.lava);
}
this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon");
Iterator var9 = this.flatWorldGenInfo.getFlatLayers().iterator();
while (var9.hasNext())
{
FlatLayerInfo var10 = (FlatLayerInfo)var9.next();
for (int var8 = var10.getMinY(); var8 < var10.getMinY() + var10.getLayerCount(); ++var8)
{
this.cachedBlockIDs[var8] = var10.func_151536_b();
this.cachedBlockMetadata[var8] = (byte)var10.getFillBlockMeta();
}
}
}
项目:Resilience-Client-Source
文件:ChunkProviderGenerate.java
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
BlockFalling.field_149832_M = true;
int var4 = par2 * 16;
int var5 = par3 * 16;
BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
this.rand.setSeed(this.worldObj.getSeed());
long var7 = this.rand.nextLong() / 2L * 2L + 1L;
long var9 = this.rand.nextLong() / 2L * 2L + 1L;
this.rand.setSeed((long)par2 * var7 + (long)par3 * var9 ^ this.worldObj.getSeed());
boolean var11 = false;
if (this.mapFeaturesEnabled)
{
this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
var11 = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
}
int var12;
int var13;
int var14;
if (var6 != BiomeGenBase.desert && var6 != BiomeGenBase.desertHills && !var11 && this.rand.nextInt(4) == 0)
{
var12 = var4 + this.rand.nextInt(16) + 8;
var13 = this.rand.nextInt(256);
var14 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, var12, var13, var14);
}
if (!var11 && this.rand.nextInt(8) == 0)
{
var12 = var4 + this.rand.nextInt(16) + 8;
var13 = this.rand.nextInt(this.rand.nextInt(248) + 8);
var14 = var5 + this.rand.nextInt(16) + 8;
if (var13 < 63 || this.rand.nextInt(10) == 0)
{
(new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, var12, var13, var14);
}
}
for (var12 = 0; var12 < 8; ++var12)
{
var13 = var4 + this.rand.nextInt(16) + 8;
var14 = this.rand.nextInt(256);
int var15 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenDungeons()).generate(this.worldObj, this.rand, var13, var14, var15);
}
var6.decorate(this.worldObj, this.rand, var4, var5);
SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.rand);
var4 += 8;
var5 += 8;
for (var12 = 0; var12 < 16; ++var12)
{
for (var13 = 0; var13 < 16; ++var13)
{
var14 = this.worldObj.getPrecipitationHeight(var4 + var12, var5 + var13);
if (this.worldObj.isBlockFreezable(var12 + var4, var14 - 1, var13 + var5))
{
this.worldObj.setBlock(var12 + var4, var14 - 1, var13 + var5, Blocks.ice, 0, 2);
}
if (this.worldObj.func_147478_e(var12 + var4, var14, var13 + var5, true))
{
this.worldObj.setBlock(var12 + var4, var14, var13 + var5, Blocks.snow_layer, 0, 2);
}
}
}
BlockFalling.field_149832_M = false;
}
项目:Cauldron
文件:ChunkProviderFlat.java
public ChunkProviderFlat(World p_i2004_1_, long p_i2004_2_, boolean p_i2004_4_, String p_i2004_5_)
{
this.worldObj = p_i2004_1_;
this.random = new Random(p_i2004_2_);
this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(p_i2004_5_);
if (p_i2004_4_)
{
Map map = this.flatWorldGenInfo.getWorldFeatures();
if (map.containsKey("village"))
{
Map map1 = (Map)map.get("village");
if (!map1.containsKey("size"))
{
map1.put("size", "1");
}
this.structureGenerators.add(new MapGenVillage(map1));
}
if (map.containsKey("biome_1"))
{
this.structureGenerators.add(new MapGenScatteredFeature((Map)map.get("biome_1")));
}
if (map.containsKey("mineshaft"))
{
this.structureGenerators.add(new MapGenMineshaft((Map)map.get("mineshaft")));
}
if (map.containsKey("stronghold"))
{
this.structureGenerators.add(new MapGenStronghold((Map)map.get("stronghold")));
}
}
this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration");
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake"))
{
this.waterLakeGenerator = new WorldGenLakes(Blocks.water);
}
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake"))
{
this.lavaLakeGenerator = new WorldGenLakes(Blocks.lava);
}
this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon");
Iterator iterator = this.flatWorldGenInfo.getFlatLayers().iterator();
while (iterator.hasNext())
{
FlatLayerInfo flatlayerinfo = (FlatLayerInfo)iterator.next();
for (int j = flatlayerinfo.getMinY(); j < flatlayerinfo.getMinY() + flatlayerinfo.getLayerCount(); ++j)
{
this.cachedBlockIDs[j] = flatlayerinfo.func_151536_b();
this.cachedBlockMetadata[j] = (byte)flatlayerinfo.getFillBlockMeta();
}
}
}
项目:Cauldron
文件:ChunkProviderFlat.java
public ChunkProviderFlat(World p_i2004_1_, long p_i2004_2_, boolean p_i2004_4_, String p_i2004_5_)
{
this.worldObj = p_i2004_1_;
this.random = new Random(p_i2004_2_);
this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(p_i2004_5_);
if (p_i2004_4_)
{
Map map = this.flatWorldGenInfo.getWorldFeatures();
if (map.containsKey("village"))
{
Map map1 = (Map)map.get("village");
if (!map1.containsKey("size"))
{
map1.put("size", "1");
}
this.structureGenerators.add(new MapGenVillage(map1));
}
if (map.containsKey("biome_1"))
{
this.structureGenerators.add(new MapGenScatteredFeature((Map)map.get("biome_1")));
}
if (map.containsKey("mineshaft"))
{
this.structureGenerators.add(new MapGenMineshaft((Map)map.get("mineshaft")));
}
if (map.containsKey("stronghold"))
{
this.structureGenerators.add(new MapGenStronghold((Map)map.get("stronghold")));
}
}
this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration");
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake"))
{
this.waterLakeGenerator = new WorldGenLakes(Blocks.water);
}
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake"))
{
this.lavaLakeGenerator = new WorldGenLakes(Blocks.lava);
}
this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon");
Iterator iterator = this.flatWorldGenInfo.getFlatLayers().iterator();
while (iterator.hasNext())
{
FlatLayerInfo flatlayerinfo = (FlatLayerInfo)iterator.next();
for (int j = flatlayerinfo.getMinY(); j < flatlayerinfo.getMinY() + flatlayerinfo.getLayerCount(); ++j)
{
this.cachedBlockIDs[j] = flatlayerinfo.func_151536_b();
this.cachedBlockMetadata[j] = (byte)flatlayerinfo.getFillBlockMeta();
}
}
}
项目:RuneCraftery
文件:ChunkProviderFlat.java
public ChunkProviderFlat(World p_i2004_1_, long p_i2004_2_, boolean p_i2004_4_, String p_i2004_5_) {
this.field_73163_a = p_i2004_1_;
this.field_73161_b = new Random(p_i2004_2_);
this.field_82699_e = FlatGeneratorInfo.func_82651_a(p_i2004_5_);
if(p_i2004_4_) {
Map var6 = this.field_82699_e.func_82644_b();
if(var6.containsKey("village")) {
Map var7 = (Map)var6.get("village");
if(!var7.containsKey("size")) {
var7.put("size", "1");
}
this.field_82696_f.add(new MapGenVillage(var7));
}
if(var6.containsKey("biome_1")) {
this.field_82696_f.add(new MapGenScatteredFeature((Map)var6.get("biome_1")));
}
if(var6.containsKey("mineshaft")) {
this.field_82696_f.add(new MapGenMineshaft((Map)var6.get("mineshaft")));
}
if(var6.containsKey("stronghold")) {
this.field_82696_f.add(new MapGenStronghold((Map)var6.get("stronghold")));
}
}
this.field_82697_g = this.field_82699_e.func_82644_b().containsKey("decoration");
if(this.field_82699_e.func_82644_b().containsKey("lake")) {
this.field_82703_i = new WorldGenLakes(Block.field_71943_B.field_71990_ca);
}
if(this.field_82699_e.func_82644_b().containsKey("lava_lake")) {
this.field_82701_j = new WorldGenLakes(Block.field_71938_D.field_71990_ca);
}
this.field_82702_h = this.field_82699_e.func_82644_b().containsKey("dungeon");
Iterator var9 = this.field_82699_e.func_82650_c().iterator();
while(var9.hasNext()) {
FlatLayerInfo var10 = (FlatLayerInfo)var9.next();
for(int var8 = var10.func_82656_d(); var8 < var10.func_82656_d() + var10.func_82657_a(); ++var8) {
this.field_82700_c[var8] = (byte)(var10.func_82659_b() & 255);
this.field_82698_d[var8] = (byte)var10.func_82658_c();
}
}
}
项目:RuneCraftery
文件:ChunkProviderGenerate.java
public void func_73153_a(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) {
BlockSand.field_72192_a = true;
int var4 = p_73153_2_ * 16;
int var5 = p_73153_3_ * 16;
BiomeGenBase var6 = this.field_73230_p.func_72807_a(var4 + 16, var5 + 16);
this.field_73220_k.setSeed(this.field_73230_p.func_72905_C());
long var7 = this.field_73220_k.nextLong() / 2L * 2L + 1L;
long var9 = this.field_73220_k.nextLong() / 2L * 2L + 1L;
this.field_73220_k.setSeed((long)p_73153_2_ * var7 + (long)p_73153_3_ * var9 ^ this.field_73230_p.func_72905_C());
boolean var11 = false;
if(this.field_73229_q) {
this.field_73223_w.func_75051_a(this.field_73230_p, this.field_73220_k, p_73153_2_, p_73153_3_);
var11 = this.field_73224_v.func_75051_a(this.field_73230_p, this.field_73220_k, p_73153_2_, p_73153_3_);
this.field_73225_u.func_75051_a(this.field_73230_p, this.field_73220_k, p_73153_2_, p_73153_3_);
this.field_73233_x.func_75051_a(this.field_73230_p, this.field_73220_k, p_73153_2_, p_73153_3_);
}
int var12;
int var13;
int var14;
if(var6 != BiomeGenBase.field_76769_d && var6 != BiomeGenBase.field_76786_s && !var11 && this.field_73220_k.nextInt(4) == 0) {
var12 = var4 + this.field_73220_k.nextInt(16) + 8;
var13 = this.field_73220_k.nextInt(128);
var14 = var5 + this.field_73220_k.nextInt(16) + 8;
(new WorldGenLakes(Block.field_71943_B.field_71990_ca)).func_76484_a(this.field_73230_p, this.field_73220_k, var12, var13, var14);
}
if(!var11 && this.field_73220_k.nextInt(8) == 0) {
var12 = var4 + this.field_73220_k.nextInt(16) + 8;
var13 = this.field_73220_k.nextInt(this.field_73220_k.nextInt(120) + 8);
var14 = var5 + this.field_73220_k.nextInt(16) + 8;
if(var13 < 63 || this.field_73220_k.nextInt(10) == 0) {
(new WorldGenLakes(Block.field_71938_D.field_71990_ca)).func_76484_a(this.field_73230_p, this.field_73220_k, var12, var13, var14);
}
}
for(var12 = 0; var12 < 8; ++var12) {
var13 = var4 + this.field_73220_k.nextInt(16) + 8;
var14 = this.field_73220_k.nextInt(128);
int var15 = var5 + this.field_73220_k.nextInt(16) + 8;
(new WorldGenDungeons()).func_76484_a(this.field_73230_p, this.field_73220_k, var13, var14, var15);
}
var6.func_76728_a(this.field_73230_p, this.field_73220_k, var4, var5);
SpawnerAnimals.func_77191_a(this.field_73230_p, var6, var4 + 8, var5 + 8, 16, 16, this.field_73220_k);
var4 += 8;
var5 += 8;
for(var12 = 0; var12 < 16; ++var12) {
for(var13 = 0; var13 < 16; ++var13) {
var14 = this.field_73230_p.func_72874_g(var4 + var12, var5 + var13);
if(this.field_73230_p.func_72884_u(var12 + var4, var14 - 1, var13 + var5)) {
this.field_73230_p.func_72832_d(var12 + var4, var14 - 1, var13 + var5, Block.field_72036_aT.field_71990_ca, 0, 2);
}
if(this.field_73230_p.func_72858_w(var12 + var4, var14, var13 + var5)) {
this.field_73230_p.func_72832_d(var12 + var4, var14, var13 + var5, Block.field_72037_aS.field_71990_ca, 0, 2);
}
}
}
BlockSand.field_72192_a = false;
}
项目:RuneCraftery
文件:ChunkProviderFlat.java
public ChunkProviderFlat(World par1World, long par2, boolean par4, String par5Str)
{
this.worldObj = par1World;
this.random = new Random(par2);
this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(par5Str);
if (par4)
{
Map map = this.flatWorldGenInfo.getWorldFeatures();
if (map.containsKey("village"))
{
Map map1 = (Map)map.get("village");
if (!map1.containsKey("size"))
{
map1.put("size", "1");
}
this.structureGenerators.add(new MapGenVillage(map1));
}
if (map.containsKey("biome_1"))
{
this.structureGenerators.add(new MapGenScatteredFeature((Map)map.get("biome_1")));
}
if (map.containsKey("mineshaft"))
{
this.structureGenerators.add(new MapGenMineshaft((Map)map.get("mineshaft")));
}
if (map.containsKey("stronghold"))
{
this.structureGenerators.add(new MapGenStronghold((Map)map.get("stronghold")));
}
}
this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration");
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake"))
{
this.waterLakeGenerator = new WorldGenLakes(Block.waterStill.blockID);
}
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake"))
{
this.lavaLakeGenerator = new WorldGenLakes(Block.lavaStill.blockID);
}
this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon");
Iterator iterator = this.flatWorldGenInfo.getFlatLayers().iterator();
while (iterator.hasNext())
{
FlatLayerInfo flatlayerinfo = (FlatLayerInfo)iterator.next();
for (int j = flatlayerinfo.getMinY(); j < flatlayerinfo.getMinY() + flatlayerinfo.getLayerCount(); ++j)
{
this.cachedBlockIDs[j] = (byte)(flatlayerinfo.getFillBlock() & 255);
this.cachedBlockMetadata[j] = (byte)flatlayerinfo.getFillBlockMeta();
}
}
}
项目:BetterNutritionMod
文件:ChunkProviderFlat.java
public ChunkProviderFlat(World par1World, long par2, boolean par4, String par5Str)
{
this.worldObj = par1World;
this.random = new Random(par2);
this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(par5Str);
if (par4)
{
Map map = this.flatWorldGenInfo.getWorldFeatures();
if (map.containsKey("village"))
{
Map map1 = (Map)map.get("village");
if (!map1.containsKey("size"))
{
map1.put("size", "1");
}
this.structureGenerators.add(new MapGenVillage(map1));
}
if (map.containsKey("biome_1"))
{
this.structureGenerators.add(new MapGenScatteredFeature((Map)map.get("biome_1")));
}
if (map.containsKey("mineshaft"))
{
this.structureGenerators.add(new MapGenMineshaft((Map)map.get("mineshaft")));
}
if (map.containsKey("stronghold"))
{
this.structureGenerators.add(new MapGenStronghold((Map)map.get("stronghold")));
}
}
this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration");
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake"))
{
this.waterLakeGenerator = new WorldGenLakes(Block.waterStill.blockID);
}
if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake"))
{
this.lavaLakeGenerator = new WorldGenLakes(Block.lavaStill.blockID);
}
this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon");
Iterator iterator = this.flatWorldGenInfo.getFlatLayers().iterator();
while (iterator.hasNext())
{
FlatLayerInfo flatlayerinfo = (FlatLayerInfo)iterator.next();
for (int j = flatlayerinfo.getMinY(); j < flatlayerinfo.getMinY() + flatlayerinfo.getLayerCount(); ++j)
{
this.cachedBlockIDs[j] = (byte)(flatlayerinfo.getFillBlock() & 255);
this.cachedBlockMetadata[j] = (byte)flatlayerinfo.getFillBlockMeta();
}
}
}
项目:AgeCraft-Old
文件:AgeChunkProvider.java
@Override
public void populate(IChunkProvider chunkProvider, int chunkX, int chunkZ) {
BlockFalling.fallInstantly = true;
int x = chunkX * 16;
int z = chunkZ * 16;
BiomeGenBase biome = world.getBiomeGenForCoords(x + 16, z + 16);
random.setSeed(world.getSeed());
long randLong1 = random.nextLong() / 2L * 2L + 1L;
long randLong2 = random.nextLong() / 2L * 2L + 1L;
random.setSeed((long) chunkX * randLong1 + (long) chunkZ * randLong2 ^ world.getSeed());
boolean flag = false;
MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(chunkProvider, world, random, chunkX, chunkZ, flag));
if(mapFeaturesEnabled) {
populateMapGenerators(chunkProvider, chunkX, chunkX);
}
int xx;
int yy;
int zz;
if(biome != BiomeGenBase.desert && biome != BiomeGenBase.desertHills && !flag && random.nextInt(4) == 0 && TerrainGen.populate(chunkProvider, world, random, chunkX, chunkZ, flag, LAKE)) {
xx = x + random.nextInt(16) + 8;
yy = random.nextInt(256);
zz = z + random.nextInt(16) + 8;
(new WorldGenLakes(Blocks.water)).generate(world, random, xx, yy, zz);
}
if(TerrainGen.populate(chunkProvider, world, random, chunkX, chunkZ, flag, LAVA) && !flag && this.random.nextInt(8) == 0) {
xx = x + random.nextInt(16) + 8;
yy = random.nextInt(random.nextInt(248) + 8);
zz = z + random.nextInt(16) + 8;
if(yy < 63 || random.nextInt(10) == 0) {
(new WorldGenLakes(Blocks.lava)).generate(world, random, xx, yy, zz);
}
}
boolean doGen = TerrainGen.populate(chunkProvider, world, random, chunkX, chunkZ, flag, DUNGEON);
for(xx = 0; doGen && xx < 8; ++xx) {
yy = x + random.nextInt(16) + 8;
zz = random.nextInt(256);
int j2 = z + random.nextInt(16) + 8;
(new WorldGenDungeons()).generate(world, random, yy, zz, j2);
}
if(biome instanceof AgeBiome) {
AgeBiome ageBiome = (AgeBiome) biome;
ageBiome.chunkProvider = this;
ageBiome.decorate(world, random, x, z);
ageBiome.chunkProvider = null;
} else {
biome.decorate(world, random, x, z);
}
SpawnerAnimals.performWorldGenSpawning(world, biome, x + 8, z + 8, 16, 16, random);
x += 8;
z += 8;
doGen = TerrainGen.populate(chunkProvider, world, random, chunkX, chunkZ, flag, ICE);
for(xx = 0; doGen && xx < 16; ++xx) {
for(yy = 0; yy < 16; ++yy) {
zz = world.getPrecipitationHeight(x + xx, z + yy);
if(world.isBlockFreezable(xx + x, zz - 1, yy + z)) {
world.setBlock(xx + x, zz - 1, yy + z, Blocks.ice, 0, 2);
}
if(world.func_147478_e(xx + x, zz, yy + z, true)) {
world.setBlock(xx + x, zz, yy + z, Blocks.snow_layer, 0, 2);
}
}
}
MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(chunkProvider, world, random, chunkX, chunkZ, flag));
BlockFalling.fallInstantly = false;
}
项目:Eldritch-Infusion
文件:ChunkProviderEI.java
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
BlockSand.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));
if (this.mapFeaturesEnabled) {
this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
flag = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
}
int k1;
int l1;
int i2;
if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE) && !flag && this.rand.nextInt(4) == 0) {
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);
}
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(120) + 8);
i2 = l + this.rand.nextInt(16) + 8;
if (l1 < 63 || this.rand.nextInt(10) == 0) {
(new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.rand, k1, l1, i2);
}
}
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(128);
int j2 = l + this.rand.nextInt(16) + 8;
if ((new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2)) {
;
}
}
biomegenbase.decorate(this.worldObj, this.rand, k, l);
SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
k += 8;
l += 8;
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, Block.ice.blockID, 0, 2);
}
if (this.worldObj.canSnowAt(k1 + k, i2, l1 + l)) {
this.worldObj.setBlock(k1 + k, i2, l1 + l, Block.snow.blockID, 0, 2);
}
}
}
MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));
BlockSand.fallInstantly = false;
}
项目:Eldritch-Infusion
文件:ChunkProviderEI.java
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
BlockSand.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));
if (this.mapFeaturesEnabled) {
this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
flag = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
}
int k1;
int l1;
int i2;
if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE) && !flag && this.rand.nextInt(4) == 0) {
k1 = k + this.rand.nextInt(16) + 8;
l1 = this.rand.nextInt(128);
i2 = l + this.rand.nextInt(16) + 8;
(new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, 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(120) + 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);
}
}
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(128);
int j2 = l + this.rand.nextInt(16) + 8;
if ((new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2)) {
;
}
}
biomegenbase.decorate(this.worldObj, this.rand, k, l);
SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
k += 8;
l += 8;
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.canSnowAt(k1 + k, i2, l1 + l)) {
this.worldObj.setBlock(k1 + k, i2, l1 + l, Blocks.snow, 0, 2);
}
}
}
MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));
BlockSand.fallInstantly = false;
}
项目:JLPModJam
文件:ChunkProviderNightMare.java
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
BlockSand.fallInstantly = true;
int k = par2 * 16;
int l = par3 * 16;
BiomeDreamLand biomedreamland = (BiomeDreamLand) 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));
int k1;
int l1;
int i2;
if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE) &&
!flag && this.rand.nextInt(4) == 0)
{
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);//water
}
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(120) + 8);
i2 = l + this.rand.nextInt(16) + 8;
if (l1 < 63 || this.rand.nextInt(10) == 0)
{
(new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.rand, k1, l1, i2);//lava
}
}
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(128);
int j2 = l + this.rand.nextInt(16) + 8;
if ((new WorldGenDLDungeons()).generate(this.worldObj, this.rand, l1, i2, j2))
{
;
}
}
biomedreamland.decorate(this.worldObj, this.rand, k, l);
SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomedreamland, 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));
BlockSand.fallInstantly = false;
}
项目:powell.cellarium
文件:RasterlandChunkProvider.java
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
BlockSand.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));
if (this.mapFeaturesEnabled) {
// this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
flag = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
System.out.println("flag is " + flag);
this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
}
int k1;
int l1;
int i2;
if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE) && !flag && this.rand.nextInt(4) == 0) {
k1 = k + this.rand.nextInt(16) + 8;
l1 = this.rand.nextInt(128);
i2 = l + this.rand.nextInt(16) + 8;
(new WorldGenLakes(Fluids.blockRasterWasser.blockID)).generate(this.worldObj, this.rand, 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(120) + 8);
i2 = l + this.rand.nextInt(16) + 8;
if (l1 < 63 || this.rand.nextInt(10) == 0) {
(new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.rand, k1, l1, i2);
}
}
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(128);
int j2 = l + this.rand.nextInt(16) + 8;
if ((new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2)) {
;
}
}
MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));
BlockSand.fallInstantly = false;
}