API changes for 3.1

This commit is contained in:
Luck 2017-04-10 22:26:20 +01:00
parent 4631dcf857
commit 4fb07ff181
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
52 changed files with 392 additions and 298 deletions

View File

@ -5,12 +5,13 @@
<parent> <parent>
<artifactId>luckperms</artifactId> <artifactId>luckperms</artifactId>
<groupId>me.lucko.luckperms</groupId> <groupId>me.lucko.luckperms</groupId>
<version>3.0-SNAPSHOT</version> <version>3.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>luckperms-api</artifactId> <artifactId>luckperms-api</artifactId>
<build> <build>
<finalName>LuckPerms-API-${release.version}</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

View File

@ -29,8 +29,8 @@ import java.util.Optional;
/** /**
* Singleton for the {@link LuckPermsApi}. * Singleton for the {@link LuckPermsApi}.
* *
* <p> Ideally, the ServiceManager for the platform should be used to obtain and cache an instance, however, this can be * <p>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. * used if you need static access.</p>
*/ */
public final class LuckPerms { public final class LuckPerms {
private static LuckPermsApi api = null; private static LuckPermsApi api = null;

View File

@ -27,7 +27,7 @@ import me.lucko.luckperms.api.context.ContextSet;
/** /**
* Context and options for a permission lookup. * Context and options for a permission lookup.
* *
* <p> All values are immutable. * <p>All values are immutable.</p>
* *
* @since 2.11 * @since 2.11
*/ */

View File

@ -20,16 +20,13 @@
* SOFTWARE. * SOFTWARE.
*/ */
package me.lucko.luckperms.common.core; package me.lucko.luckperms.api;
import lombok.AllArgsConstructor;
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException; import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
import me.lucko.luckperms.exceptions.ObjectLacksException; import me.lucko.luckperms.exceptions.ObjectLacksException;
import java.util.function.Supplier; import java.util.function.Supplier;
@AllArgsConstructor
public enum DataMutateResult { public enum DataMutateResult {
SUCCESS(true, null), SUCCESS(true, null),
@ -37,9 +34,14 @@ public enum DataMutateResult {
LACKS(false, ObjectLacksException::new), LACKS(false, ObjectLacksException::new),
FAIL(false, RuntimeException::new); FAIL(false, RuntimeException::new);
private boolean bool; private boolean value;
private final Supplier<? extends Exception> exceptionSupplier; private final Supplier<? extends Exception> exceptionSupplier;
DataMutateResult(boolean value, Supplier<? extends Exception> exceptionSupplier) {
this.value = value;
this.exceptionSupplier = exceptionSupplier;
}
public void throwException() { public void throwException() {
if (exceptionSupplier != null) { if (exceptionSupplier != null) {
sneakyThrow(exceptionSupplier.get()); sneakyThrow(exceptionSupplier.get());
@ -47,7 +49,7 @@ public enum DataMutateResult {
} }
public boolean asBoolean() { public boolean asBoolean() {
return bool; return value;
} }
// allows us to throw checked exceptions without declaring it, as #throwException throws a number of // allows us to throw checked exceptions without declaring it, as #throwException throws a number of

View File

@ -82,7 +82,9 @@ public interface Group extends PermissionHolder {
* @throws ObjectAlreadyHasException if the group already inherits the group * @throws ObjectAlreadyHasException if the group already inherits the group
* @throws NullPointerException if the group is null * @throws NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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; 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 NullPointerException if the group or server is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @throws IllegalArgumentException if the server is invalid * @throws IllegalArgumentException if the server is invalid
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
*/ */
@Deprecated
void setInheritGroup(Group group, String server) throws ObjectAlreadyHasException; 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 NullPointerException if the group, server or world is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @throws IllegalArgumentException if the server or world is invalid * @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; 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 NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @throws IllegalArgumentException if the expiry time is in the past * @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; 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 NullPointerException if the group or server is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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 * @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; 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 NullPointerException if the group, server or world is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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 * @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; 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 ObjectLacksException if the group does not already inherit the group
* @throws NullPointerException if the group is null * @throws NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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; 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 ObjectLacksException if the group does not already inherit the group
* @throws NullPointerException if the group is null * @throws NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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; 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 NullPointerException if the group or server is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @throws IllegalArgumentException if the server is invalid * @throws IllegalArgumentException if the server is invalid
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
*/ */
@Deprecated
void unsetInheritGroup(Group group, String server) throws ObjectLacksException; 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 NullPointerException if the group, server or world is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @throws IllegalArgumentException if the server or world is invalid * @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; 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 NullPointerException if the group or server is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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 * @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; 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 NullPointerException if the group, server or world is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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 * @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; void unsetInheritGroup(Group group, String server, String world, boolean temporary) throws ObjectLacksException;
/** /**

View File

@ -29,8 +29,8 @@ import java.util.UUID;
/** /**
* Represents the internal LuckPerms log. * Represents the internal LuckPerms log.
* *
* <p> The returned instance provides a copy of the data at the time of retrieval. Any changes made to log entries will * <p>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. * only apply to this instance of the log. You can add to the log using the {@link Storage}, and then request an updated copy.</p>
*/ */
public interface Log { public interface Log {

View File

@ -27,7 +27,7 @@ import java.util.UUID;
/** /**
* A single entry in the log * A single entry in the log
* *
* <p> Implements {@link Comparable} ordering based upon the timestamp of the entry. * <p>Implements {@link Comparable} ordering based upon the timestamp of the entry.</p>
*/ */
public class LogEntry implements Comparable<LogEntry> { public class LogEntry implements Comparable<LogEntry> {
private static final String FORMAT = "&8(&e%s&8) [&a%s&8] (&b%s&8) &7--> &f%s"; private static final String FORMAT = "&8(&e%s&8) [&a%s&8] (&b%s&8) &7--> &f%s";

View File

@ -25,8 +25,8 @@ package me.lucko.luckperms.api;
/** /**
* A wrapper interface for platform logger instances * A wrapper interface for platform logger instances
* *
* <p> Bukkit/Bungee both use java.util.logging, and Sponge uses org.slf4j. This class wraps those classes so the * <p>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. * commons module can access a logger.</p>
*/ */
public interface Logger { public interface Logger {

View File

@ -113,7 +113,9 @@ public interface LuckPermsApi {
User getUser(UUID uuid); 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.
*
* <p>This method does not return null, unlike {@link #getUser(UUID)}</p>
* *
* @param uuid the uuid of the user to get * @param uuid the uuid of the user to get
* @return an optional {@link User} object * @return an optional {@link User} object
@ -131,8 +133,9 @@ public interface LuckPermsApi {
User getUser(String name); User getUser(String name);
/** /**
* Gets a wrapped user object from the user storage. This method does not return null, unlike {@link * Gets a wrapped user object from the user storage.
* #getUser(String)} *
* <p>This method does not return null, unlike {@link #getUser(String)}</p>
* *
* @param name the username of the user to get * @param name the username of the user to get
* @return an optional {@link User} object * @return an optional {@link User} object
@ -175,7 +178,9 @@ public interface LuckPermsApi {
Group getGroup(String name); 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.
*
* <p>This method does not return null, unlike {@link #getGroup}</p>
* *
* @param name the name of the group to get * @param name the name of the group to get
* @return an optional {@link Group} object * @return an optional {@link Group} object
@ -209,7 +214,9 @@ public interface LuckPermsApi {
Track getTrack(String name); 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.
*
* <p>This method does not return null, unlike {@link #getTrack}</p>
* *
* @param name the name of the track to get * @param name the name of the track to get
* @return an optional {@link Track} object * @return an optional {@link Track} object

View File

@ -32,8 +32,8 @@ public interface MessagingService {
/** /**
* Uses the messaging service to inform other servers about changes. * Uses the messaging service to inform other servers about changes.
* *
* <p> This will push the update asynchronously, and this method will return immediately. Calling this method is * <p>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. * equivalent to running "/lp networksync", except will not sync this server.</p>
*/ */
void pushUpdate(); void pushUpdate();

View File

@ -34,7 +34,9 @@ import java.util.Set;
* A collection of utilities to help retrieve meta values for {@link PermissionHolder}s * A collection of utilities to help retrieve meta values for {@link PermissionHolder}s
* *
* @since 2.7 * @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 { public class MetaUtils {
private static String escapeDelimiters(String s, String... delims) { 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 holder the holder to apply the meta node to
* @param server the server to apply the meta on, can be null * @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 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 * @param value the meta value
* @throws NullPointerException if the holder, node or value is null * @throws NullPointerException if the holder, node or value is null
* @throws IllegalArgumentException if the node or value is empty * @throws IllegalArgumentException if the node or value is empty
*/ */
public static void setMeta(PermissionHolder holder, String server, String world, String node, String value) { public static void setMeta(PermissionHolder holder, String server, String world, String key, String value) {
if (holder == null) { if (holder == null) throw new NullPointerException("holder");
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) { key = escapeCharacters(key);
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);
value = escapeCharacters(value); value = escapeCharacters(value);
Set<Node> toRemove = new HashSet<>(); Set<Node> toRemove = new HashSet<>();
for (Node n : holder.getEnduringPermissions()) { for (Node n : holder.getEnduringPermissions()) {
if (n.isMeta() && n.getMeta().getKey().equals(node)) { if (n.isMeta() && n.getMeta().getKey().equals(key)) {
toRemove.add(n); toRemove.add(n);
} }
} }
@ -138,12 +122,12 @@ public class MetaUtils {
} catch (ObjectLacksException ignored) {} } catch (ObjectLacksException ignored) {}
} }
Node.Builder metaNode = LuckPerms.getApi().buildNode("meta." + node + "." + value).setValue(true); Node.Builder metaNode = LuckPerms.getApi().buildNode("meta." + key + "." + value).setValue(true);
if (!server.equalsIgnoreCase("global")) { if (server != null) {
metaNode.setServer(server); metaNode.setServer(server);
} }
if (world != null && !world.equals("")) { if (world != null) {
metaNode.setServer(server).setWorld(world); metaNode.setWorld(world);
} }
try { try {
@ -165,18 +149,8 @@ public class MetaUtils {
* @throws IllegalArgumentException if the node is empty * @throws IllegalArgumentException if the node is empty
*/ */
public static String getMeta(PermissionHolder holder, String server, String world, String node, String defaultValue, boolean includeGlobal) { public static String getMeta(PermissionHolder holder, String server, String world, String node, String defaultValue, boolean includeGlobal) {
if (holder == null) { if (holder == null) throw new NullPointerException("holder");
throw new NullPointerException("holder"); if (node == null) throw new NullPointerException("node");
}
if (server == null || server.equals("")) {
server = "global";
}
if (node == null) {
throw new NullPointerException("node");
}
if (node.equals("")) { if (node.equals("")) {
throw new IllegalArgumentException("node is empty"); throw new IllegalArgumentException("node is empty");
} }
@ -184,23 +158,10 @@ public class MetaUtils {
node = escapeCharacters(node); node = escapeCharacters(node);
for (Node n : holder.getPermissions()) { for (Node n : holder.getPermissions()) {
if (!n.getValue()) { if (!n.getValue() || !n.isMeta()) continue;
continue;
}
if (!n.isMeta()) { if (!n.shouldApplyOnServer(server, includeGlobal, false)) continue;
continue; if (!n.shouldApplyOnWorld(world, includeGlobal, false)) continue;
}
if (!server.equalsIgnoreCase("global")) {
if (!n.shouldApplyOnServer(server, includeGlobal, false)) {
continue;
}
}
if (!n.shouldApplyOnWorld(world, includeGlobal, false)) {
continue;
}
Map.Entry<String, String> meta = n.getMeta(); Map.Entry<String, String> meta = n.getMeta();
if (meta.getKey().equalsIgnoreCase(node)) { 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) { private static void setChatMeta(boolean prefix, PermissionHolder holder, String value, int priority, String server, String world) {
if (holder == null) { if (holder == null) throw new NullPointerException("holder");
throw new NullPointerException("holder");
}
if (value == null || value.equals("")) { if (value == null || value.equals("")) {
throw new IllegalArgumentException("value is null/empty"); throw new IllegalArgumentException("value is null/empty");
} }
Node.Builder node = LuckPerms.getApi().buildNode(prefix ? "prefix" : "suffix" + "." + priority + "." + escapeCharacters(value)); Node.Builder node = LuckPerms.getApi().buildNode(prefix ? "prefix" : "suffix" + "." + priority + "." + escapeCharacters(value));
node.setValue(true); node.setValue(true);
if (!server.equalsIgnoreCase("global")) { if (server != null) {
node.setServer(server); node.setServer(server);
} }
if (world != null && !world.equals("")) { if (world != null) {
node.setServer(server).setWorld(world); node.setWorld(world);
} }
try { try {
@ -268,26 +226,14 @@ public class MetaUtils {
if (holder == null) { if (holder == null) {
throw new NullPointerException("holder"); throw new NullPointerException("holder");
} }
if (server == null) {
server = "global";
}
int priority = Integer.MIN_VALUE; int priority = Integer.MIN_VALUE;
String meta = null; String meta = null;
for (Node n : holder.getAllNodes(Contexts.allowAll())) { for (Node n : holder.getAllNodes(Contexts.allowAll())) {
if (!n.getValue()) { if (!n.getValue()) continue;
continue;
}
if (!server.equalsIgnoreCase("global")) { if (!n.shouldApplyOnServer(server, includeGlobal, false)) continue;
if (!n.shouldApplyOnServer(server, includeGlobal, false)) { if (!n.shouldApplyOnWorld(world, includeGlobal, false)) continue;
continue;
}
}
if (!n.shouldApplyOnWorld(world, includeGlobal, false)) {
continue;
}
if (prefix ? !n.isPrefix() : !n.isSuffix()) { if (prefix ? !n.isPrefix() : !n.isSuffix()) {
continue; continue;

View File

@ -33,7 +33,7 @@ import java.util.Set;
/** /**
* An immutable permission node * An immutable permission node
* *
* <p> Use {@link LuckPermsApi#buildNode(String)} to get an instance. * <p>Use {@link LuckPermsApi#buildNode(String)} to get an instance.</p>
* *
* @since 2.6 * @since 2.6
*/ */

View File

@ -33,7 +33,7 @@ public interface NodeFactory {
* Creates a node from a serialised node string * Creates a node from a serialised node string
* *
* @param serialisedPermission the serialised permission 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 * @return a node instance
* @throws NullPointerException if the permission is null * @throws NullPointerException if the permission is null
*/ */
@ -60,18 +60,30 @@ public interface NodeFactory {
/** /**
* Creates a node builder from a serialised node string * Creates a node builder from a serialised node string
*
* @param serialisedPermission the serialised permission 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 * @return a node builder instance
* @throws NullPointerException if the permission is null * @throws NullPointerException if the permission is null
*/ */
Node.Builder newBuilderFromSerialisedNode(String serialisedPermission, boolean value); 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 * Creates a node builder from a key value pair
* *
* @param key the key * @param key the key
* @param value the value * @param value the value
* @return a node builder instance * @return a node builder instance
* @throws NullPointerException if the key or value is null * @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 * Creates a node builder from a prefix string and priority
* *
* @param priority the priority * @param priority the priority
* @param prefix the prefix string * @param prefix the prefix string
* @return a node builder instance * @return a node builder instance
* @throws NullPointerException if the prefix is null * @throws NullPointerException if the prefix is null
*/ */
@ -92,7 +104,7 @@ public interface NodeFactory {
* Creates a node builder from a prefix string and priority * Creates a node builder from a prefix string and priority
* *
* @param priority the priority * @param priority the priority
* @param suffix the suffix string * @param suffix the suffix string
* @return a node builder instance * @return a node builder instance
* @throws NullPointerException if the suffix is null * @throws NullPointerException if the suffix is null
*/ */

View File

@ -32,15 +32,15 @@ import java.util.SortedSet;
/** /**
* An object capable of holding permissions * An object capable of holding permissions
* *
* <p> Any changes made will be lost unless the instance is saved back to the {@link Storage}. * <p>Any changes made will be lost unless the instance is saved back to the {@link Storage}.</p>
*/ */
public interface PermissionHolder { public interface PermissionHolder {
/** /**
* Gets the objects name * Gets the objects name
* *
* <p> {@link User#getUuid()}, {@link User#getName()} or {@link Group#getName()} should normally be used instead of * <p>{@link User#getUuid()}, {@link User#getName()} or {@link Group#getName()} should normally be used instead of
* this method. * this method.</p>
* *
* @return the identifier for this object. Either a uuid string or name. * @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 * 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. * <p>Unlike {@link #getAllNodesFiltered(Contexts)}, this method will not filter individual nodes. The context is only
* Nodes are sorted into priority order. * used to determine which groups should apply.</p>
*
* <p>Nodes are sorted into priority order.</p>
* *
* @param contexts the context for the lookup, * @param contexts the context for the lookup,
* @return a mutable sorted set of permissions * @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. * 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. * <p>Unlike {@link #getAllNodes(Contexts)}, this method WILL filter individual nodes, and only return ones that fully
* meet the context provided.</p>
* *
* @param contexts the context for the lookup * @param contexts the context for the lookup
* @return a mutable set of permissions * @return a mutable set of permissions
@ -99,6 +102,7 @@ public interface PermissionHolder {
/** /**
* Converts the output of {@link #getAllNodesFiltered(Contexts)}, and expands shorthand permissions. * Converts the output of {@link #getAllNodesFiltered(Contexts)}, and expands shorthand permissions.
*
* @param contexts the context for the lookup * @param contexts the context for the lookup
* @param lowerCase if the keys should be made lowercase whilst being exported * @param lowerCase if the keys should be made lowercase whilst being exported
* @return a mutable map of permissions * @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); 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 * @param node the node to check for
* @return a Tristate for the holders inheritance status for the node * @return a Tristate for the holders inheritance status for the node
@ -300,17 +304,27 @@ public interface PermissionHolder {
*/ */
void setPermission(Node node) throws ObjectAlreadyHasException; 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 * Sets a transient permission for the object
* *
* <p> A transient node is a permission that does not persist. * <p>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. * 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.</p>
* *
* <p> This is useful if you want to temporarily set a permission for a user while they're online, but don't * <p>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. * want it to persist, and have to worry about removing it when they log out.</p>
* *
* <p> For unsetting a transient permission, see {@link #unsetTransientPermission(Node)} * <p>For unsetting a transient permission, see {@link #unsetTransientPermission(Node)}</p>
* *
* @param node The node to be set * @param node The node to be set
* @throws ObjectAlreadyHasException if the object already has the permission * @throws ObjectAlreadyHasException if the object already has the permission
@ -319,6 +333,25 @@ public interface PermissionHolder {
*/ */
void setTransientPermission(Node node) throws ObjectAlreadyHasException; void setTransientPermission(Node node) throws ObjectAlreadyHasException;
/**
* Sets a transient permission for the object
*
* <p>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.</p>
*
* <p>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.</p>
*
* <p>For unsetting a transient permission, see {@link #unsetTransientPermission(Node)}</p>
*
* @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 * Sets a permission for the object
* *
@ -416,6 +449,16 @@ public interface PermissionHolder {
*/ */
void unsetPermission(Node node) throws ObjectLacksException; 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 * Unsets a transient permission for the object
* *
@ -426,6 +469,16 @@ public interface PermissionHolder {
*/ */
void unsetTransientPermission(Node node) throws ObjectLacksException; 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 * Unsets a permission for the object
* *

View File

@ -34,11 +34,11 @@ import java.util.function.Consumer;
* *
* <p>All methods return {@link CompletableFuture}s, which will be populated with the result once the data has been * <p>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 * loaded asynchronously. Care should be taken when using the methods to ensure that the main server thread is not
* blocked. * blocked.</p>
* *
* <p>Methods such as {@link CompletableFuture#get()} and equivalent should <strong>not</strong> be called on the main * <p>Methods such as {@link CompletableFuture#get()} and equivalent should <strong>not</strong> 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 * 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()}.</p>
* *
* @since 2.14 * @since 2.14
*/ */

View File

@ -41,7 +41,7 @@ public interface Track {
/** /**
* Gets an ordered list of the groups on this track * Gets an ordered list of the groups on this track
* *
* <p> Index 0 is the first/lowest group in (or start of) the track * <p>Index 0 is the first/lowest group in (or start of) the track</p>
* *
* @return an ordered {@link List} of the groups on this track * @return an ordered {@link List} of the groups on this track
*/ */

View File

@ -25,8 +25,8 @@ package me.lucko.luckperms.api;
/** /**
* Represents a permission setting. * Represents a permission setting.
* *
* <p> Consider a value of {@link #FALSE} to be a "negated" setting, and a value of {@link #UNDEFINED} to be a * <p>Consider a value of {@link #FALSE} to be a "negated" setting, and a value of {@link #UNDEFINED} to be a
* non-existent value. * non-existent value.</p>
*/ */
public enum Tristate { public enum Tristate {
@ -63,7 +63,8 @@ public enum Tristate {
/** /**
* Returns the value of the Tristate as a boolean. * Returns the value of the Tristate as a boolean.
* <p> A value of {@link #UNDEFINED} converts to false. *
* <p>A value of {@link #UNDEFINED} converts to false.</p>
* *
* @return a boolean representation of the Tristate. * @return a boolean representation of the Tristate.
*/ */

View File

@ -69,8 +69,8 @@ public interface User extends PermissionHolder {
/** /**
* Refresh and re-assign the users permissions. * Refresh and re-assign the users permissions.
* *
* <p> This request is not buffered, and the refresh call will be ran directly. This should ideally be called on * <p>This request is not buffered, and the refresh call will be ran directly. This should ideally be called on
* an asynchronous thread. * an asynchronous thread.</p>
*/ */
void refreshPermissions(); void refreshPermissions();
@ -128,7 +128,9 @@ public interface User extends PermissionHolder {
* @throws ObjectAlreadyHasException if the user is already a member of the group * @throws ObjectAlreadyHasException if the user is already a member of the group
* @throws NullPointerException if the group is null * @throws NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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; 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 NullPointerException if the group or server is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @throws IllegalArgumentException if the server is invalid * @throws IllegalArgumentException if the server is invalid
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
*/ */
@Deprecated
void addGroup(Group group, String server) throws ObjectAlreadyHasException; 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 NullPointerException if the group, server or world is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @throws IllegalArgumentException if the server or world is invalid * @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; 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 NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @throws IllegalArgumentException if the expiry time is in the past * @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; 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 NullPointerException if the group or server is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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 * @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; 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 NullPointerException if the group, server or world is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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 * @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; 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 ObjectLacksException if the user isn't a member of the group
* @throws NullPointerException if the group is null * @throws NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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; 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 ObjectLacksException if the user isn't a member of the group
* @throws NullPointerException if the group is null * @throws NullPointerException if the group is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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; 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 NullPointerException if the group or server is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @throws IllegalArgumentException if the server is invalid * @throws IllegalArgumentException if the server is invalid
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
*/ */
@Deprecated
void removeGroup(Group group, String server) throws ObjectLacksException; 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 NullPointerException if the group, server or world is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @throws IllegalStateException if the group instance was not obtained from LuckPerms.
* @throws IllegalArgumentException if the server or world is invalid * @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; 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 NullPointerException if the group or server is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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 * @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; 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 NullPointerException if the group, server or world is null
* @throws IllegalStateException if the group instance was not obtained from LuckPerms. * @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 * @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; void removeGroup(Group group, String server, String world, boolean temporary) throws ObjectLacksException;
/** /**

View File

@ -27,15 +27,15 @@ import java.util.UUID;
/** /**
* A UUID cache for online users, between external Mojang UUIDs, and internal LuckPerms UUIDs. * A UUID cache for online users, between external Mojang UUIDs, and internal LuckPerms UUIDs.
* *
* <p> This UuidCache is a means of allowing users to have the same internal UUID across a network of offline mode * <p>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 * 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 * 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. * instead check the datastore cache, to get a UUID for a user that is consistent across an entire network.
* *
* <p> 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 * <p>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 cache, OR use Storage#getUUID, for users that are not online.
* *
* <p> THIS IS ONLY EFFECTIVE FOR ONLINE PLAYERS. USE THE DATASTORE METHODS FOR OFFLINE PLAYERS. * <p><strong>This is only effective for online players. Use {@link Storage#getUUID(String)} for offline players.</strong></p>
*/ */
public interface UuidCache { public interface UuidCache {

View File

@ -45,7 +45,7 @@ public interface PermissionData {
/** /**
* Invalidates the underlying permission calculator cache. * Invalidates the underlying permission calculator cache.
* *
* <p> Can be called to allow for an update in defaults. * <p>Can be called to allow for an update in defaults.</p>
*/ */
void invalidateCache(); void invalidateCache();

View File

@ -30,7 +30,7 @@ import java.util.Set;
* Holds cached permission and meta lookup data for a {@link me.lucko.luckperms.api.User}. * Holds cached permission and meta lookup data for a {@link me.lucko.luckperms.api.User}.
* *
* <p>Data is only likely to be available for online users. All calls will account for inheritance, as well as any * <p>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.</p>
* *
* @since 2.13 * @since 2.13
*/ */
@ -39,7 +39,7 @@ public interface UserData {
/** /**
* Gets PermissionData from the cache, given a specified context. * Gets PermissionData from the cache, given a specified context.
* *
* <p> If the data is not cached, it is calculated. Therefore, this call could be costly. * <p>If the data is not cached, it is calculated. Therefore, this call could be costly.</p>
* *
* @param contexts the contexts to get the permission data in * @param contexts the contexts to get the permission data in
* @return a permission data instance * @return a permission data instance
@ -50,7 +50,7 @@ public interface UserData {
/** /**
* Gets MetaData from the cache, given a specified context. * Gets MetaData from the cache, given a specified context.
* *
* <p> If the data is not cached, it is calculated. Therefore, this call could be costly. * <p>If the data is not cached, it is calculated. Therefore, this call could be costly.</p>
* *
* @param contexts the contexts to get the permission data in * @param contexts the contexts to get the permission data in
* @return a meta data instance * @return a meta data instance
@ -79,8 +79,8 @@ public interface UserData {
/** /**
* Calculates permission data and stores it in the cache. * Calculates permission data and stores it in the cache.
* *
* <p> If there is already data cached for the given contexts, and if the resultant output is different, * <p>If there is already data cached for the given contexts, and if the resultant output is different,
* the cached value is updated. * the cached value is updated.</p>
* *
* @param contexts the contexts to recalculate in. * @param contexts the contexts to recalculate in.
* @throws NullPointerException if contexts is null * @throws NullPointerException if contexts is null
@ -90,8 +90,8 @@ public interface UserData {
/** /**
* Calculates meta data and stores it in the cache. * Calculates meta data and stores it in the cache.
* *
* <p> If there is already data cached for the given contexts, and if the resultant output is different, * <p>If there is already data cached for the given contexts, and if the resultant output is different,
* the cached value is updated. * the cached value is updated.</p>
* *
* @param contexts the contexts to recalculate in. * @param contexts the contexts to recalculate in.
* @throws NullPointerException if contexts is null * @throws NullPointerException if contexts is null
@ -119,7 +119,7 @@ public interface UserData {
/** /**
* Ensures that PermissionData and MetaData is cached for a context. * Ensures that PermissionData and MetaData is cached for a context.
* *
* <p> If the cache does not contain any data for the context, it will be calculated and saved. * <p>If the cache does not contain any data for the context, it will be calculated and saved.</p>
* *
* @param contexts the contexts to pre-calculate for * @param contexts the contexts to pre-calculate for
* @throws NullPointerException if contexts is null * @throws NullPointerException if contexts is null
@ -128,7 +128,8 @@ public interface UserData {
/** /**
* Invalidates all of the underlying Permission calculators. * Invalidates all of the underlying Permission calculators.
* Can be called to allow for an update in defaults. *
* <p>Can be called to allow for an update in defaults.</p>
*/ */
void invalidatePermissionCalculators(); void invalidatePermissionCalculators();

View File

@ -25,9 +25,8 @@ package me.lucko.luckperms.api.context;
/** /**
* Calculates whether contexts are applicable to {@link T} * Calculates whether contexts are applicable to {@link T}
* *
* <p>Somewhat inspired by the system used on Sponge.
*
* @param <T> the subject type. Is ALWAYS the player class of the platform. * @param <T> the subject type. Is ALWAYS the player class of the platform.
* @since 2.13
*/ */
public interface ContextCalculator<T> { public interface ContextCalculator<T> {

View File

@ -29,8 +29,9 @@ import java.util.Optional;
import java.util.Set; import java.util.Set;
/** /**
* Holds contexts. * Holder of contexts.
* Implementations may be either mutable or immutable. *
* <p>Implementations may be either mutable or immutable.</p>
* *
* @since 2.13 * @since 2.13
*/ */

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>luckperms</artifactId> <artifactId>luckperms</artifactId>
<groupId>me.lucko.luckperms</groupId> <groupId>me.lucko.luckperms</groupId>
<version>3.0-SNAPSHOT</version> <version>3.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>luckperms</artifactId> <artifactId>luckperms</artifactId>
<groupId>me.lucko.luckperms</groupId> <groupId>me.lucko.luckperms</groupId>
<version>3.0-SNAPSHOT</version> <version>3.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -26,6 +26,7 @@ import lombok.Getter;
import lombok.NonNull; import lombok.NonNull;
import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Contexts;
import me.lucko.luckperms.api.DataMutateResult;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.Tristate;
import me.lucko.luckperms.api.caching.PermissionData; 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.api.context.ImmutableContextSet;
import me.lucko.luckperms.bukkit.LPBukkitPlugin; import me.lucko.luckperms.bukkit.LPBukkitPlugin;
import me.lucko.luckperms.common.config.ConfigKeys; 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.NodeFactory;
import me.lucko.luckperms.common.core.model.Group; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>luckperms</artifactId> <artifactId>luckperms</artifactId>
<groupId>me.lucko.luckperms</groupId> <groupId>me.lucko.luckperms</groupId>
<version>3.0-SNAPSHOT</version> <version>3.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>luckperms</artifactId> <artifactId>luckperms</artifactId>
<groupId>me.lucko.luckperms</groupId> <groupId>me.lucko.luckperms</groupId>
<version>3.0-SNAPSHOT</version> <version>3.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -13,6 +13,7 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<build> <build>
<finalName>LuckPerms-Common-${release.version}.${patch.version}</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

View File

@ -79,7 +79,7 @@ public class ApiProvider implements LuckPermsApi {
@Override @Override
public double getApiVersion() { public double getApiVersion() {
return 3.0; return 3.1;
} }
@Override @Override

View File

@ -36,105 +36,105 @@ import java.util.Map;
*/ */
@AllArgsConstructor @AllArgsConstructor
public class LPConfigurationDelegate implements LPConfiguration { public class LPConfigurationDelegate implements LPConfiguration {
private final LuckPermsConfiguration master; private final LuckPermsConfiguration handle;
@Override @Override
public String getServer() { public String getServer() {
return master.get(ConfigKeys.SERVER); return handle.get(ConfigKeys.SERVER);
} }
@Override @Override
public int getSyncTime() { public int getSyncTime() {
return master.get(ConfigKeys.SYNC_TIME); return handle.get(ConfigKeys.SYNC_TIME);
} }
@Override @Override
public boolean getIncludeGlobalPerms() { public boolean getIncludeGlobalPerms() {
return master.get(ConfigKeys.INCLUDING_GLOBAL_PERMS); return handle.get(ConfigKeys.INCLUDING_GLOBAL_PERMS);
} }
@Override @Override
public boolean getIncludeGlobalWorldPerms() { public boolean getIncludeGlobalWorldPerms() {
return master.get(ConfigKeys.INCLUDING_GLOBAL_WORLD_PERMS); return handle.get(ConfigKeys.INCLUDING_GLOBAL_WORLD_PERMS);
} }
@Override @Override
public boolean getApplyGlobalGroups() { public boolean getApplyGlobalGroups() {
return master.get(ConfigKeys.APPLYING_GLOBAL_GROUPS); return handle.get(ConfigKeys.APPLYING_GLOBAL_GROUPS);
} }
@Override @Override
public boolean getApplyGlobalWorldGroups() { public boolean getApplyGlobalWorldGroups() {
return master.get(ConfigKeys.APPLYING_GLOBAL_WORLD_GROUPS); return handle.get(ConfigKeys.APPLYING_GLOBAL_WORLD_GROUPS);
} }
@Override @Override
public boolean getOnlineMode() { public boolean getOnlineMode() {
return master.get(ConfigKeys.USE_SERVER_UUIDS); return handle.get(ConfigKeys.USE_SERVER_UUIDS);
} }
@Override @Override
public boolean getApplyWildcards() { public boolean getApplyWildcards() {
return master.get(ConfigKeys.APPLYING_WILDCARDS); return handle.get(ConfigKeys.APPLYING_WILDCARDS);
} }
@Override @Override
public boolean getApplyRegex() { public boolean getApplyRegex() {
return master.get(ConfigKeys.APPLYING_REGEX); return handle.get(ConfigKeys.APPLYING_REGEX);
} }
@Override @Override
public boolean getApplyShorthand() { public boolean getApplyShorthand() {
return master.get(ConfigKeys.APPLYING_SHORTHAND); return handle.get(ConfigKeys.APPLYING_SHORTHAND);
} }
@Override @Override
public boolean getLogNotify() { public boolean getLogNotify() {
return master.get(ConfigKeys.LOG_NOTIFY); return handle.get(ConfigKeys.LOG_NOTIFY);
} }
@Override @Override
public boolean getEnableOps() { public boolean getEnableOps() {
return master.get(ConfigKeys.OPS_ENABLED); return handle.get(ConfigKeys.OPS_ENABLED);
} }
@Override @Override
public boolean getCommandsAllowOp() { public boolean getCommandsAllowOp() {
return master.get(ConfigKeys.COMMANDS_ALLOW_OP); return handle.get(ConfigKeys.COMMANDS_ALLOW_OP);
} }
@Override @Override
public boolean getAutoOp() { public boolean getAutoOp() {
return master.get(ConfigKeys.AUTO_OP); return handle.get(ConfigKeys.AUTO_OP);
} }
@Override @Override
public String getVaultServer() { public String getVaultServer() {
return master.get(ConfigKeys.VAULT_SERVER); return handle.get(ConfigKeys.VAULT_SERVER);
} }
@Override @Override
public boolean getVaultIncludeGlobal() { public boolean getVaultIncludeGlobal() {
return master.get(ConfigKeys.VAULT_INCLUDING_GLOBAL); return handle.get(ConfigKeys.VAULT_INCLUDING_GLOBAL);
} }
@Override @Override
public DatastoreConfiguration getDatastoreConfig() { public DatastoreConfiguration getDatastoreConfig() {
return master.get(ConfigKeys.DATABASE_VALUES); return handle.get(ConfigKeys.DATABASE_VALUES);
} }
@Override @Override
public String getStorageMethod() { public String getStorageMethod() {
return master.get(ConfigKeys.STORAGE_METHOD); return handle.get(ConfigKeys.STORAGE_METHOD);
} }
@Override @Override
public boolean getSplitStorage() { public boolean getSplitStorage() {
return master.get(ConfigKeys.SPLIT_STORAGE); return handle.get(ConfigKeys.SPLIT_STORAGE);
} }
@Override @Override
public Map<String, String> getSplitStorageOptions() { public Map<String, String> getSplitStorageOptions() {
return master.get(ConfigKeys.SPLIT_STORAGE_OPTIONS); return handle.get(ConfigKeys.SPLIT_STORAGE_OPTIONS);
} }
} }

View File

@ -39,100 +39,100 @@ import static me.lucko.luckperms.common.api.ApiUtils.checkName;
*/ */
@AllArgsConstructor @AllArgsConstructor
public class LogDelegate implements Log { public class LogDelegate implements Log {
private final me.lucko.luckperms.common.data.Log master; private final me.lucko.luckperms.common.data.Log handle;
@Override @Override
public SortedSet<LogEntry> getContent() { public SortedSet<LogEntry> getContent() {
return master.getContent(); return handle.getContent();
} }
@Override @Override
public SortedSet<LogEntry> getRecent() { public SortedSet<LogEntry> getRecent() {
return master.getRecent(); return handle.getRecent();
} }
@Override @Override
public SortedMap<Integer, LogEntry> getRecent(int pageNo) { public SortedMap<Integer, LogEntry> getRecent(int pageNo) {
return master.getRecent(pageNo); return handle.getRecent(pageNo);
} }
@Override @Override
public int getRecentMaxPages() { public int getRecentMaxPages() {
return master.getRecentMaxPages(); return handle.getRecentMaxPages();
} }
@Override @Override
public SortedSet<LogEntry> getRecent(@NonNull UUID actor) { public SortedSet<LogEntry> getRecent(@NonNull UUID actor) {
return master.getRecent(actor); return handle.getRecent(actor);
} }
@Override @Override
public SortedMap<Integer, LogEntry> getRecent(int pageNo, @NonNull UUID actor) { public SortedMap<Integer, LogEntry> getRecent(int pageNo, @NonNull UUID actor) {
return master.getRecent(pageNo, actor); return handle.getRecent(pageNo, actor);
} }
@Override @Override
public int getRecentMaxPages(@NonNull UUID actor) { public int getRecentMaxPages(@NonNull UUID actor) {
return master.getRecentMaxPages(actor); return handle.getRecentMaxPages(actor);
} }
@Override @Override
public SortedSet<LogEntry> getUserHistory(@NonNull UUID uuid) { public SortedSet<LogEntry> getUserHistory(@NonNull UUID uuid) {
return master.getUserHistory(uuid); return handle.getUserHistory(uuid);
} }
@Override @Override
public SortedMap<Integer, LogEntry> getUserHistory(int pageNo, @NonNull UUID uuid) { public SortedMap<Integer, LogEntry> getUserHistory(int pageNo, @NonNull UUID uuid) {
return master.getUserHistory(pageNo, uuid); return handle.getUserHistory(pageNo, uuid);
} }
@Override @Override
public int getUserHistoryMaxPages(@NonNull UUID uuid) { public int getUserHistoryMaxPages(@NonNull UUID uuid) {
return master.getUserHistoryMaxPages(uuid); return handle.getUserHistoryMaxPages(uuid);
} }
@Override @Override
public SortedSet<LogEntry> getGroupHistory(@NonNull String name) { public SortedSet<LogEntry> getGroupHistory(@NonNull String name) {
return master.getGroupHistory(checkName(name)); return handle.getGroupHistory(checkName(name));
} }
@Override @Override
public SortedMap<Integer, LogEntry> getGroupHistory(int pageNo, @NonNull String name) { public SortedMap<Integer, LogEntry> getGroupHistory(int pageNo, @NonNull String name) {
return master.getGroupHistory(pageNo, checkName(name)); return handle.getGroupHistory(pageNo, checkName(name));
} }
@Override @Override
public int getGroupHistoryMaxPages(@NonNull String name) { public int getGroupHistoryMaxPages(@NonNull String name) {
return master.getGroupHistoryMaxPages(checkName(name)); return handle.getGroupHistoryMaxPages(checkName(name));
} }
@Override @Override
public SortedSet<LogEntry> getTrackHistory(@NonNull String name) { public SortedSet<LogEntry> getTrackHistory(@NonNull String name) {
return master.getTrackHistory(checkName(name)); return handle.getTrackHistory(checkName(name));
} }
@Override @Override
public SortedMap<Integer, LogEntry> getTrackHistory(int pageNo, @NonNull String name) { public SortedMap<Integer, LogEntry> getTrackHistory(int pageNo, @NonNull String name) {
return master.getTrackHistory(pageNo, checkName(name)); return handle.getTrackHistory(pageNo, checkName(name));
} }
@Override @Override
public int getTrackHistoryMaxPages(@NonNull String name) { public int getTrackHistoryMaxPages(@NonNull String name) {
return master.getTrackHistoryMaxPages(checkName(name)); return handle.getTrackHistoryMaxPages(checkName(name));
} }
@Override @Override
public SortedSet<LogEntry> getSearch(@NonNull String query) { public SortedSet<LogEntry> getSearch(@NonNull String query) {
return master.getSearch(query); return handle.getSearch(query);
} }
@Override @Override
public SortedMap<Integer, LogEntry> getSearch(int pageNo, @NonNull String query) { public SortedMap<Integer, LogEntry> getSearch(int pageNo, @NonNull String query) {
return master.getSearch(pageNo, query); return handle.getSearch(pageNo, query);
} }
@Override @Override
public int getSearchMaxPages(@NonNull String query) { public int getSearchMaxPages(@NonNull String query) {
return master.getSearchMaxPages(query); return handle.getSearchMaxPages(query);
} }
} }

View File

@ -24,6 +24,7 @@ package me.lucko.luckperms.common.api.delegates;
import lombok.NonNull; import lombok.NonNull;
import me.lucko.luckperms.api.Group;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.common.core.NodeFactory; 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); return NodeFactory.builderFromSerializedNode(serialisedPermission, value);
} }
@Override
public Node.Builder makeGroupNode(Group group) {
return NodeFactory.newBuilder("group." + GroupDelegate.cast(group).getName());
}
@Override @Override
public Node.Builder makeMetaNode(@NonNull String key, @NonNull String value) { public Node.Builder makeMetaNode(@NonNull String key, @NonNull String value) {
return NodeFactory.makeMetaNode(key, value); return NodeFactory.makeMetaNode(key, value);

View File

@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.ImmutableSortedSet;
import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Contexts;
import me.lucko.luckperms.api.DataMutateResult;
import me.lucko.luckperms.api.LocalizedNode; import me.lucko.luckperms.api.LocalizedNode;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.api.PermissionHolder; import me.lucko.luckperms.api.PermissionHolder;
@ -53,201 +54,221 @@ import static me.lucko.luckperms.common.api.ApiUtils.checkTime;
*/ */
@AllArgsConstructor @AllArgsConstructor
public class PermissionHolderDelegate implements PermissionHolder { 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 @Override
public String getObjectName() { public String getObjectName() {
return master.getObjectName(); return handle.getObjectName();
} }
@Override @Override
public SortedSet<? extends Node> getPermissions() { public SortedSet<? extends Node> getPermissions() {
return ImmutableSortedSet.copyOfSorted(master.mergePermissionsToSortedSet()); return ImmutableSortedSet.copyOfSorted(handle.mergePermissionsToSortedSet());
} }
@Override @Override
public Set<Node> getEnduringPermissions() { public Set<Node> getEnduringPermissions() {
return ImmutableSet.copyOf(master.getNodes().values()); return ImmutableSet.copyOf(handle.getNodes().values());
} }
@Override @Override
public Set<Node> getTransientPermissions() { public Set<Node> getTransientPermissions() {
return ImmutableSet.copyOf(master.getTransientNodes().values()); return ImmutableSet.copyOf(handle.getTransientNodes().values());
} }
@Override @Override
public SortedSet<LocalizedNode> getAllNodes(@NonNull Contexts contexts) { public SortedSet<LocalizedNode> getAllNodes(@NonNull Contexts contexts) {
return new TreeSet<>(master.resolveInheritancesAlmostEqual(ExtractedContexts.generate(contexts))); return new TreeSet<>(handle.resolveInheritancesAlmostEqual(ExtractedContexts.generate(contexts)));
} }
@Override @Override
public Set<LocalizedNode> getAllNodesFiltered(@NonNull Contexts contexts) { public Set<LocalizedNode> getAllNodesFiltered(@NonNull Contexts contexts) {
return new HashSet<>(master.getAllNodes(ExtractedContexts.generate(contexts))); return new HashSet<>(handle.getAllNodes(ExtractedContexts.generate(contexts)));
} }
@Override @Override
public Map<String, Boolean> exportNodes(Contexts contexts, boolean lowerCase) { public Map<String, Boolean> exportNodes(Contexts contexts, boolean lowerCase) {
return new HashMap<>(master.exportNodes(ExtractedContexts.generate(contexts), lowerCase)); return new HashMap<>(handle.exportNodes(ExtractedContexts.generate(contexts), lowerCase));
} }
@Override @Override
public Tristate hasPermission(@NonNull Node node) { public Tristate hasPermission(@NonNull Node node) {
return master.hasPermission(node, false); return handle.hasPermission(node, false);
} }
@Override @Override
public Tristate hasTransientPermission(@NonNull Node node) { public Tristate hasTransientPermission(@NonNull Node node) {
return master.hasPermission(node, true); return handle.hasPermission(node, true);
} }
@Override @Override
public boolean hasPermission(@NonNull String node, @NonNull boolean b) { public boolean hasPermission(@NonNull String node, @NonNull boolean b) {
return master.hasPermission(node, b); return handle.hasPermission(node, b);
} }
@Override @Override
public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server) { 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 @Override
public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world) { 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 @Override
public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull boolean temporary) { 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 @Override
public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull boolean temporary) { 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 @Override
public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world, @NonNull boolean temporary) { 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 @Override
public Tristate inheritsPermission(@NonNull Node node) { public Tristate inheritsPermission(@NonNull Node node) {
return master.inheritsPermission(node); return handle.inheritsPermission(node);
} }
@Override @Override
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b) { public boolean inheritsPermission(@NonNull String node, @NonNull boolean b) {
return master.inheritsPermission(node, b); return handle.inheritsPermission(node, b);
} }
@Override @Override
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server) { 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 @Override
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world) { 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 @Override
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull boolean temporary) { 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 @Override
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull boolean temporary) { 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 @Override
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world, @NonNull boolean temporary) { 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 @Override
public void setPermission(@NonNull Node node) throws ObjectAlreadyHasException { 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 @Override
public void setTransientPermission(@NonNull Node node) throws ObjectAlreadyHasException { 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 @Override
public void setPermission(@NonNull String node, @NonNull boolean value) throws ObjectAlreadyHasException { 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 @Override
public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server) throws ObjectAlreadyHasException { 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 @Override
public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server, @NonNull String world) throws ObjectAlreadyHasException { 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 @Override
public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull long expireAt) throws ObjectAlreadyHasException { 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 @Override
public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server, @NonNull long expireAt) throws ObjectAlreadyHasException { 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 @Override
public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server, @NonNull String world, @NonNull long expireAt) throws ObjectAlreadyHasException { 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 @Override
public void unsetPermission(@NonNull Node node) throws ObjectLacksException { 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 @Override
public void unsetTransientPermission(@NonNull Node node) throws ObjectLacksException { 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 @Override
public void unsetPermission(@NonNull String node, @NonNull boolean temporary) throws ObjectLacksException { 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 @Override
public void unsetPermission(@NonNull String node) throws ObjectLacksException { public void unsetPermission(@NonNull String node) throws ObjectLacksException {
master.unsetPermission(NodeFactory.make(node)).throwException(); handle.unsetPermission(NodeFactory.make(node)).throwException();
} }
@Override @Override
public void unsetPermission(@NonNull String node, @NonNull String server) throws ObjectLacksException { 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 @Override
public void unsetPermission(@NonNull String node, @NonNull String server, @NonNull String world) throws ObjectLacksException { 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 @Override
public void unsetPermission(@NonNull String node, @NonNull String server, @NonNull boolean temporary) throws ObjectLacksException { 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 @Override
public void unsetPermission(@NonNull String node, @NonNull String server, @NonNull String world, @NonNull boolean temporary) throws ObjectLacksException { 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 @Override
public void clearNodes() { public void clearNodes() {
master.clearNodes(); handle.clearNodes();
} }
@Override @Override
@ -257,7 +278,7 @@ public class PermissionHolderDelegate implements PermissionHolder {
set.add("server", server); set.add("server", server);
} }
master.clearNodes(set); handle.clearNodes(set);
} }
@Override @Override
@ -270,12 +291,12 @@ public class PermissionHolderDelegate implements PermissionHolder {
set.add("world", world); set.add("world", world);
} }
master.clearNodes(set); handle.clearNodes(set);
} }
@Override @Override
public void clearParents() { public void clearParents() {
master.clearParents(true); handle.clearParents(true);
} }
@Override @Override
@ -285,7 +306,7 @@ public class PermissionHolderDelegate implements PermissionHolder {
set.add("server", server); set.add("server", server);
} }
master.clearParents(set, true); handle.clearParents(set, true);
} }
@Override @Override
@ -298,12 +319,12 @@ public class PermissionHolderDelegate implements PermissionHolder {
set.add("world", world); set.add("world", world);
} }
master.clearParents(set, true); handle.clearParents(set, true);
} }
@Override @Override
public void clearMeta() { public void clearMeta() {
master.clearMeta(); handle.clearMeta();
} }
@Override @Override
@ -313,7 +334,7 @@ public class PermissionHolderDelegate implements PermissionHolder {
set.add("server", server); set.add("server", server);
} }
master.clearMeta(set); handle.clearMeta(set);
} }
@Override @Override
@ -326,7 +347,7 @@ public class PermissionHolderDelegate implements PermissionHolder {
set.add("world", world); set.add("world", world);
} }
master.clearMeta(set); handle.clearMeta(set);
} }
@Override @Override
@ -339,27 +360,27 @@ public class PermissionHolderDelegate implements PermissionHolder {
set.add("world", world); set.add("world", world);
} }
master.clearMetaKeys(key, set, temporary); handle.clearMetaKeys(key, set, temporary);
} }
@Override @Override
public void clearTransientNodes() { public void clearTransientNodes() {
master.clearTransientNodes(); handle.clearTransientNodes();
} }
@Override @Override
public Set<Node> getTemporaryPermissionNodes() { public Set<Node> getTemporaryPermissionNodes() {
return master.getTemporaryNodes(); return handle.getTemporaryNodes();
} }
@Override @Override
public Set<Node> getPermanentPermissionNodes() { public Set<Node> getPermanentPermissionNodes() {
return master.getPermanentNodes(); return handle.getPermanentNodes();
} }
@Override @Override
public void auditTemporaryPermissions() { public void auditTemporaryPermissions() {
master.auditTemporaryPermissions(); handle.auditTemporaryPermissions();
} }
} }

View File

@ -52,16 +52,16 @@ import static me.lucko.luckperms.common.api.ApiUtils.checkUsername;
@AllArgsConstructor @AllArgsConstructor
public class StorageDelegate implements Storage { public class StorageDelegate implements Storage {
private final LuckPermsPlugin plugin; private final LuckPermsPlugin plugin;
private final me.lucko.luckperms.common.storage.Storage master; private final me.lucko.luckperms.common.storage.Storage handle;
@Override @Override
public String getName() { public String getName() {
return master.getName(); return handle.getName();
} }
@Override @Override
public boolean isAcceptingLogins() { public boolean isAcceptingLogins() {
return master.isAcceptingLogins(); return handle.isAcceptingLogins();
} }
@Override @Override
@ -76,57 +76,57 @@ public class StorageDelegate implements Storage {
@Override @Override
public CompletableFuture<Boolean> logAction(@NonNull LogEntry entry) { public CompletableFuture<Boolean> logAction(@NonNull LogEntry entry) {
return master.force().logAction(entry); return handle.force().logAction(entry);
} }
@Override @Override
public CompletableFuture<Log> getLog() { public CompletableFuture<Log> 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 @Override
public CompletableFuture<Boolean> loadUser(UUID uuid, String username) { public CompletableFuture<Boolean> loadUser(UUID uuid, String username) {
return master.force().loadUser(uuid, checkUsername(username)); return handle.force().loadUser(uuid, checkUsername(username));
} }
@Override @Override
public CompletableFuture<Boolean> saveUser(User user) { public CompletableFuture<Boolean> saveUser(User user) {
return master.force().saveUser(UserDelegate.cast(user)); return handle.force().saveUser(UserDelegate.cast(user));
} }
@Override @Override
public CompletableFuture<Boolean> cleanupUsers() { public CompletableFuture<Boolean> cleanupUsers() {
return master.force().cleanupUsers(); return handle.force().cleanupUsers();
} }
@Override @Override
public CompletableFuture<Set<UUID>> getUniqueUsers() { public CompletableFuture<Set<UUID>> getUniqueUsers() {
return master.force().getUniqueUsers(); return handle.force().getUniqueUsers();
} }
@Override @Override
public CompletableFuture<List<HeldPermission<UUID>>> getUsersWithPermission(@NonNull String permission) { public CompletableFuture<List<HeldPermission<UUID>>> getUsersWithPermission(@NonNull String permission) {
return master.force().getUsersWithPermission(permission); return handle.force().getUsersWithPermission(permission);
} }
@Override @Override
public CompletableFuture<Boolean> createAndLoadGroup(String name) { public CompletableFuture<Boolean> createAndLoadGroup(String name) {
return master.force().createAndLoadGroup(checkName(name), CreationCause.API); return handle.force().createAndLoadGroup(checkName(name), CreationCause.API);
} }
@Override @Override
public CompletableFuture<Boolean> loadGroup(String name) { public CompletableFuture<Boolean> loadGroup(String name) {
return master.force().loadGroup(checkName(name)); return handle.force().loadGroup(checkName(name));
} }
@Override @Override
public CompletableFuture<Boolean> loadAllGroups() { public CompletableFuture<Boolean> loadAllGroups() {
return master.force().loadAllGroups(); return handle.force().loadAllGroups();
} }
@Override @Override
public CompletableFuture<Boolean> saveGroup(Group group) { public CompletableFuture<Boolean> saveGroup(Group group) {
return master.force().saveGroup(GroupDelegate.cast(group)); return handle.force().saveGroup(GroupDelegate.cast(group));
} }
@Override @Override
@ -134,51 +134,51 @@ public class StorageDelegate implements Storage {
if (group.getName().equalsIgnoreCase(plugin.getConfiguration().get(ConfigKeys.DEFAULT_GROUP_NAME))) { if (group.getName().equalsIgnoreCase(plugin.getConfiguration().get(ConfigKeys.DEFAULT_GROUP_NAME))) {
throw new IllegalArgumentException("Cannot delete the default group."); 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 @Override
public CompletableFuture<List<HeldPermission<String>>> getGroupsWithPermission(@NonNull String permission) { public CompletableFuture<List<HeldPermission<String>>> getGroupsWithPermission(@NonNull String permission) {
return master.force().getGroupsWithPermission(permission); return handle.force().getGroupsWithPermission(permission);
} }
@Override @Override
public CompletableFuture<Boolean> createAndLoadTrack(String name) { public CompletableFuture<Boolean> createAndLoadTrack(String name) {
return master.force().createAndLoadTrack(checkName(name), CreationCause.API); return handle.force().createAndLoadTrack(checkName(name), CreationCause.API);
} }
@Override @Override
public CompletableFuture<Boolean> loadTrack(String name) { public CompletableFuture<Boolean> loadTrack(String name) {
return master.force().loadTrack(checkName(name)); return handle.force().loadTrack(checkName(name));
} }
@Override @Override
public CompletableFuture<Boolean> loadAllTracks() { public CompletableFuture<Boolean> loadAllTracks() {
return master.force().loadAllTracks(); return handle.force().loadAllTracks();
} }
@Override @Override
public CompletableFuture<Boolean> saveTrack(Track track) { public CompletableFuture<Boolean> saveTrack(Track track) {
return master.force().saveTrack(TrackDelegate.cast(track)); return handle.force().saveTrack(TrackDelegate.cast(track));
} }
@Override @Override
public CompletableFuture<Boolean> deleteTrack(Track track) { public CompletableFuture<Boolean> deleteTrack(Track track) {
return master.force().deleteTrack(TrackDelegate.cast(track), DeletionCause.API); return handle.force().deleteTrack(TrackDelegate.cast(track), DeletionCause.API);
} }
@Override @Override
public CompletableFuture<Boolean> saveUUIDData(String username, UUID uuid) { public CompletableFuture<Boolean> saveUUIDData(String username, UUID uuid) {
return master.force().saveUUIDData(checkUsername(username), uuid); return handle.force().saveUUIDData(checkUsername(username), uuid);
} }
@Override @Override
public CompletableFuture<UUID> getUUID(String username) { public CompletableFuture<UUID> getUUID(String username) {
return master.force().getUUID(checkUsername(username)); return handle.force().getUUID(checkUsername(username));
} }
@Override @Override
public CompletableFuture<String> getName(@NonNull UUID uuid) { public CompletableFuture<String> getName(@NonNull UUID uuid) {
return master.force().getName(uuid); return handle.force().getName(uuid);
} }
} }

View File

@ -34,15 +34,15 @@ import java.util.UUID;
*/ */
@AllArgsConstructor @AllArgsConstructor
public class UuidCacheDelegate implements UuidCache { public class UuidCacheDelegate implements UuidCache {
private final me.lucko.luckperms.common.core.UuidCache master; private final me.lucko.luckperms.common.core.UuidCache handle;
@Override @Override
public UUID getUUID(@NonNull UUID external) { public UUID getUUID(@NonNull UUID external) {
return master.getUUID(external); return handle.getUUID(external);
} }
@Override @Override
public UUID getExternalUUID(@NonNull UUID internal) { public UUID getExternalUUID(@NonNull UUID internal) {
return master.getExternalUUID(internal); return handle.getExternalUUID(internal);
} }
} }

View File

@ -28,7 +28,6 @@ import lombok.ToString;
import me.lucko.luckperms.api.LocalizedNode; import me.lucko.luckperms.api.LocalizedNode;
import me.lucko.luckperms.common.caching.stacking.MetaStack; import me.lucko.luckperms.common.caching.stacking.MetaStack;
import me.lucko.luckperms.common.caching.stacking.NoopMetaStack;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
@ -60,10 +59,6 @@ public class MetaAccumulator {
this.suffixStack = suffixStack; this.suffixStack = suffixStack;
} }
public MetaAccumulator() {
this(NoopMetaStack.INSTANCE, NoopMetaStack.INSTANCE);
}
public void accumulateNode(LocalizedNode n) { public void accumulateNode(LocalizedNode n) {
if (n.isMeta()) { if (n.isMeta()) {
Map.Entry<String, String> entry = n.getMeta(); Map.Entry<String, String> entry = n.getMeta();

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.meta; 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.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; 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.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.meta; 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.Node;
import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; 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.config.ConfigKeys;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.TemporaryModifier; import me.lucko.luckperms.common.core.TemporaryModifier;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.meta; 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.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; 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.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.meta; 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.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; 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.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.parent; 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.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; 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.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.Group;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.parent; 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.Node;
import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; 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.config.ConfigKeys;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.TemporaryModifier; import me.lucko.luckperms.common.core.TemporaryModifier;
import me.lucko.luckperms.common.core.model.Group; import me.lucko.luckperms.common.core.model.Group;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.parent; 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.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; 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.config.ConfigKeys;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.core.model.User; import me.lucko.luckperms.common.core.model.User;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.parent; 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.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; 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.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.permission; 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.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; 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.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.permission; 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.Node;
import me.lucko.luckperms.api.context.MutableContextSet; import me.lucko.luckperms.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; 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.config.ConfigKeys;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.TemporaryModifier; import me.lucko.luckperms.common.core.TemporaryModifier;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.permission; 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.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; 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.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;

View File

@ -22,6 +22,7 @@
package me.lucko.luckperms.common.commands.impl.generic.permission; 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.api.context.MutableContextSet;
import me.lucko.luckperms.common.commands.Arg; import me.lucko.luckperms.common.commands.Arg;
import me.lucko.luckperms.common.commands.CommandException; 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.commands.utils.Util;
import me.lucko.luckperms.common.constants.Message; import me.lucko.luckperms.common.constants.Message;
import me.lucko.luckperms.common.constants.Permission; 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.NodeFactory;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;
import me.lucko.luckperms.common.data.LogEntry; import me.lucko.luckperms.common.data.LogEntry;

View File

@ -35,6 +35,7 @@ import com.google.common.collect.MultimapBuilder;
import com.google.common.collect.SortedSetMultimap; import com.google.common.collect.SortedSetMultimap;
import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Contexts;
import me.lucko.luckperms.api.DataMutateResult;
import me.lucko.luckperms.api.LocalizedNode; import me.lucko.luckperms.api.LocalizedNode;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.api.Tristate; 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.caching.handlers.HolderReference;
import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.config.ConfigKeys;
import me.lucko.luckperms.common.core.ContextSetComparator; 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.InheritanceInfo;
import me.lucko.luckperms.common.core.NodeComparator; import me.lucko.luckperms.common.core.NodeComparator;
import me.lucko.luckperms.common.core.NodeFactory; import me.lucko.luckperms.common.core.NodeFactory;

View File

@ -6,7 +6,7 @@
<groupId>me.lucko.luckperms</groupId> <groupId>me.lucko.luckperms</groupId>
<artifactId>luckperms</artifactId> <artifactId>luckperms</artifactId>
<version>3.0-SNAPSHOT</version> <version>3.1-SNAPSHOT</version>
<modules> <modules>
<module>api</module> <module>api</module>
<module>common</module> <module>common</module>
@ -40,12 +40,12 @@
<skipTests>true</skipTests> <skipTests>true</skipTests>
<maven.test.skip>true</maven.test.skip> <maven.test.skip>true</maven.test.skip>
<release.version>3.0</release.version> <release.version>3.1</release.version>
<patch.version>${git.closest.tag.commit.count}</patch.version> <patch.version>${git.closest.tag.commit.count}</patch.version>
<compiler.version>3.6.1</compiler.version> <compiler.version>3.6.1</compiler.version>
<shade.version>3.0.0</shade.version> <shade.version>3.0.0</shade.version>
<lombok.version>1.16.14</lombok.version> <lombok.version>1.16.16</lombok.version>
</properties> </properties>
<distributionManagement> <distributionManagement>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>luckperms</artifactId> <artifactId>luckperms</artifactId>
<groupId>me.lucko.luckperms</groupId> <groupId>me.lucko.luckperms</groupId>
<version>3.0-SNAPSHOT</version> <version>3.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -29,12 +29,12 @@ import lombok.NonNull;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import me.lucko.luckperms.api.DataMutateResult;
import me.lucko.luckperms.api.Node; import me.lucko.luckperms.api.Node;
import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.api.Tristate;
import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ContextSet;
import me.lucko.luckperms.api.context.ImmutableContextSet; import me.lucko.luckperms.api.context.ImmutableContextSet;
import me.lucko.luckperms.common.caching.MetaAccumulator; 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.NodeFactory;
import me.lucko.luckperms.common.core.model.Group; import me.lucko.luckperms.common.core.model.Group;
import me.lucko.luckperms.common.core.model.PermissionHolder; import me.lucko.luckperms.common.core.model.PermissionHolder;