Bugfixing and readded the Maple Woods

This commit is contained in:
Adubbz 2014-01-09 18:26:21 +11:00
parent 36f26515cb
commit 9ed744df02
6 changed files with 92 additions and 47 deletions

View file

@ -34,7 +34,7 @@ public abstract class BOPBiome extends BiomeGenBase implements IBOPDecoration
{ {
Throwable cause = e.getCause(); Throwable cause = e.getCause();
if (e.getMessage().equals("Already decorating!!") || (cause != null && cause.getMessage().equals("Already decorating!!"))) if (e.getMessage() != null && e.getMessage().equals("Already decorating!!") || (cause != null && cause.getMessage() != null && cause.getMessage().equals("Already decorating!!")))
{ {
} }
else else
@ -60,7 +60,7 @@ public abstract class BOPBiome extends BiomeGenBase implements IBOPDecoration
@Override @Override
public WorldGenerator getRandomWorldGenForGrass(Random random) public WorldGenerator getRandomWorldGenForGrass(Random random)
{ {
if (!getWeightedWorldGenForGrass().isEmpty()) if (getWeightedWorldGenForBOPFlowers() != null && !getWeightedWorldGenForGrass().isEmpty())
{ {
return getRandomWeightedWorldGenerator(getWeightedWorldGenForGrass()); return getRandomWeightedWorldGenerator(getWeightedWorldGenForGrass());
} }

View file

@ -20,7 +20,7 @@ import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenLushDesert extends BOPBiome public class BiomeGenLushDesert extends BOPBiome
{ {
private static final Height biomeHeight = new Height(0.2F, 0.4F); private static final Height biomeHeight = new Height(0.2F, 0.9F);
public BiomeGenLushDesert(int id) public BiomeGenLushDesert(int id)
{ {
@ -29,8 +29,8 @@ public class BiomeGenLushDesert extends BOPBiome
//TODO: setHeight() //TODO: setHeight()
this.func_150570_a(biomeHeight); this.func_150570_a(biomeHeight);
//TODO: setColor() //TODO: setColor()
this.setColor(10739795); this.setColor(9087277);
this.setTemperatureRainfall(1.2F, 0.9F); this.setTemperatureRainfall(0.8F, 0.2F);
this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6));

View file

@ -1,54 +1,92 @@
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.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.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2;
import biomesoplenty.common.world.features.trees.WorldGenOriginalTree;
public class BiomeGenMapleWoods extends BOPBiome public class BiomeGenMapleWoods extends BOPBiome
{ {
private static final Height biomeHeight = new Height(0.3F, 0.6F);
public BiomeGenMapleWoods(int par1) public BiomeGenMapleWoods(int id)
{ {
super(par1); super(id);
/*
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 9;
customBiomeDecorator.grassPerChunk = 1;
customBiomeDecorator.wheatGrassPerChunk = 1;
customBiomeDecorator.violetsPerChunk = 2;
customBiomeDecorator.poisonIvyPerChunk = 1;
customBiomeDecorator.shrubsPerChunk = 2;
*/
}
/** //TODO: setHeight()
* Gets a WorldGen appropriate for this biome. this.func_150570_a(biomeHeight);
*/ //TODO: setColor()
/* this.setColor(6988649);
@Override this.setTemperatureRainfall(0.2F, 0.8F);
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{ this.theBiomeDecorator.treesPerChunk = 9;
return par1Random.nextInt(6) == 0 ? new WorldGenTaiga5(false) : new WorldGenMaple(false); this.theBiomeDecorator.grassPerChunk = 1;
this.bopWorldFeatures.bopFlowersPerChunk = 2;
this.bopWorldFeatures.poisonIvyPerChunk = 1;
this.bopWorldFeatures.shrubsPerChunk = 2;
} }
@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); {
int var5 = 3 + par2Random.nextInt(6); return random.nextInt(6) == 0 ? new WorldGenBOPTaiga2(Blocks.log, Blocks.leaves, 1, 1, false, 9, 9, 6) :
new WorldGenOriginalTree(Blocks.log, BOPBlockHelper.get("leaves3"), 0, 2, false, 5, 3, false);
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2);
}
}
} }
*/
@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 HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 8), 1D);
return flowerMap;
}
@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)
{
int x = chunkX + random.nextInt(16);
int y = random.nextInt(28) + 4;
int z = chunkZ + random.nextInt(16);
//TODO: getBlock()
Block block = world.func_147439_a(x, y, z);
if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
{
//TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 0, 2);
}
}
}
} }

View file

@ -32,6 +32,7 @@ import biomesoplenty.common.biomes.BiomeGenJadeCliffs;
import biomesoplenty.common.biomes.BiomeGenLavenderFields; import biomesoplenty.common.biomes.BiomeGenLavenderFields;
import biomesoplenty.common.biomes.BiomeGenLushDesert; import biomesoplenty.common.biomes.BiomeGenLushDesert;
import biomesoplenty.common.biomes.BiomeGenLushSwamp; import biomesoplenty.common.biomes.BiomeGenLushSwamp;
import biomesoplenty.common.biomes.BiomeGenMapleWoods;
import biomesoplenty.common.biomes.BiomeGenMarsh; import biomesoplenty.common.biomes.BiomeGenMarsh;
import biomesoplenty.common.biomes.BiomeGenMountain; import biomesoplenty.common.biomes.BiomeGenMountain;
import biomesoplenty.common.biomes.BiomeGenOminousWoods; import biomesoplenty.common.biomes.BiomeGenOminousWoods;
@ -110,7 +111,7 @@ public class BOPBiomes
registerBiome(new BOPBiomeListEntry(new BiomeGenLavenderFields(BOPConfigurationIDs.lavenderFieldsID).setBiomeName("Lavender Fields"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenLavenderFields(BOPConfigurationIDs.lavenderFieldsID).setBiomeName("Lavender Fields"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenLushDesert(BOPConfigurationIDs.lushDesertID).setBiomeName("Lush Desert"), BOPBiomeTemperatureType.HOT)); registerBiome(new BOPBiomeListEntry(new BiomeGenLushDesert(BOPConfigurationIDs.lushDesertID).setBiomeName("Lush Desert"), BOPBiomeTemperatureType.HOT));
registerBiome(new BOPBiomeListEntry(new BiomeGenLushSwamp(BOPConfigurationIDs.lushSwampID).setBiomeName("Lush Swamp"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenLushSwamp(BOPConfigurationIDs.lushSwampID).setBiomeName("Lush Swamp"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenMapleWoods(BOPConfigurationIDs.mapleWoodsID).setBiomeName("Maple Woods"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenMapleWoods(BOPConfigurationIDs.mapleWoodsID).setBiomeName("Maple Woods"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenMarsh(BOPConfigurationIDs.marshID).setBiomeName("Marsh"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenMarsh(BOPConfigurationIDs.marshID).setBiomeName("Marsh"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenMeadow(BOPConfigurationIDs.meadowID).setBiomeName("Meadow"), BOPBiomeTemperatureType.COOL)); //registerBiome(new BOPBiomeListEntry(new BiomeGenMeadow(BOPConfigurationIDs.meadowID).setBiomeName("Meadow"), BOPBiomeTemperatureType.COOL));
//registerBiome(new BOPBiomeListEntry(new BiomeGenMoor(BOPConfigurationIDs.moorID).setBiomeName("Moor"), BOPBiomeTemperatureType.COOL)); //registerBiome(new BOPBiomeListEntry(new BiomeGenMoor(BOPConfigurationIDs.moorID).setBiomeName("Moor"), BOPBiomeTemperatureType.COOL));

View file

@ -90,7 +90,7 @@ public class DecorateBiomeEventHandler
{ {
Throwable cause = e.getCause(); Throwable cause = e.getCause();
if (e.getMessage().equals("Already decorating!!") || (cause != null && cause.getMessage().equals("Already decorating!!"))) if (e.getMessage() != null && e.getMessage().equals("Already decorating!!") || (cause != null && cause.getMessage() != null && cause.getMessage().equals("Already decorating!!")))
{ {
} }
else else

View file

@ -77,6 +77,12 @@ public class WorldGenBOPTaiga2 extends WorldGenAbstractTree
k1 = 2 + random.nextInt(2); k1 = 2 + random.nextInt(2);
break; break;
case 6:
i1 = 2 + random.nextInt(4);
j1 = l - i1;
k1 = 2 + random.nextInt(2);
break;
default: default:
i1 = 1 + random.nextInt(2); i1 = 1 + random.nextInt(2);
j1 = l - i1; j1 = l - i1;