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();
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
@ -60,7 +60,7 @@ public abstract class BOPBiome extends BiomeGenBase implements IBOPDecoration
@Override
public WorldGenerator getRandomWorldGenForGrass(Random random)
{
if (!getWeightedWorldGenForGrass().isEmpty())
if (getWeightedWorldGenForBOPFlowers() != null && !getWeightedWorldGenForGrass().isEmpty())
{
return getRandomWeightedWorldGenerator(getWeightedWorldGenForGrass());
}

View file

@ -20,7 +20,7 @@ import net.minecraft.world.gen.feature.WorldGenerator;
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)
{
@ -29,8 +29,8 @@ public class BiomeGenLushDesert extends BOPBiome
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(10739795);
this.setTemperatureRainfall(1.2F, 0.9F);
this.setColor(9087277);
this.setTemperatureRainfall(0.8F, 0.2F);
this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6));

View file

@ -1,54 +1,92 @@
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
{
private static final Height biomeHeight = new Height(0.3F, 0.6F);
public BiomeGenMapleWoods(int par1)
public BiomeGenMapleWoods(int id)
{
super(par1);
/*
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;
*/
}
super(id);
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(6) == 0 ? new WorldGenTaiga5(false) : new WorldGenMaple(false);
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(6988649);
this.setTemperatureRainfall(0.2F, 0.8F);
this.theBiomeDecorator.treesPerChunk = 9;
this.theBiomeDecorator.grassPerChunk = 1;
this.bopWorldFeatures.bopFlowersPerChunk = 2;
this.bopWorldFeatures.poisonIvyPerChunk = 1;
this.bopWorldFeatures.shrubsPerChunk = 2;
}
@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);
}
@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 var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
int x = chunkX + random.nextInt(16);
int y = random.nextInt(28) + 4;
int z = chunkZ + random.nextInt(16);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
//TODO: getBlock()
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, Block.oreEmerald.blockID, 0, 2);
//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.BiomeGenLushDesert;
import biomesoplenty.common.biomes.BiomeGenLushSwamp;
import biomesoplenty.common.biomes.BiomeGenMapleWoods;
import biomesoplenty.common.biomes.BiomeGenMarsh;
import biomesoplenty.common.biomes.BiomeGenMountain;
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 BiomeGenLushDesert(BOPConfigurationIDs.lushDesertID).setBiomeName("Lush Desert"), BOPBiomeTemperatureType.HOT));
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 BiomeGenMeadow(BOPConfigurationIDs.meadowID).setBiomeName("Meadow"), 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();
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

View file

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