Commit f3061a36 authored by KingRainbow44's avatar KingRainbow44
Browse files

gave up, Pass class as argument to constructor

parent ae6a6abc
......@@ -3,17 +3,14 @@ package emu.grasscutter.server.event;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.utils.EventConsumer;
import java.lang.reflect.ParameterizedType;
public final class EventHandler<T extends Event> {
private final Class<T> eventClass;
private EventConsumer<T> listener;
private HandlerPriority priority;
private boolean handleCanceled;
@SuppressWarnings("unchecked")
public EventHandler() {
this.eventClass = (Class<T>) ((ParameterizedType) (getClass().getGenericSuperclass())).getActualTypeArguments()[0];
public EventHandler(Class<T> eventClass) {
this.eventClass = eventClass;
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment