This commit is contained in:
liujiahua123123 2019-08-17 15:58:40 +08:00
parent 1ce386e80d
commit 87fe5206e9

View File

@ -6,10 +6,12 @@ import net.mamoe.mirai.event.events.Cancellable;
import net.mamoe.mirai.event.events.MiraiEvent; import net.mamoe.mirai.event.events.MiraiEvent;
import net.mamoe.mirai.event.events.server.ServerDisableEvent; import net.mamoe.mirai.event.events.server.ServerDisableEvent;
import java.io.Closeable;
import java.io.IOException;
import java.util.function.Consumer; import java.util.function.Consumer;
import java.util.function.Predicate; import java.util.function.Predicate;
public class MiraiEventHook<T extends MiraiEvent> { public class MiraiEventHook<T extends MiraiEvent> implements Closeable {
@Getter @Getter
Class<T> eventClass; Class<T> eventClass;
@ -98,5 +100,9 @@ public class MiraiEventHook<T extends MiraiEvent> {
} }
@Override
public void close(){
this.handler = null;
this.valid = null;
}
} }