Added a redwood shrub thing to Redwood Forests
This commit is contained in:
parent
2343994014
commit
47bd4d85ac
5 changed files with 94 additions and 10 deletions
|
@ -90,6 +90,7 @@ import biomesoplenty.worldgen.WorldGenPotatoes;
|
||||||
import biomesoplenty.worldgen.WorldGenPumpkinAlt;
|
import biomesoplenty.worldgen.WorldGenPumpkinAlt;
|
||||||
import biomesoplenty.worldgen.WorldGenQuagmire;
|
import biomesoplenty.worldgen.WorldGenQuagmire;
|
||||||
import biomesoplenty.worldgen.WorldGenQuicksand;
|
import biomesoplenty.worldgen.WorldGenQuicksand;
|
||||||
|
import biomesoplenty.worldgen.WorldGenRedwoodShrub;
|
||||||
import biomesoplenty.worldgen.WorldGenReedBOP;
|
import biomesoplenty.worldgen.WorldGenReedBOP;
|
||||||
import biomesoplenty.worldgen.WorldGenShield;
|
import biomesoplenty.worldgen.WorldGenShield;
|
||||||
import biomesoplenty.worldgen.WorldGenShortKelp;
|
import biomesoplenty.worldgen.WorldGenShortKelp;
|
||||||
|
@ -234,6 +235,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
||||||
public WorldGenerator bluebellGen;
|
public WorldGenerator bluebellGen;
|
||||||
public WorldGenerator minersDelightGen;
|
public WorldGenerator minersDelightGen;
|
||||||
public WorldGenerator icyIrisGen;
|
public WorldGenerator icyIrisGen;
|
||||||
|
public WorldGenerator redwoodShrubGen;
|
||||||
|
|
||||||
public WorldGenerator boneSpineGen;
|
public WorldGenerator boneSpineGen;
|
||||||
public WorldGenerator boneSpine2Gen;
|
public WorldGenerator boneSpine2Gen;
|
||||||
|
@ -331,6 +333,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
||||||
public int minersDelightPerChunk;
|
public int minersDelightPerChunk;
|
||||||
public int icyIrisPerChunk;
|
public int icyIrisPerChunk;
|
||||||
public int waterReedsPerChunk;
|
public int waterReedsPerChunk;
|
||||||
|
public int redwoodShrubsPerChunk;
|
||||||
|
|
||||||
public int boneSpinesPerChunk;
|
public int boneSpinesPerChunk;
|
||||||
public int boneSpines2PerChunk;
|
public int boneSpines2PerChunk;
|
||||||
|
@ -536,6 +539,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
||||||
waterlilyGen = new WorldGenWaterlily();
|
waterlilyGen = new WorldGenWaterlily();
|
||||||
algaeGen = new WorldGenAlgae();
|
algaeGen = new WorldGenAlgae();
|
||||||
waterReedGen = new WorldGenWaterReeds();
|
waterReedGen = new WorldGenWaterReeds();
|
||||||
|
redwoodShrubGen = new WorldGenRedwoodShrub(0,0);
|
||||||
pitGen = new WorldGenPit(Blocks.ash.get().blockID);
|
pitGen = new WorldGenPit(Blocks.ash.get().blockID);
|
||||||
waterlilyPerChunk = 0;
|
waterlilyPerChunk = 0;
|
||||||
lilyflowersPerChunk = 0;
|
lilyflowersPerChunk = 0;
|
||||||
|
@ -628,6 +632,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
||||||
minersDelightPerChunk = 2;
|
minersDelightPerChunk = 2;
|
||||||
icyIrisPerChunk = 0;
|
icyIrisPerChunk = 0;
|
||||||
waterReedsPerChunk = 0;
|
waterReedsPerChunk = 0;
|
||||||
|
redwoodShrubsPerChunk = 0;
|
||||||
generateLakes = true;
|
generateLakes = true;
|
||||||
generateAsh = false;
|
generateAsh = false;
|
||||||
generateMycelium = false;
|
generateMycelium = false;
|
||||||
|
@ -1546,6 +1551,14 @@ public class BiomeDecoratorBOP extends BiomeDecorator
|
||||||
highCattailGen.generate(currentWorld, randomGenerator, var3, var4, var5);
|
highCattailGen.generate(currentWorld, randomGenerator, var3, var4, var5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (var2 = 0; var2 < redwoodShrubsPerChunk; ++var2)
|
||||||
|
{
|
||||||
|
var3 = chunk_X + randomGenerator.nextInt(16) + 8;
|
||||||
|
var4 = randomGenerator.nextInt(50) + 70;
|
||||||
|
var5 = chunk_Z + randomGenerator.nextInt(16) + 8;
|
||||||
|
redwoodShrubGen.generate(currentWorld, randomGenerator, var3, var4, var5);
|
||||||
|
}
|
||||||
|
|
||||||
//Added
|
//Added
|
||||||
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH);
|
doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH);
|
||||||
for (var2 = 0; doGen && var2 < deadBushPerChunk; ++var2)
|
for (var2 = 0; doGen && var2 < deadBushPerChunk; ++var2)
|
||||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.world.gen.feature.WorldGenShrub;
|
||||||
import net.minecraft.world.gen.feature.WorldGenTallGrass;
|
import net.minecraft.world.gen.feature.WorldGenTallGrass;
|
||||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||||
import biomesoplenty.configuration.configfile.BOPConfigurationMain;
|
import biomesoplenty.configuration.configfile.BOPConfigurationMain;
|
||||||
|
import biomesoplenty.worldgen.WorldGenRedwoodShrub;
|
||||||
import biomesoplenty.worldgen.realtree.WorldGenRealRedwood;
|
import biomesoplenty.worldgen.realtree.WorldGenRealRedwood;
|
||||||
import biomesoplenty.worldgen.realtree.WorldGenRealRedwood2;
|
import biomesoplenty.worldgen.realtree.WorldGenRealRedwood2;
|
||||||
import biomesoplenty.worldgen.tree.WorldGenRedwoodTree;
|
import biomesoplenty.worldgen.tree.WorldGenRedwoodTree;
|
||||||
|
@ -23,12 +24,13 @@ public class BiomeGenRedwoodForest extends BiomeGenBase
|
||||||
super(par1);
|
super(par1);
|
||||||
theBiomeDecorator = new BiomeDecoratorBOP(this);
|
theBiomeDecorator = new BiomeDecoratorBOP(this);
|
||||||
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
|
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
|
||||||
customBiomeDecorator.treesPerChunk = 6;
|
customBiomeDecorator.treesPerChunk = 50;
|
||||||
customBiomeDecorator.grassPerChunk = 16;
|
customBiomeDecorator.grassPerChunk = 16;
|
||||||
customBiomeDecorator.bushesPerChunk = 4;
|
customBiomeDecorator.bushesPerChunk = 4;
|
||||||
customBiomeDecorator.berryBushesPerChunk = 1;
|
customBiomeDecorator.berryBushesPerChunk = 1;
|
||||||
customBiomeDecorator.wheatGrassPerChunk = 7;
|
customBiomeDecorator.wheatGrassPerChunk = 7;
|
||||||
customBiomeDecorator.shrubsPerChunk = 10;
|
customBiomeDecorator.shrubsPerChunk = 10;
|
||||||
|
customBiomeDecorator.redwoodShrubsPerChunk = 100;
|
||||||
customBiomeDecorator.generatePumpkins = false;
|
customBiomeDecorator.generatePumpkins = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +45,7 @@ public class BiomeGenRedwoodForest extends BiomeGenBase
|
||||||
return par1Random.nextInt(4) == 0 ? new WorldGenRealRedwood() : (par1Random.nextInt(2) == 0 ? new WorldGenShrub(0,0) : new WorldGenRealRedwood2());
|
return par1Random.nextInt(4) == 0 ? new WorldGenRealRedwood() : (par1Random.nextInt(2) == 0 ? new WorldGenShrub(0,0) : new WorldGenRealRedwood2());
|
||||||
}
|
}
|
||||||
|
|
||||||
return par1Random.nextInt(4) == 0 ? new WorldGenRedwoodTree(false) : (par1Random.nextInt(2) == 0 ? new WorldGenShrub(0,0) : new WorldGenRedwoodTree2(false));
|
return par1Random.nextInt(4) == 0 ? new WorldGenRedwoodTree(false) : (par1Random.nextInt(8) == 0 ? new WorldGenShrub(0,0) : new WorldGenRedwoodTree2(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
69
common/biomesoplenty/worldgen/WorldGenRedwoodShrub.java
Normal file
69
common/biomesoplenty/worldgen/WorldGenRedwoodShrub.java
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
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 WorldGenRedwoodShrub extends WorldGenerator
|
||||||
|
{
|
||||||
|
private int field_76527_a;
|
||||||
|
private int field_76526_b;
|
||||||
|
|
||||||
|
public WorldGenRedwoodShrub(int par1, int par2)
|
||||||
|
{
|
||||||
|
field_76526_b = par1;
|
||||||
|
field_76527_a = par2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
|
||||||
|
{
|
||||||
|
int var15;
|
||||||
|
|
||||||
|
for (boolean var6 = false; ((var15 = par1World.getBlockId(par3, par4, par5)) == 0 || var15 == Blocks.leavesColorized.get().blockID) && par4 > 0; --par4)
|
||||||
|
{
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
int var7 = par1World.getBlockId(par3, par4, par5);
|
||||||
|
int var77 = par1World.getBlockMetadata(par3, par4, par5);
|
||||||
|
|
||||||
|
if (var7 == Blocks.logs3.get().blockID)
|
||||||
|
{
|
||||||
|
if (var77 == 0)
|
||||||
|
{
|
||||||
|
if (par1World.isAirBlock(par3 - 1, par4, par5) || par1World.isAirBlock(par3 + 1, par4, par5) || par1World.isAirBlock(par3, par4, par5 - 1) || par1World.isAirBlock(par3, par4, par5 + 1))
|
||||||
|
{
|
||||||
|
++par4;
|
||||||
|
this.setBlockAndMetadata(par1World, par3, par4, par5, Blocks.logs3.get().blockID,0);
|
||||||
|
|
||||||
|
for (int var8 = par4; var8 <= par4 + 1; ++var8)
|
||||||
|
{
|
||||||
|
int var9 = var8 - par4;
|
||||||
|
int var10 = 2 - var9;
|
||||||
|
|
||||||
|
for (int var11 = par3 - var10; var11 <= par3 + var10; ++var11)
|
||||||
|
{
|
||||||
|
int var12 = var11 - par3;
|
||||||
|
|
||||||
|
for (int var13 = par5 - var10; var13 <= par5 + var10; ++var13)
|
||||||
|
{
|
||||||
|
int var14 = var13 - par5;
|
||||||
|
|
||||||
|
if ((Math.abs(var12) != var10 || Math.abs(var14) != var10 || par2Random.nextInt(2) != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var11, var8, var13)])
|
||||||
|
{
|
||||||
|
this.setBlockAndMetadata(par1World, var11, var8, var13, Blocks.leavesColorized.get().blockID, 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,7 +24,7 @@ public class WorldGenRedwoodTree extends WorldGenerator
|
||||||
|
|
||||||
public WorldGenRedwoodTree(boolean par1)
|
public WorldGenRedwoodTree(boolean par1)
|
||||||
{
|
{
|
||||||
this(par1, 30, 0, 0, false);
|
this(par1, 40, 0, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldGenRedwoodTree(boolean par1, int par2, int par3, int par4, boolean par5)
|
public WorldGenRedwoodTree(boolean par1, int par2, int par3, int par4, boolean par5)
|
||||||
|
@ -62,16 +62,16 @@ public class WorldGenRedwoodTree extends WorldGenerator
|
||||||
|
|
||||||
for (var8 = par4; var8 <= par4 + 1 + var6; ++var8)
|
for (var8 = par4; var8 <= par4 + 1 + var6; ++var8)
|
||||||
{
|
{
|
||||||
var9 = 1;
|
var9 = 7;
|
||||||
|
|
||||||
if (var8 == par4)
|
if (var8 == par4)
|
||||||
{
|
{
|
||||||
var9 = 0;
|
var9 = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var8 >= par4 + 1 + var6 - 2)
|
if (var8 >= par4 + 1 + var6 - 2)
|
||||||
{
|
{
|
||||||
var9 = 2;
|
var9 = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10)
|
for (int var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10)
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class WorldGenRedwoodTree2 extends WorldGenerator
|
||||||
@Override
|
@Override
|
||||||
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
|
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
int var6 = par2Random.nextInt(10) + minTreeHeight;
|
int var6 = par2Random.nextInt(15) + minTreeHeight;
|
||||||
boolean var7 = true;
|
boolean var7 = true;
|
||||||
|
|
||||||
if (par4 >= 1 && par4 + var6 + 1 <= 256)
|
if (par4 >= 1 && par4 + var6 + 1 <= 256)
|
||||||
|
@ -58,16 +58,16 @@ public class WorldGenRedwoodTree2 extends WorldGenerator
|
||||||
|
|
||||||
for (var8 = par4; var8 <= par4 + 1 + var6; ++var8)
|
for (var8 = par4; var8 <= par4 + 1 + var6; ++var8)
|
||||||
{
|
{
|
||||||
var9 = 1;
|
var9 = 5;
|
||||||
|
|
||||||
if (var8 == par4)
|
if (var8 == par4)
|
||||||
{
|
{
|
||||||
var9 = 0;
|
var9 = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var8 >= par4 + 1 + var6 - 2)
|
if (var8 >= par4 + 1 + var6 - 2)
|
||||||
{
|
{
|
||||||
var9 = 2;
|
var9 = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10)
|
for (int var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10)
|
||||||
|
|
Loading…
Reference in a new issue