Update event to 3.0.0

This commit is contained in:
Luck 2018-08-16 20:01:26 +01:00
parent 68ec6e2a37
commit fec87d4c6a
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 6 additions and 13 deletions

View File

@ -7,7 +7,7 @@ dependencies {
exclude(module: 'guava')
exclude(module: 'gson')
}
compile('net.kyori:event-api:2.0.2') {
compile('net.kyori:event-api:3.0.0') {
exclude(module: 'checker-qual')
exclude(module: 'guava')
}

View File

@ -70,8 +70,8 @@ public enum Dependency {
EVENT(
"net{}kyori",
"event-api",
"2.0.2",
"+69FXQhgPlBtg/OvEiB+hvpbdGyUquj4cORHV1gnN1w=",
"3.0.0",
"yjvdTdAyktl3iFEQFLHC3qYwwt7/DbCd7Zc8Q4SlIag=",
Relocation.of("eventbus", "net{}kyori{}event")
),
CAFFEINE(

View File

@ -31,13 +31,11 @@ import me.lucko.luckperms.api.event.LuckPermsEvent;
import me.lucko.luckperms.common.api.LuckPermsApiProvider;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
import net.kyori.event.EventSubscriber;
import net.kyori.event.SimpleEventBus;
import java.util.Objects;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
@ -137,7 +135,7 @@ public abstract class AbstractEventBus<P> implements EventBus, AutoCloseable {
* @param plugin the plugin
*/
protected void unregisterHandlers(P plugin) {
this.bus.unregisterMatching(sub -> ((LuckPermsEventHandler) sub).getPlugin() == plugin);
this.bus.unregister(sub -> ((LuckPermsEventHandler) sub).getPlugin() == plugin);
}
@Override
@ -147,13 +145,8 @@ public abstract class AbstractEventBus<P> implements EventBus, AutoCloseable {
private static final class Bus extends SimpleEventBus<LuckPermsEvent> {
@Override
public void unregisterMatching(@Nonnull Predicate<EventSubscriber<?>> predicate) {
super.unregisterMatching(predicate);
}
public void unregisterAll() {
super.unregisterAll();
public Bus() {
super(LuckPermsEvent.class);
}
public <T extends LuckPermsEvent> Set<EventHandler<T>> getHandlers(Class<T> eventClass) {