diff --git a/api/src/main/java/net/luckperms/api/query/dataorder/DataQueryOrder.java b/api/src/main/java/net/luckperms/api/query/dataorder/DataQueryOrder.java index 694511a55..3abb672c1 100644 --- a/api/src/main/java/net/luckperms/api/query/dataorder/DataQueryOrder.java +++ b/api/src/main/java/net/luckperms/api/query/dataorder/DataQueryOrder.java @@ -60,10 +60,7 @@ public enum DataQueryOrder implements Comparator { if (o1 == o2) { return 0; } - return Boolean.compare( - o1 == DataType.TRANSIENT, - o2 == DataType.TRANSIENT - ); + return o1 == DataType.TRANSIENT ? 1 : -1; } }, @@ -76,10 +73,7 @@ public enum DataQueryOrder implements Comparator { if (o1 == o2) { return 0; } - return -Boolean.compare( - o1 == DataType.TRANSIENT, - o2 == DataType.TRANSIENT - ); + return o1 == DataType.TRANSIENT ? -1 : 1; } }; diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeeBootstrap.java b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeeBootstrap.java index fe0b56c62..d5e756e31 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeeBootstrap.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeeBootstrap.java @@ -287,7 +287,7 @@ public class LPBungeeBootstrap extends Plugin implements LuckPermsBootstrap { private static boolean checkIncompatibleVersion() { try { - Class aClass = Class.forName("com.google.gson.internal.bind.TreeTypeAdapter"); + Class.forName("com.google.gson.internal.bind.TreeTypeAdapter"); return false; } catch (ClassNotFoundException e) { return true; diff --git a/common/src/main/java/me/lucko/luckperms/common/actionlog/LoggedAction.java b/common/src/main/java/me/lucko/luckperms/common/actionlog/LoggedAction.java index 3e45d1772..bb07f1c66 100644 --- a/common/src/main/java/me/lucko/luckperms/common/actionlog/LoggedAction.java +++ b/common/src/main/java/me/lucko/luckperms/common/actionlog/LoggedAction.java @@ -250,36 +250,43 @@ public class LoggedAction implements Action { private Target.Type targetType = null; private String description = null; + @Override public @NonNull Builder timestamp(@NonNull Instant timestamp) { this.timestamp = timestamp.getEpochSecond(); return this; } + @Override public @NonNull Builder source(@NonNull UUID source) { this.sourceUniqueId = Objects.requireNonNull(source, "source"); return this; } + @Override public @NonNull Builder sourceName(@NonNull String sourceName) { this.sourceName = Objects.requireNonNull(sourceName, "sourceName"); return this; } + @Override public @NonNull Builder targetType(Action.Target.Type type) { this.targetType = Objects.requireNonNull(type, "type"); return this; } + @Override public @NonNull Builder target(UUID target) { this.targetUniqueId = target; // nullable return this; } + @Override public @NonNull Builder targetName(@NonNull String targetName) { this.targetName = Objects.requireNonNull(targetName, "targetName"); return this; } + @Override public @NonNull Builder description(@NonNull String description) { this.description = Objects.requireNonNull(description, "description"); return this; diff --git a/common/src/main/java/me/lucko/luckperms/common/cacheddata/type/MetaCache.java b/common/src/main/java/me/lucko/luckperms/common/cacheddata/type/MetaCache.java index f0e8b6040..8e5419925 100644 --- a/common/src/main/java/me/lucko/luckperms/common/cacheddata/type/MetaCache.java +++ b/common/src/main/java/me/lucko/luckperms/common/cacheddata/type/MetaCache.java @@ -68,24 +68,28 @@ public class MetaCache extends SimpleMetaCache implements CachedMetaData { } } + @Override public String getMetaValue(String key, MetaCheckEvent.Origin origin) { String value = super.getMetaValue(key, origin); this.plugin.getVerboseHandler().offerMetaCheckEvent(origin, this.verboseCheckTarget, this.metadata.getQueryOptions(), key, String.valueOf(value)); return value; } + @Override public String getPrefix(MetaCheckEvent.Origin origin) { String value = super.getPrefix(origin); this.plugin.getVerboseHandler().offerMetaCheckEvent(origin, this.verboseCheckTarget, this.metadata.getQueryOptions(), Prefix.NODE_KEY, String.valueOf(value)); return value; } + @Override public String getSuffix(MetaCheckEvent.Origin origin) { String value = super.getSuffix(origin); this.plugin.getVerboseHandler().offerMetaCheckEvent(origin, this.verboseCheckTarget, this.metadata.getQueryOptions(), Suffix.NODE_KEY, String.valueOf(value)); return value; } + @Override public Map> getMeta(MetaCheckEvent.Origin origin) { return new MonitoredMetaMap(super.getMeta(origin), origin); } @@ -97,6 +101,7 @@ public class MetaCache extends SimpleMetaCache implements CachedMetaData { return value; } + @Override public @Nullable String getPrimaryGroup(MetaCheckEvent.Origin origin) { String value = super.getPrimaryGroup(origin); this.plugin.getVerboseHandler().offerMetaCheckEvent(origin, this.verboseCheckTarget, this.metadata.getQueryOptions(), "primarygroup", String.valueOf(value)); diff --git a/common/src/main/java/me/lucko/luckperms/common/model/manager/user/UserManager.java b/common/src/main/java/me/lucko/luckperms/common/model/manager/user/UserManager.java index 656dae71c..8b9c02c44 100644 --- a/common/src/main/java/me/lucko/luckperms/common/model/manager/user/UserManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/model/manager/user/UserManager.java @@ -44,14 +44,6 @@ public interface UserManager extends Manager { */ T getByUsername(String name); - /** - * Get a user object by uuid - * - * @param uuid The uuid to search by - * @return a {@link User} object if the user is loaded, returns null if the user is not loaded - */ - T getIfLoaded(UUID uuid); - /** * Gives the user the default group if necessary. * diff --git a/sponge/sponge-service/src/main/java/me/lucko/luckperms/sponge/service/model/ProxiedSubject.java b/sponge/sponge-service/src/main/java/me/lucko/luckperms/sponge/service/model/ProxiedSubject.java index 0c72e6afc..edf2fe303 100644 --- a/sponge/sponge-service/src/main/java/me/lucko/luckperms/sponge/service/model/ProxiedSubject.java +++ b/sponge/sponge-service/src/main/java/me/lucko/luckperms/sponge/service/model/ProxiedSubject.java @@ -35,6 +35,7 @@ import org.spongepowered.api.service.permission.Subject; */ public interface ProxiedSubject extends Subject, ProxiedServiceObject { + @Override @NonNull LPSubjectReference asSubjectReference(); @NonNull QueryOptions getQueryOptions(); diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeEventBus.java b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeEventBus.java index 63b71613d..55e498d09 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeEventBus.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/SpongeEventBus.java @@ -29,9 +29,6 @@ import me.lucko.luckperms.common.api.LuckPermsApiProvider; import me.lucko.luckperms.common.event.AbstractEventBus; import org.spongepowered.api.Sponge; -import org.spongepowered.api.event.Listener; -import org.spongepowered.api.event.cause.EventContextKeys; -import org.spongepowered.api.event.game.GameReloadEvent; import org.spongepowered.api.plugin.PluginContainer; public class SpongeEventBus extends AbstractEventBus { @@ -57,15 +54,4 @@ public class SpongeEventBus extends AbstractEventBus { throw new IllegalArgumentException("Object " + plugin + " (" + plugin.getClass().getName() + ") is not a plugin."); } - @Listener - public void onReload(GameReloadEvent e) { - // sponge doesn't really support unloading of plugins at runtime. - // this probably won't ever work/be useful, but I suppose it's worth a try. - PluginContainer pluginContainer = e.getContext().get(EventContextKeys.PLUGIN).orElse(null); - if (pluginContainer == null) { - return; - } - unregisterHandlers(pluginContainer); - } - } diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/model/calculated/CalculatedSubject.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/model/calculated/CalculatedSubject.java index 1eb7dbae6..ab8150adc 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/model/calculated/CalculatedSubject.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/model/calculated/CalculatedSubject.java @@ -61,7 +61,10 @@ public abstract class CalculatedSubject implements LPSubject { return this.plugin.getService().getDefaultSubjects().getTypeDefaults(getParentCollection().getIdentifier()); } + @Override public abstract CalculatedSubjectData getSubjectData(); + + @Override public abstract CalculatedSubjectData getTransientSubjectData(); public Map getCombinedPermissions(QueryOptions filter) {