Added Gravestone gen to the nether
This commit is contained in:
parent
1d569786fd
commit
af27d0d3d0
8 changed files with 140 additions and 11 deletions
|
@ -1,9 +1,13 @@
|
|||
package biomesoplenty.biomes;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import biomesoplenty.worldgen.WorldGenGrave;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntityMagmaCube;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
|
||||
|
@ -26,4 +30,18 @@ public class BiomeGenNetherBase extends BiomeGenBase
|
|||
spawnableMonsterList.add(new SpawnListEntry(EntityPigZombie.class, 100, 4, 4));
|
||||
spawnableMonsterList.add(new SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decorate(World par1World, Random par2Random, int par3, int par4)
|
||||
{
|
||||
super.decorate(par1World, par2Random, par3, par4);
|
||||
|
||||
if (par2Random.nextInt(15) == 0)
|
||||
{
|
||||
int var5 = par3 + par2Random.nextInt(16) + 8;
|
||||
int var6 = par4 + par2Random.nextInt(16) + 8;
|
||||
WorldGenGrave var7 = new WorldGenGrave();
|
||||
var7.generate(par1World, par2Random, var5, par1World.getHeightValue(var5, var6) + 1, var6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
package biomesoplenty.biomes;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import biomesoplenty.api.Blocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntityMagmaCube;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
import biomesoplenty.worldgen.WorldGenGrave;
|
||||
|
||||
public class BiomeGenNetherBone extends BiomeGenBase
|
||||
{
|
||||
|
@ -28,4 +33,18 @@ public class BiomeGenNetherBone extends BiomeGenBase
|
|||
spawnableMonsterList.add(new SpawnListEntry(EntityPigZombie.class, 100, 4, 4));
|
||||
spawnableMonsterList.add(new SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decorate(World par1World, Random par2Random, int par3, int par4)
|
||||
{
|
||||
super.decorate(par1World, par2Random, par3, par4);
|
||||
|
||||
if (par2Random.nextInt(10) == 0)
|
||||
{
|
||||
int var5 = par3 + par2Random.nextInt(16) + 8;
|
||||
int var6 = par4 + par2Random.nextInt(16) + 8;
|
||||
WorldGenGrave var7 = new WorldGenGrave();
|
||||
var7.generate(par1World, par2Random, var5, par1World.getHeightValue(var5, var6) + 1, var6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package biomesoplenty.biomes;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import biomesoplenty.worldgen.WorldGenGrave;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntityMagmaCube;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
|
||||
|
@ -28,4 +32,18 @@ public class BiomeGenNetherDesert extends BiomeGenBase
|
|||
spawnableMonsterList.add(new SpawnListEntry(EntityPigZombie.class, 100, 4, 4));
|
||||
spawnableMonsterList.add(new SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decorate(World par1World, Random par2Random, int par3, int par4)
|
||||
{
|
||||
super.decorate(par1World, par2Random, par3, par4);
|
||||
|
||||
if (par2Random.nextInt(5) == 0)
|
||||
{
|
||||
int var5 = par3 + par2Random.nextInt(16) + 8;
|
||||
int var6 = par4 + par2Random.nextInt(16) + 8;
|
||||
WorldGenGrave var7 = new WorldGenGrave();
|
||||
var7.generate(par1World, par2Random, var5, par1World.getHeightValue(var5, var6) + 1, var6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,11 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntityMagmaCube;
|
||||
import net.minecraft.entity.monster.EntityPigZombie;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import biomesoplenty.worldgen.WorldGenGrave;
|
||||
import biomesoplenty.worldgen.WorldGenNetherMushroom;
|
||||
|
||||
public class BiomeGenNetherGarden extends BiomeGenBase
|
||||
|
@ -47,4 +49,18 @@ public class BiomeGenNetherGarden extends BiomeGenBase
|
|||
{
|
||||
return new WorldGenNetherMushroom();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decorate(World par1World, Random par2Random, int par3, int par4)
|
||||
{
|
||||
super.decorate(par1World, par2Random, par3, par4);
|
||||
|
||||
if (par2Random.nextInt(20) == 0)
|
||||
{
|
||||
int var5 = par3 + par2Random.nextInt(16) + 8;
|
||||
int var6 = par4 + par2Random.nextInt(16) + 8;
|
||||
WorldGenGrave var7 = new WorldGenGrave();
|
||||
var7.generate(par1World, par2Random, var5, par1World.getHeightValue(var5, var6) + 1, var6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.world.biome.BiomeGenBase;
|
|||
import net.minecraft.world.biome.SpawnListEntry;
|
||||
import net.minecraft.world.gen.feature.WorldGenFire;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import biomesoplenty.worldgen.WorldGenGrave;
|
||||
import biomesoplenty.worldgen.WorldGenLavaSpring;
|
||||
|
||||
public class BiomeGenNetherLava extends BiomeGenBase
|
||||
|
@ -64,5 +65,13 @@ public class BiomeGenNetherLava extends BiomeGenBase
|
|||
var8 = par4 + par2Random.nextInt(16);
|
||||
theWorldGenerator.generate(par1World, par2Random, var6, var7, var8);
|
||||
}
|
||||
|
||||
if (par2Random.nextInt(15) == 0)
|
||||
{
|
||||
int var55 = par3 + par2Random.nextInt(16) + 8;
|
||||
int var66 = par4 + par2Random.nextInt(16) + 8;
|
||||
WorldGenGrave var77 = new WorldGenGrave();
|
||||
var77.generate(par1World, par2Random, var55, par1World.getHeightValue(var55, var66) + 1, var66);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class BiomeGenPromisedLandForest extends BiomeGenBase
|
|||
@Override
|
||||
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
|
||||
{
|
||||
return par1Random.nextInt(4) == 0 ? new WorldGenPromisedTree3(false) : (par1Random.nextInt(2) == 0 ? new WorldGenPromisedShrub(0,0) : (par1Random.nextInt(8) == 0 ? new WorldGenPromisedTree2(false) : new WorldGenPromisedTree(false)));
|
||||
return par1Random.nextInt(2) == 0 ? new WorldGenPromisedShrub(0,0) : (par1Random.nextInt(8) == 0 ? new WorldGenPromisedTree2(false) : new WorldGenPromisedTree(false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
49
src/minecraft/biomesoplenty/worldgen/WorldGenGrave.java
Normal file
49
src/minecraft/biomesoplenty/worldgen/WorldGenGrave.java
Normal file
|
@ -0,0 +1,49 @@
|
|||
package biomesoplenty.worldgen;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import biomesoplenty.api.Blocks;
|
||||
|
||||
public class WorldGenGrave extends WorldGenerator
|
||||
{
|
||||
@Override
|
||||
public boolean generate(World var1, Random var2, int var3, int var4, int var5)
|
||||
{
|
||||
while (var1.isAirBlock(var3, var4, var5) && var4 > 2)
|
||||
{
|
||||
--var4;
|
||||
}
|
||||
|
||||
int var6 = var1.getBlockId(var3, var4, var5);
|
||||
|
||||
if (var6 != Block.netherrack.blockID && var6 != Block.slowSand.blockID)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
for (int var7 = -2; var7 <= 2; ++var7)
|
||||
{
|
||||
for (int var8 = -2; var8 <= 2; ++var8)
|
||||
{
|
||||
if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8) && !var1.isAirBlock(var3 + var7, var4, var5 + var8))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int var999 = var2.nextInt(4);
|
||||
|
||||
if (var999 == 0 || var999 == 1)
|
||||
{
|
||||
var1.setBlock(var3, var4 + 1, var5, Blocks.grave.get().blockID, 0, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
var1.setBlock(var3, var4 + 1, var5, Blocks.grave.get().blockID, 2, 2);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ public class WorldGenPromisedWillowTree extends WorldGenerator
|
|||
{
|
||||
int var6;
|
||||
|
||||
for (var6 = par2Random.nextInt(6) + 8; par1World.getBlockMaterial(par3, par4 - 1, par5) == Material.water; --par4)
|
||||
for (var6 = par2Random.nextInt(8) + 6; par1World.getBlockMaterial(par3, par4 - 1, par5) == Material.water; --par4)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public class WorldGenPromisedWillowTree extends WorldGenerator
|
|||
|
||||
if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var12, var16, var14)])
|
||||
{
|
||||
this.setBlock(par1World, var12, var16, var14, Block.leaves.blockID);
|
||||
this.setBlockAndMetadata(par1World, var12, var16, var14, Block.leaves.blockID, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public class WorldGenPromisedWillowTree extends WorldGenerator
|
|||
|
||||
if (var10 == 0 || var10 == Block.leaves.blockID || var10 == Block.waterMoving.blockID || var10 == Block.waterStill.blockID)
|
||||
{
|
||||
this.setBlock(par1World, par3, par4 + var16, par5, Block.wood.blockID);
|
||||
this.setBlockAndMetadata(par1World, par3, par4 + var16, par5, Block.wood.blockID, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,22 +125,22 @@ public class WorldGenPromisedWillowTree extends WorldGenerator
|
|||
{
|
||||
if (par1World.getBlockId(var12, var16, var13) == Block.leaves.blockID)
|
||||
{
|
||||
if (par2Random.nextInt(3) == 0 && par1World.getBlockId(var12 - 1, var16, var13) == 0)
|
||||
if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var12 - 1, var16, var13) == 0)
|
||||
{
|
||||
this.generateVines(par1World, var12 - 1, var16, var13, 8);
|
||||
}
|
||||
|
||||
if (par2Random.nextInt(3) == 0 && par1World.getBlockId(var12 + 1, var16, var13) == 0)
|
||||
if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var12 + 1, var16, var13) == 0)
|
||||
{
|
||||
this.generateVines(par1World, var12 + 1, var16, var13, 2);
|
||||
}
|
||||
|
||||
if (par2Random.nextInt(3) == 0 && par1World.getBlockId(var12, var16, var13 - 1) == 0)
|
||||
if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var12, var16, var13 - 1) == 0)
|
||||
{
|
||||
this.generateVines(par1World, var12, var16, var13 - 1, 1);
|
||||
}
|
||||
|
||||
if (par2Random.nextInt(3) == 0 && par1World.getBlockId(var12, var16, var13 + 1) == 0)
|
||||
if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var12, var16, var13 + 1) == 0)
|
||||
{
|
||||
this.generateVines(par1World, var12, var16, var13 + 1, 4);
|
||||
}
|
||||
|
@ -162,8 +162,8 @@ public class WorldGenPromisedWillowTree extends WorldGenerator
|
|||
*/
|
||||
private void generateVines(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
this.setBlockAndMetadata(par1World, par2, par3, par4, Blocks.ivy.get().blockID, par5);
|
||||
int var6 = 8;
|
||||
this.setBlockAndMetadata(par1World, par2, par3, par4, Block.leaves.blockID, 4);
|
||||
int var6 = 24;
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
@ -172,7 +172,7 @@ public class WorldGenPromisedWillowTree extends WorldGenerator
|
|||
if (par1World.getBlockId(par2, par3, par4) != 0 || var6 <= 0)
|
||||
return;
|
||||
|
||||
this.setBlockAndMetadata(par1World, par2, par3, par4, Blocks.ivy.get().blockID, par5);
|
||||
this.setBlockAndMetadata(par1World, par2, par3, par4, Block.leaves.blockID, 4);
|
||||
--var6;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue