Removed debug, added a new workaround for the "Already Decorating" error

This commit is contained in:
Adubbz 2014-01-09 09:52:48 +11:00
parent d59a54f79b
commit da698b62da
3 changed files with 28 additions and 33 deletions

View File

@ -26,7 +26,22 @@ public abstract class BOPBiome extends BiomeGenBase implements IBOPDecoration
@Override
public void decorate(World world, Random random, int x, int z)
{
DecorateBiomeEventHandler.decorate(world, random, this, x, z);
try
{
super.decorate(world, random, x, z);
}
catch (Exception e)
{
Throwable cause = e.getCause();
if (e.getMessage().equals("Already decorating!!") || (cause != null && cause.getMessage().equals("Already decorating!!")))
{
}
else
{
e.printStackTrace();
}
}
}
@Override

View File

@ -84,7 +84,7 @@ public class BOPBiomes
registerBiome(new BOPBiomeListEntry(new BiomeGenCanyon(BOPConfigurationIDs.canyonID).setBiomeName("Canyon"), BOPBiomeTemperatureType.HOT));
registerBiome(new BOPBiomeListEntry(new BiomeGenChaparral(BOPConfigurationIDs.chaparralID).setBiomeName("Chaparral"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenCherryBlossomGrove(BOPConfigurationIDs.cherryBlossomGroveID).setBiomeName("Cherry Blossom Grove"), BOPBiomeTemperatureType.COOL));
registerOnlyBiome(new BOPBiomeListEntry(new BiomeGenConiferousForest(BOPConfigurationIDs.coniferousForestID).setBiomeName("Coniferous Forest"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenConiferousForest(BOPConfigurationIDs.coniferousForestID).setBiomeName("Coniferous Forest"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenConiferousForestSnow(BOPConfigurationIDs.coniferousForestSnowID).setBiomeName("Snowy Coniferous Forest"), BOPBiomeTemperatureType.ICY));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenCrag(BOPConfigurationIDs.cragID).setBiomeName("Crag"), BOPBiomeTemperatureType.HOT));
registerBiome(new BOPBiomeListEntry(new BiomeGenDeadForest(BOPConfigurationIDs.deadForestID).setBiomeName("Dead Forest"), BOPBiomeTemperatureType.COOL));

View File

@ -8,8 +8,10 @@ import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeDecorator;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate;
import net.minecraftforge.event.terraingen.TerrainGen;
import biomesoplenty.common.world.decoration.BOPWorldFeatures;
import biomesoplenty.common.world.decoration.ForcedDecorators;
@ -86,39 +88,17 @@ public class DecorateBiomeEventHandler
}
catch (Exception e)
{
e.printStackTrace();
Throwable cause = e.getCause();
if (e.getMessage().equals("Already decorating!!") || (cause != null && cause.getMessage().equals("Already decorating!!")))
{
}
else
{
e.printStackTrace();
}
}
}
}
}
public static void decorate(World world, Random random, BiomeGenBase biome, int x, int z)
{
BiomeDecorator biomeDecorator = biome.theBiomeDecorator;
if (biomeDecorator.currentWorld != null)
{
return;
}
else
{
biomeDecorator.currentWorld = world;
biomeDecorator.randomGenerator = random;
biomeDecorator.chunk_X = x;
biomeDecorator.chunk_Z = z;
//TODO: decorate
try
{
ReflectionHelper.findMethod(BiomeDecorator.class, biomeDecorator, new String[] { "func_150513_a" }, BiomeGenBase.class).invoke(biomeDecorator, biome);
}
catch (Exception e)
{
}
biomeDecorator.currentWorld = null;
biomeDecorator.randomGenerator = null;
}
}
}