Readded the Tundra and Tropical Rainforest. 8 remaining.

This commit is contained in:
Adubbz 2014-01-11 21:19:09 +11:00
parent c7f1fb5057
commit d934a1c9cd
9 changed files with 517 additions and 183 deletions

View file

@ -1,99 +1,131 @@
package biomesoplenty.common.biomes; package biomesoplenty.common.biomes;
import net.minecraft.world.biome.BiomeGenBase; import java.util.HashMap;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenTrees;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.entities.EntityJungleSpider;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.WorldGenRainforestTree1;
public class BiomeGenTropicalRainforest extends BOPBiome public class BiomeGenTropicalRainforest extends BOPBiome
{ {
private static final Height biomeHeight = new Height(0.3F, 0.7F);
@SuppressWarnings("unchecked") public BiomeGenTropicalRainforest(int id)
public BiomeGenTropicalRainforest(int par1)
{ {
super(par1); super(id);
/*
spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1)); //TODO: setHeight()
theBiomeDecorator = new BiomeDecoratorBOP(this); this.func_150570_a(biomeHeight);
customBiomeDecorator = (BiomeDecoratorBOP) theBiomeDecorator; //TODO: setColor()
customBiomeDecorator.treesPerChunk = 12; this.setColor(8970560);
customBiomeDecorator.grassPerChunk = 9; this.setTemperatureRainfall(1.2F, 0.9F);
customBiomeDecorator.highGrassPerChunk = 4;
customBiomeDecorator.reedsPerChunk = 10; this.spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1));
customBiomeDecorator.waterlilyPerChunk = 2; this.spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class, 12, 6, 6));
customBiomeDecorator.orangeFlowersPerChunk = 10;
customBiomeDecorator.generatePumpkins = false; this.waterColorMultiplier = 6160128;
customBiomeDecorator.generateMelons = true;
customBiomeDecorator.sproutsPerChunk = 2; this.theBiomeDecorator.treesPerChunk = 12;
customBiomeDecorator.generateQuicksand = true; this.theBiomeDecorator.grassPerChunk = 9;
customBiomeDecorator.poisonIvyPerChunk = 4; this.theBiomeDecorator.reedsPerChunk = 10;
customBiomeDecorator.lilyflowersPerChunk = 2; this.theBiomeDecorator.waterlilyPerChunk = 2;
customBiomeDecorator.shrubsPerChunk = 15;
customBiomeDecorator.wheatGrassPerChunk = 5; this.bopWorldFeatures.bopFlowersPerChunk = 10;
spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class, 12, 6, 6)); this.bopWorldFeatures.doubleTallGrassPerChunk = 4;
waterColorMultiplier = 6160128; this.bopWorldFeatures.generatePumpkins = false;
*/ this.bopWorldFeatures.generateMelons = true;
this.bopWorldFeatures.sproutsPerChunk = 2;
this.bopWorldFeatures.generateQuicksand = true;
this.bopWorldFeatures.poisonIvyPerChunk = 4;
this.bopWorldFeatures.shrubsPerChunk = 15;
} }
/*
@Override @Override
public void decorate(World par1World, Random par2Random, int par3, int par4) //TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{ {
super.decorate(par1World, par2Random, par3, par4); return random.nextInt(5) == 0 ? new WorldGenTrees(false, 4 + random.nextInt(7), 3, 3, true) :
int var5 = 12 + par2Random.nextInt(6); new WorldGenRainforestTree1(Blocks.log, Blocks.leaves, 3, 3, false, 8, 8);
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 5), 1D);
return flowerMap;
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
HashMap<WorldGenerator, Double> grassMap = new HashMap();
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D);
return grassMap;
}
@Override
public void decorate(World world, Random random, int chunkX, int chunkZ)
{
super.decorate(world, random, chunkX, chunkZ);
int var5 = 12 + random.nextInt(6);
for (int var6 = 0; var6 < var5; ++var6) for (int var6 = 0; var6 < var5; ++var6)
{ {
int var7 = par3 + par2Random.nextInt(16); int x = chunkX + random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4; int y = random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16); int z = chunkZ + random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
Block block = Block.blocksList[var10]; //TODO: getBlock()
if (block != null Block block = world.func_147439_a(x, y, z);
&& block.isGenMineableReplaceable(par1World, var7, var8,
var9, Block.stone.blockID)) if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
{ {
par1World.setBlock(var7, var8, var9, //TODO: setBlock()
Blocks.amethystOre.get().blockID, 6, 2); world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 6, 2);
} }
} }
} }
*/
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override @Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random) //TODO: getBiomeGrassColor()
{ public int func_150558_b(int p_150558_1_, int p_150558_2_, int p_150558_3_)
return par1Random.nextInt(5) == 0 ? new WorldGenTrees(false,
4 + par1Random.nextInt(7), 3, 3, true)
: new WorldGenRainforest1(false);
}
*/
/**
* Provides the basic grass color based on the biome temperature and
* rainfall
*/
/*
@Override
public int getBiomeGrassColor()
{ {
return 11002176; return 11002176;
} }
*/
/**
* Provides the basic foliage color based on the biome temperature and
* rainfall
*/
/*
@Override @Override
public int getBiomeFoliageColor() //TODO: getBiomeFoliageColor()
public int func_150571_c(int x, int y, int z)
{ {
return 8970560; return 8970560;
} }
*/
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors) return 11128415;
else return super.getSkyColorByTemp(par1);
}
/** /**
* Fog Color * Fog Color
@ -106,37 +138,7 @@ public class BiomeGenTropicalRainforest extends BOPBiome
} }
*/ */
/** /*@Override
* takes temperature, returns color
*/
/*
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
{
return 11128415;
}
else
{
par1 /= 3.0F;
if (par1 < -1.0F)
{
par1 = -1.0F;
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F,
0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness() public float getFogCloseness()
{ {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View file

@ -1,94 +1,112 @@
package biomesoplenty.common.biomes; package biomesoplenty.common.biomes;
import java.util.HashMap;
import java.util.Random;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenTundra extends BOPBiome public class BiomeGenTundra extends BOPBiome
{ {
private static final Height biomeHeight = new Height(0.1F, 0.3F);
public BiomeGenTundra(int par1) public BiomeGenTundra(int id)
{ {
super(par1); super(id);
/*
spawnableCreatureList.clear(); //TODO: setHeight()
theBiomeDecorator = new BiomeDecoratorBOP(this); this.func_150570_a(biomeHeight);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; //TODO: setColor()
customBiomeDecorator.treesPerChunk = 5; this.setColor(11371606);
customBiomeDecorator.grassPerChunk = 8; this.setTemperatureRainfall(0.2F, 0.8F);
customBiomeDecorator.wheatGrassPerChunk = 3;
customBiomeDecorator.flowersPerChunk = -999; this.spawnableCreatureList.clear();
customBiomeDecorator.reedsPerChunk = -999;
customBiomeDecorator.gravelPerChunk = 8; this.theBiomeDecorator.treesPerChunk = 5;
customBiomeDecorator.gravelPerChunk2 = 8; this.theBiomeDecorator.grassPerChunk = 8;
customBiomeDecorator.shrubsPerChunk = 2; this.theBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.waterReedsPerChunk = 2; this.theBiomeDecorator.reedsPerChunk = -999;
customBiomeDecorator.violetsPerChunk = 1; this.theBiomeDecorator.sandPerChunk = 8;
*/
this.bopWorldFeatures.bopFlowersPerChunk = 1;
this.bopWorldFeatures.shrubsPerChunk = 2;
this.bopWorldFeatures.waterReedsPerChunk = 2;
this.bopWorldFeatures.rockpilesPerChunk = 25;
} }
/*
@Override @Override
public void decorate(World par1World, Random par2Random, int par3, int par4) //TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{ {
super.decorate(par1World, par2Random, par3, par4); return new WorldGenShrub(0, 0);
int var5 = 12 + par2Random.nextInt(6); }
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 8), 1D);
return flowerMap;
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
HashMap<WorldGenerator, Double> grassMap = new HashMap();
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 1), 1D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 2), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
return grassMap;
}
@Override
public void decorate(World world, Random random, int chunkX, int chunkZ)
{
super.decorate(world, random, chunkX, chunkZ);
int var5 = 12 + random.nextInt(6);
for (int var6 = 0; var6 < var5; ++var6) for (int var6 = 0; var6 < var5; ++var6)
{ {
int var7 = par3 + par2Random.nextInt(16); int x = chunkX + random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4; int y = random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16); int z = chunkZ + random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
Block block = Block.blocksList[var10]; //TODO: getBlock()
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID)) Block block = world.func_147439_a(x, y, z);
if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
{ {
par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 8, 2); //TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 8, 2);
} }
} }
} }
*/
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override @Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random) //TODO: getBiomeGrassColor()
{ public int func_150558_b(int p_150558_1_, int p_150558_2_, int p_150558_3_)
return par1Random.nextInt(4) == 0 ? new WorldGenShrub(0,0) : new WorldGenTundra1();
}
*/
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(4) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Blocks.foliage.get().blockID, 1);
}
*/
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
/*
@Override
public int getBiomeGrassColor()
{ {
return 11371606; return 11371606;
} }
*/
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
/*
@Override @Override
public int getBiomeFoliageColor() //TODO: getBiomeFoliageColor()
public int func_150571_c(int x, int y, int z)
{ {
return 12543566; return 12543566;
} }
*/
} }

