mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-30 22:53:27 +01:00
Update event to 3.0.0
This commit is contained in:
parent
68ec6e2a37
commit
fec87d4c6a
@ -7,7 +7,7 @@ dependencies {
|
|||||||
exclude(module: 'guava')
|
exclude(module: 'guava')
|
||||||
exclude(module: 'gson')
|
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: 'checker-qual')
|
||||||
exclude(module: 'guava')
|
exclude(module: 'guava')
|
||||||
}
|
}
|
||||||
|
@ -70,8 +70,8 @@ public enum Dependency {
|
|||||||
EVENT(
|
EVENT(
|
||||||
"net{}kyori",
|
"net{}kyori",
|
||||||
"event-api",
|
"event-api",
|
||||||
"2.0.2",
|
"3.0.0",
|
||||||
"+69FXQhgPlBtg/OvEiB+hvpbdGyUquj4cORHV1gnN1w=",
|
"yjvdTdAyktl3iFEQFLHC3qYwwt7/DbCd7Zc8Q4SlIag=",
|
||||||
Relocation.of("eventbus", "net{}kyori{}event")
|
Relocation.of("eventbus", "net{}kyori{}event")
|
||||||
),
|
),
|
||||||
CAFFEINE(
|
CAFFEINE(
|
||||||
|
@ -31,13 +31,11 @@ import me.lucko.luckperms.api.event.LuckPermsEvent;
|
|||||||
import me.lucko.luckperms.common.api.LuckPermsApiProvider;
|
import me.lucko.luckperms.common.api.LuckPermsApiProvider;
|
||||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||||
|
|
||||||
import net.kyori.event.EventSubscriber;
|
|
||||||
import net.kyori.event.SimpleEventBus;
|
import net.kyori.event.SimpleEventBus;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Predicate;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@ -137,7 +135,7 @@ public abstract class AbstractEventBus<P> implements EventBus, AutoCloseable {
|
|||||||
* @param plugin the plugin
|
* @param plugin the plugin
|
||||||
*/
|
*/
|
||||||
protected void unregisterHandlers(P plugin) {
|
protected void unregisterHandlers(P plugin) {
|
||||||
this.bus.unregisterMatching(sub -> ((LuckPermsEventHandler) sub).getPlugin() == plugin);
|
this.bus.unregister(sub -> ((LuckPermsEventHandler) sub).getPlugin() == plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -147,13 +145,8 @@ public abstract class AbstractEventBus<P> implements EventBus, AutoCloseable {
|
|||||||
|
|
||||||
private static final class Bus extends SimpleEventBus<LuckPermsEvent> {
|
private static final class Bus extends SimpleEventBus<LuckPermsEvent> {
|
||||||
|
|
||||||
@Override
|
public Bus() {
|
||||||
public void unregisterMatching(@Nonnull Predicate<EventSubscriber<?>> predicate) {
|
super(LuckPermsEvent.class);
|
||||||
super.unregisterMatching(predicate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void unregisterAll() {
|
|
||||||
super.unregisterAll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends LuckPermsEvent> Set<EventHandler<T>> getHandlers(Class<T> eventClass) {
|
public <T extends LuckPermsEvent> Set<EventHandler<T>> getHandlers(Class<T> eventClass) {
|
||||||
|
Loading…
Reference in New Issue
Block a user