diff --git a/src/main/java/mcp/mobius/waila/addons/buildcraft/BCModule.java b/src/main/java/mcp/mobius/waila/addons/buildcraft/BCModule.java index 8df1d0f..21797a7 100644 --- a/src/main/java/mcp/mobius/waila/addons/buildcraft/BCModule.java +++ b/src/main/java/mcp/mobius/waila/addons/buildcraft/BCModule.java @@ -24,11 +24,11 @@ public static void register() { ModuleRegistrar.instance().registerHeadProvider(new HUDHandlerBCTanks(), TileTank); ModuleRegistrar.instance().registerBodyProvider(new HUDHandlerBCTanks(), TileTank); - } catch (ClassNotFoundException e) { - Waila.log.log(Level.WARN, "[BC] Class not found. " + e); - } catch (NoSuchMethodException e) { - Waila.log.log(Level.WARN, "[BC] Method not found." + e); + } catch (ClassNotFoundException | NoSuchMethodException e) { + Waila.log.log(Level.INFO, "[BC] Buildcraft mod not found."); + return; } + Waila.log.log(Level.INFO, "Buildcraft mod found."); } diff --git a/src/main/java/mcp/mobius/waila/addons/ic2/IC2Module.java b/src/main/java/mcp/mobius/waila/addons/ic2/IC2Module.java index cc2bb8d..5a3e966 100644 --- a/src/main/java/mcp/mobius/waila/addons/ic2/IC2Module.java +++ b/src/main/java/mcp/mobius/waila/addons/ic2/IC2Module.java @@ -84,8 +84,14 @@ public static void register() { ModuleRegistrar.instance().addConfigRemote("IndustrialCraft2", "ic2.outputeu"); } catch (Exception e) { - Waila.log.log(Level.WARN, "[IndustrialCraft 2] Error while loading generator hooks." + e); + if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) { + Waila.log.log(Level.INFO, "[IndustrialCraft 2] IndustrialCraft 2 mod not found."); + } else { + Waila.log.log(Level.WARN, "[IndustrialCraft 2] Error while loading generator hooks." + e); + } + return; } + Waila.log.log(Level.INFO, "IndustrialCraft 2 mod found."); } } diff --git a/src/main/java/mcp/mobius/waila/addons/thaumcraft/ThaumcraftModule.java b/src/main/java/mcp/mobius/waila/addons/thaumcraft/ThaumcraftModule.java index 9023b33..5304175 100644 --- a/src/main/java/mcp/mobius/waila/addons/thaumcraft/ThaumcraftModule.java +++ b/src/main/java/mcp/mobius/waila/addons/thaumcraft/ThaumcraftModule.java @@ -66,10 +66,13 @@ public static void register() { ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIAspectContainer(), TileAlchemyFurnace); } catch (ClassNotFoundException e) { - Waila.log.log(Level.WARN, "[Thaumcraft] Class not found. " + e); + Waila.log.log(Level.INFO, "[Thaumcraft] Thaumcraft mod not found."); + return; } catch (Exception e) { - Waila.log.log(Level.WARN, "[Thaumcraft] Unhandled exception." + e); + Waila.log.log(Level.WARN, "[Thaumcraft] Unhandled exception. {}", e); + return; } + Waila.log.log(Level.INFO, "Thaumcraft mod found."); } diff --git a/src/main/java/mcp/mobius/waila/addons/thermaldynamics/ThermalDynamicsModule.java b/src/main/java/mcp/mobius/waila/addons/thermaldynamics/ThermalDynamicsModule.java index 2266055..335ad1e 100644 --- a/src/main/java/mcp/mobius/waila/addons/thermaldynamics/ThermalDynamicsModule.java +++ b/src/main/java/mcp/mobius/waila/addons/thermaldynamics/ThermalDynamicsModule.java @@ -21,8 +21,14 @@ public static void register() { ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerDuct(), TileFluidDuct); } catch (Exception e) { - Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks." + e); + if (e instanceof ClassNotFoundException) { + Waila.log.log(Level.INFO, "[Thermal Dynamics] Thermal Dynamics mod not found."); + } else { + Waila.log.log(Level.WARN, "[Thermal Dynamics] Error while loading FluidDuct hooks. {}", e); + } + return; } + Waila.log.log(Level.INFO, "Thermal Dynamics mod found."); } } diff --git a/src/main/java/mcp/mobius/waila/addons/thermalexpansion/ThermalExpansionModule.java b/src/main/java/mcp/mobius/waila/addons/thermalexpansion/ThermalExpansionModule.java index 2ee5b42..585a48e 100644 --- a/src/main/java/mcp/mobius/waila/addons/thermalexpansion/ThermalExpansionModule.java +++ b/src/main/java/mcp/mobius/waila/addons/thermalexpansion/ThermalExpansionModule.java @@ -51,6 +51,7 @@ public class ThermalExpansionModule { public static Method IBlockInfo_getBlockInfo = null; public static void register() { + boolean printedThermalExpansionNotFound = false; // XXX : We register the Energy interface first try { IEnergyProvider = Class.forName("cofh.api.energy.IEnergyProvider"); @@ -74,7 +75,12 @@ public static void register() { ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerIEnergyHandler(), IEnergyInfo); } catch (Exception e) { - Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy hooks." + e); + if (e instanceof ClassNotFoundException) { + Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found."); + printedThermalExpansionNotFound = true; + } else { + Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy hooks. {}", e); + } } // XXX : We register the energy cell @@ -88,7 +94,14 @@ public static void register() { ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerEnergyCell(), TileEnergyCell); } catch (Exception e) { - Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy Cell hooks." + e); + if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) { + if (!printedThermalExpansionNotFound) { + printedThermalExpansionNotFound = true; + Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found."); + } + } else { + Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Energy Cell hooks. {}", e); + } } // XXX : We register the Tank interface @@ -107,7 +120,14 @@ public static void register() { ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTank(), TileTank); } catch (Exception e) { - Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tank hooks." + e); + if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) { + if (!printedThermalExpansionNotFound) { + printedThermalExpansionNotFound = true; + Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found."); + } + } else { + Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tank hooks. {}", e); + } } // XXX : We register the Tesseract interface @@ -123,7 +143,14 @@ public static void register() { ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerTesseract(), TileTesseract); } catch (Exception e) { - Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e); + if (e instanceof ClassNotFoundException || e instanceof NoSuchFieldException) { + if (!printedThermalExpansionNotFound) { + printedThermalExpansionNotFound = true; + Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found."); + } + } else { + Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks. {}", e); + } } // XXX : We register the ISecureTile interface @@ -137,7 +164,14 @@ public static void register() { ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerISecureTile(), ISecureTile); } catch (Exception e) { - Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks." + e); + if (e instanceof ClassNotFoundException) { + if (!printedThermalExpansionNotFound) { + printedThermalExpansionNotFound = true; + Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found."); + } + } else { + Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading ISecureTile hooks. {}", e); + } } // XXX : We register the Cache interface @@ -153,7 +187,17 @@ public static void register() { ModuleRegistrar.instance().registerNBTProvider(new HUDHandlerCache(), TileCache); } catch (Exception e) { - Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks." + e); + if (e instanceof ClassNotFoundException) { + if (!printedThermalExpansionNotFound) { + printedThermalExpansionNotFound = true; + Waila.log.log(Level.INFO, "[Thermal Expansion] Thermal Expansion mod not found."); + } + } else { + Waila.log.log(Level.WARN, "[Thermal Expansion] Error while loading Tesseract hooks. {}", e); + } + } + if (!printedThermalExpansionNotFound) { + Waila.log.log(Level.INFO, "Thermal Expansion mod found."); } }