Work around FML crashing without UBC due to accessing the exception type in the UBC try-catch

This commit is contained in:
Bernhard Bonigl committed 2015-01-06 11:32:16 +01:00
1 parent 0972d78077
commit c94fc4310f
1 file changed
+8 -3
@@ -9,7 +9,6 @@ import mantle.pulsar.pulse.Pulse;
import tconstruct.TConstruct;
import tconstruct.world.TinkerWorld;
@ObjectHolder(TConstruct.modID)
@Pulse(id = "Tinkers' Underground Biomes Compatiblity", description = "Tinkers' Construct compatibilty for Underground Biomes Construct", modsRequired = "UndergroundBiomes", pulsesRequired = "Tinkers' World", forced = true)
public class TinkerUBC
{
@@ -28,9 +27,15 @@ public class TinkerUBC
{
UBAPIHook.ubAPIHook.ubOreTexturizer.requestUBOreSetup(TinkerWorld.oreSlag, meta, "tinker:ore_" + overlayTexture + "_overlay", "MetalOre." + blockName);
}
catch (BlocksAreAlreadySet exception)
catch (RuntimeException exception)
{
TConstruct.logger.error(blockName + " is already registered in UBC");
// we have to work around this because otherwise FML would access this for some reason
// and crash because BlocksAreAlreadySet Exception is not present without UBC
if(exception instanceof BlocksAreAlreadySet)
TConstruct.logger.error(blockName + " is already registered in UBC");
else
// rethrow if it's another exception
throw exception;
}
}