mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-26 18:39:44 -05:00
Allow @PluginName syntax
This commit is contained in:
1 parent
aa8989132e
commit
a10df0c5e1
1 file changed
+5
-2
@@ -114,7 +114,7 @@ public class QSEventManager implements QuickEventManager, Listener {
|
||||
continue;
|
||||
}
|
||||
Class<?> regClass = registration.getListener().getClass();
|
||||
if (this.ignoredListener.stream().anyMatch(listenerContainer -> listenerContainer.matches(regClass))) {
|
||||
if (this.ignoredListener.stream().anyMatch(listenerContainer -> listenerContainer.matches(regClass, registration.getPlugin()))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -157,10 +157,13 @@ class ListenerContainer {
|
||||
@NotNull
|
||||
private final String clazzName;
|
||||
|
||||
public boolean matches(Class<?> matching) {
|
||||
public boolean matches(@NotNull Class<?> matching, @NotNull Plugin plugin) {
|
||||
if (clazz != null) {
|
||||
return matching.equals(clazz);
|
||||
}
|
||||
if (clazzName.startsWith("@")) {
|
||||
return clazzName.equalsIgnoreCase("@" + plugin.getName());
|
||||
}
|
||||
String name = matching.getName();
|
||||
if (name.equalsIgnoreCase(clazzName)) {
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user