Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/fix class not found errors #21

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true

# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true

# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.19'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.21'
}


Original file line number Diff line number Diff line change
Expand Up @@ -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.");

}

Expand Down
8 changes: 7 additions & 1 deletion src/main/java/mcp/mobius/waila/addons/ic2/IC2Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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.");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.");
}
}

Expand Down