View file

@ -53,6 +53,8 @@ import biomesoplenty.common.biomes.BiomeGenShrubland;
import biomesoplenty.common.biomes.BiomeGenSpruceWoods; import biomesoplenty.common.biomes.BiomeGenSpruceWoods;
import biomesoplenty.common.biomes.BiomeGenThicket; import biomesoplenty.common.biomes.BiomeGenThicket;
import biomesoplenty.common.biomes.BiomeGenTimber; import biomesoplenty.common.biomes.BiomeGenTimber;
import biomesoplenty.common.biomes.BiomeGenTropicalRainforest;
import biomesoplenty.common.biomes.BiomeGenTundra;
import biomesoplenty.common.configuration.BOPConfigurationIDs; import biomesoplenty.common.configuration.BOPConfigurationIDs;
import biomesoplenty.common.world.WorldTypeBOP; import biomesoplenty.common.world.WorldTypeBOP;
@ -142,14 +144,14 @@ public class BOPBiomes
registerBiome(new BOPBiomeListEntry(new BiomeGenShield(BOPConfigurationIDs.shieldID).setBiomeName("Shield"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenShield(BOPConfigurationIDs.shieldID).setBiomeName("Shield"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenShrubland(BOPConfigurationIDs.shrublandID).setBiomeName("Shrubland"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenShrubland(BOPConfigurationIDs.shrublandID).setBiomeName("Shrubland"), BOPBiomeTemperatureType.COOL));
//registerBiome(new BOPBiomeListEntry(new BiomeGenSilkglades(BOPConfigurationIDs.silkgladesID).setBiomeName("Silkglades"), BOPBiomeTemperatureType.COOL)); //registerBiome(new BOPBiomeListEntry(new BiomeGenSilkglades(BOPConfigurationIDs.silkgladesID).setBiomeName("Silkglades"), BOPBiomeTemperatureType.COOL));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenSludgepit(BOPConfigurationIDs.sludgepitID).setBiomeName("Sludgepit"), BOPBiomeTemperatureType.WARM));*/ //registerBiome(new BOPBiomeListEntry(new BiomeGenSludgepit(BOPConfigurationIDs.sludgepitID).setBiomeName("Sludgepit"), BOPBiomeTemperatureType.WARM));
registerOnlyBiome(new BOPBiomeListEntry(new BiomeGenSpruceWoods(BOPConfigurationIDs.spruceWoodsID).setBiomeName("Spruce Woods"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenSpruceWoods(BOPConfigurationIDs.spruceWoodsID).setBiomeName("Spruce Woods"), BOPBiomeTemperatureType.WARM));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenTemperateRainforest(BOPConfigurationIDs.temperateRainforestID).setBiomeName("Temperate Rainforest"), BOPBiomeTemperatureType.WARM));*/ /*registerBiome(new BOPBiomeListEntry(new BiomeGenTemperateRainforest(BOPConfigurationIDs.temperateRainforestID).setBiomeName("Temperate Rainforest"), BOPBiomeTemperatureType.WARM));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenThicket(BOPConfigurationIDs.thicketID).setBiomeName("Thicket"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenThicket(BOPConfigurationIDs.thicketID).setBiomeName("Thicket"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenTimber(BOPConfigurationIDs.timberID).setBiomeName("Timber"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenTimber(BOPConfigurationIDs.timberID).setBiomeName("Timber"), BOPBiomeTemperatureType.COOL));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenTropicalRainforest(BOPConfigurationIDs.tropicalRainforestID).setBiomeName("Tropical Rainforest"), BOPBiomeTemperatureType.HOT)); registerBiome(new BOPBiomeListEntry(new BiomeGenTropicalRainforest(BOPConfigurationIDs.tropicalRainforestID).setBiomeName("Tropical Rainforest"), BOPBiomeTemperatureType.HOT));
registerBiome(new BOPBiomeListEntry(new BiomeGenTropics(BOPConfigurationIDs.tropicsID).setBiomeName("Tropics"), BOPBiomeTemperatureType.HOT)); /*registerBiome(new BOPBiomeListEntry(new BiomeGenTropics(BOPConfigurationIDs.tropicsID).setBiomeName("Tropics"), BOPBiomeTemperatureType.HOT));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenTundra(BOPConfigurationIDs.tundraID).setBiomeName("Tundra"), BOPBiomeTemperatureType.ICY));*/ registerOnlyBiome(new BOPBiomeListEntry(new BiomeGenTundra(BOPConfigurationIDs.tundraID).setBiomeName("Tundra"), BOPBiomeTemperatureType.ICY));
//registerBiome(new BOPBiomeListEntry(new BiomeGenVolcano(BOPConfigurationIDs.volcanoID).setBiomeName("Volcano"), BOPBiomeTemperatureType.HOT)); //registerBiome(new BOPBiomeListEntry(new BiomeGenVolcano(BOPConfigurationIDs.volcanoID).setBiomeName("Volcano"), BOPBiomeTemperatureType.HOT));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenWasteland(BOPConfigurationIDs.wastelandID).setBiomeName("Wasteland"), BOPBiomeTemperatureType.HOT)); /*registerBiome(new BOPBiomeListEntry(new BiomeGenWasteland(BOPConfigurationIDs.wastelandID).setBiomeName("Wasteland"), BOPBiomeTemperatureType.HOT));
registerBiome(new BOPBiomeListEntry(new BiomeGenWetland(BOPConfigurationIDs.wetlandID).setBiomeName("Wetland"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenWetland(BOPConfigurationIDs.wetlandID).setBiomeName("Wetland"), BOPBiomeTemperatureType.WARM));

View file

@ -10,6 +10,7 @@ public class BOPWorldFeatures
public boolean generateGrass = false; public boolean generateGrass = false;
public boolean generateSand = false; public boolean generateSand = false;
public boolean generateQuagmire = false; public boolean generateQuagmire = false;
public boolean generateMelons = false;
public int waterPoolsPerChunk = 0; public int waterPoolsPerChunk = 0;
public int lavaPoolsPerChunk = 0; public int lavaPoolsPerChunk = 0;
@ -47,6 +48,7 @@ public class BOPWorldFeatures
public int minersDelightPerChunk = 2; public int minersDelightPerChunk = 2;
public int rootsPerChunk = 9; public int rootsPerChunk = 9;
public int grassSplatterPerChunk = 0; public int grassSplatterPerChunk = 0;
public int rockpilesPerChunk = 0;
public int bopFlowersPerChunk = 0; public int bopFlowersPerChunk = 0;
} }

View file

@ -0,0 +1,179 @@
package biomesoplenty.common.world.features;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.util.Direction;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraftforge.common.util.ForgeDirection;
public class WorldGenRainforestTree1 extends WorldGenAbstractTree
{
private final int minTreeHeight;
private final int randomTreeHeight;
private final Block wood;
private final Block leaves;
private final int woodMeta;
private final int leavesMeta;
public WorldGenRainforestTree1(Block wood, Block leaves, int woodMeta, int leavesMeta, boolean doBlockNotify, int minTreeHeight, int randomTreeHeight)
{
super(doBlockNotify);
this.wood = wood;
this.leaves = leaves;
this.woodMeta = woodMeta;
this.leavesMeta = leavesMeta;
this.minTreeHeight = minTreeHeight;
this.randomTreeHeight = randomTreeHeight;
}
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
int l = random.nextInt(randomTreeHeight) + this.minTreeHeight;
boolean flag = true;
if (y >= 1 && y + l + 1 <= 256)
{
byte b0;
int k1;
Block block;
for (int i1 = y; i1 <= y + 1 + l; ++i1)
{
b0 = 1;
if (i1 == y)
{
b0 = 0;
}
if (i1 >= y + 1 + l - 2)
{
b0 = 2;
}
for (int j1 = x - b0; j1 <= x + b0 && flag; ++j1)
{
for (k1 = z - b0; k1 <= z + b0 && flag; ++k1)
{
if (i1 >= 0 && i1 < 256)
{
block = world.func_147439_a(j1, i1, k1);
if (!this.isReplaceable(world, j1, i1, k1))
{
flag = false;
}
}
else
{
flag = false;
}
}
}
}
if (!flag)
{
return false;
}
else
{
Block block2 = world.func_147439_a(x, y - 1, z);
boolean isSoil = block2.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling)Blocks.sapling);
if (isSoil && y < 256 - l - 1)
{
block2.onPlantGrow(world, x, y - 1, z, x, y, z);
b0 = 3;
byte b1 = 0;
int l1;
int i2;
int j2;
int i3;
for (k1 = y - b0 + l; k1 <= y + l; ++k1)
{
i3 = k1 - (y + l);
l1 = b1 + 1 - i3;
for (i2 = x - l1; i2 <= x + l1; ++i2)
{
j2 = i2 - x;
for (int k2 = z - l1; k2 <= z + l1; ++k2)
{
int l2 = k2 - z;
if (Math.abs(j2) != l1 || Math.abs(l2) != l1 || random.nextInt(2) != 0 && i3 != 0)
{
Block block1 = world.func_147439_a(i2, k1, k2);
if (block1.isAir(world, i2, k1, k2) || block1.isLeaves(world, i2, k1, k2))
{
this.func_150516_a(world, i2, k1, k2, Blocks.leaves, this.leavesMeta);
}
}
}
}
}
for (k1 = 0; k1 < l; ++k1)
{
block = world.func_147439_a(x, y + k1, z);
if (block.isAir(world, x, y + k1, z) || block.isLeaves(world, x, y + k1, z))
{
//TODO: setBlock()
this.func_150516_a(world, x, y + k1, z, this.wood, this.woodMeta);
this.func_150516_a(world, x - 3, y + (l - 3), z, this.wood, this.woodMeta + 4);
this.func_150516_a(world, x + 3, y + (l - 3), z, this.wood, this.woodMeta + 4);
this.func_150516_a(world, x, y + (l - 3), z - 3, this.wood, this.woodMeta + 8);
this.func_150516_a(world, x, y + (l - 3), z + 3, this.wood, this.woodMeta + 8);
this.func_150516_a(world, x - 2, y + (l - 4), z, this.wood, this.woodMeta);
this.func_150516_a(world, x + 2, y + (l - 4), z, this.wood, this.woodMeta);
this.func_150516_a(world, x, y + (l - 4), z - 2, this.wood, this.woodMeta);
this.func_150516_a(world, x, y + (l - 4), z + 2, this.wood, this.woodMeta);
this.func_150516_a(world, x - 2, y + (l - 5), z, this.wood, this.woodMeta);
this.func_150516_a(world, x + 2, y + (l - 5), z, this.wood, this.woodMeta);
this.func_150516_a(world, x, y + (l - 5), z - 2, this.wood, this.woodMeta);
this.func_150516_a(world, x, y + (l - 5), z + 2, this.wood, this.woodMeta);
this.func_150516_a(world, x - 1, y + (l - 6), z, this.wood, this.woodMeta + 4);
this.func_150516_a(world, x + 1, y + (l - 6), z, this.wood, this.woodMeta + 4);
this.func_150516_a(world, x, y + (l - 6), z - 1, this.wood, this.woodMeta + 8);
this.func_150516_a(world, x, y + (l - 6), z + 1, this.wood, this.woodMeta + 8);
this.func_150516_a(world, x, y + (l - 3), z, this.leaves, this.leavesMeta);
this.func_150516_a(world, x, y + (l - 2), z, this.leaves, this.leavesMeta);
this.func_150516_a(world, x, y + (l - 1), z, this.leaves, this.leavesMeta);
this.func_150516_a(world, x, y + (l), z, this.leaves, this.leavesMeta);
this.func_150515_a(world, x, y + (l - 4), z, Blocks.air);
this.func_150515_a(world, x, y + (l - 5), z, Blocks.air);
this.func_150516_a(world, x - 1, y + (l - 3), z, this.wood, this.woodMeta + 4);
this.func_150516_a(world, x + 1, y + (l - 3), z, this.wood, this.woodMeta + 4);
this.func_150516_a(world, x, y + (l - 3), z - 1, this.wood, this.woodMeta + 8);
this.func_150516_a(world, x, y + (l - 3), z + 1, this.wood, this.woodMeta + 8);
this.func_150516_a(world, x, y + (l - 2), z, this.wood, this.woodMeta);
}
}
return true;
}
else
{
return false;
}
}
}
else
{
return false;
}
}
}

