From a4d71b2c0b2eec42419cba1c91f5b4f9eee713ae Mon Sep 17 00:00:00 2001 From: Paldiu Date: Mon, 25 Apr 2022 16:33:54 -0500 Subject: [PATCH] Minor Change - Version change to Beta 1.0 RC01 - Adjusted the way the listeners are registered --- build.gradle | 2 +- src/main/java/io/github/simplex/luck/FeelingLucky.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 9408900..404f8a9 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { } group = 'io.github.simplex' -version = 'Beta-20220422-SNAPSHOT' +version = 'Beta-1.0-RC01' repositories { mavenCentral() diff --git a/src/main/java/io/github/simplex/luck/FeelingLucky.java b/src/main/java/io/github/simplex/luck/FeelingLucky.java index 95e878e..015f639 100644 --- a/src/main/java/io/github/simplex/luck/FeelingLucky.java +++ b/src/main/java/io/github/simplex/luck/FeelingLucky.java @@ -68,9 +68,11 @@ public final class FeelingLucky extends JavaPlugin { private void registerListeners() { try { - Class[] listeners = SneakyWorker.getClasses("io.github.simplex.luck.listener"); + Class[] listeners = SneakyWorker.getClasses(AbstractListener.class.getPackage().getName()); Arrays.stream(listeners).forEach(l -> { if (AbstractListener.class.isAssignableFrom(l)) { + if (l.equals(AbstractListener.class)) return; + SneakyWorker.sneakyTry(() -> l.getDeclaredConstructor(FeelingLucky.class).newInstance(this)); } });