Skip to content

Commit 88708df

Browse files
Giving throwable catch for preventing plugin broken
this may happen in the future minecraft version, so prevent it for now
1 parent fc02532 commit 88708df

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/org/maxgamer/quickshop/util/ReflectFactory.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,12 @@ public static String getMaterialMinecraftNamespacedKey(Material material) {
294294
} else {
295295
return (String) getMinecraftKeyNameMethod.invoke(nmsItem);
296296
}
297-
} catch (IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) {
298-
e.printStackTrace();
297+
} catch (IllegalAccessException | ClassNotFoundException | NoSuchMethodException |
298+
InvocationTargetException e) {
299+
Util.debugLog("getMinecraftKeyNameMethod, error: " + e);
300+
return null;
301+
} catch (Throwable throwable) {
302+
Util.debugLog("getMinecraftKeyNameMethod, Unknown error: " + throwable);
299303
return null;
300304
}
301305
}

0 commit comments

Comments
 (0)