View file

@ -0,0 +1,98 @@
package biomesoplenty.common.world.features;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
public class WorldGenRockpile extends WorldGeneratorBOP
{
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
//TODO: isAirBlock()
while (world.func_147437_c(x, y, z) && y > 2)
{
--y;
}
boolean isGrass = true;
for (int ix = -1; ix <= 1; ix++)
{
for (int iz = -1; iz <= 1; iz++)
{
if (world.func_147439_a(x + ix, y, z + iz) != Blocks.grass)
{
isGrass = false;
break;
}
}
}
if (!isGrass)
{
return false;
}
else
{
for (int var7 = -2; var7 <= 2; ++var7)
{
for (int var8 = -2; var8 <= 2; ++var8)
{
//TODO: isAirBlock() isAirBlock()
if (world.func_147437_c(x + var7, y - 1, z + var8) && world.func_147437_c(x + var7, y - 2, z + var8))
return false;
}
}
int var999 = random.nextInt(2);
if (var999 == 0)
{
//TODO: setBlock()
this.func_150515_a(world, x, y, z, Blocks.dirt);
this.func_150515_a(world, x - 1, y, z, Blocks.dirt);
this.func_150515_a(world, x + 1, y, z, Blocks.dirt);
this.func_150515_a(world, x, y, z - 1, Blocks.dirt);
this.func_150515_a(world, x, y, z + 1, Blocks.dirt);
//TODO: setBlockAndMetadata()
this.func_150516_a(world, x, y + 1, z, Blocks.stone, 0);
this.func_150516_a(world, x + 1, y + 1, z, Blocks.stone, 0);
this.func_150516_a(world, x - 1, y + 1, z, Blocks.stone, 0);
this.func_150516_a(world, x, y + 1, z + 1, Blocks.stone, 0);
this.func_150516_a(world, x, y + 1, z - 1, Blocks.stone, 0);
this.func_150516_a(world, x, y + 2, z, Blocks.stone, 0);
return true;
}
else if (var999 == 1)
{
//TODO: setBlock()
this.func_150515_a(world, x, y, z, Blocks.dirt);
//TODO: setBlockAndMetadata()
this.func_150516_a(world, x, y + 1, z, Blocks.stone, 0);
return true;
}
return true;
}
}
@Override
public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception
{
for (int i = 0; i < worldGeneratorField.getInt(bopDecoration.getWorldFeatures()); i++)
{
int randX = x + random.nextInt(16) + 8;
int randZ = z + random.nextInt(16) + 8;
int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2);
worldGenerator.generate(world, random, randX, randY, randZ);
}
}
}

