diff --git a/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java b/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java
index c4971e19..055c7e94 100644
--- a/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java
+++ b/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java
@@ -67,6 +67,13 @@ public enum Dependency {
"drQpwf+oI1+DPrn0iCvEtoID+xXR3dpZK5ySaBrUiok=",
Relocation.of("text", "net{}kyori{}text")
),
+ EVENT(
+ "net{}kyori",
+ "event-api",
+ "2.0.1",
+ "4XVmowvKHCmO38ZO2jeZKh/mD00xBg73zau79s4kTe4=",
+ Relocation.of("eventbus", "net{}kyori{}event")
+ ),
CAFFEINE(
"com{}github{}ben-manes{}caffeine",
"caffeine",
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/AbstractEventBus.java b/common/src/main/java/me/lucko/luckperms/common/event/AbstractEventBus.java
index bc0b3387..304abb4b 100644
--- a/common/src/main/java/me/lucko/luckperms/common/event/AbstractEventBus.java
+++ b/common/src/main/java/me/lucko/luckperms/common/event/AbstractEventBus.java
@@ -25,33 +25,26 @@
package me.lucko.luckperms.common.event;
-import com.github.benmanes.caffeine.cache.Caffeine;
-import com.github.benmanes.caffeine.cache.LoadingCache;
-import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Multimaps;
-import me.lucko.luckperms.api.event.Cancellable;
import me.lucko.luckperms.api.event.EventBus;
import me.lucko.luckperms.api.event.EventHandler;
import me.lucko.luckperms.api.event.LuckPermsEvent;
import me.lucko.luckperms.common.api.LuckPermsApiProvider;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
+import me.lucko.luckperms.common.utils.Predicates;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
+import net.kyori.event.EventSubscriber;
+import net.kyori.event.SimpleEventBus;
+
+import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
+import java.util.function.Predicate;
import javax.annotation.Nonnull;
-/**
- * Simple implementation of EventBus.
- */
public abstract class AbstractEventBus implements EventBus, AutoCloseable {
/**
@@ -65,26 +58,9 @@ public abstract class AbstractEventBus
implements EventBus, AutoCloseable {
private final LuckPermsApiProvider apiProvider;
/**
- * The registered handlers in this event bus
+ * The delegate event bus
*/
- private final Multimap, LuckPermsEventHandler>> handlerMap = Multimaps.newSetMultimap(new ConcurrentHashMap<>(), ConcurrentHashMap::newKeySet);
-
- /**
- * A cache of event class --> applicable handlers.
- *
- * A registered "handler" will be passed all possible events it can handle, according to
- * {@link Class#isAssignableFrom(Class)}.
- */
- private final LoadingCache, List>> handlerCache = Caffeine.newBuilder()
- .build(eventClass -> {
- ImmutableList.Builder> matched = ImmutableList.builder();
- AbstractEventBus.this.handlerMap.asMap().forEach((clazz, handlers) -> {
- if (clazz.isAssignableFrom(eventClass)) {
- matched.addAll(handlers);
- }
- });
- return matched.build();
- });
+ private final Bus bus = new Bus();
protected AbstractEventBus(LuckPermsPlugin plugin, LuckPermsApiProvider apiProvider) {
this.plugin = plugin;
@@ -95,6 +71,23 @@ public abstract class AbstractEventBus implements EventBus, AutoCloseable {
return this.plugin;
}
+ public LuckPermsApiProvider getApiProvider() {
+ return this.apiProvider;
+ }
+
+ /**
+ * Checks that the given plugin object is a valid plugin instance for the platform
+ *
+ * @param plugin the object
+ * @return a plugin
+ * @throws IllegalArgumentException if the plugin is invalid
+ */
+ protected abstract P checkPlugin(Object plugin) throws IllegalArgumentException;
+
+ public void post(LuckPermsEvent event) {
+ this.bus.post(event);
+ }
+
@Nonnull
@Override
public EventHandler subscribe(@Nonnull Class eventClass, @Nonnull Consumer super T> handler) {
@@ -112,36 +105,6 @@ public abstract class AbstractEventBus implements EventBus, AutoCloseable {
return registerSubscription(eventClass, handler, checkPlugin(plugin));
}
- @Nonnull
- @Override
- public Set> getHandlers(@Nonnull Class eventClass) {
- Collection> handlers = this.handlerMap.asMap().get(eventClass);
- ImmutableSet.Builder> ret = ImmutableSet.builder();
- for (LuckPermsEventHandler> handler : handlers) {
- //noinspection unchecked
- ret.add((EventHandler) handler);
- }
- return ret.build();
- }
-
- /**
- * Checks that the given plugin object is a valid plugin instance for the platform
- *
- * @param plugin the object
- * @return a plugin
- * @throws IllegalArgumentException if the plugin is invalid
- */
- protected abstract P checkPlugin(Object plugin) throws IllegalArgumentException;
-
- /**
- * Registers a subscription for the given class, handler and plugin
- *
- * @param eventClass the event class
- * @param handler the handler
- * @param plugin the plugin, nullable
- * @param the event type
- * @return the resultant handler
- */
private EventHandler registerSubscription(Class eventClass, Consumer super T> handler, Object plugin) {
if (!eventClass.isInterface()) {
throw new IllegalArgumentException("class " + eventClass + " is not an interface");
@@ -151,20 +114,28 @@ public abstract class AbstractEventBus implements EventBus, AutoCloseable {
}
LuckPermsEventHandler eventHandler = new LuckPermsEventHandler<>(this, eventClass, handler, plugin);
- this.handlerMap.put(eventClass, eventHandler);
- this.handlerCache.invalidateAll();
+ this.bus.register(eventClass, eventHandler);
return eventHandler;
}
+ @Nonnull
+ @Override
+ public Set> getHandlers(@Nonnull Class eventClass) {
+ Set> handlers = this.bus.getHandlers();
+ handlers.removeIf(h -> !h.getEventClass().isAssignableFrom(eventClass));
+
+ //noinspection unchecked
+ return (Set) ImmutableSet.copyOf(handlers);
+ }
+
/**
* Removes a specific handler from the bus
*
* @param handler the handler to remove
*/
public void unregisterHandler(LuckPermsEventHandler> handler) {
- this.handlerMap.remove(handler.getEventClass(), handler);
- this.handlerCache.invalidateAll();
+ this.bus.unregister(handler);
}
/**
@@ -173,54 +144,35 @@ public abstract class AbstractEventBus implements EventBus, AutoCloseable {
* @param plugin the plugin
*/
protected void unregisterHandlers(P plugin) {
- List> handlers = new ArrayList<>(this.handlerMap.values());
- for (LuckPermsEventHandler> handler : handlers) {
- if (handler.getPlugin() == plugin) {
- handler.unregister();
- }
- }
+ this.bus.unregisterMatching(sub -> ((LuckPermsEventHandler) sub).getPlugin() == plugin);
}
- /**
- * Unregisters all handlers in this event bus
- */
@Override
public void close() {
- List> handlers = new ArrayList<>(this.handlerMap.values());
- for (LuckPermsEventHandler> handler : handlers) {
- handler.unregister();
- }
+ this.bus.unregisterAll();
}
- /**
- * Fires the given event to all registered handlers in this event bus
- *
- * @param event the event to fire
- */
- public void fireEvent(LuckPermsEvent event) {
- if (event instanceof AbstractEvent) {
- ((AbstractEvent) event).setApi(this.apiProvider);
+ private static final class Bus extends SimpleEventBus {
+
+ @Override
+ public void unregisterMatching(@Nonnull Predicate> predicate) {
+ super.unregisterMatching(predicate);
}
- List> handlers = this.handlerCache.get(event.getClass());
- if (handlers == null) {
- return;
+ public void unregisterAll() {
+ unregisterMatching(Predicates.alwaysTrue());
}
- for (LuckPermsEventHandler> handler : handlers) {
- handler.handle(event);
- }
- }
+ public Set> getHandlers() {
+ Set> handlers = new HashSet<>();
- /**
- * Fires the given event asynchronously to all registered handlers in this event bus
- *
- * @param event the event to fire
- */
- public void fireEventAsync(LuckPermsEvent event) {
- if (event instanceof Cancellable) {
- throw new IllegalArgumentException("cannot call Cancellable event async");
+ // bit of a hack
+ unregisterMatching(sub -> {
+ handlers.add((LuckPermsEventHandler>) sub);
+ return false;
+ });
+
+ return handlers;
}
- this.plugin.getBootstrap().getScheduler().executeAsync(() -> fireEvent(event));
}
}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/EventFactory.java b/common/src/main/java/me/lucko/luckperms/common/event/EventFactory.java
index 4d224d1f..a8319c3d 100644
--- a/common/src/main/java/me/lucko/luckperms/common/event/EventFactory.java
+++ b/common/src/main/java/me/lucko/luckperms/common/event/EventFactory.java
@@ -33,47 +33,47 @@ import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.api.PlayerSaveResult;
import me.lucko.luckperms.api.caching.GroupData;
import me.lucko.luckperms.api.caching.UserData;
+import me.lucko.luckperms.api.event.Cancellable;
import me.lucko.luckperms.api.event.LuckPermsEvent;
import me.lucko.luckperms.api.event.cause.CreationCause;
import me.lucko.luckperms.api.event.cause.DeletionCause;
+import me.lucko.luckperms.api.event.group.GroupCacheLoadEvent;
+import me.lucko.luckperms.api.event.group.GroupCreateEvent;
+import me.lucko.luckperms.api.event.group.GroupDataRecalculateEvent;
+import me.lucko.luckperms.api.event.group.GroupDeleteEvent;
+import me.lucko.luckperms.api.event.group.GroupLoadAllEvent;
+import me.lucko.luckperms.api.event.group.GroupLoadEvent;
import me.lucko.luckperms.api.event.log.LogBroadcastEvent;
+import me.lucko.luckperms.api.event.log.LogNetworkPublishEvent;
import me.lucko.luckperms.api.event.log.LogNotifyEvent;
+import me.lucko.luckperms.api.event.log.LogPublishEvent;
+import me.lucko.luckperms.api.event.log.LogReceiveEvent;
+import me.lucko.luckperms.api.event.node.NodeAddEvent;
+import me.lucko.luckperms.api.event.node.NodeClearEvent;
+import me.lucko.luckperms.api.event.node.NodeRemoveEvent;
+import me.lucko.luckperms.api.event.player.PlayerDataSaveEvent;
import me.lucko.luckperms.api.event.source.Source;
+import me.lucko.luckperms.api.event.sync.ConfigReloadEvent;
+import me.lucko.luckperms.api.event.sync.PostSyncEvent;
+import me.lucko.luckperms.api.event.sync.PreNetworkSyncEvent;
+import me.lucko.luckperms.api.event.sync.PreSyncEvent;
+import me.lucko.luckperms.api.event.track.TrackCreateEvent;
+import me.lucko.luckperms.api.event.track.TrackDeleteEvent;
+import me.lucko.luckperms.api.event.track.TrackLoadAllEvent;
+import me.lucko.luckperms.api.event.track.TrackLoadEvent;
+import me.lucko.luckperms.api.event.track.mutate.TrackAddGroupEvent;
+import me.lucko.luckperms.api.event.track.mutate.TrackClearEvent;
+import me.lucko.luckperms.api.event.track.mutate.TrackRemoveGroupEvent;
+import me.lucko.luckperms.api.event.user.UserCacheLoadEvent;
+import me.lucko.luckperms.api.event.user.UserDataRecalculateEvent;
+import me.lucko.luckperms.api.event.user.UserFirstLoginEvent;
+import me.lucko.luckperms.api.event.user.UserLoadEvent;
+import me.lucko.luckperms.api.event.user.UserLoginProcessEvent;
+import me.lucko.luckperms.api.event.user.track.UserDemoteEvent;
+import me.lucko.luckperms.api.event.user.track.UserPromoteEvent;
import me.lucko.luckperms.common.api.delegates.model.ApiPermissionHolder;
import me.lucko.luckperms.common.api.delegates.model.ApiUser;
-import me.lucko.luckperms.common.event.impl.EventConfigReload;
-import me.lucko.luckperms.common.event.impl.EventGroupCacheLoad;
-import me.lucko.luckperms.common.event.impl.EventGroupCreate;
-import me.lucko.luckperms.common.event.impl.EventGroupDataRecalculate;
-import me.lucko.luckperms.common.event.impl.EventGroupDelete;
-import me.lucko.luckperms.common.event.impl.EventGroupLoad;
-import me.lucko.luckperms.common.event.impl.EventGroupLoadAll;
-import me.lucko.luckperms.common.event.impl.EventLogBroadcast;
-import me.lucko.luckperms.common.event.impl.EventLogNetworkPublish;
-import me.lucko.luckperms.common.event.impl.EventLogNotify;
-import me.lucko.luckperms.common.event.impl.EventLogPublish;
-import me.lucko.luckperms.common.event.impl.EventLogReceive;
-import me.lucko.luckperms.common.event.impl.EventNodeAdd;
-import me.lucko.luckperms.common.event.impl.EventNodeClear;
-import me.lucko.luckperms.common.event.impl.EventNodeRemove;
-import me.lucko.luckperms.common.event.impl.EventPlayerDataSave;
-import me.lucko.luckperms.common.event.impl.EventPostSync;
-import me.lucko.luckperms.common.event.impl.EventPreNetworkSync;
-import me.lucko.luckperms.common.event.impl.EventPreSync;
-import me.lucko.luckperms.common.event.impl.EventTrackAddGroup;
-import me.lucko.luckperms.common.event.impl.EventTrackClear;
-import me.lucko.luckperms.common.event.impl.EventTrackCreate;
-import me.lucko.luckperms.common.event.impl.EventTrackDelete;
-import me.lucko.luckperms.common.event.impl.EventTrackLoad;
-import me.lucko.luckperms.common.event.impl.EventTrackLoadAll;
-import me.lucko.luckperms.common.event.impl.EventTrackRemoveGroup;
-import me.lucko.luckperms.common.event.impl.EventUserCacheLoad;
-import me.lucko.luckperms.common.event.impl.EventUserDataRecalculate;
-import me.lucko.luckperms.common.event.impl.EventUserDemote;
-import me.lucko.luckperms.common.event.impl.EventUserFirstLogin;
-import me.lucko.luckperms.common.event.impl.EventUserLoad;
-import me.lucko.luckperms.common.event.impl.EventUserLoginProcess;
-import me.lucko.luckperms.common.event.impl.EventUserPromote;
+import me.lucko.luckperms.common.event.gen.GeneratedEventSpec;
import me.lucko.luckperms.common.event.model.EntitySourceImpl;
import me.lucko.luckperms.common.event.model.SenderEntity;
import me.lucko.luckperms.common.event.model.UnknownSource;
@@ -85,15 +85,17 @@ import me.lucko.luckperms.common.sender.Sender;
import java.util.Collection;
import java.util.List;
+import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Supplier;
import javax.annotation.Nullable;
public final class EventFactory {
- private final AbstractEventBus eventBus;
+ private final AbstractEventBus> eventBus;
- public EventFactory(AbstractEventBus eventBus) {
+ public EventFactory(AbstractEventBus> eventBus) {
this.eventBus = eventBus;
}
@@ -101,193 +103,174 @@ public final class EventFactory {
return this.eventBus;
}
- private void fireEventAsync(LuckPermsEvent event) {
- this.eventBus.fireEventAsync(event);
+ private void post(LuckPermsEvent event) {
+ this.eventBus.post(event);
}
- private void fireEvent(LuckPermsEvent event) {
- this.eventBus.fireEvent(event);
+ private void post(Supplier supplier) {
+ this.eventBus.getPlugin().getBootstrap().getScheduler().executeAsync(() -> {
+ LuckPermsEvent event = supplier.get();
+ if (event instanceof Cancellable) {
+ throw new RuntimeException("Cancellable event posted async: " + event);
+ }
+ this.eventBus.post(event);
+ });
+ }
+
+ private LuckPermsEvent generate(Class extends LuckPermsEvent> eventClass, Object... params) {
+ return GeneratedEventSpec.lookup(eventClass).newInstance(this.eventBus.getApiProvider(), params);
}
public void handleGroupCacheLoad(Group group, GroupData data) {
- EventGroupCacheLoad event = new EventGroupCacheLoad(group.getApiDelegate(), data);
- fireEventAsync(event);
+ post(() -> generate(GroupCacheLoadEvent.class, group.getApiDelegate(), data));
}
public void handleGroupCreate(Group group, CreationCause cause) {
- EventGroupCreate event = new EventGroupCreate(group.getApiDelegate(), cause);
- fireEventAsync(event);
+ post(() -> generate(GroupCreateEvent.class, group.getApiDelegate(), cause));
}
public void handleGroupDelete(Group group, DeletionCause cause) {
- EventGroupDelete event = new EventGroupDelete(group.getName(), ImmutableSet.copyOf(group.enduringData().immutable().values()), cause);
- fireEventAsync(event);
+ post(() -> generate(GroupDeleteEvent.class, group.getName(), ImmutableSet.copyOf(group.enduringData().immutable().values()), cause));
}
public void handleGroupLoadAll() {
- EventGroupLoadAll event = new EventGroupLoadAll();
- fireEventAsync(event);
+ post(() -> generate(GroupLoadAllEvent.class));
}
public void handleGroupLoad(Group group) {
- EventGroupLoad event = new EventGroupLoad(group.getApiDelegate());
- fireEventAsync(event);
+ post(() -> generate(GroupLoadEvent.class, group.getApiDelegate()));
}
public boolean handleLogBroadcast(boolean initialState, LogEntry entry, LogBroadcastEvent.Origin origin) {
AtomicBoolean cancel = new AtomicBoolean(initialState);
- EventLogBroadcast event = new EventLogBroadcast(cancel, entry, origin);
- fireEvent(event);
+ post(generate(LogBroadcastEvent.class, cancel, entry, origin));
return cancel.get();
}
public boolean handleLogPublish(boolean initialState, LogEntry entry) {
AtomicBoolean cancel = new AtomicBoolean(initialState);
- EventLogPublish event = new EventLogPublish(cancel, entry);
- fireEvent(event);
+ post(generate(LogPublishEvent.class, cancel, entry));
return cancel.get();
}
public boolean handleLogNetworkPublish(boolean initialState, UUID id, LogEntry entry) {
AtomicBoolean cancel = new AtomicBoolean(initialState);
- EventLogNetworkPublish event = new EventLogNetworkPublish(cancel, id, entry);
- fireEvent(event);
+ post(generate(LogNetworkPublishEvent.class, cancel, id, entry));
return cancel.get();
}
public boolean handleLogNotify(boolean initialState, LogEntry entry, LogNotifyEvent.Origin origin, Sender sender) {
AtomicBoolean cancel = new AtomicBoolean(initialState);
- EventLogNotify event = new EventLogNotify(cancel, entry, origin, sender);
- fireEvent(event);
+ post(generate(LogNotifyEvent.class, cancel, entry, origin, new SenderEntity(sender)));
return cancel.get();
}
public void handleLogReceive(UUID id, LogEntry entry) {
- EventLogReceive event = new EventLogReceive(id, entry);
- fireEventAsync(event);
+ post(() -> generate(LogReceiveEvent.class, id, entry));
}
public void handleNodeAdd(Node node, PermissionHolder target, Collection extends Node> before, Collection extends Node> after) {
- EventNodeAdd event = new EventNodeAdd(node, getDelegate(target), ImmutableSet.copyOf(before), ImmutableSet.copyOf(after));
- fireEventAsync(event);
+ post(() -> generate(NodeAddEvent.class, getDelegate(target), ImmutableSet.copyOf(before), ImmutableSet.copyOf(after), node));
}
public void handleNodeClear(PermissionHolder target, Collection extends Node> before, Collection extends Node> after) {
- EventNodeClear event = new EventNodeClear(getDelegate(target), ImmutableSet.copyOf(before), ImmutableSet.copyOf(after));
- fireEventAsync(event);
+ post(() -> generate(NodeClearEvent.class, getDelegate(target), ImmutableSet.copyOf(before), ImmutableSet.copyOf(after)));
}
public void handleNodeRemove(Node node, PermissionHolder target, Collection extends Node> before, Collection extends Node> after) {
- EventNodeRemove event = new EventNodeRemove(node, getDelegate(target), ImmutableSet.copyOf(before), ImmutableSet.copyOf(after));
- fireEventAsync(event);
+ post(() -> generate(NodeRemoveEvent.class, getDelegate(target), ImmutableSet.copyOf(before), ImmutableSet.copyOf(after), node));
}
public void handleConfigReload() {
- EventConfigReload event = new EventConfigReload();
- fireEventAsync(event);
+ post(() -> generate(ConfigReloadEvent.class));
}
public void handlePostSync() {
- EventPostSync event = new EventPostSync();
- fireEventAsync(event);
+ post(() -> generate(PostSyncEvent.class));
}
public boolean handleNetworkPreSync(boolean initialState, UUID id) {
AtomicBoolean cancel = new AtomicBoolean(initialState);
- EventPreNetworkSync event = new EventPreNetworkSync(cancel, id);
- fireEvent(event);
+ post(generate(PreNetworkSyncEvent.class, cancel, id));
return cancel.get();
}
public boolean handlePreSync(boolean initialState) {
AtomicBoolean cancel = new AtomicBoolean(initialState);
- EventPreSync event = new EventPreSync(cancel);
- fireEvent(event);
+ post(generate(PreSyncEvent.class, cancel));
return cancel.get();
}
public void handleTrackCreate(Track track, CreationCause cause) {
- EventTrackCreate event = new EventTrackCreate(track.getApiDelegate(), cause);
- fireEventAsync(event);
+ post(() -> generate(TrackCreateEvent.class, track.getApiDelegate(), cause));
}
public void handleTrackDelete(Track track, DeletionCause cause) {
- EventTrackDelete event = new EventTrackDelete(track.getName(), ImmutableList.copyOf(track.getGroups()), cause);
- fireEventAsync(event);
+ post(() -> generate(TrackDeleteEvent.class, track.getName(), ImmutableList.copyOf(track.getGroups()), cause));
}
public void handleTrackLoadAll() {
- EventTrackLoadAll event = new EventTrackLoadAll();
- fireEventAsync(event);
+ post(() -> generate(TrackLoadAllEvent.class));
}
public void handleTrackLoad(Track track) {
- EventTrackLoad event = new EventTrackLoad(track.getApiDelegate());
- fireEventAsync(event);
+ post(() -> generate(TrackLoadEvent.class, track.getApiDelegate()));
}
public void handleTrackAddGroup(Track track, String group, List before, List after) {
- EventTrackAddGroup event = new EventTrackAddGroup(group, track.getApiDelegate(), ImmutableList.copyOf(before), ImmutableList.copyOf(after));
- fireEventAsync(event);
+ post(() -> generate(TrackAddGroupEvent.class, track.getApiDelegate(), ImmutableList.copyOf(before), ImmutableList.copyOf(after), group));
}
public void handleTrackClear(Track track, List before) {
- EventTrackClear event = new EventTrackClear(track.getApiDelegate(), ImmutableList.copyOf(before), ImmutableList.of());
- fireEventAsync(event);
+ post(() -> generate(TrackClearEvent.class, track.getApiDelegate(), ImmutableList.copyOf(before), ImmutableList.of()));
}
public void handleTrackRemoveGroup(Track track, String group, List before, List after) {
- EventTrackRemoveGroup event = new EventTrackRemoveGroup(group, track.getApiDelegate(), ImmutableList.copyOf(before), ImmutableList.copyOf(after));
- fireEventAsync(event);
+ post(() -> generate(TrackRemoveGroupEvent.class, track.getApiDelegate(), ImmutableList.copyOf(before), ImmutableList.copyOf(after), group));
}
public void handleUserCacheLoad(User user, UserData data) {
- EventUserCacheLoad event = new EventUserCacheLoad(new ApiUser(user), data);
- fireEventAsync(event);
+ post(() -> generate(UserCacheLoadEvent.class, new ApiUser(user), data));
}
public void handleDataRecalculate(PermissionHolder holder) {
if (holder.getType().isUser()) {
User user = (User) holder;
- EventUserDataRecalculate event = new EventUserDataRecalculate(user.getApiDelegate(), user.getCachedData());
- fireEventAsync(event);
+ post(() -> generate(UserDataRecalculateEvent.class, user.getApiDelegate(), user.getCachedData()));
} else {
Group group = (Group) holder;
- EventGroupDataRecalculate event = new EventGroupDataRecalculate(group.getApiDelegate(), group.getCachedData());
- fireEventAsync(event);
+ post(() -> generate(GroupDataRecalculateEvent.class, group.getApiDelegate(), group.getCachedData()));
}
}
public void handleUserFirstLogin(UUID uuid, String username) {
- EventUserFirstLogin event = new EventUserFirstLogin(uuid, username);
- fireEventAsync(event);
+ post(() -> generate(UserFirstLoginEvent.class, uuid, username));
}
public void handlePlayerDataSave(UUID uuid, String username, PlayerSaveResult result) {
- EventPlayerDataSave event = new EventPlayerDataSave(uuid, username, result);
- fireEventAsync(event);
+ post(() -> generate(PlayerDataSaveEvent.class, uuid, username, result));
}
public void handleUserLoad(User user) {
- EventUserLoad event = new EventUserLoad(new ApiUser(user));
- fireEventAsync(event);
+ post(() -> generate(UserLoadEvent.class, new ApiUser(user)));
}
public void handleUserLoginProcess(UUID uuid, String username, User user) {
- EventUserLoginProcess event = new EventUserLoginProcess(uuid, username, new ApiUser(user));
- fireEvent(event);
+ post(() -> generate(UserLoginProcessEvent.class, uuid, username, new ApiUser(user)));
}
public void handleUserDemote(User user, Track track, String from, String to, @Nullable Sender source) {
- Source s = source == null ? UnknownSource.INSTANCE : new EntitySourceImpl(new SenderEntity(source));
- EventUserDemote event = new EventUserDemote(track.getApiDelegate(), new ApiUser(user), from, to, s);
- fireEventAsync(event);
+ post(() -> {
+ Source s = source == null ? UnknownSource.INSTANCE : new EntitySourceImpl(new SenderEntity(source));
+ return generate(UserDemoteEvent.class, s, track.getApiDelegate(), new ApiUser(user), Optional.ofNullable(from), Optional.ofNullable(to));
+ });
}
public void handleUserPromote(User user, Track track, String from, String to, @Nullable Sender source) {
- Source s = source == null ? UnknownSource.INSTANCE : new EntitySourceImpl(new SenderEntity(source));
- EventUserPromote event = new EventUserPromote(track.getApiDelegate(), new ApiUser(user), from, to, s);
- fireEventAsync(event);
+ post(() -> {
+ Source s = source == null ? UnknownSource.INSTANCE : new EntitySourceImpl(new SenderEntity(source));
+ return generate(UserPromoteEvent.class, s, track.getApiDelegate(), new ApiUser(user), Optional.ofNullable(from), Optional.ofNullable(to));
+ });
}
private static ApiPermissionHolder getDelegate(PermissionHolder holder) {
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/LuckPermsEventHandler.java b/common/src/main/java/me/lucko/luckperms/common/event/LuckPermsEventHandler.java
index aa7b9425..656be80c 100644
--- a/common/src/main/java/me/lucko/luckperms/common/event/LuckPermsEventHandler.java
+++ b/common/src/main/java/me/lucko/luckperms/common/event/LuckPermsEventHandler.java
@@ -28,6 +28,8 @@ package me.lucko.luckperms.common.event;
import me.lucko.luckperms.api.event.EventHandler;
import me.lucko.luckperms.api.event.LuckPermsEvent;
+import net.kyori.event.EventSubscriber;
+
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
@@ -40,7 +42,7 @@ import javax.annotation.Nullable;
*
* @param the event type
*/
-public class LuckPermsEventHandler implements EventHandler {
+public class LuckPermsEventHandler implements EventHandler, EventSubscriber {
/**
* The event bus which created this handler
@@ -101,11 +103,10 @@ public class LuckPermsEventHandler implements EventHan
return this.callCount.get();
}
- @SuppressWarnings("unchecked") // we know that this method will never be called if the class doesn't match eventClass
- void handle(LuckPermsEvent event) {
+ @Override
+ public void invoke(T event) throws Throwable {
try {
- T t = (T) event;
- this.consumer.accept(t);
+ this.consumer.accept(event);
this.callCount.incrementAndGet();
} catch (Throwable t) {
this.eventBus.getPlugin().getLogger().warn("Unable to pass event " + event.getClass().getSimpleName() + " to handler " + this.consumer.getClass().getName());
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/gen/GeneratedEventSpec.java b/common/src/main/java/me/lucko/luckperms/common/event/gen/GeneratedEventSpec.java
new file mode 100644
index 00000000..e3f0ff06
--- /dev/null
+++ b/common/src/main/java/me/lucko/luckperms/common/event/gen/GeneratedEventSpec.java
@@ -0,0 +1,163 @@
+/*
+ * This file is part of LuckPerms, licensed under the MIT License.
+ *
+ * Copyright (c) lucko (Luck)
+ * Copyright (c) contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package me.lucko.luckperms.common.event.gen;
+
+import com.github.benmanes.caffeine.cache.Caffeine;
+import com.github.benmanes.caffeine.cache.LoadingCache;
+import com.google.common.collect.ImmutableList;
+
+import me.lucko.luckperms.api.LuckPermsApi;
+import me.lucko.luckperms.api.event.LuckPermsEvent;
+import me.lucko.luckperms.api.event.Param;
+import me.lucko.luckperms.common.utils.ImmutableCollectors;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * Represents the generated specification for an instance of a given {@link LuckPermsEvent}.
+ */
+public class GeneratedEventSpec {
+
+ private static final Method TO_STRING_METHOD;
+ private static final Method EQUALS_METHOD;
+ private static final Method HASHCODE_METHOD;
+ private static final Method GET_API_METHOD;
+ static {
+ try {
+ TO_STRING_METHOD = Object.class.getMethod("toString");
+ EQUALS_METHOD = Object.class.getMethod("equals", Object.class);
+ HASHCODE_METHOD = Object.class.getMethod("hashCode");
+ GET_API_METHOD = LuckPermsEvent.class.getMethod("getApi");
+ } catch (NoSuchMethodException e) {
+ throw new ExceptionInInitializerError(e);
+ }
+ }
+
+ private static final LoadingCache, GeneratedEventSpec> CACHE = Caffeine.newBuilder()
+ .build(GeneratedEventSpec::new);
+
+ public static GeneratedEventSpec lookup(Class extends LuckPermsEvent> event) {
+ return CACHE.get(event);
+ }
+
+ private final Class extends LuckPermsEvent> eventClass;
+ private final List methods;
+ private final List> returnTypes;
+
+ private GeneratedEventSpec(Class extends LuckPermsEvent> eventClass) {
+ this.eventClass = eventClass;
+
+ List methods = new ArrayList<>();
+ for (Method method : eventClass.getMethods()) {
+ if (method.isDefault()) {
+ continue;
+ }
+ if (GET_API_METHOD.equals(method)) {
+ continue;
+ }
+
+ methods.add(method);
+ }
+ methods.sort(Comparator.comparingInt(o -> o.isAnnotationPresent(Param.class) ? o.getAnnotation(Param.class).value() : 0));
+ this.methods = ImmutableList.copyOf(methods);
+
+ this.returnTypes = this.methods.stream()
+ .map(Method::getReturnType)
+ .collect(ImmutableCollectors.toList());
+ }
+
+ public LuckPermsEvent newInstance(LuckPermsApi api, Object... params) {
+ if (params.length != this.methods.size()) {
+ throw new IllegalStateException("param length differs from number of methods. expected " + this.methods.size() + " - " + this.methods);
+ }
+
+ for (int i = 0; i < params.length; i++) {
+ Object param = params[i];
+ Class> expectedType = this.returnTypes.get(i);
+ if (!expectedType.isInstance(param)) {
+ throw new IllegalArgumentException("Parameter at index " + i + " cannot be assigned to " + expectedType);
+ }
+ }
+
+ EventInvocationHandler eventInvocationHandler = new EventInvocationHandler(api, params);
+ return (LuckPermsEvent) Proxy.newProxyInstance(GeneratedEventSpec.class.getClassLoader(), new Class[]{this.eventClass}, eventInvocationHandler);
+ }
+
+ /**
+ * An invocation handler bound to a set of parameters, used to implement the event as a proxy.
+ */
+ private final class EventInvocationHandler implements InvocationHandler {
+ private final LuckPermsApi api;
+ private final Object[] fields;
+
+ EventInvocationHandler(LuckPermsApi api, Object[] fields) {
+ this.api = api;
+ this.fields = fields;
+ }
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ if (TO_STRING_METHOD.equals(method)) {
+ return "GeneratedEvent(" +
+ "proxy=" + proxy + ", " +
+ "class=" + GeneratedEventSpec.this.eventClass.toString() + ", " +
+ "fields=" + Arrays.toString(this.fields) + ")";
+ }
+ if (EQUALS_METHOD.equals(method)) {
+ return proxy == args[0];
+ }
+ if (HASHCODE_METHOD.equals(method)) {
+ return System.identityHashCode(proxy);
+ }
+ if (GET_API_METHOD.equals(method)) {
+ return this.api;
+ }
+
+ if (method.getDeclaringClass() == Object.class || method.isDefault()) {
+ return MethodHandles.lookup()
+ .in(method.getDeclaringClass())
+ .unreflectSpecial(method, method.getDeclaringClass())
+ .bindTo(proxy)
+ .invokeWithArguments(args);
+ }
+
+ int methodIndex = GeneratedEventSpec.this.methods.indexOf(method);
+ if (methodIndex == -1) {
+ throw new UnsupportedOperationException("Method not supported: " + method);
+ }
+
+ return this.fields[methodIndex];
+ }
+ }
+
+}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventConfigReload.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventConfigReload.java
deleted file mode 100644
index 908c1360..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventConfigReload.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.event.sync.ConfigReloadEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-public class EventConfigReload extends AbstractEvent implements ConfigReloadEvent {
-
- @Override
- public String toString() {
- return "ConfigReloadEvent()";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupCacheLoad.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupCacheLoad.java
deleted file mode 100644
index 2e421a1e..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupCacheLoad.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Group;
-import me.lucko.luckperms.api.caching.GroupData;
-import me.lucko.luckperms.api.event.group.GroupCacheLoadEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import javax.annotation.Nonnull;
-
-public class EventGroupCacheLoad extends AbstractEvent implements GroupCacheLoadEvent {
-
- private final Group group;
- private final GroupData loadedData;
-
- public EventGroupCacheLoad(Group group, GroupData loadedData) {
- this.group = group;
- this.loadedData = loadedData;
- }
-
- @Nonnull
- @Override
- public Group getGroup() {
- return this.group;
- }
-
- @Nonnull
- @Override
- public GroupData getLoadedData() {
- return this.loadedData;
- }
-
- @Override
- public String toString() {
- return "GroupCacheLoadEvent(group=" + this.getGroup() + ", loadedData=" + this.getLoadedData() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupCreate.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupCreate.java
deleted file mode 100644
index 55cab3e3..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupCreate.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Group;
-import me.lucko.luckperms.api.event.cause.CreationCause;
-import me.lucko.luckperms.api.event.group.GroupCreateEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import javax.annotation.Nonnull;
-
-public class EventGroupCreate extends AbstractEvent implements GroupCreateEvent {
-
- private final Group group;
- private final CreationCause cause;
-
- public EventGroupCreate(Group group, CreationCause cause) {
- this.group = group;
- this.cause = cause;
- }
-
- @Nonnull
- @Override
- public Group getGroup() {
- return this.group;
- }
-
- @Nonnull
- @Override
- public CreationCause getCause() {
- return this.cause;
- }
-
- @Override
- public String toString() {
- return "GroupCreateEvent(group=" + this.getGroup() + ", cause=" + this.getCause() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupDataRecalculate.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupDataRecalculate.java
deleted file mode 100644
index a152b3cf..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupDataRecalculate.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Group;
-import me.lucko.luckperms.api.caching.GroupData;
-import me.lucko.luckperms.api.event.group.GroupDataRecalculateEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import javax.annotation.Nonnull;
-
-public class EventGroupDataRecalculate extends AbstractEvent implements GroupDataRecalculateEvent {
-
- private final Group group;
- private final GroupData data;
-
- public EventGroupDataRecalculate(Group group, GroupData data) {
- this.group = group;
- this.data = data;
- }
-
- @Nonnull
- @Override
- public Group getGroup() {
- return this.group;
- }
-
- @Nonnull
- @Override
- public GroupData getData() {
- return this.data;
- }
-
- @Override
- public String toString() {
- return "GroupDataRecalculateEvent(group=" + this.getGroup() + ", data=" + this.getData() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupDelete.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupDelete.java
deleted file mode 100644
index 7cd1adb8..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupDelete.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Node;
-import me.lucko.luckperms.api.event.cause.DeletionCause;
-import me.lucko.luckperms.api.event.group.GroupDeleteEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.Set;
-
-import javax.annotation.Nonnull;
-
-public class EventGroupDelete extends AbstractEvent implements GroupDeleteEvent {
-
- private final String groupName;
- private final Set existingData;
- private final DeletionCause cause;
-
- public EventGroupDelete(String groupName, Set existingData, DeletionCause cause) {
- this.groupName = groupName;
- this.existingData = existingData;
- this.cause = cause;
- }
-
- @Nonnull
- @Override
- public String getGroupName() {
- return this.groupName;
- }
-
- @Nonnull
- @Override
- public Set getExistingData() {
- return this.existingData;
- }
-
- @Nonnull
- @Override
- public DeletionCause getCause() {
- return this.cause;
- }
-
- @Override
- public String toString() {
- return "GroupDeleteEvent(" +
- "groupName=" + this.getGroupName() + ", " +
- "existingData=" + this.getExistingData() + ", " +
- "cause=" + this.getCause() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupLoad.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupLoad.java
deleted file mode 100644
index 3289d4b6..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupLoad.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Group;
-import me.lucko.luckperms.api.event.group.GroupLoadEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import javax.annotation.Nonnull;
-
-public class EventGroupLoad extends AbstractEvent implements GroupLoadEvent {
-
- private final Group group;
-
- public EventGroupLoad(Group group) {
- this.group = group;
- }
-
- @Nonnull
- @Override
- public Group getGroup() {
- return this.group;
- }
-
- @Override
- public String toString() {
- return "GroupLoadEvent(group=" + this.getGroup() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupLoadAll.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupLoadAll.java
deleted file mode 100644
index 933763e9..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventGroupLoadAll.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.event.group.GroupLoadAllEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-public class EventGroupLoadAll extends AbstractEvent implements GroupLoadAllEvent {
-
- @Override
- public String toString() {
- return "GroupLoadAllEvent()";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogBroadcast.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogBroadcast.java
deleted file mode 100644
index 57fa84ea..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogBroadcast.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.LogEntry;
-import me.lucko.luckperms.api.event.log.LogBroadcastEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.annotation.Nonnull;
-
-public class EventLogBroadcast extends AbstractEvent implements LogBroadcastEvent {
-
- private final AtomicBoolean cancellationState;
- private final LogEntry entry;
- private final Origin origin;
-
- public EventLogBroadcast(AtomicBoolean cancellationState, LogEntry entry, Origin origin) {
- this.cancellationState = cancellationState;
- this.entry = entry;
- this.origin = origin;
- }
-
- @Nonnull
- @Override
- public AtomicBoolean getCancellationState() {
- return this.cancellationState;
- }
-
- @Nonnull
- @Override
- public LogEntry getEntry() {
- return this.entry;
- }
-
- @Nonnull
- @Override
- public Origin getOrigin() {
- return this.origin;
- }
-
- @Override
- public String toString() {
- return "LogBroadcastEvent(" +
- "cancellationState=" + this.getCancellationState() + ", " +
- "entry=" + this.getEntry() + ", " +
- "origin=" + this.getOrigin() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogNetworkPublish.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogNetworkPublish.java
deleted file mode 100644
index 1735fa63..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogNetworkPublish.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.LogEntry;
-import me.lucko.luckperms.api.event.log.LogNetworkPublishEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.annotation.Nonnull;
-
-public class EventLogNetworkPublish extends AbstractEvent implements LogNetworkPublishEvent {
-
- private final AtomicBoolean cancellationState;
- private final UUID logId;
- private final LogEntry entry;
-
- public EventLogNetworkPublish(AtomicBoolean cancellationState, UUID logId, LogEntry entry) {
- this.cancellationState = cancellationState;
- this.logId = logId;
- this.entry = entry;
- }
-
- @Nonnull
- @Override
- public AtomicBoolean getCancellationState() {
- return this.cancellationState;
- }
-
- @Nonnull
- @Override
- public UUID getLogId() {
- return this.logId;
- }
-
- @Nonnull
- @Override
- public LogEntry getEntry() {
- return this.entry;
- }
-
- @Override
- public String toString() {
- return "LogNetworkPublishEvent(" +
- "cancellationState=" + this.getCancellationState() + ", " +
- "logId=" + this.getLogId() + ", " +
- "entry=" + this.getEntry() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogNotify.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogNotify.java
deleted file mode 100644
index 31851476..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogNotify.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Entity;
-import me.lucko.luckperms.api.LogEntry;
-import me.lucko.luckperms.api.event.log.LogNotifyEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-import me.lucko.luckperms.common.event.model.SenderEntity;
-import me.lucko.luckperms.common.sender.Sender;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.annotation.Nonnull;
-
-public class EventLogNotify extends AbstractEvent implements LogNotifyEvent {
-
- private final AtomicBoolean cancellationState;
- private final LogEntry entry;
- private final Origin origin;
- private final Sender sender;
-
- private Entity notifiable;
-
- public EventLogNotify(AtomicBoolean cancellationState, LogEntry entry, Origin origin, Sender sender) {
- this.cancellationState = cancellationState;
- this.entry = entry;
- this.origin = origin;
- this.sender = sender;
- }
-
- @Nonnull
- @Override
- public synchronized Entity getNotifiable() {
- if (this.notifiable == null) {
- this.notifiable = new SenderEntity(this.sender);
- }
- return this.notifiable;
- }
-
- @Nonnull
- @Override
- public AtomicBoolean getCancellationState() {
- return this.cancellationState;
- }
-
- @Nonnull
- @Override
- public LogEntry getEntry() {
- return this.entry;
- }
-
- @Nonnull
- @Override
- public Origin getOrigin() {
- return this.origin;
- }
-
- @Override
- public String toString() {
- return "LogNotifyEvent(" +
- "cancellationState=" + this.getCancellationState() + ", " +
- "entry=" + this.getEntry() + ", " +
- "origin=" + this.getOrigin() + ", " +
- "notifiable=" + this.getNotifiable() + ")";
- }
-
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogPublish.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogPublish.java
deleted file mode 100644
index 3f40129c..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogPublish.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.LogEntry;
-import me.lucko.luckperms.api.event.log.LogPublishEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.annotation.Nonnull;
-
-public class EventLogPublish extends AbstractEvent implements LogPublishEvent {
-
- private final AtomicBoolean cancellationState;
- private final LogEntry entry;
-
- public EventLogPublish(AtomicBoolean cancellationState, LogEntry entry) {
- this.cancellationState = cancellationState;
- this.entry = entry;
- }
-
- @Nonnull
- @Override
- public AtomicBoolean getCancellationState() {
- return this.cancellationState;
- }
-
- @Nonnull
- @Override
- public LogEntry getEntry() {
- return this.entry;
- }
-
- @Override
- public String toString() {
- return "LogPublishEvent(cancellationState=" + this.getCancellationState() + ", entry=" + this.getEntry() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogReceive.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogReceive.java
deleted file mode 100644
index 7fccae35..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventLogReceive.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.LogEntry;
-import me.lucko.luckperms.api.event.log.LogReceiveEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.UUID;
-
-import javax.annotation.Nonnull;
-
-public class EventLogReceive extends AbstractEvent implements LogReceiveEvent {
-
- private final UUID logId;
- private final LogEntry entry;
-
- public EventLogReceive(UUID logId, LogEntry entry) {
- this.logId = logId;
- this.entry = entry;
- }
-
- @Nonnull
- @Override
- public UUID getLogId() {
- return this.logId;
- }
-
- @Nonnull
- @Override
- public LogEntry getEntry() {
- return this.entry;
- }
-
- @Override
- public String toString() {
- return "LogReceiveEvent(logId=" + this.getLogId() + ", entry=" + this.getEntry() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventNodeAdd.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventNodeAdd.java
deleted file mode 100644
index 282427f9..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventNodeAdd.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Group;
-import me.lucko.luckperms.api.Node;
-import me.lucko.luckperms.api.PermissionHolder;
-import me.lucko.luckperms.api.User;
-import me.lucko.luckperms.api.event.node.NodeAddEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.Set;
-
-import javax.annotation.Nonnull;
-
-public class EventNodeAdd extends AbstractEvent implements NodeAddEvent {
-
- private final Node node;
- private final PermissionHolder target;
- private final Set dataBefore;
- private final Set dataAfter;
-
- public EventNodeAdd(Node node, PermissionHolder target, Set dataBefore, Set dataAfter) {
- this.node = node;
- this.target = target;
- this.dataBefore = dataBefore;
- this.dataAfter = dataAfter;
- }
-
- @Override
- public boolean isUser() {
- return this.target instanceof User;
- }
-
- @Override
- public boolean isGroup() {
- return this.target instanceof Group;
- }
-
- @Nonnull
- @Override
- public Node getNode() {
- return this.node;
- }
-
- @Nonnull
- @Override
- public PermissionHolder getTarget() {
- return this.target;
- }
-
- @Nonnull
- @Override
- public Set getDataBefore() {
- return this.dataBefore;
- }
-
- @Nonnull
- @Override
- public Set getDataAfter() {
- return this.dataAfter;
- }
-
- @Override
- public String toString() {
- return "NodeAddEvent(" +
- "node=" + this.getNode() + ", " +
- "target=" + this.getTarget() + ", " +
- "dataBefore=" + this.getDataBefore() + ", " +
- "dataAfter=" + this.getDataAfter() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventNodeClear.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventNodeClear.java
deleted file mode 100644
index 76fb2815..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventNodeClear.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Group;
-import me.lucko.luckperms.api.Node;
-import me.lucko.luckperms.api.PermissionHolder;
-import me.lucko.luckperms.api.User;
-import me.lucko.luckperms.api.event.node.NodeClearEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.Set;
-
-import javax.annotation.Nonnull;
-
-public class EventNodeClear extends AbstractEvent implements NodeClearEvent {
-
- private final PermissionHolder target;
- private final Set dataBefore;
- private final Set dataAfter;
-
- public EventNodeClear(PermissionHolder target, Set dataBefore, Set dataAfter) {
- this.target = target;
- this.dataBefore = dataBefore;
- this.dataAfter = dataAfter;
- }
-
- @Override
- public boolean isUser() {
- return this.target instanceof User;
- }
-
- @Override
- public boolean isGroup() {
- return this.target instanceof Group;
- }
-
- @Nonnull
- @Override
- public PermissionHolder getTarget() {
- return this.target;
- }
-
- @Nonnull
- @Override
- public Set getDataBefore() {
- return this.dataBefore;
- }
-
- @Nonnull
- @Override
- public Set getDataAfter() {
- return this.dataAfter;
- }
-
- @Override
- public String toString() {
- return "NodeClearEvent(" +
- "target=" + this.getTarget() + ", " +
- "dataBefore=" + this.getDataBefore() + ", " +
- "dataAfter=" + this.getDataAfter() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventNodeRemove.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventNodeRemove.java
deleted file mode 100644
index 65ee6b3f..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventNodeRemove.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Group;
-import me.lucko.luckperms.api.Node;
-import me.lucko.luckperms.api.PermissionHolder;
-import me.lucko.luckperms.api.User;
-import me.lucko.luckperms.api.event.node.NodeRemoveEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.Set;
-
-import javax.annotation.Nonnull;
-
-public class EventNodeRemove extends AbstractEvent implements NodeRemoveEvent {
-
- private final Node node;
- private final PermissionHolder target;
- private final Set dataBefore;
- private final Set dataAfter;
-
- public EventNodeRemove(Node node, PermissionHolder target, Set dataBefore, Set dataAfter) {
- this.node = node;
- this.target = target;
- this.dataBefore = dataBefore;
- this.dataAfter = dataAfter;
- }
-
- @Override
- public boolean isUser() {
- return this.target instanceof User;
- }
-
- @Override
- public boolean isGroup() {
- return this.target instanceof Group;
- }
-
- @Nonnull
- @Override
- public Node getNode() {
- return this.node;
- }
-
- @Nonnull
- @Override
- public PermissionHolder getTarget() {
- return this.target;
- }
-
- @Nonnull
- @Override
- public Set getDataBefore() {
- return this.dataBefore;
- }
-
- @Nonnull
- @Override
- public Set getDataAfter() {
- return this.dataAfter;
- }
-
- @Override
- public String toString() {
- return "NodeRemoveEvent(" +
- "node=" + this.getNode() + ", " +
- "target=" + this.getTarget() + ", " +
- "dataBefore=" + this.getDataBefore() + ", " +
- "dataAfter=" + this.getDataAfter() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPlayerDataSave.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPlayerDataSave.java
deleted file mode 100644
index c0167b75..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPlayerDataSave.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.PlayerSaveResult;
-import me.lucko.luckperms.api.event.player.PlayerDataSaveEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.UUID;
-
-import javax.annotation.Nonnull;
-
-public class EventPlayerDataSave extends AbstractEvent implements PlayerDataSaveEvent {
- private final UUID uuid;
- private final String username;
- private final PlayerSaveResult result;
-
- public EventPlayerDataSave(UUID uuid, String username, PlayerSaveResult result) {
- this.uuid = uuid;
- this.username = username;
- this.result = result;
- }
-
- @Nonnull
- @Override
- public UUID getUuid() {
- return this.uuid;
- }
-
- @Nonnull
- @Override
- public String getUsername() {
- return this.username;
- }
-
- @Nonnull
- @Override
- public PlayerSaveResult getResult() {
- return this.result;
- }
-
- @Override
- public String toString() {
- return "PlayerDataSaveEvent(" +
- "uuid=" + this.uuid + ", " +
- "username=" + this.username + ", " +
- "result=" + this.result + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPostSync.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPostSync.java
deleted file mode 100644
index 69fa8f9d..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPostSync.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.event.sync.PostSyncEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-public class EventPostSync extends AbstractEvent implements PostSyncEvent {
-
- @Override
- public String toString() {
- return "PostSyncEvent()";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPreNetworkSync.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPreNetworkSync.java
deleted file mode 100644
index 24bb9ee1..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPreNetworkSync.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.event.sync.PreNetworkSyncEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.annotation.Nonnull;
-
-public class EventPreNetworkSync extends AbstractEvent implements PreNetworkSyncEvent {
-
- private final AtomicBoolean cancellationState;
- private final UUID syncId;
-
- public EventPreNetworkSync(AtomicBoolean cancellationState, UUID syncId) {
- this.cancellationState = cancellationState;
- this.syncId = syncId;
- }
-
- @Nonnull
- @Override
- public AtomicBoolean getCancellationState() {
- return this.cancellationState;
- }
-
- @Nonnull
- @Override
- public UUID getSyncId() {
- return this.syncId;
- }
-
- @Override
- public String toString() {
- return "PreNetworkSyncEvent(" +
- "cancellationState=" + this.getCancellationState() + ", " +
- "syncId=" + this.getSyncId() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPreSync.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPreSync.java
deleted file mode 100644
index b9b62c57..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventPreSync.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.event.sync.PreSyncEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.annotation.Nonnull;
-
-public class EventPreSync extends AbstractEvent implements PreSyncEvent {
-
- private final AtomicBoolean cancellationState;
-
- public EventPreSync(AtomicBoolean cancellationState) {
- this.cancellationState = cancellationState;
- }
-
- @Nonnull
- @Override
- public AtomicBoolean getCancellationState() {
- return this.cancellationState;
- }
-
- @Override
- public String toString() {
- return "PreSyncEvent(cancellationState=" + this.getCancellationState() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackAddGroup.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackAddGroup.java
deleted file mode 100644
index b7eb0f3d..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackAddGroup.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Track;
-import me.lucko.luckperms.api.event.track.mutate.TrackAddGroupEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.List;
-
-import javax.annotation.Nonnull;
-
-public class EventTrackAddGroup extends AbstractEvent implements TrackAddGroupEvent {
-
- private final String group;
- private final Track track;
- private final List dataBefore;
- private final List dataAfter;
-
- public EventTrackAddGroup(String group, Track track, List dataBefore, List dataAfter) {
- this.group = group;
- this.track = track;
- this.dataBefore = dataBefore;
- this.dataAfter = dataAfter;
- }
-
- @Nonnull
- @Override
- public String getGroup() {
- return this.group;
- }
-
- @Nonnull
- @Override
- public Track getTrack() {
- return this.track;
- }
-
- @Nonnull
- @Override
- public List getDataBefore() {
- return this.dataBefore;
- }
-
- @Nonnull
- @Override
- public List getDataAfter() {
- return this.dataAfter;
- }
-
- @Override
- public String toString() {
- return "TrackAddGroupEvent(" +
- "group=" + this.getGroup() + ", " +
- "track=" + this.getTrack() + ", " +
- "dataBefore=" + this.getDataBefore() + ", " +
- "dataAfter=" + this.getDataAfter() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackClear.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackClear.java
deleted file mode 100644
index 383c9177..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackClear.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Track;
-import me.lucko.luckperms.api.event.track.mutate.TrackClearEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.List;
-
-import javax.annotation.Nonnull;
-
-public class EventTrackClear extends AbstractEvent implements TrackClearEvent {
-
- private final Track track;
- private final List dataBefore;
- private final List dataAfter;
-
- public EventTrackClear(Track track, List dataBefore, List dataAfter) {
- this.track = track;
- this.dataBefore = dataBefore;
- this.dataAfter = dataAfter;
- }
-
- @Nonnull
- @Override
- public Track getTrack() {
- return this.track;
- }
-
- @Nonnull
- @Override
- public List getDataBefore() {
- return this.dataBefore;
- }
-
- @Nonnull
- @Override
- public List getDataAfter() {
- return this.dataAfter;
- }
-
- @Override
- public String toString() {
- return "TrackClearEvent(" +
- "track=" + this.getTrack() + ", " +
- "dataBefore=" + this.getDataBefore() + ", " +
- "dataAfter=" + this.getDataAfter() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackCreate.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackCreate.java
deleted file mode 100644
index 26ecde55..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackCreate.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Track;
-import me.lucko.luckperms.api.event.cause.CreationCause;
-import me.lucko.luckperms.api.event.track.TrackCreateEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import javax.annotation.Nonnull;
-
-public class EventTrackCreate extends AbstractEvent implements TrackCreateEvent {
-
- private final Track track;
- private final CreationCause cause;
-
- public EventTrackCreate(Track track, CreationCause cause) {
- this.track = track;
- this.cause = cause;
- }
-
- @Nonnull
- @Override
- public Track getTrack() {
- return this.track;
- }
-
- @Nonnull
- @Override
- public CreationCause getCause() {
- return this.cause;
- }
-
- @Override
- public String toString() {
- return "TrackCreateEvent(track=" + this.getTrack() + ", cause=" + this.getCause() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackDelete.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackDelete.java
deleted file mode 100644
index 568a04e2..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackDelete.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.event.cause.DeletionCause;
-import me.lucko.luckperms.api.event.track.TrackDeleteEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.List;
-
-import javax.annotation.Nonnull;
-
-public class EventTrackDelete extends AbstractEvent implements TrackDeleteEvent {
-
- private final String trackName;
- private final List existingData;
- private final DeletionCause cause;
-
- public EventTrackDelete(String trackName, List existingData, DeletionCause cause) {
- this.trackName = trackName;
- this.existingData = existingData;
- this.cause = cause;
- }
-
- @Nonnull
- @Override
- public String getTrackName() {
- return this.trackName;
- }
-
- @Nonnull
- @Override
- public List getExistingData() {
- return this.existingData;
- }
-
- @Nonnull
- @Override
- public DeletionCause getCause() {
- return this.cause;
- }
-
- @Override
- public String toString() {
- return "TrackDeleteEvent(" +
- "trackName=" + this.getTrackName() + ", " +
- "existingData=" + this.getExistingData() + ", " +
- "cause=" + this.getCause() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackLoad.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackLoad.java
deleted file mode 100644
index 799fd726..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackLoad.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Track;
-import me.lucko.luckperms.api.event.track.TrackLoadEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import javax.annotation.Nonnull;
-
-public class EventTrackLoad extends AbstractEvent implements TrackLoadEvent {
-
- private final Track track;
-
- public EventTrackLoad(Track track) {
- this.track = track;
- }
-
- @Nonnull
- @Override
- public Track getTrack() {
- return this.track;
- }
-
- @Override
- public String toString() {
- return "TrackLoadEvent(track=" + this.getTrack() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackLoadAll.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackLoadAll.java
deleted file mode 100644
index daadd0b6..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackLoadAll.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.event.track.TrackLoadAllEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-public class EventTrackLoadAll extends AbstractEvent implements TrackLoadAllEvent {
-
- @Override
- public String toString() {
- return "TrackLoadAllEvent()";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackRemoveGroup.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackRemoveGroup.java
deleted file mode 100644
index 81b42b6f..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventTrackRemoveGroup.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Track;
-import me.lucko.luckperms.api.event.track.mutate.TrackRemoveGroupEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.List;
-
-import javax.annotation.Nonnull;
-
-public class EventTrackRemoveGroup extends AbstractEvent implements TrackRemoveGroupEvent {
-
- private final String group;
- private final Track track;
- private final List dataBefore;
- private final List dataAfter;
-
- public EventTrackRemoveGroup(String group, Track track, List dataBefore, List dataAfter) {
- this.group = group;
- this.track = track;
- this.dataBefore = dataBefore;
- this.dataAfter = dataAfter;
- }
-
- @Nonnull
- @Override
- public String getGroup() {
- return this.group;
- }
-
- @Nonnull
- @Override
- public Track getTrack() {
- return this.track;
- }
-
- @Nonnull
- @Override
- public List getDataBefore() {
- return this.dataBefore;
- }
-
- @Nonnull
- @Override
- public List getDataAfter() {
- return this.dataAfter;
- }
-
- @Override
- public String toString() {
- return "TrackRemoveGroupEvent(" +
- "group=" + this.getGroup() + ", " +
- "track=" + this.getTrack() + ", " +
- "dataBefore=" + this.getDataBefore() + ", " +
- "dataAfter=" + this.getDataAfter() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserCacheLoad.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserCacheLoad.java
deleted file mode 100644
index 39435c66..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserCacheLoad.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.User;
-import me.lucko.luckperms.api.caching.UserData;
-import me.lucko.luckperms.api.event.user.UserCacheLoadEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import javax.annotation.Nonnull;
-
-public class EventUserCacheLoad extends AbstractEvent implements UserCacheLoadEvent {
-
- private final User user;
- private final UserData loadedData;
-
- public EventUserCacheLoad(User user, UserData loadedData) {
- this.user = user;
- this.loadedData = loadedData;
- }
-
- @Nonnull
- @Override
- public User getUser() {
- return this.user;
- }
-
- @Nonnull
- @Override
- public UserData getLoadedData() {
- return this.loadedData;
- }
-
- @Override
- public String toString() {
- return "UserCacheLoadEvent(user=" + this.getUser() + ", loadedData=" + this.getLoadedData() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserDataRecalculate.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserDataRecalculate.java
deleted file mode 100644
index 5943678f..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserDataRecalculate.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.User;
-import me.lucko.luckperms.api.caching.UserData;
-import me.lucko.luckperms.api.event.user.UserDataRecalculateEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import javax.annotation.Nonnull;
-
-public class EventUserDataRecalculate extends AbstractEvent implements UserDataRecalculateEvent {
-
- private final User user;
- private final UserData data;
-
- public EventUserDataRecalculate(User user, UserData data) {
- this.user = user;
- this.data = data;
- }
-
- @Nonnull
- @Override
- public User getUser() {
- return this.user;
- }
-
- @Nonnull
- @Override
- public UserData getData() {
- return this.data;
- }
-
- @Override
- public String toString() {
- return "UserDataRecalculateEvent(user=" + this.getUser() + ", data=" + this.getData() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserDemote.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserDemote.java
deleted file mode 100644
index 9b536ead..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserDemote.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Track;
-import me.lucko.luckperms.api.User;
-import me.lucko.luckperms.api.event.source.Source;
-import me.lucko.luckperms.api.event.user.track.TrackAction;
-import me.lucko.luckperms.api.event.user.track.UserDemoteEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.Optional;
-
-import javax.annotation.Nonnull;
-
-public class EventUserDemote extends AbstractEvent implements UserDemoteEvent {
-
- private final Track track;
- private final User user;
-
- private final String groupFrom;
- private final String groupTo;
-
- private final Source source;
-
- public EventUserDemote(Track track, User user, String groupFrom, String groupTo, Source source) {
- this.track = track;
- this.user = user;
- this.groupFrom = groupFrom;
- this.groupTo = groupTo;
- this.source = source;
- }
-
- @Nonnull
- @Override
- public Track getTrack() {
- return this.track;
- }
-
- @Nonnull
- @Override
- public User getUser() {
- return this.user;
- }
-
- @Nonnull
- @Override
- public TrackAction getAction() {
- return TrackAction.DEMOTION;
- }
-
- @Nonnull
- @Override
- public Optional getGroupFrom() {
- return Optional.ofNullable(this.groupFrom);
- }
-
- @Nonnull
- @Override
- public Optional getGroupTo() {
- return Optional.ofNullable(this.groupTo);
- }
-
- @Nonnull
- @Override
- public Source getSource() {
- return this.source;
- }
-
- @Override
- public String toString() {
- return "UserDemoteEvent(" +
- "track=" + this.track + ", " +
- "user=" + this.user + ", " +
- "groupFrom=" + this.getGroupFrom() + ", " +
- "groupTo=" + this.getGroupTo() + ", " +
- "source=" + this.getSource() + ")";
- }
-
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserFirstLogin.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserFirstLogin.java
deleted file mode 100644
index c947cd90..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserFirstLogin.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.event.user.UserFirstLoginEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.UUID;
-
-import javax.annotation.Nonnull;
-
-public class EventUserFirstLogin extends AbstractEvent implements UserFirstLoginEvent {
-
- private final UUID uuid;
- private final String username;
-
- public EventUserFirstLogin(UUID uuid, String username) {
- this.uuid = uuid;
- this.username = username;
- }
-
- @Nonnull
- @Override
- public UUID getUuid() {
- return this.uuid;
- }
-
- @Nonnull
- @Override
- public String getUsername() {
- return this.username;
- }
-
- @Override
- public String toString() {
- return "UserFirstLoginEvent(uuid=" + this.getUuid() + ", username=" + this.getUsername() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserLoad.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserLoad.java
deleted file mode 100644
index 9565b796..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserLoad.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.User;
-import me.lucko.luckperms.api.event.user.UserLoadEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import javax.annotation.Nonnull;
-
-public class EventUserLoad extends AbstractEvent implements UserLoadEvent {
-
- private final User user;
-
- public EventUserLoad(User user) {
- this.user = user;
- }
-
- @Nonnull
- @Override
- public User getUser() {
- return this.user;
- }
-
- @Override
- public String toString() {
- return "UserLoadEvent(user=" + this.getUser() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserLoginProcess.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserLoginProcess.java
deleted file mode 100644
index 0cfc596c..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserLoginProcess.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.User;
-import me.lucko.luckperms.api.event.user.UserLoginProcessEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.UUID;
-
-import javax.annotation.Nonnull;
-
-public class EventUserLoginProcess extends AbstractEvent implements UserLoginProcessEvent {
-
- private final UUID uuid;
- private final String username;
- private final User user;
-
- public EventUserLoginProcess(UUID uuid, String username, User user) {
- this.uuid = uuid;
- this.username = username;
- this.user = user;
- }
-
- @Nonnull
- @Override
- public UUID getUuid() {
- return this.uuid;
- }
-
- @Nonnull
- @Override
- public String getUsername() {
- return this.username;
- }
-
- @Override
- public User getUser() {
- return this.user;
- }
-
- @Override
- public String toString() {
- return "UserLoginProcessEvent(uuid=" + this.getUuid() + ", username=" + this.getUsername() + ", user=" + this.getUser() + ")";
- }
-}
diff --git a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserPromote.java b/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserPromote.java
deleted file mode 100644
index fdfccbbb..00000000
--- a/common/src/main/java/me/lucko/luckperms/common/event/impl/EventUserPromote.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * This file is part of LuckPerms, licensed under the MIT License.
- *
- * Copyright (c) lucko (Luck)
- * Copyright (c) contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.lucko.luckperms.common.event.impl;
-
-import me.lucko.luckperms.api.Track;
-import me.lucko.luckperms.api.User;
-import me.lucko.luckperms.api.event.source.Source;
-import me.lucko.luckperms.api.event.user.track.TrackAction;
-import me.lucko.luckperms.api.event.user.track.UserPromoteEvent;
-import me.lucko.luckperms.common.event.AbstractEvent;
-
-import java.util.Optional;
-
-import javax.annotation.Nonnull;
-
-public class EventUserPromote extends AbstractEvent implements UserPromoteEvent {
-
- private final Track track;
- private final User user;
-
- private final String groupFrom;
- private final String groupTo;
-
- private final Source source;
-
- public EventUserPromote(Track track, User user, String groupFrom, String groupTo, Source source) {
- this.track = track;
- this.user = user;
- this.groupFrom = groupFrom;
- this.groupTo = groupTo;
- this.source = source;
- }
-
- @Nonnull
- @Override
- public Track getTrack() {
- return this.track;
- }
-
- @Nonnull
- @Override
- public User getUser() {
- return this.user;
- }
-
- @Nonnull
- @Override
- public TrackAction getAction() {
- return TrackAction.PROMOTION;
- }
-
- @Nonnull
- @Override
- public Optional getGroupFrom() {
- return Optional.ofNullable(this.groupFrom);
- }
-
- @Nonnull
- @Override
- public Optional getGroupTo() {
- return Optional.ofNullable(this.groupTo);
- }
-
- @Nonnull
- @Override
- public Source getSource() {
- return this.source;
- }
-
- @Override
- public String toString() {
- return "UserPromoteEvent(" +
- "track=" + this.track + ", " +
- "user=" + this.user + ", " +
- "groupFrom=" + this.getGroupFrom() + ", " +
- "groupTo=" + this.getGroupTo() + ", " +
- "source=" + this.getSource() + ")";
- }
-
-}
diff --git a/nukkit/pom.xml b/nukkit/pom.xml
index c824969c..956a7d8b 100644
--- a/nukkit/pom.xml
+++ b/nukkit/pom.xml
@@ -56,6 +56,10 @@
net.kyori.text
me.lucko.luckperms.lib.text