diff --git a/api/pom.xml b/api/pom.xml index 68fe431c8..18f19e79c 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,12 +5,13 @@ luckperms me.lucko.luckperms - 3.0-SNAPSHOT + 3.1-SNAPSHOT 4.0.0 luckperms-api + LuckPerms-API-${release.version} org.apache.maven.plugins diff --git a/api/src/main/java/me/lucko/luckperms/LuckPerms.java b/api/src/main/java/me/lucko/luckperms/LuckPerms.java index 2a835116e..ec2e1c80f 100644 --- a/api/src/main/java/me/lucko/luckperms/LuckPerms.java +++ b/api/src/main/java/me/lucko/luckperms/LuckPerms.java @@ -29,8 +29,8 @@ import java.util.Optional; /** * Singleton for the {@link LuckPermsApi}. * - *

Ideally, the ServiceManager for the platform should be used to obtain and cache an instance, however, this can be - * used if you need static access. + *

Ideally, the ServiceManager for the platform should be used to obtain and cache an instance, however, this can be + * used if you need static access.

*/ public final class LuckPerms { private static LuckPermsApi api = null; diff --git a/api/src/main/java/me/lucko/luckperms/api/Contexts.java b/api/src/main/java/me/lucko/luckperms/api/Contexts.java index ae272883a..1326909cf 100644 --- a/api/src/main/java/me/lucko/luckperms/api/Contexts.java +++ b/api/src/main/java/me/lucko/luckperms/api/Contexts.java @@ -27,7 +27,7 @@ import me.lucko.luckperms.api.context.ContextSet; /** * Context and options for a permission lookup. * - *

All values are immutable. + *

All values are immutable.

* * @since 2.11 */ diff --git a/common/src/main/java/me/lucko/luckperms/common/core/DataMutateResult.java b/api/src/main/java/me/lucko/luckperms/api/DataMutateResult.java similarity index 89% rename from common/src/main/java/me/lucko/luckperms/common/core/DataMutateResult.java rename to api/src/main/java/me/lucko/luckperms/api/DataMutateResult.java index 673b134ef..05f587ca9 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/DataMutateResult.java +++ b/api/src/main/java/me/lucko/luckperms/api/DataMutateResult.java @@ -20,16 +20,13 @@ * SOFTWARE. */ -package me.lucko.luckperms.common.core; - -import lombok.AllArgsConstructor; +package me.lucko.luckperms.api; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectLacksException; import java.util.function.Supplier; -@AllArgsConstructor public enum DataMutateResult { SUCCESS(true, null), @@ -37,9 +34,14 @@ public enum DataMutateResult { LACKS(false, ObjectLacksException::new), FAIL(false, RuntimeException::new); - private boolean bool; + private boolean value; private final Supplier exceptionSupplier; + DataMutateResult(boolean value, Supplier exceptionSupplier) { + this.value = value; + this.exceptionSupplier = exceptionSupplier; + } + public void throwException() { if (exceptionSupplier != null) { sneakyThrow(exceptionSupplier.get()); @@ -47,7 +49,7 @@ public enum DataMutateResult { } public boolean asBoolean() { - return bool; + return value; } // allows us to throw checked exceptions without declaring it, as #throwException throws a number of diff --git a/api/src/main/java/me/lucko/luckperms/api/Group.java b/api/src/main/java/me/lucko/luckperms/api/Group.java index bad6ed0da..c9595c2a0 100644 --- a/api/src/main/java/me/lucko/luckperms/api/Group.java +++ b/api/src/main/java/me/lucko/luckperms/api/Group.java @@ -82,7 +82,9 @@ public interface Group extends PermissionHolder { * @throws ObjectAlreadyHasException if the group already inherits the group * @throws NullPointerException if the group is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void setInheritGroup(Group group) throws ObjectAlreadyHasException; /** @@ -94,7 +96,9 @@ public interface Group extends PermissionHolder { * @throws NullPointerException if the group or server is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the server is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void setInheritGroup(Group group, String server) throws ObjectAlreadyHasException; /** @@ -107,7 +111,9 @@ public interface Group extends PermissionHolder { * @throws NullPointerException if the group, server or world is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the server or world is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void setInheritGroup(Group group, String server, String world) throws ObjectAlreadyHasException; /** @@ -119,7 +125,9 @@ public interface Group extends PermissionHolder { * @throws NullPointerException if the group is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the expiry time is in the past + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void setInheritGroup(Group group, long expireAt) throws ObjectAlreadyHasException; /** @@ -132,7 +140,9 @@ public interface Group extends PermissionHolder { * @throws NullPointerException if the group or server is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the expiry time is in the past or the server is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void setInheritGroup(Group group, String server, long expireAt) throws ObjectAlreadyHasException; /** @@ -146,7 +156,9 @@ public interface Group extends PermissionHolder { * @throws NullPointerException if the group, server or world is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the expiry time is in the past or the server/world is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void setInheritGroup(Group group, String server, String world, long expireAt) throws ObjectAlreadyHasException; /** @@ -156,7 +168,9 @@ public interface Group extends PermissionHolder { * @throws ObjectLacksException if the group does not already inherit the group * @throws NullPointerException if the group is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void unsetInheritGroup(Group group) throws ObjectLacksException; /** @@ -167,7 +181,9 @@ public interface Group extends PermissionHolder { * @throws ObjectLacksException if the group does not already inherit the group * @throws NullPointerException if the group is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void unsetInheritGroup(Group group, boolean temporary) throws ObjectLacksException; /** @@ -179,7 +195,9 @@ public interface Group extends PermissionHolder { * @throws NullPointerException if the group or server is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the server is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void unsetInheritGroup(Group group, String server) throws ObjectLacksException; /** @@ -192,7 +210,9 @@ public interface Group extends PermissionHolder { * @throws NullPointerException if the group, server or world is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the server or world is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void unsetInheritGroup(Group group, String server, String world) throws ObjectLacksException; /** @@ -205,7 +225,9 @@ public interface Group extends PermissionHolder { * @throws NullPointerException if the group or server is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the expiry time is in the past or the server is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void unsetInheritGroup(Group group, String server, boolean temporary) throws ObjectLacksException; /** @@ -219,7 +241,9 @@ public interface Group extends PermissionHolder { * @throws NullPointerException if the group, server or world is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the expiry time is in the past or the server/world is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void unsetInheritGroup(Group group, String server, String world, boolean temporary) throws ObjectLacksException; /** diff --git a/api/src/main/java/me/lucko/luckperms/api/Log.java b/api/src/main/java/me/lucko/luckperms/api/Log.java index b66964d0a..bc0afca6e 100644 --- a/api/src/main/java/me/lucko/luckperms/api/Log.java +++ b/api/src/main/java/me/lucko/luckperms/api/Log.java @@ -29,8 +29,8 @@ import java.util.UUID; /** * Represents the internal LuckPerms log. * - *

The returned instance provides a copy of the data at the time of retrieval. Any changes made to log entries will - * only apply to this instance of the log. You can add to the log using the {@link Storage}, and then request an updated copy. + *

The returned instance provides a copy of the data at the time of retrieval. Any changes made to log entries will + * only apply to this instance of the log. You can add to the log using the {@link Storage}, and then request an updated copy.

*/ public interface Log { diff --git a/api/src/main/java/me/lucko/luckperms/api/LogEntry.java b/api/src/main/java/me/lucko/luckperms/api/LogEntry.java index 46cfcf6c1..fbdfe6dc5 100644 --- a/api/src/main/java/me/lucko/luckperms/api/LogEntry.java +++ b/api/src/main/java/me/lucko/luckperms/api/LogEntry.java @@ -27,7 +27,7 @@ import java.util.UUID; /** * A single entry in the log * - *

Implements {@link Comparable} ordering based upon the timestamp of the entry. + *

Implements {@link Comparable} ordering based upon the timestamp of the entry.

*/ public class LogEntry implements Comparable { private static final String FORMAT = "&8(&e%s&8) [&a%s&8] (&b%s&8) &7--> &f%s"; diff --git a/api/src/main/java/me/lucko/luckperms/api/Logger.java b/api/src/main/java/me/lucko/luckperms/api/Logger.java index a4d7bd9c6..a0369ed8e 100644 --- a/api/src/main/java/me/lucko/luckperms/api/Logger.java +++ b/api/src/main/java/me/lucko/luckperms/api/Logger.java @@ -25,8 +25,8 @@ package me.lucko.luckperms.api; /** * A wrapper interface for platform logger instances * - *

Bukkit/Bungee both use java.util.logging, and Sponge uses org.slf4j. This class wraps those classes so the - * commons module can access a logger. + *

Bukkit/Bungee both use java.util.logging, and Sponge uses org.slf4j. This class wraps those classes so the + * commons module can access a logger.

*/ public interface Logger { diff --git a/api/src/main/java/me/lucko/luckperms/api/LuckPermsApi.java b/api/src/main/java/me/lucko/luckperms/api/LuckPermsApi.java index 112006362..891b1a1e1 100644 --- a/api/src/main/java/me/lucko/luckperms/api/LuckPermsApi.java +++ b/api/src/main/java/me/lucko/luckperms/api/LuckPermsApi.java @@ -113,7 +113,9 @@ public interface LuckPermsApi { User getUser(UUID uuid); /** - * Gets a wrapped user object from the user storage. This method does not return null, unlike {@link #getUser(UUID)} + * Gets a wrapped user object from the user storage. + * + *

This method does not return null, unlike {@link #getUser(UUID)}

* * @param uuid the uuid of the user to get * @return an optional {@link User} object @@ -131,8 +133,9 @@ public interface LuckPermsApi { User getUser(String name); /** - * Gets a wrapped user object from the user storage. This method does not return null, unlike {@link - * #getUser(String)} + * Gets a wrapped user object from the user storage. + * + *

This method does not return null, unlike {@link #getUser(String)}

* * @param name the username of the user to get * @return an optional {@link User} object @@ -175,7 +178,9 @@ public interface LuckPermsApi { Group getGroup(String name); /** - * Gets a wrapped group object from the group storage. This method does not return null, unlike {@link #getGroup} + * Gets a wrapped group object from the group storage. + * + *

This method does not return null, unlike {@link #getGroup}

* * @param name the name of the group to get * @return an optional {@link Group} object @@ -209,7 +214,9 @@ public interface LuckPermsApi { Track getTrack(String name); /** - * Gets a wrapped track object from the track storage. This method does not return null, unlike {@link #getTrack} + * Gets a wrapped track object from the track storage. + * + *

This method does not return null, unlike {@link #getTrack}

* * @param name the name of the track to get * @return an optional {@link Track} object diff --git a/api/src/main/java/me/lucko/luckperms/api/MessagingService.java b/api/src/main/java/me/lucko/luckperms/api/MessagingService.java index 99e5c4e67..661d345e3 100644 --- a/api/src/main/java/me/lucko/luckperms/api/MessagingService.java +++ b/api/src/main/java/me/lucko/luckperms/api/MessagingService.java @@ -32,8 +32,8 @@ public interface MessagingService { /** * Uses the messaging service to inform other servers about changes. * - *

This will push the update asynchronously, and this method will return immediately. Calling this method is - * equivalent to running "/lp networksync", except will not sync this server. + *

This will push the update asynchronously, and this method will return immediately. Calling this method is + * equivalent to running "/lp networksync", except will not sync this server.

*/ void pushUpdate(); diff --git a/api/src/main/java/me/lucko/luckperms/api/MetaUtils.java b/api/src/main/java/me/lucko/luckperms/api/MetaUtils.java index 481d68fb5..bcdec7f4b 100644 --- a/api/src/main/java/me/lucko/luckperms/api/MetaUtils.java +++ b/api/src/main/java/me/lucko/luckperms/api/MetaUtils.java @@ -34,7 +34,9 @@ import java.util.Set; * A collection of utilities to help retrieve meta values for {@link PermissionHolder}s * * @since 2.7 + * @deprecated in favour of using {@link NodeFactory#makeMetaNode(String, String)} or {@link me.lucko.luckperms.api.caching.MetaData}. */ +@Deprecated public class MetaUtils { private static String escapeDelimiters(String s, String... delims) { @@ -92,42 +94,24 @@ public class MetaUtils { * @param holder the holder to apply the meta node to * @param server the server to apply the meta on, can be null * @param world the world to apply the meta on, can be null - * @param node the meta node + * @param key the meta key * @param value the meta value * @throws NullPointerException if the holder, node or value is null * @throws IllegalArgumentException if the node or value is empty */ - public static void setMeta(PermissionHolder holder, String server, String world, String node, String value) { - if (holder == null) { - throw new NullPointerException("holder"); - } + public static void setMeta(PermissionHolder holder, String server, String world, String key, String value) { + if (holder == null) throw new NullPointerException("holder"); + if (key == null) throw new NullPointerException("node"); + if (value == null) throw new NullPointerException("value"); + if (key.equals("")) throw new IllegalArgumentException("node is empty"); + if (value.equals("")) throw new IllegalArgumentException("value is empty"); - if (node == null) { - throw new NullPointerException("node"); - } - - if (value == null) { - throw new NullPointerException("value"); - } - - if (node.equals("")) { - throw new IllegalArgumentException("node is empty"); - } - - if (value.equals("")) { - throw new IllegalArgumentException("value is empty"); - } - - if (server == null || server.equals("")) { - server = "global"; - } - - node = escapeCharacters(node); + key = escapeCharacters(key); value = escapeCharacters(value); Set toRemove = new HashSet<>(); for (Node n : holder.getEnduringPermissions()) { - if (n.isMeta() && n.getMeta().getKey().equals(node)) { + if (n.isMeta() && n.getMeta().getKey().equals(key)) { toRemove.add(n); } } @@ -138,12 +122,12 @@ public class MetaUtils { } catch (ObjectLacksException ignored) {} } - Node.Builder metaNode = LuckPerms.getApi().buildNode("meta." + node + "." + value).setValue(true); - if (!server.equalsIgnoreCase("global")) { + Node.Builder metaNode = LuckPerms.getApi().buildNode("meta." + key + "." + value).setValue(true); + if (server != null) { metaNode.setServer(server); } - if (world != null && !world.equals("")) { - metaNode.setServer(server).setWorld(world); + if (world != null) { + metaNode.setWorld(world); } try { @@ -165,18 +149,8 @@ public class MetaUtils { * @throws IllegalArgumentException if the node is empty */ public static String getMeta(PermissionHolder holder, String server, String world, String node, String defaultValue, boolean includeGlobal) { - if (holder == null) { - throw new NullPointerException("holder"); - } - - if (server == null || server.equals("")) { - server = "global"; - } - - if (node == null) { - throw new NullPointerException("node"); - } - + if (holder == null) throw new NullPointerException("holder"); + if (node == null) throw new NullPointerException("node"); if (node.equals("")) { throw new IllegalArgumentException("node is empty"); } @@ -184,23 +158,10 @@ public class MetaUtils { node = escapeCharacters(node); for (Node n : holder.getPermissions()) { - if (!n.getValue()) { - continue; - } + if (!n.getValue() || !n.isMeta()) continue; - if (!n.isMeta()) { - continue; - } - - if (!server.equalsIgnoreCase("global")) { - if (!n.shouldApplyOnServer(server, includeGlobal, false)) { - continue; - } - } - - if (!n.shouldApplyOnWorld(world, includeGlobal, false)) { - continue; - } + if (!n.shouldApplyOnServer(server, includeGlobal, false)) continue; + if (!n.shouldApplyOnWorld(world, includeGlobal, false)) continue; Map.Entry meta = n.getMeta(); if (meta.getKey().equalsIgnoreCase(node)) { @@ -212,21 +173,18 @@ public class MetaUtils { } private static void setChatMeta(boolean prefix, PermissionHolder holder, String value, int priority, String server, String world) { - if (holder == null) { - throw new NullPointerException("holder"); - } - + if (holder == null) throw new NullPointerException("holder"); if (value == null || value.equals("")) { throw new IllegalArgumentException("value is null/empty"); } Node.Builder node = LuckPerms.getApi().buildNode(prefix ? "prefix" : "suffix" + "." + priority + "." + escapeCharacters(value)); node.setValue(true); - if (!server.equalsIgnoreCase("global")) { + if (server != null) { node.setServer(server); } - if (world != null && !world.equals("")) { - node.setServer(server).setWorld(world); + if (world != null) { + node.setWorld(world); } try { @@ -268,26 +226,14 @@ public class MetaUtils { if (holder == null) { throw new NullPointerException("holder"); } - if (server == null) { - server = "global"; - } int priority = Integer.MIN_VALUE; String meta = null; for (Node n : holder.getAllNodes(Contexts.allowAll())) { - if (!n.getValue()) { - continue; - } + if (!n.getValue()) continue; - if (!server.equalsIgnoreCase("global")) { - if (!n.shouldApplyOnServer(server, includeGlobal, false)) { - continue; - } - } - - if (!n.shouldApplyOnWorld(world, includeGlobal, false)) { - continue; - } + if (!n.shouldApplyOnServer(server, includeGlobal, false)) continue; + if (!n.shouldApplyOnWorld(world, includeGlobal, false)) continue; if (prefix ? !n.isPrefix() : !n.isSuffix()) { continue; diff --git a/api/src/main/java/me/lucko/luckperms/api/Node.java b/api/src/main/java/me/lucko/luckperms/api/Node.java index 8c3b1177f..8e86bee2d 100644 --- a/api/src/main/java/me/lucko/luckperms/api/Node.java +++ b/api/src/main/java/me/lucko/luckperms/api/Node.java @@ -33,7 +33,7 @@ import java.util.Set; /** * An immutable permission node * - *

Use {@link LuckPermsApi#buildNode(String)} to get an instance. + *

Use {@link LuckPermsApi#buildNode(String)} to get an instance.

* * @since 2.6 */ diff --git a/api/src/main/java/me/lucko/luckperms/api/NodeFactory.java b/api/src/main/java/me/lucko/luckperms/api/NodeFactory.java index 11bf81fd6..33800e42e 100644 --- a/api/src/main/java/me/lucko/luckperms/api/NodeFactory.java +++ b/api/src/main/java/me/lucko/luckperms/api/NodeFactory.java @@ -33,7 +33,7 @@ public interface NodeFactory { * Creates a node from a serialised node string * * @param serialisedPermission the serialised permission string - * @param value the value of the node + * @param value the value of the node * @return a node instance * @throws NullPointerException if the permission is null */ @@ -60,18 +60,30 @@ public interface NodeFactory { /** * Creates a node builder from a serialised node string + * * @param serialisedPermission the serialised permission string - * @param value the value of the node + * @param value the value of the node * @return a node builder instance * @throws NullPointerException if the permission is null */ Node.Builder newBuilderFromSerialisedNode(String serialisedPermission, boolean value); + /** + * Creates a node builder from a group + * + * @param group the group + * @return a node builder instance + * @throws NullPointerException if the group is null + * @throws IllegalStateException if the group instance was not obtained from LuckPerms. + * @since 3.1 + */ + Node.Builder makeGroupNode(Group group); + /** * Creates a node builder from a key value pair * - * @param key the key + * @param key the key * @param value the value * @return a node builder instance * @throws NullPointerException if the key or value is null @@ -82,7 +94,7 @@ public interface NodeFactory { * Creates a node builder from a prefix string and priority * * @param priority the priority - * @param prefix the prefix string + * @param prefix the prefix string * @return a node builder instance * @throws NullPointerException if the prefix is null */ @@ -92,7 +104,7 @@ public interface NodeFactory { * Creates a node builder from a prefix string and priority * * @param priority the priority - * @param suffix the suffix string + * @param suffix the suffix string * @return a node builder instance * @throws NullPointerException if the suffix is null */ diff --git a/api/src/main/java/me/lucko/luckperms/api/PermissionHolder.java b/api/src/main/java/me/lucko/luckperms/api/PermissionHolder.java index 5d2a85d67..8714f254a 100644 --- a/api/src/main/java/me/lucko/luckperms/api/PermissionHolder.java +++ b/api/src/main/java/me/lucko/luckperms/api/PermissionHolder.java @@ -32,15 +32,15 @@ import java.util.SortedSet; /** * An object capable of holding permissions * - *

Any changes made will be lost unless the instance is saved back to the {@link Storage}. + *

Any changes made will be lost unless the instance is saved back to the {@link Storage}.

*/ public interface PermissionHolder { /** * Gets the objects name * - *

{@link User#getUuid()}, {@link User#getName()} or {@link Group#getName()} should normally be used instead of - * this method. + *

{@link User#getUuid()}, {@link User#getName()} or {@link Group#getName()} should normally be used instead of + * this method.

* * @return the identifier for this object. Either a uuid string or name. */ @@ -74,9 +74,11 @@ public interface PermissionHolder { /** * Gets a mutable sorted set of the nodes that this object has and inherits, filtered by context - * Unlike {@link #getAllNodesFiltered(Contexts)}, this method will not filter individual nodes. The context is only - * used to determine which groups should apply. - * Nodes are sorted into priority order. + * + *

Unlike {@link #getAllNodesFiltered(Contexts)}, this method will not filter individual nodes. The context is only + * used to determine which groups should apply.

+ * + *

Nodes are sorted into priority order.

* * @param contexts the context for the lookup, * @return a mutable sorted set of permissions @@ -87,8 +89,9 @@ public interface PermissionHolder { /** * Gets a mutable set of the nodes that this object has and inherits, filtered by context. - * Unlike {@link #getAllNodes(Contexts)}, this method WILL filter individual nodes, and only return ones that fully - * meet the context provided. + * + *

Unlike {@link #getAllNodes(Contexts)}, this method WILL filter individual nodes, and only return ones that fully + * meet the context provided.

* * @param contexts the context for the lookup * @return a mutable set of permissions @@ -99,6 +102,7 @@ public interface PermissionHolder { /** * Converts the output of {@link #getAllNodesFiltered(Contexts)}, and expands shorthand permissions. + * * @param contexts the context for the lookup * @param lowerCase if the keys should be made lowercase whilst being exported * @return a mutable map of permissions @@ -206,7 +210,7 @@ public interface PermissionHolder { boolean hasPermission(String node, boolean b, String server, String world, boolean temporary); /** - * Cheks to see if the object inherits a certain permission + * Checks to see if the object inherits a certain permission * * @param node the node to check for * @return a Tristate for the holders inheritance status for the node @@ -300,17 +304,27 @@ public interface PermissionHolder { */ void setPermission(Node node) throws ObjectAlreadyHasException; + /** + * Sets a permission for the object + * + * @param node The node to be set + * @throws NullPointerException if the node is null + * @return the result of the operation + * @since 3.1 + */ + DataMutateResult setPermissionUnchecked(Node node); + /** * Sets a transient permission for the object * - *

A transient node is a permission that does not persist. + *

A transient node is a permission that does not persist. * Whenever a user logs out of the server, or the server restarts, this permission will disappear. - * It is never saved to the datastore, and therefore will not apply on other servers. + * It is never saved to the datastore, and therefore will not apply on other servers.

* - *

This is useful if you want to temporarily set a permission for a user while they're online, but don't - * want it to persist, and have to worry about removing it when they log out. + *

This is useful if you want to temporarily set a permission for a user while they're online, but don't + * want it to persist, and have to worry about removing it when they log out.

* - *

For unsetting a transient permission, see {@link #unsetTransientPermission(Node)} + *

For unsetting a transient permission, see {@link #unsetTransientPermission(Node)}

* * @param node The node to be set * @throws ObjectAlreadyHasException if the object already has the permission @@ -319,6 +333,25 @@ public interface PermissionHolder { */ void setTransientPermission(Node node) throws ObjectAlreadyHasException; + /** + * Sets a transient permission for the object + * + *

A transient node is a permission that does not persist. + * Whenever a user logs out of the server, or the server restarts, this permission will disappear. + * It is never saved to the datastore, and therefore will not apply on other servers.

+ * + *

This is useful if you want to temporarily set a permission for a user while they're online, but don't + * want it to persist, and have to worry about removing it when they log out.

+ * + *

For unsetting a transient permission, see {@link #unsetTransientPermission(Node)}

+ * + * @param node The node to be set + * @throws NullPointerException if the node is null + * @return the result of the operation + * @since 3.1 + */ + DataMutateResult setTransientPermissionUnchecked(Node node); + /** * Sets a permission for the object * @@ -416,6 +449,16 @@ public interface PermissionHolder { */ void unsetPermission(Node node) throws ObjectLacksException; + /** + * Unsets a permission for the object + * + * @param node The node to be unset + * @throws NullPointerException if the node is null + * @return the result of the operation + * @since 3.1 + */ + DataMutateResult unsetPermissionUnchecked(Node node); + /** * Unsets a transient permission for the object * @@ -426,6 +469,16 @@ public interface PermissionHolder { */ void unsetTransientPermission(Node node) throws ObjectLacksException; + /** + * Unsets a transient permission for the object + * + * @param node The node to be unset + * @throws NullPointerException if the node is null + * @return the result of the operation + * @since 3.1 + */ + DataMutateResult unsetTransientPermissionUnchecked(Node node); + /** * Unsets a permission for the object * diff --git a/api/src/main/java/me/lucko/luckperms/api/Storage.java b/api/src/main/java/me/lucko/luckperms/api/Storage.java index e7341ae87..f9e4713a7 100644 --- a/api/src/main/java/me/lucko/luckperms/api/Storage.java +++ b/api/src/main/java/me/lucko/luckperms/api/Storage.java @@ -34,11 +34,11 @@ import java.util.function.Consumer; * *

All methods return {@link CompletableFuture}s, which will be populated with the result once the data has been * loaded asynchronously. Care should be taken when using the methods to ensure that the main server thread is not - * blocked. + * blocked.

* *

Methods such as {@link CompletableFuture#get()} and equivalent should not be called on the main * server thread. If you need to use the result of these operations on the main server thread, please register a - * callback using {@link CompletableFuture#thenAcceptAsync(Consumer, Executor)} and {@link #getSyncExecutor()}. + * callback using {@link CompletableFuture#thenAcceptAsync(Consumer, Executor)} and {@link #getSyncExecutor()}.

* * @since 2.14 */ diff --git a/api/src/main/java/me/lucko/luckperms/api/Track.java b/api/src/main/java/me/lucko/luckperms/api/Track.java index 1a1918788..a5f969fca 100644 --- a/api/src/main/java/me/lucko/luckperms/api/Track.java +++ b/api/src/main/java/me/lucko/luckperms/api/Track.java @@ -41,7 +41,7 @@ public interface Track { /** * Gets an ordered list of the groups on this track * - *

Index 0 is the first/lowest group in (or start of) the track + *

Index 0 is the first/lowest group in (or start of) the track

* * @return an ordered {@link List} of the groups on this track */ diff --git a/api/src/main/java/me/lucko/luckperms/api/Tristate.java b/api/src/main/java/me/lucko/luckperms/api/Tristate.java index bcc17e082..dbc5ed1ba 100644 --- a/api/src/main/java/me/lucko/luckperms/api/Tristate.java +++ b/api/src/main/java/me/lucko/luckperms/api/Tristate.java @@ -25,8 +25,8 @@ package me.lucko.luckperms.api; /** * Represents a permission setting. * - *

Consider a value of {@link #FALSE} to be a "negated" setting, and a value of {@link #UNDEFINED} to be a - * non-existent value. + *

Consider a value of {@link #FALSE} to be a "negated" setting, and a value of {@link #UNDEFINED} to be a + * non-existent value.

*/ public enum Tristate { @@ -63,7 +63,8 @@ public enum Tristate { /** * Returns the value of the Tristate as a boolean. - *

A value of {@link #UNDEFINED} converts to false. + * + *

A value of {@link #UNDEFINED} converts to false.

* * @return a boolean representation of the Tristate. */ diff --git a/api/src/main/java/me/lucko/luckperms/api/User.java b/api/src/main/java/me/lucko/luckperms/api/User.java index c6d0a2af4..41ccaafc9 100644 --- a/api/src/main/java/me/lucko/luckperms/api/User.java +++ b/api/src/main/java/me/lucko/luckperms/api/User.java @@ -69,8 +69,8 @@ public interface User extends PermissionHolder { /** * Refresh and re-assign the users permissions. * - *

This request is not buffered, and the refresh call will be ran directly. This should ideally be called on - * an asynchronous thread. + *

This request is not buffered, and the refresh call will be ran directly. This should ideally be called on + * an asynchronous thread.

*/ void refreshPermissions(); @@ -128,7 +128,9 @@ public interface User extends PermissionHolder { * @throws ObjectAlreadyHasException if the user is already a member of the group * @throws NullPointerException if the group is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void addGroup(Group group) throws ObjectAlreadyHasException; /** @@ -140,7 +142,9 @@ public interface User extends PermissionHolder { * @throws NullPointerException if the group or server is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the server is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void addGroup(Group group, String server) throws ObjectAlreadyHasException; /** @@ -153,7 +157,9 @@ public interface User extends PermissionHolder { * @throws NullPointerException if the group, server or world is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the server or world is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void addGroup(Group group, String server, String world) throws ObjectAlreadyHasException; /** @@ -165,7 +171,9 @@ public interface User extends PermissionHolder { * @throws NullPointerException if the group is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the expiry time is in the past + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void addGroup(Group group, long expireAt) throws ObjectAlreadyHasException; /** @@ -178,7 +186,9 @@ public interface User extends PermissionHolder { * @throws NullPointerException if the group or server is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the expiry time is in the past or the server is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void addGroup(Group group, String server, long expireAt) throws ObjectAlreadyHasException; /** @@ -192,7 +202,9 @@ public interface User extends PermissionHolder { * @throws NullPointerException if the group, server or world is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the expiry time is in the past or the server/world is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void addGroup(Group group, String server, String world, long expireAt) throws ObjectAlreadyHasException; /** @@ -202,7 +214,9 @@ public interface User extends PermissionHolder { * @throws ObjectLacksException if the user isn't a member of the group * @throws NullPointerException if the group is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void removeGroup(Group group) throws ObjectLacksException; /** @@ -213,7 +227,9 @@ public interface User extends PermissionHolder { * @throws ObjectLacksException if the user isn't a member of the group * @throws NullPointerException if the group is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void removeGroup(Group group, boolean temporary) throws ObjectLacksException; /** @@ -225,7 +241,9 @@ public interface User extends PermissionHolder { * @throws NullPointerException if the group or server is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the server is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void removeGroup(Group group, String server) throws ObjectLacksException; /** @@ -238,7 +256,9 @@ public interface User extends PermissionHolder { * @throws NullPointerException if the group, server or world is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the server or world is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void removeGroup(Group group, String server, String world) throws ObjectLacksException; /** @@ -251,7 +271,9 @@ public interface User extends PermissionHolder { * @throws NullPointerException if the group or server is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the expiry time is in the past or the server is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void removeGroup(Group group, String server, boolean temporary) throws ObjectLacksException; /** @@ -265,7 +287,9 @@ public interface User extends PermissionHolder { * @throws NullPointerException if the group, server or world is null * @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalArgumentException if the expiry time is in the past or the server/world is invalid + * @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)} */ + @Deprecated void removeGroup(Group group, String server, String world, boolean temporary) throws ObjectLacksException; /** diff --git a/api/src/main/java/me/lucko/luckperms/api/UuidCache.java b/api/src/main/java/me/lucko/luckperms/api/UuidCache.java index 545051069..6bea46b38 100644 --- a/api/src/main/java/me/lucko/luckperms/api/UuidCache.java +++ b/api/src/main/java/me/lucko/luckperms/api/UuidCache.java @@ -27,15 +27,15 @@ import java.util.UUID; /** * A UUID cache for online users, between external Mojang UUIDs, and internal LuckPerms UUIDs. * - *

This UuidCache is a means of allowing users to have the same internal UUID across a network of offline mode + *

This UuidCache is a means of allowing users to have the same internal UUID across a network of offline mode * servers or mixed offline mode and online mode servers. Platforms running in offline mode generate a UUID for a * user when they first join the server, but this UUID will then not be consistent across the network. LuckPerms will * instead check the datastore cache, to get a UUID for a user that is consistent across an entire network. * - *

If you want to get a user object from the Storage using the api on a server in offline mode, you will need to use + *

If you want to get a user object from the Storage using the api on a server in offline mode, you will need to use * this cache, OR use Storage#getUUID, for users that are not online. * - *

THIS IS ONLY EFFECTIVE FOR ONLINE PLAYERS. USE THE DATASTORE METHODS FOR OFFLINE PLAYERS. + *

This is only effective for online players. Use {@link Storage#getUUID(String)} for offline players.

*/ public interface UuidCache { diff --git a/api/src/main/java/me/lucko/luckperms/api/caching/PermissionData.java b/api/src/main/java/me/lucko/luckperms/api/caching/PermissionData.java index 082686534..f5c762ff7 100644 --- a/api/src/main/java/me/lucko/luckperms/api/caching/PermissionData.java +++ b/api/src/main/java/me/lucko/luckperms/api/caching/PermissionData.java @@ -45,7 +45,7 @@ public interface PermissionData { /** * Invalidates the underlying permission calculator cache. * - *

Can be called to allow for an update in defaults. + *

Can be called to allow for an update in defaults.

*/ void invalidateCache(); diff --git a/api/src/main/java/me/lucko/luckperms/api/caching/UserData.java b/api/src/main/java/me/lucko/luckperms/api/caching/UserData.java index e752f71d1..c61885134 100644 --- a/api/src/main/java/me/lucko/luckperms/api/caching/UserData.java +++ b/api/src/main/java/me/lucko/luckperms/api/caching/UserData.java @@ -30,7 +30,7 @@ import java.util.Set; * Holds cached permission and meta lookup data for a {@link me.lucko.luckperms.api.User}. * *

Data is only likely to be available for online users. All calls will account for inheritance, as well as any - * default data provided by the platform. This calls are heavily cached and are therefore fast. + * default data provided by the platform. This calls are heavily cached and are therefore fast.

* * @since 2.13 */ @@ -39,7 +39,7 @@ public interface UserData { /** * Gets PermissionData from the cache, given a specified context. * - *

If the data is not cached, it is calculated. Therefore, this call could be costly. + *

If the data is not cached, it is calculated. Therefore, this call could be costly.

* * @param contexts the contexts to get the permission data in * @return a permission data instance @@ -50,7 +50,7 @@ public interface UserData { /** * Gets MetaData from the cache, given a specified context. * - *

If the data is not cached, it is calculated. Therefore, this call could be costly. + *

If the data is not cached, it is calculated. Therefore, this call could be costly.

* * @param contexts the contexts to get the permission data in * @return a meta data instance @@ -79,8 +79,8 @@ public interface UserData { /** * Calculates permission data and stores it in the cache. * - *

If there is already data cached for the given contexts, and if the resultant output is different, - * the cached value is updated. + *

If there is already data cached for the given contexts, and if the resultant output is different, + * the cached value is updated.

* * @param contexts the contexts to recalculate in. * @throws NullPointerException if contexts is null @@ -90,8 +90,8 @@ public interface UserData { /** * Calculates meta data and stores it in the cache. * - *

If there is already data cached for the given contexts, and if the resultant output is different, - * the cached value is updated. + *

If there is already data cached for the given contexts, and if the resultant output is different, + * the cached value is updated.

* * @param contexts the contexts to recalculate in. * @throws NullPointerException if contexts is null @@ -119,7 +119,7 @@ public interface UserData { /** * Ensures that PermissionData and MetaData is cached for a context. * - *

If the cache does not contain any data for the context, it will be calculated and saved. + *

If the cache does not contain any data for the context, it will be calculated and saved.

* * @param contexts the contexts to pre-calculate for * @throws NullPointerException if contexts is null @@ -128,7 +128,8 @@ public interface UserData { /** * Invalidates all of the underlying Permission calculators. - * Can be called to allow for an update in defaults. + * + *

Can be called to allow for an update in defaults.

*/ void invalidatePermissionCalculators(); diff --git a/api/src/main/java/me/lucko/luckperms/api/context/ContextCalculator.java b/api/src/main/java/me/lucko/luckperms/api/context/ContextCalculator.java index 5ebf34950..0e69014eb 100644 --- a/api/src/main/java/me/lucko/luckperms/api/context/ContextCalculator.java +++ b/api/src/main/java/me/lucko/luckperms/api/context/ContextCalculator.java @@ -25,9 +25,8 @@ package me.lucko.luckperms.api.context; /** * Calculates whether contexts are applicable to {@link T} * - *

Somewhat inspired by the system used on Sponge. - * * @param the subject type. Is ALWAYS the player class of the platform. + * @since 2.13 */ public interface ContextCalculator { diff --git a/api/src/main/java/me/lucko/luckperms/api/context/ContextSet.java b/api/src/main/java/me/lucko/luckperms/api/context/ContextSet.java index 9a95b3835..66a217bfd 100644 --- a/api/src/main/java/me/lucko/luckperms/api/context/ContextSet.java +++ b/api/src/main/java/me/lucko/luckperms/api/context/ContextSet.java @@ -29,8 +29,9 @@ import java.util.Optional; import java.util.Set; /** - * Holds contexts. - * Implementations may be either mutable or immutable. + * Holder of contexts. + * + *

Implementations may be either mutable or immutable.

* * @since 2.13 */ diff --git a/bukkit-legacy/pom.xml b/bukkit-legacy/pom.xml index 3e9896a8c..fac39ad85 100644 --- a/bukkit-legacy/pom.xml +++ b/bukkit-legacy/pom.xml @@ -5,7 +5,7 @@ luckperms me.lucko.luckperms - 3.0-SNAPSHOT + 3.1-SNAPSHOT 4.0.0 diff --git a/bukkit/pom.xml b/bukkit/pom.xml index a7953e39d..bf12d08e8 100644 --- a/bukkit/pom.xml +++ b/bukkit/pom.xml @@ -5,7 +5,7 @@ luckperms me.lucko.luckperms - 3.0-SNAPSHOT + 3.1-SNAPSHOT 4.0.0 diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java index 98faa7b5a..00e92cf6d 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java @@ -26,6 +26,7 @@ import lombok.Getter; import lombok.NonNull; import me.lucko.luckperms.api.Contexts; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.caching.PermissionData; @@ -33,7 +34,6 @@ import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.bukkit.LPBukkitPlugin; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.model.Group; import me.lucko.luckperms.common.core.model.PermissionHolder; diff --git a/bungee/pom.xml b/bungee/pom.xml index ea4d373df..2314e7a65 100644 --- a/bungee/pom.xml +++ b/bungee/pom.xml @@ -5,7 +5,7 @@ luckperms me.lucko.luckperms - 3.0-SNAPSHOT + 3.1-SNAPSHOT 4.0.0 diff --git a/common/pom.xml b/common/pom.xml index 857afd285..d0d512caa 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -5,7 +5,7 @@ luckperms me.lucko.luckperms - 3.0-SNAPSHOT + 3.1-SNAPSHOT 4.0.0 @@ -13,6 +13,7 @@ jar + LuckPerms-Common-${release.version}.${patch.version} org.apache.maven.plugins diff --git a/common/src/main/java/me/lucko/luckperms/common/api/ApiProvider.java b/common/src/main/java/me/lucko/luckperms/common/api/ApiProvider.java index 852fa5e4d..244e7ae6a 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/ApiProvider.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/ApiProvider.java @@ -79,7 +79,7 @@ public class ApiProvider implements LuckPermsApi { @Override public double getApiVersion() { - return 3.0; + return 3.1; } @Override diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/LPConfigurationDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/LPConfigurationDelegate.java index 8bff53bc8..9fb31b3d5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/LPConfigurationDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/LPConfigurationDelegate.java @@ -36,105 +36,105 @@ import java.util.Map; */ @AllArgsConstructor public class LPConfigurationDelegate implements LPConfiguration { - private final LuckPermsConfiguration master; + private final LuckPermsConfiguration handle; @Override public String getServer() { - return master.get(ConfigKeys.SERVER); + return handle.get(ConfigKeys.SERVER); } @Override public int getSyncTime() { - return master.get(ConfigKeys.SYNC_TIME); + return handle.get(ConfigKeys.SYNC_TIME); } @Override public boolean getIncludeGlobalPerms() { - return master.get(ConfigKeys.INCLUDING_GLOBAL_PERMS); + return handle.get(ConfigKeys.INCLUDING_GLOBAL_PERMS); } @Override public boolean getIncludeGlobalWorldPerms() { - return master.get(ConfigKeys.INCLUDING_GLOBAL_WORLD_PERMS); + return handle.get(ConfigKeys.INCLUDING_GLOBAL_WORLD_PERMS); } @Override public boolean getApplyGlobalGroups() { - return master.get(ConfigKeys.APPLYING_GLOBAL_GROUPS); + return handle.get(ConfigKeys.APPLYING_GLOBAL_GROUPS); } @Override public boolean getApplyGlobalWorldGroups() { - return master.get(ConfigKeys.APPLYING_GLOBAL_WORLD_GROUPS); + return handle.get(ConfigKeys.APPLYING_GLOBAL_WORLD_GROUPS); } @Override public boolean getOnlineMode() { - return master.get(ConfigKeys.USE_SERVER_UUIDS); + return handle.get(ConfigKeys.USE_SERVER_UUIDS); } @Override public boolean getApplyWildcards() { - return master.get(ConfigKeys.APPLYING_WILDCARDS); + return handle.get(ConfigKeys.APPLYING_WILDCARDS); } @Override public boolean getApplyRegex() { - return master.get(ConfigKeys.APPLYING_REGEX); + return handle.get(ConfigKeys.APPLYING_REGEX); } @Override public boolean getApplyShorthand() { - return master.get(ConfigKeys.APPLYING_SHORTHAND); + return handle.get(ConfigKeys.APPLYING_SHORTHAND); } @Override public boolean getLogNotify() { - return master.get(ConfigKeys.LOG_NOTIFY); + return handle.get(ConfigKeys.LOG_NOTIFY); } @Override public boolean getEnableOps() { - return master.get(ConfigKeys.OPS_ENABLED); + return handle.get(ConfigKeys.OPS_ENABLED); } @Override public boolean getCommandsAllowOp() { - return master.get(ConfigKeys.COMMANDS_ALLOW_OP); + return handle.get(ConfigKeys.COMMANDS_ALLOW_OP); } @Override public boolean getAutoOp() { - return master.get(ConfigKeys.AUTO_OP); + return handle.get(ConfigKeys.AUTO_OP); } @Override public String getVaultServer() { - return master.get(ConfigKeys.VAULT_SERVER); + return handle.get(ConfigKeys.VAULT_SERVER); } @Override public boolean getVaultIncludeGlobal() { - return master.get(ConfigKeys.VAULT_INCLUDING_GLOBAL); + return handle.get(ConfigKeys.VAULT_INCLUDING_GLOBAL); } @Override public DatastoreConfiguration getDatastoreConfig() { - return master.get(ConfigKeys.DATABASE_VALUES); + return handle.get(ConfigKeys.DATABASE_VALUES); } @Override public String getStorageMethod() { - return master.get(ConfigKeys.STORAGE_METHOD); + return handle.get(ConfigKeys.STORAGE_METHOD); } @Override public boolean getSplitStorage() { - return master.get(ConfigKeys.SPLIT_STORAGE); + return handle.get(ConfigKeys.SPLIT_STORAGE); } @Override public Map getSplitStorageOptions() { - return master.get(ConfigKeys.SPLIT_STORAGE_OPTIONS); + return handle.get(ConfigKeys.SPLIT_STORAGE_OPTIONS); } } diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/LogDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/LogDelegate.java index 08a199090..1bb21f137 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/LogDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/LogDelegate.java @@ -39,100 +39,100 @@ import static me.lucko.luckperms.common.api.ApiUtils.checkName; */ @AllArgsConstructor public class LogDelegate implements Log { - private final me.lucko.luckperms.common.data.Log master; + private final me.lucko.luckperms.common.data.Log handle; @Override public SortedSet getContent() { - return master.getContent(); + return handle.getContent(); } @Override public SortedSet getRecent() { - return master.getRecent(); + return handle.getRecent(); } @Override public SortedMap getRecent(int pageNo) { - return master.getRecent(pageNo); + return handle.getRecent(pageNo); } @Override public int getRecentMaxPages() { - return master.getRecentMaxPages(); + return handle.getRecentMaxPages(); } @Override public SortedSet getRecent(@NonNull UUID actor) { - return master.getRecent(actor); + return handle.getRecent(actor); } @Override public SortedMap getRecent(int pageNo, @NonNull UUID actor) { - return master.getRecent(pageNo, actor); + return handle.getRecent(pageNo, actor); } @Override public int getRecentMaxPages(@NonNull UUID actor) { - return master.getRecentMaxPages(actor); + return handle.getRecentMaxPages(actor); } @Override public SortedSet getUserHistory(@NonNull UUID uuid) { - return master.getUserHistory(uuid); + return handle.getUserHistory(uuid); } @Override public SortedMap getUserHistory(int pageNo, @NonNull UUID uuid) { - return master.getUserHistory(pageNo, uuid); + return handle.getUserHistory(pageNo, uuid); } @Override public int getUserHistoryMaxPages(@NonNull UUID uuid) { - return master.getUserHistoryMaxPages(uuid); + return handle.getUserHistoryMaxPages(uuid); } @Override public SortedSet getGroupHistory(@NonNull String name) { - return master.getGroupHistory(checkName(name)); + return handle.getGroupHistory(checkName(name)); } @Override public SortedMap getGroupHistory(int pageNo, @NonNull String name) { - return master.getGroupHistory(pageNo, checkName(name)); + return handle.getGroupHistory(pageNo, checkName(name)); } @Override public int getGroupHistoryMaxPages(@NonNull String name) { - return master.getGroupHistoryMaxPages(checkName(name)); + return handle.getGroupHistoryMaxPages(checkName(name)); } @Override public SortedSet getTrackHistory(@NonNull String name) { - return master.getTrackHistory(checkName(name)); + return handle.getTrackHistory(checkName(name)); } @Override public SortedMap getTrackHistory(int pageNo, @NonNull String name) { - return master.getTrackHistory(pageNo, checkName(name)); + return handle.getTrackHistory(pageNo, checkName(name)); } @Override public int getTrackHistoryMaxPages(@NonNull String name) { - return master.getTrackHistoryMaxPages(checkName(name)); + return handle.getTrackHistoryMaxPages(checkName(name)); } @Override public SortedSet getSearch(@NonNull String query) { - return master.getSearch(query); + return handle.getSearch(query); } @Override public SortedMap getSearch(int pageNo, @NonNull String query) { - return master.getSearch(pageNo, query); + return handle.getSearch(pageNo, query); } @Override public int getSearchMaxPages(@NonNull String query) { - return master.getSearchMaxPages(query); + return handle.getSearchMaxPages(query); } } diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/NodeFactoryDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/NodeFactoryDelegate.java index 95dac0a2d..0ac7e0321 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/NodeFactoryDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/NodeFactoryDelegate.java @@ -24,6 +24,7 @@ package me.lucko.luckperms.common.api.delegates; import lombok.NonNull; +import me.lucko.luckperms.api.Group; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.common.core.NodeFactory; @@ -50,6 +51,11 @@ public class NodeFactoryDelegate implements me.lucko.luckperms.api.NodeFactory { return NodeFactory.builderFromSerializedNode(serialisedPermission, value); } + @Override + public Node.Builder makeGroupNode(Group group) { + return NodeFactory.newBuilder("group." + GroupDelegate.cast(group).getName()); + } + @Override public Node.Builder makeMetaNode(@NonNull String key, @NonNull String value) { return NodeFactory.makeMetaNode(key, value); diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/PermissionHolderDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/PermissionHolderDelegate.java index 57e9e3cfb..bc69fe0f9 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/PermissionHolderDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/PermissionHolderDelegate.java @@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSortedSet; import me.lucko.luckperms.api.Contexts; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.LocalizedNode; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.PermissionHolder; @@ -53,201 +54,221 @@ import static me.lucko.luckperms.common.api.ApiUtils.checkTime; */ @AllArgsConstructor public class PermissionHolderDelegate implements PermissionHolder { - private final me.lucko.luckperms.common.core.model.PermissionHolder master; + private final me.lucko.luckperms.common.core.model.PermissionHolder handle; @Override public String getObjectName() { - return master.getObjectName(); + return handle.getObjectName(); } @Override public SortedSet getPermissions() { - return ImmutableSortedSet.copyOfSorted(master.mergePermissionsToSortedSet()); + return ImmutableSortedSet.copyOfSorted(handle.mergePermissionsToSortedSet()); } @Override public Set getEnduringPermissions() { - return ImmutableSet.copyOf(master.getNodes().values()); + return ImmutableSet.copyOf(handle.getNodes().values()); } @Override public Set getTransientPermissions() { - return ImmutableSet.copyOf(master.getTransientNodes().values()); + return ImmutableSet.copyOf(handle.getTransientNodes().values()); } @Override public SortedSet getAllNodes(@NonNull Contexts contexts) { - return new TreeSet<>(master.resolveInheritancesAlmostEqual(ExtractedContexts.generate(contexts))); + return new TreeSet<>(handle.resolveInheritancesAlmostEqual(ExtractedContexts.generate(contexts))); } @Override public Set getAllNodesFiltered(@NonNull Contexts contexts) { - return new HashSet<>(master.getAllNodes(ExtractedContexts.generate(contexts))); + return new HashSet<>(handle.getAllNodes(ExtractedContexts.generate(contexts))); } @Override public Map exportNodes(Contexts contexts, boolean lowerCase) { - return new HashMap<>(master.exportNodes(ExtractedContexts.generate(contexts), lowerCase)); + return new HashMap<>(handle.exportNodes(ExtractedContexts.generate(contexts), lowerCase)); } @Override public Tristate hasPermission(@NonNull Node node) { - return master.hasPermission(node, false); + return handle.hasPermission(node, false); } @Override public Tristate hasTransientPermission(@NonNull Node node) { - return master.hasPermission(node, true); + return handle.hasPermission(node, true); } @Override public boolean hasPermission(@NonNull String node, @NonNull boolean b) { - return master.hasPermission(node, b); + return handle.hasPermission(node, b); } @Override public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server) { - return master.hasPermission(node, b, server); + return handle.hasPermission(node, b, server); } @Override public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world) { - return master.hasPermission(node, b, server, world); + return handle.hasPermission(node, b, server, world); } @Override public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull boolean temporary) { - return master.hasPermission(node, b, temporary); + return handle.hasPermission(node, b, temporary); } @Override public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull boolean temporary) { - return master.hasPermission(node, b, server, temporary); + return handle.hasPermission(node, b, server, temporary); } @Override public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world, @NonNull boolean temporary) { - return master.hasPermission(node, b, server, world, temporary); + return handle.hasPermission(node, b, server, world, temporary); } @Override public Tristate inheritsPermission(@NonNull Node node) { - return master.inheritsPermission(node); + return handle.inheritsPermission(node); } @Override public boolean inheritsPermission(@NonNull String node, @NonNull boolean b) { - return master.inheritsPermission(node, b); + return handle.inheritsPermission(node, b); } @Override public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server) { - return master.inheritsPermission(node, b, server); + return handle.inheritsPermission(node, b, server); } @Override public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world) { - return master.inheritsPermission(node, b, server, world); + return handle.inheritsPermission(node, b, server, world); } @Override public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull boolean temporary) { - return master.inheritsPermission(node, b, temporary); + return handle.inheritsPermission(node, b, temporary); } @Override public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull boolean temporary) { - return master.inheritsPermission(node, b, server, temporary); + return handle.inheritsPermission(node, b, server, temporary); } @Override public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world, @NonNull boolean temporary) { - return master.inheritsPermission(node, b, server, world, temporary); + return handle.inheritsPermission(node, b, server, world, temporary); } @Override public void setPermission(@NonNull Node node) throws ObjectAlreadyHasException { - master.setPermission(node).throwException(); + handle.setPermission(node).throwException(); + } + + @Override + public DataMutateResult setPermissionUnchecked(Node node) { + return handle.setPermission(node); } @Override public void setTransientPermission(@NonNull Node node) throws ObjectAlreadyHasException { - master.setTransientPermission(node).throwException(); + handle.setTransientPermission(node).throwException(); + } + + @Override + public DataMutateResult setTransientPermissionUnchecked(Node node) { + return handle.setTransientPermission(node); } @Override public void setPermission(@NonNull String node, @NonNull boolean value) throws ObjectAlreadyHasException { - master.setPermission(NodeFactory.make(node, value)).throwException(); + handle.setPermission(NodeFactory.make(node, value)).throwException(); } @Override public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server) throws ObjectAlreadyHasException { - master.setPermission(NodeFactory.make(node, value, server)).throwException(); + handle.setPermission(NodeFactory.make(node, value, server)).throwException(); } @Override public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server, @NonNull String world) throws ObjectAlreadyHasException { - master.setPermission(NodeFactory.make(node, value, server, world)).throwException(); + handle.setPermission(NodeFactory.make(node, value, server, world)).throwException(); } @Override public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull long expireAt) throws ObjectAlreadyHasException { - master.setPermission(NodeFactory.make(node, value, checkTime(expireAt))).throwException(); + handle.setPermission(NodeFactory.make(node, value, checkTime(expireAt))).throwException(); } @Override public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server, @NonNull long expireAt) throws ObjectAlreadyHasException { - master.setPermission(NodeFactory.make(node, value, server, checkTime(expireAt))).throwException(); + handle.setPermission(NodeFactory.make(node, value, server, checkTime(expireAt))).throwException(); } @Override public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server, @NonNull String world, @NonNull long expireAt) throws ObjectAlreadyHasException { - master.setPermission(NodeFactory.make(node, value, server, world, checkTime(expireAt))).throwException(); + handle.setPermission(NodeFactory.make(node, value, server, world, checkTime(expireAt))).throwException(); } @Override public void unsetPermission(@NonNull Node node) throws ObjectLacksException { - master.unsetPermission(node).throwException(); + handle.unsetPermission(node).throwException(); + } + + @Override + public DataMutateResult unsetPermissionUnchecked(Node node) { + return handle.unsetPermission(node); } @Override public void unsetTransientPermission(@NonNull Node node) throws ObjectLacksException { - master.unsetTransientPermission(node).throwException(); + handle.unsetTransientPermission(node).throwException(); + } + + @Override + public DataMutateResult unsetTransientPermissionUnchecked(Node node) { + return handle.unsetTransientPermission(node); } @Override public void unsetPermission(@NonNull String node, @NonNull boolean temporary) throws ObjectLacksException { - master.unsetPermission(NodeFactory.make(node, temporary)).throwException(); + handle.unsetPermission(NodeFactory.make(node, temporary)).throwException(); } @Override public void unsetPermission(@NonNull String node) throws ObjectLacksException { - master.unsetPermission(NodeFactory.make(node)).throwException(); + handle.unsetPermission(NodeFactory.make(node)).throwException(); } @Override public void unsetPermission(@NonNull String node, @NonNull String server) throws ObjectLacksException { - master.unsetPermission(NodeFactory.make(node, server)).throwException(); + handle.unsetPermission(NodeFactory.make(node, server)).throwException(); } @Override public void unsetPermission(@NonNull String node, @NonNull String server, @NonNull String world) throws ObjectLacksException { - master.unsetPermission(NodeFactory.make(node, server, world)).throwException(); + handle.unsetPermission(NodeFactory.make(node, server, world)).throwException(); } @Override public void unsetPermission(@NonNull String node, @NonNull String server, @NonNull boolean temporary) throws ObjectLacksException { - master.unsetPermission(NodeFactory.make(node, server, temporary)).throwException(); + handle.unsetPermission(NodeFactory.make(node, server, temporary)).throwException(); } @Override public void unsetPermission(@NonNull String node, @NonNull String server, @NonNull String world, @NonNull boolean temporary) throws ObjectLacksException { - master.unsetPermission(NodeFactory.make(node, server, world, temporary)).throwException(); + handle.unsetPermission(NodeFactory.make(node, server, world, temporary)).throwException(); } @Override public void clearNodes() { - master.clearNodes(); + handle.clearNodes(); } @Override @@ -257,7 +278,7 @@ public class PermissionHolderDelegate implements PermissionHolder { set.add("server", server); } - master.clearNodes(set); + handle.clearNodes(set); } @Override @@ -270,12 +291,12 @@ public class PermissionHolderDelegate implements PermissionHolder { set.add("world", world); } - master.clearNodes(set); + handle.clearNodes(set); } @Override public void clearParents() { - master.clearParents(true); + handle.clearParents(true); } @Override @@ -285,7 +306,7 @@ public class PermissionHolderDelegate implements PermissionHolder { set.add("server", server); } - master.clearParents(set, true); + handle.clearParents(set, true); } @Override @@ -298,12 +319,12 @@ public class PermissionHolderDelegate implements PermissionHolder { set.add("world", world); } - master.clearParents(set, true); + handle.clearParents(set, true); } @Override public void clearMeta() { - master.clearMeta(); + handle.clearMeta(); } @Override @@ -313,7 +334,7 @@ public class PermissionHolderDelegate implements PermissionHolder { set.add("server", server); } - master.clearMeta(set); + handle.clearMeta(set); } @Override @@ -326,7 +347,7 @@ public class PermissionHolderDelegate implements PermissionHolder { set.add("world", world); } - master.clearMeta(set); + handle.clearMeta(set); } @Override @@ -339,27 +360,27 @@ public class PermissionHolderDelegate implements PermissionHolder { set.add("world", world); } - master.clearMetaKeys(key, set, temporary); + handle.clearMetaKeys(key, set, temporary); } @Override public void clearTransientNodes() { - master.clearTransientNodes(); + handle.clearTransientNodes(); } @Override public Set getTemporaryPermissionNodes() { - return master.getTemporaryNodes(); + return handle.getTemporaryNodes(); } @Override public Set getPermanentPermissionNodes() { - return master.getPermanentNodes(); + return handle.getPermanentNodes(); } @Override public void auditTemporaryPermissions() { - master.auditTemporaryPermissions(); + handle.auditTemporaryPermissions(); } } diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/StorageDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/StorageDelegate.java index 93fe00bc4..881240983 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/StorageDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/StorageDelegate.java @@ -52,16 +52,16 @@ import static me.lucko.luckperms.common.api.ApiUtils.checkUsername; @AllArgsConstructor public class StorageDelegate implements Storage { private final LuckPermsPlugin plugin; - private final me.lucko.luckperms.common.storage.Storage master; + private final me.lucko.luckperms.common.storage.Storage handle; @Override public String getName() { - return master.getName(); + return handle.getName(); } @Override public boolean isAcceptingLogins() { - return master.isAcceptingLogins(); + return handle.isAcceptingLogins(); } @Override @@ -76,57 +76,57 @@ public class StorageDelegate implements Storage { @Override public CompletableFuture logAction(@NonNull LogEntry entry) { - return master.force().logAction(entry); + return handle.force().logAction(entry); } @Override public CompletableFuture getLog() { - return master.force().getLog().thenApply(log -> log == null ? null : new LogDelegate(log)); + return handle.force().getLog().thenApply(log -> log == null ? null : new LogDelegate(log)); } @Override public CompletableFuture loadUser(UUID uuid, String username) { - return master.force().loadUser(uuid, checkUsername(username)); + return handle.force().loadUser(uuid, checkUsername(username)); } @Override public CompletableFuture saveUser(User user) { - return master.force().saveUser(UserDelegate.cast(user)); + return handle.force().saveUser(UserDelegate.cast(user)); } @Override public CompletableFuture cleanupUsers() { - return master.force().cleanupUsers(); + return handle.force().cleanupUsers(); } @Override public CompletableFuture> getUniqueUsers() { - return master.force().getUniqueUsers(); + return handle.force().getUniqueUsers(); } @Override public CompletableFuture>> getUsersWithPermission(@NonNull String permission) { - return master.force().getUsersWithPermission(permission); + return handle.force().getUsersWithPermission(permission); } @Override public CompletableFuture createAndLoadGroup(String name) { - return master.force().createAndLoadGroup(checkName(name), CreationCause.API); + return handle.force().createAndLoadGroup(checkName(name), CreationCause.API); } @Override public CompletableFuture loadGroup(String name) { - return master.force().loadGroup(checkName(name)); + return handle.force().loadGroup(checkName(name)); } @Override public CompletableFuture loadAllGroups() { - return master.force().loadAllGroups(); + return handle.force().loadAllGroups(); } @Override public CompletableFuture saveGroup(Group group) { - return master.force().saveGroup(GroupDelegate.cast(group)); + return handle.force().saveGroup(GroupDelegate.cast(group)); } @Override @@ -134,51 +134,51 @@ public class StorageDelegate implements Storage { if (group.getName().equalsIgnoreCase(plugin.getConfiguration().get(ConfigKeys.DEFAULT_GROUP_NAME))) { throw new IllegalArgumentException("Cannot delete the default group."); } - return master.force().deleteGroup(GroupDelegate.cast(group), DeletionCause.API); + return handle.force().deleteGroup(GroupDelegate.cast(group), DeletionCause.API); } @Override public CompletableFuture>> getGroupsWithPermission(@NonNull String permission) { - return master.force().getGroupsWithPermission(permission); + return handle.force().getGroupsWithPermission(permission); } @Override public CompletableFuture createAndLoadTrack(String name) { - return master.force().createAndLoadTrack(checkName(name), CreationCause.API); + return handle.force().createAndLoadTrack(checkName(name), CreationCause.API); } @Override public CompletableFuture loadTrack(String name) { - return master.force().loadTrack(checkName(name)); + return handle.force().loadTrack(checkName(name)); } @Override public CompletableFuture loadAllTracks() { - return master.force().loadAllTracks(); + return handle.force().loadAllTracks(); } @Override public CompletableFuture saveTrack(Track track) { - return master.force().saveTrack(TrackDelegate.cast(track)); + return handle.force().saveTrack(TrackDelegate.cast(track)); } @Override public CompletableFuture deleteTrack(Track track) { - return master.force().deleteTrack(TrackDelegate.cast(track), DeletionCause.API); + return handle.force().deleteTrack(TrackDelegate.cast(track), DeletionCause.API); } @Override public CompletableFuture saveUUIDData(String username, UUID uuid) { - return master.force().saveUUIDData(checkUsername(username), uuid); + return handle.force().saveUUIDData(checkUsername(username), uuid); } @Override public CompletableFuture getUUID(String username) { - return master.force().getUUID(checkUsername(username)); + return handle.force().getUUID(checkUsername(username)); } @Override public CompletableFuture getName(@NonNull UUID uuid) { - return master.force().getName(uuid); + return handle.force().getName(uuid); } } diff --git a/common/src/main/java/me/lucko/luckperms/common/api/delegates/UuidCacheDelegate.java b/common/src/main/java/me/lucko/luckperms/common/api/delegates/UuidCacheDelegate.java index 83736cc35..6532235ae 100644 --- a/common/src/main/java/me/lucko/luckperms/common/api/delegates/UuidCacheDelegate.java +++ b/common/src/main/java/me/lucko/luckperms/common/api/delegates/UuidCacheDelegate.java @@ -34,15 +34,15 @@ import java.util.UUID; */ @AllArgsConstructor public class UuidCacheDelegate implements UuidCache { - private final me.lucko.luckperms.common.core.UuidCache master; + private final me.lucko.luckperms.common.core.UuidCache handle; @Override public UUID getUUID(@NonNull UUID external) { - return master.getUUID(external); + return handle.getUUID(external); } @Override public UUID getExternalUUID(@NonNull UUID internal) { - return master.getExternalUUID(internal); + return handle.getExternalUUID(internal); } } diff --git a/common/src/main/java/me/lucko/luckperms/common/caching/MetaAccumulator.java b/common/src/main/java/me/lucko/luckperms/common/caching/MetaAccumulator.java index 70503cf34..1b5e1bae2 100644 --- a/common/src/main/java/me/lucko/luckperms/common/caching/MetaAccumulator.java +++ b/common/src/main/java/me/lucko/luckperms/common/caching/MetaAccumulator.java @@ -28,7 +28,6 @@ import lombok.ToString; import me.lucko.luckperms.api.LocalizedNode; import me.lucko.luckperms.common.caching.stacking.MetaStack; -import me.lucko.luckperms.common.caching.stacking.NoopMetaStack; import java.util.Comparator; import java.util.HashMap; @@ -60,10 +59,6 @@ public class MetaAccumulator { this.suffixStack = suffixStack; } - public MetaAccumulator() { - this(NoopMetaStack.INSTANCE, NoopMetaStack.INSTANCE); - } - public void accumulateNode(LocalizedNode n) { if (n.isMeta()) { Map.Entry entry = n.getMeta(); diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddChatMeta.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddChatMeta.java index 1722863cd..02479fdd5 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddChatMeta.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddChatMeta.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.meta; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandException; @@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddTempChatMeta.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddTempChatMeta.java index e39690dd7..0eea90f32 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddTempChatMeta.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaAddTempChatMeta.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.meta; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; @@ -34,7 +35,6 @@ import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.TemporaryModifier; import me.lucko.luckperms.common.core.model.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveChatMeta.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveChatMeta.java index 8d37b9c41..67ec56d90 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveChatMeta.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveChatMeta.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.meta; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandException; @@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveTempChatMeta.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveTempChatMeta.java index 0fb97c7ef..7529191f3 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveTempChatMeta.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/meta/MetaRemoveTempChatMeta.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.meta; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandException; @@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAdd.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAdd.java index 321a3fcc1..bcb58972f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAdd.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAdd.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.parent; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandException; @@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.model.Group; import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAddTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAddTemp.java index e480071e0..6c364d47e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAddTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentAddTemp.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.parent; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; @@ -34,7 +35,6 @@ import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.TemporaryModifier; import me.lucko.luckperms.common.core.model.Group; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemove.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemove.java index f04882312..3608faf1f 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemove.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemove.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.parent; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandException; @@ -33,7 +34,6 @@ import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.User; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemoveTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemoveTemp.java index eafb807ac..d996b3efa 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemoveTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/parent/ParentRemoveTemp.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.parent; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandException; @@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSet.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSet.java index 10919bc84..5c83bcb04 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSet.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSet.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.permission; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandException; @@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSetTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSetTemp.java index a8bef4907..53829e556 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSetTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionSetTemp.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.permission; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; @@ -34,7 +35,6 @@ import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.TemporaryModifier; import me.lucko.luckperms.common.core.model.PermissionHolder; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnset.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnset.java index 9787811cc..07e78f8cc 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnset.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnset.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.permission; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandException; @@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnsetTemp.java b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnsetTemp.java index 78ba51dc5..1e9ad5bbf 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnsetTemp.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/impl/generic/permission/PermissionUnsetTemp.java @@ -22,6 +22,7 @@ package me.lucko.luckperms.common.commands.impl.generic.permission; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.CommandException; @@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils; import me.lucko.luckperms.common.commands.utils.Util; import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Permission; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.data.LogEntry; diff --git a/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java index 5b060b04a..d57f067e9 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java @@ -35,6 +35,7 @@ import com.google.common.collect.MultimapBuilder; import com.google.common.collect.SortedSetMultimap; import me.lucko.luckperms.api.Contexts; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.LocalizedNode; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Tristate; @@ -46,7 +47,6 @@ import me.lucko.luckperms.common.caching.handlers.GroupReference; import me.lucko.luckperms.common.caching.handlers.HolderReference; import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.core.ContextSetComparator; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.InheritanceInfo; import me.lucko.luckperms.common.core.NodeComparator; import me.lucko.luckperms.common.core.NodeFactory; diff --git a/pom.xml b/pom.xml index 42cf0899e..a1b572067 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.lucko.luckperms luckperms - 3.0-SNAPSHOT + 3.1-SNAPSHOT api common @@ -40,12 +40,12 @@ true true - 3.0 + 3.1 ${git.closest.tag.commit.count} 3.6.1 3.0.0 - 1.16.14 + 1.16.16 diff --git a/sponge/pom.xml b/sponge/pom.xml index 42be1d1e8..4a5c25d3a 100644 --- a/sponge/pom.xml +++ b/sponge/pom.xml @@ -5,7 +5,7 @@ luckperms me.lucko.luckperms - 3.0-SNAPSHOT + 3.1-SNAPSHOT 4.0.0 diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java index a8ae19cff..47ebca32a 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/LuckPermsSubjectData.java @@ -29,12 +29,12 @@ import lombok.NonNull; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import me.lucko.luckperms.api.DataMutateResult; import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.common.caching.MetaAccumulator; -import me.lucko.luckperms.common.core.DataMutateResult; import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.model.Group; import me.lucko.luckperms.common.core.model.PermissionHolder;