View file

@ -0,0 +1,26 @@
package biomesoplenty.common.world.forcedworldgenerators;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.generation.ForcedWorldGeneratorBOP;
public class MelonForcedGenerator extends ForcedWorldGeneratorBOP
{
@Override
public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception
{
if (bopDecoration.getWorldFeatures().generateMelons)
{
int randX = x + random.nextInt(16) + 8;
int randZ = z + random.nextInt(16) + 8;
int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2);
worldGenerator.generate(world, random, randX, randY, randZ);
}
}
}

View file

@ -4,7 +4,9 @@ import java.util.HashMap;
import net.minecraft.world.gen.feature.WorldGenLakes; import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraft.world.gen.feature.WorldGenLiquids; import net.minecraft.world.gen.feature.WorldGenLiquids;
import net.minecraft.world.gen.feature.WorldGenMelon;
import biomesoplenty.common.world.forcedworldgenerators.LakesForcedGenerator; import biomesoplenty.common.world.forcedworldgenerators.LakesForcedGenerator;
import biomesoplenty.common.world.forcedworldgenerators.MelonForcedGenerator;
import biomesoplenty.common.world.forcedworldgenerators.PondForcedGenerator; import biomesoplenty.common.world.forcedworldgenerators.PondForcedGenerator;
public class ForcedBOPWorldGenerators public class ForcedBOPWorldGenerators
@ -20,6 +22,7 @@ public class ForcedBOPWorldGenerators
{ {
addForcedGenerator(WorldGenLiquids.class, new PondForcedGenerator()); addForcedGenerator(WorldGenLiquids.class, new PondForcedGenerator());
addForcedGenerator(WorldGenLakes.class, new LakesForcedGenerator()); addForcedGenerator(WorldGenLakes.class, new LakesForcedGenerator());
addForcedGenerator(WorldGenMelon.class, new MelonForcedGenerator());
} }
public static void addForcedGenerator(Class worldGenClass, ForcedWorldGeneratorBOP generator) public static void addForcedGenerator(Class worldGenClass, ForcedWorldGeneratorBOP generator)

