Fixed boulder gen for tundras/wastelands
This commit is contained in:
parent
081bd5150b
commit
f4c7c7b564
6 changed files with 107 additions and 6 deletions
|
@ -25,6 +25,7 @@ public class BiomeGenHighland extends BOPBiome
|
|||
this.theBiomeDecorator.grassPerChunk = 99;
|
||||
|
||||
this.bopWorldFeatures.setFeature("wildCarrotsPerChunk", 1);
|
||||
this.bopWorldFeatures.setFeature("rockpilesPerChunk", 3);
|
||||
|
||||
weightedGrassGen.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.25D);
|
||||
weightedGrassGen.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.25D);
|
||||
|
|
|
@ -27,7 +27,7 @@ public class BiomeGenTundra extends BOPBiome
|
|||
|
||||
this.spawnableCreatureList.clear();
|
||||
|
||||
this.theBiomeDecorator.treesPerChunk = 5;
|
||||
this.theBiomeDecorator.treesPerChunk = 3;
|
||||
this.theBiomeDecorator.grassPerChunk = 8;
|
||||
this.theBiomeDecorator.flowersPerChunk = -999;
|
||||
this.theBiomeDecorator.reedsPerChunk = -999;
|
||||
|
@ -36,7 +36,7 @@ public class BiomeGenTundra extends BOPBiome
|
|||
this.bopWorldFeatures.setFeature("bopFlowersPerChunk", 1);
|
||||
this.bopWorldFeatures.setFeature("shrubsPerChunk", 2);
|
||||
this.bopWorldFeatures.setFeature("waterReedsPerChunk", 2);
|
||||
this.bopWorldFeatures.setFeature("rockpilesPerChunk", 25);
|
||||
this.bopWorldFeatures.setFeature("rockpilesPerChunk", 2);
|
||||
this.bopWorldFeatures.setFeature("leafPilesPerChunk", 5);
|
||||
this.bopWorldFeatures.setFeature("deadLeafPilesPerChunk", 5);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public class BiomeGenWasteland extends BOPBiome
|
|||
this.bopWorldFeatures.setFeature("wasteland2PerChunk", 1);
|
||||
this.bopWorldFeatures.setFeature("wasteland3PerChunk", 1);
|
||||
this.bopWorldFeatures.setFeature("wasteland4PerChunk", 1);
|
||||
this.bopWorldFeatures.setFeature("wastelandRockPilesPerChunk", 1);
|
||||
this.bopWorldFeatures.setFeature("wastelandRockPilesPerChunk", 2);
|
||||
|
||||
weightedGrassGen.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("plants"), 0), 1D);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
package biomesoplenty.common.world.features;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import biomesoplenty.common.world.decoration.BOPDecorationManager;
|
||||
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
|
||||
|
||||
public class WorldGenBOPBlob extends WorldGeneratorBOP
|
||||
{
|
||||
private Block field_150545_a;
|
||||
private int field_150544_b;
|
||||
private static final String __OBFID = "CL_00000402";
|
||||
|
||||
public WorldGenBOPBlob(Block p_i45450_1_, int p_i45450_2_)
|
||||
{
|
||||
super(false);
|
||||
this.field_150545_a = p_i45450_1_;
|
||||
this.field_150544_b = p_i45450_2_;
|
||||
}
|
||||
|
||||
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (par4 > 3)
|
||||
{
|
||||
label63:
|
||||
{
|
||||
if (!par1World.isAirBlock(par3, par4 - 1, par5))
|
||||
{
|
||||
Block block = par1World.getBlock(par3, par4 - 1, par5);
|
||||
|
||||
if (block == Blocks.grass || block == Blocks.dirt || block == Blocks.stone)
|
||||
{
|
||||
break label63;
|
||||
}
|
||||
}
|
||||
|
||||
--par4;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (par4 <= 3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int k2 = this.field_150544_b;
|
||||
|
||||
for (int l = 0; k2 >= 0 && l < 3; ++l)
|
||||
{
|
||||
int i1 = k2 + par2Random.nextInt(2);
|
||||
int j1 = k2 + par2Random.nextInt(2);
|
||||
int k1 = k2 + par2Random.nextInt(2);
|
||||
float f = (float)(i1 + j1 + k1) * 0.333F + 0.5F;
|
||||
|
||||
for (int l1 = par3 - i1; l1 <= par3 + i1; ++l1)
|
||||
{
|
||||
for (int i2 = par5 - k1; i2 <= par5 + k1; ++i2)
|
||||
{
|
||||
for (int j2 = par4 - j1; j2 <= par4 + j1; ++j2)
|
||||
{
|
||||
float f1 = (float)(l1 - par3);
|
||||
float f2 = (float)(i2 - par5);
|
||||
float f3 = (float)(j2 - par4);
|
||||
|
||||
if (f1 * f1 + f2 * f2 + f3 * f3 <= f * f)
|
||||
{
|
||||
par1World.setBlock(l1, j2, i2, this.field_150545_a, 0, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
par3 += -(k2 + 1) + par2Random.nextInt(2 + k2 * 2);
|
||||
par5 += -(k2 + 1) + par2Random.nextInt(2 + k2 * 2);
|
||||
par4 += 0 - par2Random.nextInt(2);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupGeneration(World world, Random random, BiomeGenBase biome, String featureName, int x, int z)
|
||||
{
|
||||
for (int i = 0; i < (Integer)BOPDecorationManager.getBiomeFeatures(biome.biomeID).getFeature(featureName); i++)
|
||||
{
|
||||
int randX = x + random.nextInt(16) + 8;
|
||||
int randZ = z + random.nextInt(16) + 8;
|
||||
int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2);
|
||||
|
||||
this.generate(world, random, randX, randY, randZ);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,7 +11,6 @@ public class PlainsForcedDecorator extends ForcedDecorator
|
|||
public PlainsForcedDecorator()
|
||||
{
|
||||
this.bopWorldFeatures.setFeature("bopFlowersPerChunk", 8);
|
||||
this.bopWorldFeatures.setFeature("wildCarrotsPerChunk", 1);
|
||||
|
||||
this.weightedFlowerGen.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 0), 10);
|
||||
this.weightedFlowerGen.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 5);
|
||||
|
|
|
@ -62,8 +62,8 @@ public class WorldGenFieldAssociation
|
|||
associateFeature("minersDelightPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 6));
|
||||
associateFeature("rootsPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("plants"), 15));
|
||||
associateFeature("grassSplatterPerChunk", new WorldGenGrassSplatter());
|
||||
associateFeature("rockpilesPerChunk", new WorldGenBlockBlob(Blocks.stone, 0));
|
||||
associateFeature("wastelandRockPilesPerChunk", new WorldGenBlockBlob(BOPBlockHelper.get("driedDirt"), 0));
|
||||
associateFeature("rockpilesPerChunk", new WorldGenBOPBlob(Blocks.cobblestone, 0));
|
||||
associateFeature("wastelandRockPilesPerChunk", new WorldGenBOPBlob(BOPBlockHelper.get("driedDirt"), 0));
|
||||
associateFeature("logsPerChunk", new WorldGenLog());
|
||||
associateFeature("lavaSpoutsPerChunk", new WorldGenLavaSpout());
|
||||
associateFeature("cobwebsPerChunk", new WorldGenBOPFlora(Blocks.web, 0));
|
||||
|
|
Loading…
Reference in a new issue