@SuppressWarnings("unchecked")
    private static <T extends Event> void addListener(IEventBus eventBus, SubscribeEvent annotation, Class<?> eventType, Consumer<?> consumer) {
        eventBus.addListener(annotation.priority(), annotation.receiveCanceled(), (Class<T>) eventType, (Consumer<T>) consumer);
    }
Handles casting generics for {@link IEventBus#addListener}.
neoforge/src/main/java/me/lucko/luckperms/neoforge/util/NeoForgeEventBusFacade.java