下面列出了怎么用net.minecraft.world.gen.feature.WorldGenLakes的API类实例代码及写法,或者点击链接到github查看源代码。
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();
}
@Override
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());
if (p_73153_2_ % 4 == 0 || p_73153_3_ % 4 == 0) {
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_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false));
int x1;
int y1;
int z1;
if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) {
x1 = k + this.rand.nextInt(16) + 8;
y1 = this.rand.nextInt(256);
z1 = l + this.rand.nextInt(16) + 8;
int rni = this.rand.nextInt(8);
if (rni == 0)
(new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1);
else if (rni == 4)
(new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1);
}
if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver
&& this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) {
x1 = k + this.rand.nextInt(16) + 3;
y1 = this.rand.nextInt(256);
z1 = l + this.rand.nextInt(16) + 3;
this.ruinsBase.generate(this.worldObj, this.rand, x1, y1, z1);
}
biomegenbase.decorate(this.worldObj, this.rand, k, l);
k += 8;
l += 8;
boolean doGen = TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, ICE);
for (x1 = 0; doGen && x1 < 16; ++x1) {
for (y1 = 0; y1 < 16; ++y1) {
z1 = this.worldObj.getPrecipitationHeight(k + x1, l + y1);
if (this.worldObj.isBlockFreezable(x1 + k, z1 - 1, y1 + l)) {
this.worldObj.setBlock(x1 + k, z1 - 1, y1 + l, Blocks.ice, 0, 2);
}
if (this.worldObj.func_147478_e(x1 + k, z1, y1 + l, true)) {
this.worldObj.setBlock(x1 + k, z1, y1 + l, Blocks.snow_layer, 0, 2);
}
}
}
BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this);
MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false));
BlockFalling.fallInstantly = false;
}
/**
* Populates chunk with ores etc etc
*/
public void populate(IChunkProvider par1IChunkProvider, int par2, int par3)
{
BlockSand.fallInstantly = true;
MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, worldObj.rand, par2, par3, false));
int var4 = par2 * 16;
int var5 = par3 * 16;
BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
//this.RNGa.setSeed(this.worldObj.getSeed());
long var7 = this.RNGa.nextLong() / 2L * 2L + 1L;
long var9 = this.RNGa.nextLong() / 2L * 2L + 1L;
//this.RNGa.setSeed((long)par2 * var7 + (long)par3 * var9 ^ this.worldObj.getSeed());
boolean var11 = false;
int var12;
int var13;
int var14;
if (!var11 && this.RNGa.nextInt(2) == 0)
{
var12 = var4 + this.RNGa.nextInt(16) + 8;
var13 = this.RNGa.nextInt(128);
var14 = var5 + this.RNGa.nextInt(16) + 8;
(new WorldGenLakes(Block.waterStill.blockID)).generate(this.worldObj, this.RNGa, var12, var13, var14);
}
if (!var11 && this.RNGa.nextInt(8) == 0)
{
var12 = var4 + this.RNGa.nextInt(16) + 8;
var13 = this.RNGa.nextInt(this.RNGa.nextInt(120) + 8);
var14 = var5 + this.RNGa.nextInt(16) + 8;
if (var13 < 63 || this.RNGa.nextInt(10) == 0)
{
(new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.RNGa, var12, var13, var14);
}
}
var6.decorate(this.worldObj, this.RNGa, var4, var5);
SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.RNGa);
if (!portalDone) createPortal(this.worldObj, this.RNGa);
/* while(!portalDone)
{
createPortal(this.worldObj, this.RNGa);
}
*/
MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, worldObj.rand, par2, par3, false));
BlockSand.fallInstantly = false;
}