Skip to content

Commit

Permalink
- optimise error reporting output
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaffe2718 committed Nov 19, 2023
1 parent 6a15814 commit a875e7c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/net/wurstclient/zoom/WiZoomInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public void onInitialize()
.getMethod("init", String.class, Class.class)
.invoke(null,"wi_zoom", WiZoomInitializer.getConfigClass());
} catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
System.err.println(e.getClass().getName() + ": " + e.getMessage());
System.err.println("WiZoomInitializer.onInitialize(): MidnightLib not found. Configuration UI will not be available.");
}

Expand All @@ -55,7 +56,7 @@ public void onInitialize()
try {
Class.forName("eu.midnightdust.lib.config.MidnightConfig"); // Check if MidnightConfig is loaded
return Class.forName("net.wurstclient.zoom.config.WiZoomConfig");
} catch (ClassNotFoundException e) {
} catch (ClassNotFoundException ignored) {
return null;
}
}
Expand All @@ -73,7 +74,7 @@ public static int getCfgMaxZoom() {
else {
try {
return (int) configClass.getField("maxZoom").get(null);
} catch (IllegalAccessException | NoSuchFieldException e) {
} catch (IllegalAccessException | NoSuchFieldException ignored) {
return 50;
}
}
Expand All @@ -92,7 +93,7 @@ public static double getCfgMinZoom() {
else {
try {
return (double) configClass.getField("minZoom").get(null);
} catch (IllegalAccessException | NoSuchFieldException e) {
} catch (IllegalAccessException | NoSuchFieldException ignored) {
return 1.0;
}
}
Expand All @@ -112,7 +113,7 @@ public static double getCfgMouseScrollZoomSensitivity() {
else {
try {
return (double) configClass.getField("mouseScrollSensitivity").get(null);
} catch (IllegalAccessException | NoSuchFieldException e) {
} catch (IllegalAccessException | NoSuchFieldException ignored) {
return 2D;
}
}
Expand Down

0 comments on commit a875e7c

Please sign in to comment.