diff --git a/src/main/java/dev/zontreck/eventsbus/EventDispatcher.java b/src/main/java/dev/zontreck/eventsbus/EventDispatcher.java index b061ce7..560c8db 100644 --- a/src/main/java/dev/zontreck/eventsbus/EventDispatcher.java +++ b/src/main/java/dev/zontreck/eventsbus/EventDispatcher.java @@ -102,10 +102,11 @@ public class EventDispatcher { try{ String packageName = pkg.getName(); - Field classesField = classLoader.getClass().getDeclaredField("classes"); - classesField.setAccessible(true); - List> classes = (List>) classesField.get(classLoader); + var clField = classLoader.getClass().getDeclaredField("classes"); + clField.setAccessible(true); + + List> classes = (List>) clField.get(classLoader); for(Class clazz : classes) {