From c94fc4310fd8412c78dfdca488efc991eca39234 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Tue, 6 Jan 2015 11:32:16 +0100 Subject: [PATCH] Work around FML crashing without UBC due to accessing the exception type in the UBC try-catch --- src/main/java/tconstruct/plugins/ubc/TinkerUBC.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/tconstruct/plugins/ubc/TinkerUBC.java b/src/main/java/tconstruct/plugins/ubc/TinkerUBC.java index e87b8222..0067e0a4 100644 --- a/src/main/java/tconstruct/plugins/ubc/TinkerUBC.java +++ b/src/main/java/tconstruct/plugins/ubc/TinkerUBC.java @@ -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; } }