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); //TODO: setHeight()
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; this.func_150570_a(biomeHeight);
customBiomeDecorator.treesPerChunk = 9; //TODO: setColor()
customBiomeDecorator.grassPerChunk = 1; this.setColor(6988649);
customBiomeDecorator.wheatGrassPerChunk = 1; this.setTemperatureRainfall(0.2F, 0.8F);
customBiomeDecorator.violetsPerChunk = 2;
customBiomeDecorator.poisonIvyPerChunk = 1; this.theBiomeDecorator.treesPerChunk = 9;
customBiomeDecorator.shrubsPerChunk = 2; this.theBiomeDecorator.grassPerChunk = 1;
*/
this.bopWorldFeatures.bopFlowersPerChunk = 2;
this.bopWorldFeatures.poisonIvyPerChunk = 1;
this.bopWorldFeatures.shrubsPerChunk = 2;
} }
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override @Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random) //TODO: getRandomWorldGenForTrees()
{ public WorldGenAbstractTree func_150567_a(Random random)
return par1Random.nextInt(6) == 0 ? new WorldGenTaiga5(false) : new WorldGenMaple(false); {
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);
} }
@Override @Override
public void decorate(World par1World, Random par2Random, int par3, int par4) public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{ {
super.decorate(par1World, par2Random, par3, par4); HashMap<WorldGenerator, Double> grassMap = new HashMap();
int var5 = 3 + par2Random.nextInt(6);
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) 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);
//TODO: getBlock()
Block block = world.func_147439_a(x, y, z);
Block block = Block.blocksList[var10]; if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID)) {
{ //TODO: setBlock()
par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2); 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

@ -76,6 +76,12 @@ public class WorldGenBOPTaiga2 extends WorldGenAbstractTree
j1 = l - i1; j1 = l - i1;
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);