From 0a4150d63eee6c1aaee503c46bd190c342d15d2d Mon Sep 17 00:00:00 2001 From: Sxtanna Date: Tue, 21 Jul 2020 16:04:24 -0400 Subject: [PATCH] updated fileutil to ignore NCDFEs, and to print exceptions --- .../me/clip/placeholderapi/util/FileUtil.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/util/FileUtil.java b/src/main/java/me/clip/placeholderapi/util/FileUtil.java index 0acb44e..70cf792 100644 --- a/src/main/java/me/clip/placeholderapi/util/FileUtil.java +++ b/src/main/java/me/clip/placeholderapi/util/FileUtil.java @@ -71,9 +71,9 @@ public class FileUtil return list; } - catch (Throwable t) + catch (final Throwable ex) { - // THIS SHOULD NOT BE EATEN LIKE THIS. + ex.printStackTrace(); } return Collections.emptyList(); @@ -92,11 +92,16 @@ public class FileUtil continue; } - final Class loaded = loader.loadClass(name.substring(0, name.lastIndexOf('.')).replace('/', '.')); - if (clazz.isAssignableFrom(loaded)) + try { - list.add(loaded.asSubclass(clazz)); + final Class loaded = loader.loadClass(name.substring(0, name.lastIndexOf('.')).replace('/', '.')); + if (clazz.isAssignableFrom(loaded)) + { + list.add(loaded.asSubclass(clazz)); + } } + catch (final NoClassDefFoundError ignored) + { } } } }