View file

@ -5,6 +5,7 @@ import java.util.HashMap;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.world.gen.feature.WorldGenLakes; import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraft.world.gen.feature.WorldGenLiquids; import net.minecraft.world.gen.feature.WorldGenLiquids;
import net.minecraft.world.gen.feature.WorldGenMelon;
import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper; import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora; import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
@ -12,6 +13,7 @@ import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass; import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.WorldGenGrassSplatter; import biomesoplenty.common.world.features.WorldGenGrassSplatter;
import biomesoplenty.common.world.features.WorldGenRiverCane; import biomesoplenty.common.world.features.WorldGenRiverCane;
import biomesoplenty.common.world.features.WorldGenRockpile;
import biomesoplenty.common.world.features.WorldGenSplotches; import biomesoplenty.common.world.features.WorldGenSplotches;
import biomesoplenty.common.world.features.WorldGenWaterReeds; import biomesoplenty.common.world.features.WorldGenWaterReeds;
import biomesoplenty.common.world.features.WorldGenWaterside; import biomesoplenty.common.world.features.WorldGenWaterside;
@ -34,6 +36,7 @@ public class WorldGenFieldAssociation
associateField("generateGrass", new WorldGenSplotches(Blocks.grass, 0, 48, BOPBlockHelper.get("redRock"))); associateField("generateGrass", new WorldGenSplotches(Blocks.grass, 0, 48, BOPBlockHelper.get("redRock")));
associateField("generateSand", new WorldGenSplotches(Blocks.sand, 0, 32, BOPBlockHelper.get("redRock"))); associateField("generateSand", new WorldGenSplotches(Blocks.sand, 0, 32, BOPBlockHelper.get("redRock")));
associateField("generateQuagmire", new WorldGenSplotches(Blocks.grass, 0, 48, BOPBlockHelper.get("mud"))); associateField("generateQuagmire", new WorldGenSplotches(Blocks.grass, 0, 48, BOPBlockHelper.get("mud")));
associateField("generateMelons", new WorldGenMelon());
associateField("waterPoolsPerChunk", new WorldGenLiquids(Blocks.flowing_water)); associateField("waterPoolsPerChunk", new WorldGenLiquids(Blocks.flowing_water));
associateField("lavaPoolsPerChunk", new WorldGenLiquids(Blocks.flowing_lava)); associateField("lavaPoolsPerChunk", new WorldGenLiquids(Blocks.flowing_lava));
@ -69,6 +72,7 @@ public class WorldGenFieldAssociation
associateField("minersDelightPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 6)); associateField("minersDelightPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 6));
associateField("rootsPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("plants"), 15)); associateField("rootsPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("plants"), 15));
associateField("grassSplatterPerChunk", new WorldGenGrassSplatter()); associateField("grassSplatterPerChunk", new WorldGenGrassSplatter());
associateField("rockpilesPerChunk", new WorldGenRockpile());
associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8)); associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8));
associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8)); associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8));