mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 03:25:19 +01:00
API changes for 3.1
This commit is contained in:
parent
4631dcf857
commit
4fb07ff181
@ -5,12 +5,13 @@
|
||||
<parent>
|
||||
<artifactId>luckperms</artifactId>
|
||||
<groupId>me.lucko.luckperms</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>luckperms-api</artifactId>
|
||||
<build>
|
||||
<finalName>LuckPerms-API-${release.version}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -29,8 +29,8 @@ import java.util.Optional;
|
||||
/**
|
||||
* 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
|
||||
* used if you need static access.
|
||||
* <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.</p>
|
||||
*/
|
||||
public final class LuckPerms {
|
||||
private static LuckPermsApi api = null;
|
||||
|
@ -27,7 +27,7 @@ import me.lucko.luckperms.api.context.ContextSet;
|
||||
/**
|
||||
* Context and options for a permission lookup.
|
||||
*
|
||||
* <p> All values are immutable.
|
||||
* <p>All values are immutable.</p>
|
||||
*
|
||||
* @since 2.11
|
||||
*/
|
||||
|
@ -20,16 +20,13 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package me.lucko.luckperms.common.core;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
package me.lucko.luckperms.api;
|
||||
|
||||
import me.lucko.luckperms.exceptions.ObjectAlreadyHasException;
|
||||
import me.lucko.luckperms.exceptions.ObjectLacksException;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@AllArgsConstructor
|
||||
public enum DataMutateResult {
|
||||
|
||||
SUCCESS(true, null),
|
||||
@ -37,9 +34,14 @@ public enum DataMutateResult {
|
||||
LACKS(false, ObjectLacksException::new),
|
||||
FAIL(false, RuntimeException::new);
|
||||
|
||||
private boolean bool;
|
||||
private boolean value;
|
||||
private final Supplier<? extends Exception> exceptionSupplier;
|
||||
|
||||
DataMutateResult(boolean value, Supplier<? extends Exception> exceptionSupplier) {
|
||||
this.value = value;
|
||||
this.exceptionSupplier = exceptionSupplier;
|
||||
}
|
||||
|
||||
public void throwException() {
|
||||
if (exceptionSupplier != null) {
|
||||
sneakyThrow(exceptionSupplier.get());
|
||||
@ -47,7 +49,7 @@ public enum DataMutateResult {
|
||||
}
|
||||
|
||||
public boolean asBoolean() {
|
||||
return bool;
|
||||
return value;
|
||||
}
|
||||
|
||||
// allows us to throw checked exceptions without declaring it, as #throwException throws a number of
|
@ -82,7 +82,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws ObjectAlreadyHasException if the group already inherits the group
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setInheritGroup(Group group) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -94,7 +96,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws NullPointerException if the group or server is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the server is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setInheritGroup(Group group, String server) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -107,7 +111,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws NullPointerException if the group, server or world is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the server or world is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setInheritGroup(Group group, String server, String world) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -119,7 +125,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the expiry time is in the past
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setInheritGroup(Group group, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -132,7 +140,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws NullPointerException if the group or server is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the expiry time is in the past or the server is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setInheritGroup(Group group, String server, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -146,7 +156,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws NullPointerException if the group, server or world is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the expiry time is in the past or the server/world is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setInheritGroup(Group group, String server, String world, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -156,7 +168,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws ObjectLacksException if the group does not already inherit the group
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void unsetInheritGroup(Group group) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
@ -167,7 +181,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws ObjectLacksException if the group does not already inherit the group
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void unsetInheritGroup(Group group, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
@ -179,7 +195,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws NullPointerException if the group or server is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the server is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void unsetInheritGroup(Group group, String server) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
@ -192,7 +210,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws NullPointerException if the group, server or world is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the server or world is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void unsetInheritGroup(Group group, String server, String world) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
@ -205,7 +225,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws NullPointerException if the group or server is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the expiry time is in the past or the server is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void unsetInheritGroup(Group group, String server, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
@ -219,7 +241,9 @@ public interface Group extends PermissionHolder {
|
||||
* @throws NullPointerException if the group, server or world is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the expiry time is in the past or the server/world is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void unsetInheritGroup(Group group, String server, String world, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
|
@ -29,8 +29,8 @@ import java.util.UUID;
|
||||
/**
|
||||
* 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
|
||||
* 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>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.</p>
|
||||
*/
|
||||
public interface Log {
|
||||
|
||||
|
@ -27,7 +27,7 @@ import java.util.UUID;
|
||||
/**
|
||||
* 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> {
|
||||
private static final String FORMAT = "&8(&e%s&8) [&a%s&8] (&b%s&8) &7--> &f%s";
|
||||
|
@ -25,8 +25,8 @@ package me.lucko.luckperms.api;
|
||||
/**
|
||||
* 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
|
||||
* commons module can access a logger.
|
||||
* <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.</p>
|
||||
*/
|
||||
public interface Logger {
|
||||
|
||||
|
@ -113,7 +113,9 @@ public interface LuckPermsApi {
|
||||
User getUser(UUID uuid);
|
||||
|
||||
/**
|
||||
* Gets a wrapped user object from the user storage. This method does not return null, unlike {@link #getUser(UUID)}
|
||||
* Gets a wrapped user object from the user storage.
|
||||
*
|
||||
* <p>This method does not return null, unlike {@link #getUser(UUID)}</p>
|
||||
*
|
||||
* @param uuid the uuid of the user to get
|
||||
* @return an optional {@link User} object
|
||||
@ -131,8 +133,9 @@ public interface LuckPermsApi {
|
||||
User getUser(String name);
|
||||
|
||||
/**
|
||||
* Gets a wrapped user object from the user storage. This method does not return null, unlike {@link
|
||||
* #getUser(String)}
|
||||
* Gets a wrapped user object from the user storage.
|
||||
*
|
||||
* <p>This method does not return null, unlike {@link #getUser(String)}</p>
|
||||
*
|
||||
* @param name the username of the user to get
|
||||
* @return an optional {@link User} object
|
||||
@ -175,7 +178,9 @@ public interface LuckPermsApi {
|
||||
Group getGroup(String name);
|
||||
|
||||
/**
|
||||
* Gets a wrapped group object from the group storage. This method does not return null, unlike {@link #getGroup}
|
||||
* Gets a wrapped group object from the group storage.
|
||||
*
|
||||
* <p>This method does not return null, unlike {@link #getGroup}</p>
|
||||
*
|
||||
* @param name the name of the group to get
|
||||
* @return an optional {@link Group} object
|
||||
@ -209,7 +214,9 @@ public interface LuckPermsApi {
|
||||
Track getTrack(String name);
|
||||
|
||||
/**
|
||||
* Gets a wrapped track object from the track storage. This method does not return null, unlike {@link #getTrack}
|
||||
* Gets a wrapped track object from the track storage.
|
||||
*
|
||||
* <p>This method does not return null, unlike {@link #getTrack}</p>
|
||||
*
|
||||
* @param name the name of the track to get
|
||||
* @return an optional {@link Track} object
|
||||
|
@ -32,8 +32,8 @@ public interface MessagingService {
|
||||
/**
|
||||
* 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
|
||||
* equivalent to running "/lp networksync", except will not sync this server.
|
||||
* <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.</p>
|
||||
*/
|
||||
void pushUpdate();
|
||||
|
||||
|
@ -34,7 +34,9 @@ import java.util.Set;
|
||||
* A collection of utilities to help retrieve meta values for {@link PermissionHolder}s
|
||||
*
|
||||
* @since 2.7
|
||||
* @deprecated in favour of using {@link NodeFactory#makeMetaNode(String, String)} or {@link me.lucko.luckperms.api.caching.MetaData}.
|
||||
*/
|
||||
@Deprecated
|
||||
public class MetaUtils {
|
||||
|
||||
private static String escapeDelimiters(String s, String... delims) {
|
||||
@ -92,42 +94,24 @@ public class MetaUtils {
|
||||
* @param holder the holder to apply the meta node to
|
||||
* @param server the server to apply the meta on, can be null
|
||||
* @param world the world to apply the meta on, can be null
|
||||
* @param node the meta node
|
||||
* @param key the meta key
|
||||
* @param value the meta value
|
||||
* @throws NullPointerException if the holder, node or value is null
|
||||
* @throws IllegalArgumentException if the node or value is empty
|
||||
*/
|
||||
public static void setMeta(PermissionHolder holder, String server, String world, String node, String value) {
|
||||
if (holder == null) {
|
||||
throw new NullPointerException("holder");
|
||||
}
|
||||
public static void setMeta(PermissionHolder holder, String server, String world, String key, String value) {
|
||||
if (holder == null) throw new NullPointerException("holder");
|
||||
if (key == null) throw new NullPointerException("node");
|
||||
if (value == null) throw new NullPointerException("value");
|
||||
if (key.equals("")) throw new IllegalArgumentException("node is empty");
|
||||
if (value.equals("")) throw new IllegalArgumentException("value is empty");
|
||||
|
||||
if (node == null) {
|
||||
throw new NullPointerException("node");
|
||||
}
|
||||
|
||||
if (value == null) {
|
||||
throw new NullPointerException("value");
|
||||
}
|
||||
|
||||
if (node.equals("")) {
|
||||
throw new IllegalArgumentException("node is empty");
|
||||
}
|
||||
|
||||
if (value.equals("")) {
|
||||
throw new IllegalArgumentException("value is empty");
|
||||
}
|
||||
|
||||
if (server == null || server.equals("")) {
|
||||
server = "global";
|
||||
}
|
||||
|
||||
node = escapeCharacters(node);
|
||||
key = escapeCharacters(key);
|
||||
value = escapeCharacters(value);
|
||||
|
||||
Set<Node> toRemove = new HashSet<>();
|
||||
for (Node n : holder.getEnduringPermissions()) {
|
||||
if (n.isMeta() && n.getMeta().getKey().equals(node)) {
|
||||
if (n.isMeta() && n.getMeta().getKey().equals(key)) {
|
||||
toRemove.add(n);
|
||||
}
|
||||
}
|
||||
@ -138,12 +122,12 @@ public class MetaUtils {
|
||||
} catch (ObjectLacksException ignored) {}
|
||||
}
|
||||
|
||||
Node.Builder metaNode = LuckPerms.getApi().buildNode("meta." + node + "." + value).setValue(true);
|
||||
if (!server.equalsIgnoreCase("global")) {
|
||||
Node.Builder metaNode = LuckPerms.getApi().buildNode("meta." + key + "." + value).setValue(true);
|
||||
if (server != null) {
|
||||
metaNode.setServer(server);
|
||||
}
|
||||
if (world != null && !world.equals("")) {
|
||||
metaNode.setServer(server).setWorld(world);
|
||||
if (world != null) {
|
||||
metaNode.setWorld(world);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -165,18 +149,8 @@ public class MetaUtils {
|
||||
* @throws IllegalArgumentException if the node is empty
|
||||
*/
|
||||
public static String getMeta(PermissionHolder holder, String server, String world, String node, String defaultValue, boolean includeGlobal) {
|
||||
if (holder == null) {
|
||||
throw new NullPointerException("holder");
|
||||
}
|
||||
|
||||
if (server == null || server.equals("")) {
|
||||
server = "global";
|
||||
}
|
||||
|
||||
if (node == null) {
|
||||
throw new NullPointerException("node");
|
||||
}
|
||||
|
||||
if (holder == null) throw new NullPointerException("holder");
|
||||
if (node == null) throw new NullPointerException("node");
|
||||
if (node.equals("")) {
|
||||
throw new IllegalArgumentException("node is empty");
|
||||
}
|
||||
@ -184,23 +158,10 @@ public class MetaUtils {
|
||||
node = escapeCharacters(node);
|
||||
|
||||
for (Node n : holder.getPermissions()) {
|
||||
if (!n.getValue()) {
|
||||
continue;
|
||||
}
|
||||
if (!n.getValue() || !n.isMeta()) continue;
|
||||
|
||||
if (!n.isMeta()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!server.equalsIgnoreCase("global")) {
|
||||
if (!n.shouldApplyOnServer(server, includeGlobal, false)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!n.shouldApplyOnWorld(world, includeGlobal, false)) {
|
||||
continue;
|
||||
}
|
||||
if (!n.shouldApplyOnServer(server, includeGlobal, false)) continue;
|
||||
if (!n.shouldApplyOnWorld(world, includeGlobal, false)) continue;
|
||||
|
||||
Map.Entry<String, String> meta = n.getMeta();
|
||||
if (meta.getKey().equalsIgnoreCase(node)) {
|
||||
@ -212,21 +173,18 @@ public class MetaUtils {
|
||||
}
|
||||
|
||||
private static void setChatMeta(boolean prefix, PermissionHolder holder, String value, int priority, String server, String world) {
|
||||
if (holder == null) {
|
||||
throw new NullPointerException("holder");
|
||||
}
|
||||
|
||||
if (holder == null) throw new NullPointerException("holder");
|
||||
if (value == null || value.equals("")) {
|
||||
throw new IllegalArgumentException("value is null/empty");
|
||||
}
|
||||
|
||||
Node.Builder node = LuckPerms.getApi().buildNode(prefix ? "prefix" : "suffix" + "." + priority + "." + escapeCharacters(value));
|
||||
node.setValue(true);
|
||||
if (!server.equalsIgnoreCase("global")) {
|
||||
if (server != null) {
|
||||
node.setServer(server);
|
||||
}
|
||||
if (world != null && !world.equals("")) {
|
||||
node.setServer(server).setWorld(world);
|
||||
if (world != null) {
|
||||
node.setWorld(world);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -268,26 +226,14 @@ public class MetaUtils {
|
||||
if (holder == null) {
|
||||
throw new NullPointerException("holder");
|
||||
}
|
||||
if (server == null) {
|
||||
server = "global";
|
||||
}
|
||||
|
||||
int priority = Integer.MIN_VALUE;
|
||||
String meta = null;
|
||||
for (Node n : holder.getAllNodes(Contexts.allowAll())) {
|
||||
if (!n.getValue()) {
|
||||
continue;
|
||||
}
|
||||
if (!n.getValue()) continue;
|
||||
|
||||
if (!server.equalsIgnoreCase("global")) {
|
||||
if (!n.shouldApplyOnServer(server, includeGlobal, false)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!n.shouldApplyOnWorld(world, includeGlobal, false)) {
|
||||
continue;
|
||||
}
|
||||
if (!n.shouldApplyOnServer(server, includeGlobal, false)) continue;
|
||||
if (!n.shouldApplyOnWorld(world, includeGlobal, false)) continue;
|
||||
|
||||
if (prefix ? !n.isPrefix() : !n.isSuffix()) {
|
||||
continue;
|
||||
|
@ -33,7 +33,7 @@ import java.util.Set;
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
@ -33,7 +33,7 @@ public interface NodeFactory {
|
||||
* Creates a node from a serialised node string
|
||||
*
|
||||
* @param serialisedPermission the serialised permission string
|
||||
* @param value the value of the node
|
||||
* @param value the value of the node
|
||||
* @return a node instance
|
||||
* @throws NullPointerException if the permission is null
|
||||
*/
|
||||
@ -60,18 +60,30 @@ public interface NodeFactory {
|
||||
|
||||
/**
|
||||
* Creates a node builder from a serialised node string
|
||||
*
|
||||
* @param serialisedPermission the serialised permission string
|
||||
* @param value the value of the node
|
||||
* @param value the value of the node
|
||||
* @return a node builder instance
|
||||
* @throws NullPointerException if the permission is null
|
||||
*/
|
||||
Node.Builder newBuilderFromSerialisedNode(String serialisedPermission, boolean value);
|
||||
|
||||
|
||||
/**
|
||||
* Creates a node builder from a group
|
||||
*
|
||||
* @param group the group
|
||||
* @return a node builder instance
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @since 3.1
|
||||
*/
|
||||
Node.Builder makeGroupNode(Group group);
|
||||
|
||||
/**
|
||||
* Creates a node builder from a key value pair
|
||||
*
|
||||
* @param key the key
|
||||
* @param key the key
|
||||
* @param value the value
|
||||
* @return a node builder instance
|
||||
* @throws NullPointerException if the key or value is null
|
||||
@ -82,7 +94,7 @@ public interface NodeFactory {
|
||||
* Creates a node builder from a prefix string and priority
|
||||
*
|
||||
* @param priority the priority
|
||||
* @param prefix the prefix string
|
||||
* @param prefix the prefix string
|
||||
* @return a node builder instance
|
||||
* @throws NullPointerException if the prefix is null
|
||||
*/
|
||||
@ -92,7 +104,7 @@ public interface NodeFactory {
|
||||
* Creates a node builder from a prefix string and priority
|
||||
*
|
||||
* @param priority the priority
|
||||
* @param suffix the suffix string
|
||||
* @param suffix the suffix string
|
||||
* @return a node builder instance
|
||||
* @throws NullPointerException if the suffix is null
|
||||
*/
|
||||
|
@ -32,15 +32,15 @@ import java.util.SortedSet;
|
||||
/**
|
||||
* 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 {
|
||||
|
||||
/**
|
||||
* Gets the objects name
|
||||
*
|
||||
* <p> {@link User#getUuid()}, {@link User#getName()} or {@link Group#getName()} should normally be used instead of
|
||||
* this method.
|
||||
* <p>{@link User#getUuid()}, {@link User#getName()} or {@link Group#getName()} should normally be used instead of
|
||||
* this method.</p>
|
||||
*
|
||||
* @return the identifier for this object. Either a uuid string or name.
|
||||
*/
|
||||
@ -74,9 +74,11 @@ public interface PermissionHolder {
|
||||
|
||||
/**
|
||||
* Gets a mutable sorted set of the nodes that this object has and inherits, filtered by context
|
||||
* Unlike {@link #getAllNodesFiltered(Contexts)}, this method will not filter individual nodes. The context is only
|
||||
* used to determine which groups should apply.
|
||||
* Nodes are sorted into priority order.
|
||||
*
|
||||
* <p>Unlike {@link #getAllNodesFiltered(Contexts)}, this method will not filter individual nodes. The context is only
|
||||
* used to determine which groups should apply.</p>
|
||||
*
|
||||
* <p>Nodes are sorted into priority order.</p>
|
||||
*
|
||||
* @param contexts the context for the lookup,
|
||||
* @return a mutable sorted set of permissions
|
||||
@ -87,8 +89,9 @@ public interface PermissionHolder {
|
||||
|
||||
/**
|
||||
* Gets a mutable set of the nodes that this object has and inherits, filtered by context.
|
||||
* Unlike {@link #getAllNodes(Contexts)}, this method WILL filter individual nodes, and only return ones that fully
|
||||
* meet the context provided.
|
||||
*
|
||||
* <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
|
||||
* @return a mutable set of permissions
|
||||
@ -99,6 +102,7 @@ public interface PermissionHolder {
|
||||
|
||||
/**
|
||||
* Converts the output of {@link #getAllNodesFiltered(Contexts)}, and expands shorthand permissions.
|
||||
*
|
||||
* @param contexts the context for the lookup
|
||||
* @param lowerCase if the keys should be made lowercase whilst being exported
|
||||
* @return a mutable map of permissions
|
||||
@ -206,7 +210,7 @@ public interface PermissionHolder {
|
||||
boolean hasPermission(String node, boolean b, String server, String world, boolean temporary);
|
||||
|
||||
/**
|
||||
* Cheks to see if the object inherits a certain permission
|
||||
* Checks to see if the object inherits a certain permission
|
||||
*
|
||||
* @param node the node to check for
|
||||
* @return a Tristate for the holders inheritance status for the node
|
||||
@ -300,17 +304,27 @@ public interface PermissionHolder {
|
||||
*/
|
||||
void setPermission(Node node) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Sets a permission for the object
|
||||
*
|
||||
* @param node The node to be set
|
||||
* @throws NullPointerException if the node is null
|
||||
* @return the result of the operation
|
||||
* @since 3.1
|
||||
*/
|
||||
DataMutateResult setPermissionUnchecked(Node node);
|
||||
|
||||
/**
|
||||
* Sets a transient permission for the object
|
||||
*
|
||||
* <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.
|
||||
* 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
|
||||
* want it to persist, and have to worry about removing it when they log out.
|
||||
* <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>For unsetting a transient permission, see {@link #unsetTransientPermission(Node)}</p>
|
||||
*
|
||||
* @param node The node to be set
|
||||
* @throws ObjectAlreadyHasException if the object already has the permission
|
||||
@ -319,6 +333,25 @@ public interface PermissionHolder {
|
||||
*/
|
||||
void setTransientPermission(Node node) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
* Sets a transient permission for the object
|
||||
*
|
||||
* <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
|
||||
*
|
||||
@ -416,6 +449,16 @@ public interface PermissionHolder {
|
||||
*/
|
||||
void unsetPermission(Node node) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Unsets a permission for the object
|
||||
*
|
||||
* @param node The node to be unset
|
||||
* @throws NullPointerException if the node is null
|
||||
* @return the result of the operation
|
||||
* @since 3.1
|
||||
*/
|
||||
DataMutateResult unsetPermissionUnchecked(Node node);
|
||||
|
||||
/**
|
||||
* Unsets a transient permission for the object
|
||||
*
|
||||
@ -426,6 +469,16 @@ public interface PermissionHolder {
|
||||
*/
|
||||
void unsetTransientPermission(Node node) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
* Unsets a transient permission for the object
|
||||
*
|
||||
* @param node The node to be unset
|
||||
* @throws NullPointerException if the node is null
|
||||
* @return the result of the operation
|
||||
* @since 3.1
|
||||
*/
|
||||
DataMutateResult unsetTransientPermissionUnchecked(Node node);
|
||||
|
||||
/**
|
||||
* Unsets a permission for the object
|
||||
*
|
||||
|
@ -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
|
||||
* 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
|
||||
* 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
|
||||
*/
|
||||
|
@ -41,7 +41,7 @@ public interface 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
|
||||
*/
|
||||
|
@ -25,8 +25,8 @@ package me.lucko.luckperms.api;
|
||||
/**
|
||||
* 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
|
||||
* non-existent value.
|
||||
* <p>Consider a value of {@link #FALSE} to be a "negated" setting, and a value of {@link #UNDEFINED} to be a
|
||||
* non-existent value.</p>
|
||||
*/
|
||||
public enum Tristate {
|
||||
|
||||
@ -63,7 +63,8 @@ public enum Tristate {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
@ -69,8 +69,8 @@ public interface User extends PermissionHolder {
|
||||
/**
|
||||
* 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
|
||||
* an asynchronous thread.
|
||||
* <p>This request is not buffered, and the refresh call will be ran directly. This should ideally be called on
|
||||
* an asynchronous thread.</p>
|
||||
*/
|
||||
void refreshPermissions();
|
||||
|
||||
@ -128,7 +128,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws ObjectAlreadyHasException if the user is already a member of the group
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void addGroup(Group group) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -140,7 +142,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws NullPointerException if the group or server is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the server is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void addGroup(Group group, String server) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -153,7 +157,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws NullPointerException if the group, server or world is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the server or world is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void addGroup(Group group, String server, String world) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -165,7 +171,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the expiry time is in the past
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void addGroup(Group group, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -178,7 +186,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws NullPointerException if the group or server is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the expiry time is in the past or the server is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void addGroup(Group group, String server, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -192,7 +202,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws NullPointerException if the group, server or world is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the expiry time is in the past or the server/world is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void addGroup(Group group, String server, String world, long expireAt) throws ObjectAlreadyHasException;
|
||||
|
||||
/**
|
||||
@ -202,7 +214,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws ObjectLacksException if the user isn't a member of the group
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void removeGroup(Group group) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
@ -213,7 +227,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws ObjectLacksException if the user isn't a member of the group
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void removeGroup(Group group, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
@ -225,7 +241,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws NullPointerException if the group or server is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the server is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void removeGroup(Group group, String server) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
@ -238,7 +256,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws NullPointerException if the group, server or world is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the server or world is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void removeGroup(Group group, String server, String world) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
@ -251,7 +271,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws NullPointerException if the group or server is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the expiry time is in the past or the server is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void removeGroup(Group group, String server, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
@ -265,7 +287,9 @@ public interface User extends PermissionHolder {
|
||||
* @throws NullPointerException if the group, server or world is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
* @throws IllegalArgumentException if the expiry time is in the past or the server/world is invalid
|
||||
* @deprecated in favour of {@link NodeFactory#makeGroupNode(Group)}
|
||||
*/
|
||||
@Deprecated
|
||||
void removeGroup(Group group, String server, String world, boolean temporary) throws ObjectLacksException;
|
||||
|
||||
/**
|
||||
|
@ -27,15 +27,15 @@ import java.util.UUID;
|
||||
/**
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* <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.
|
||||
*
|
||||
* <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 {
|
||||
|
||||
|
@ -45,7 +45,7 @@ public interface PermissionData {
|
||||
/**
|
||||
* 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();
|
||||
|
||||
|
@ -30,7 +30,7 @@ import java.util.Set;
|
||||
* 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
|
||||
* 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
|
||||
*/
|
||||
@ -39,7 +39,7 @@ public interface UserData {
|
||||
/**
|
||||
* 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
|
||||
* @return a permission data instance
|
||||
@ -50,7 +50,7 @@ public interface UserData {
|
||||
/**
|
||||
* 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
|
||||
* @return a meta data instance
|
||||
@ -79,8 +79,8 @@ public interface UserData {
|
||||
/**
|
||||
* 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,
|
||||
* the cached value is updated.
|
||||
* <p>If there is already data cached for the given contexts, and if the resultant output is different,
|
||||
* the cached value is updated.</p>
|
||||
*
|
||||
* @param contexts the contexts to recalculate in.
|
||||
* @throws NullPointerException if contexts is null
|
||||
@ -90,8 +90,8 @@ public interface UserData {
|
||||
/**
|
||||
* Calculates meta data and stores it in the cache.
|
||||
*
|
||||
* <p> If there is already data cached for the given contexts, and if the resultant output is different,
|
||||
* the cached value is updated.
|
||||
* <p>If there is already data cached for the given contexts, and if the resultant output is different,
|
||||
* the cached value is updated.</p>
|
||||
*
|
||||
* @param contexts the contexts to recalculate in.
|
||||
* @throws NullPointerException if contexts is null
|
||||
@ -119,7 +119,7 @@ public interface UserData {
|
||||
/**
|
||||
* Ensures that PermissionData and MetaData is cached for a context.
|
||||
*
|
||||
* <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
|
||||
* @throws NullPointerException if contexts is null
|
||||
@ -128,7 +128,8 @@ public interface UserData {
|
||||
|
||||
/**
|
||||
* Invalidates all of the underlying Permission calculators.
|
||||
* Can be called to allow for an update in defaults.
|
||||
*
|
||||
* <p>Can be called to allow for an update in defaults.</p>
|
||||
*/
|
||||
void invalidatePermissionCalculators();
|
||||
|
||||
|
@ -25,9 +25,8 @@ package me.lucko.luckperms.api.context;
|
||||
/**
|
||||
* 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.
|
||||
* @since 2.13
|
||||
*/
|
||||
public interface ContextCalculator<T> {
|
||||
|
||||
|
@ -29,8 +29,9 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Holds contexts.
|
||||
* Implementations may be either mutable or immutable.
|
||||
* Holder of contexts.
|
||||
*
|
||||
* <p>Implementations may be either mutable or immutable.</p>
|
||||
*
|
||||
* @since 2.13
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>luckperms</artifactId>
|
||||
<groupId>me.lucko.luckperms</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>luckperms</artifactId>
|
||||
<groupId>me.lucko.luckperms</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -26,6 +26,7 @@ import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
|
||||
import me.lucko.luckperms.api.Contexts;
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.Node;
|
||||
import me.lucko.luckperms.api.Tristate;
|
||||
import me.lucko.luckperms.api.caching.PermissionData;
|
||||
@ -33,7 +34,6 @@ import me.lucko.luckperms.api.context.ContextSet;
|
||||
import me.lucko.luckperms.api.context.ImmutableContextSet;
|
||||
import me.lucko.luckperms.bukkit.LPBukkitPlugin;
|
||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.Group;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>luckperms</artifactId>
|
||||
<groupId>me.lucko.luckperms</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>luckperms</artifactId>
|
||||
<groupId>me.lucko.luckperms</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<build>
|
||||
<finalName>LuckPerms-Common-${release.version}.${patch.version}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -79,7 +79,7 @@ public class ApiProvider implements LuckPermsApi {
|
||||
|
||||
@Override
|
||||
public double getApiVersion() {
|
||||
return 3.0;
|
||||
return 3.1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,105 +36,105 @@ import java.util.Map;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public class LPConfigurationDelegate implements LPConfiguration {
|
||||
private final LuckPermsConfiguration master;
|
||||
private final LuckPermsConfiguration handle;
|
||||
|
||||
@Override
|
||||
public String getServer() {
|
||||
return master.get(ConfigKeys.SERVER);
|
||||
return handle.get(ConfigKeys.SERVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSyncTime() {
|
||||
return master.get(ConfigKeys.SYNC_TIME);
|
||||
return handle.get(ConfigKeys.SYNC_TIME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIncludeGlobalPerms() {
|
||||
return master.get(ConfigKeys.INCLUDING_GLOBAL_PERMS);
|
||||
return handle.get(ConfigKeys.INCLUDING_GLOBAL_PERMS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIncludeGlobalWorldPerms() {
|
||||
return master.get(ConfigKeys.INCLUDING_GLOBAL_WORLD_PERMS);
|
||||
return handle.get(ConfigKeys.INCLUDING_GLOBAL_WORLD_PERMS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getApplyGlobalGroups() {
|
||||
return master.get(ConfigKeys.APPLYING_GLOBAL_GROUPS);
|
||||
return handle.get(ConfigKeys.APPLYING_GLOBAL_GROUPS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getApplyGlobalWorldGroups() {
|
||||
return master.get(ConfigKeys.APPLYING_GLOBAL_WORLD_GROUPS);
|
||||
return handle.get(ConfigKeys.APPLYING_GLOBAL_WORLD_GROUPS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getOnlineMode() {
|
||||
return master.get(ConfigKeys.USE_SERVER_UUIDS);
|
||||
return handle.get(ConfigKeys.USE_SERVER_UUIDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getApplyWildcards() {
|
||||
return master.get(ConfigKeys.APPLYING_WILDCARDS);
|
||||
return handle.get(ConfigKeys.APPLYING_WILDCARDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getApplyRegex() {
|
||||
return master.get(ConfigKeys.APPLYING_REGEX);
|
||||
return handle.get(ConfigKeys.APPLYING_REGEX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getApplyShorthand() {
|
||||
return master.get(ConfigKeys.APPLYING_SHORTHAND);
|
||||
return handle.get(ConfigKeys.APPLYING_SHORTHAND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getLogNotify() {
|
||||
return master.get(ConfigKeys.LOG_NOTIFY);
|
||||
return handle.get(ConfigKeys.LOG_NOTIFY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getEnableOps() {
|
||||
return master.get(ConfigKeys.OPS_ENABLED);
|
||||
return handle.get(ConfigKeys.OPS_ENABLED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCommandsAllowOp() {
|
||||
return master.get(ConfigKeys.COMMANDS_ALLOW_OP);
|
||||
return handle.get(ConfigKeys.COMMANDS_ALLOW_OP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getAutoOp() {
|
||||
return master.get(ConfigKeys.AUTO_OP);
|
||||
return handle.get(ConfigKeys.AUTO_OP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVaultServer() {
|
||||
return master.get(ConfigKeys.VAULT_SERVER);
|
||||
return handle.get(ConfigKeys.VAULT_SERVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getVaultIncludeGlobal() {
|
||||
return master.get(ConfigKeys.VAULT_INCLUDING_GLOBAL);
|
||||
return handle.get(ConfigKeys.VAULT_INCLUDING_GLOBAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatastoreConfiguration getDatastoreConfig() {
|
||||
return master.get(ConfigKeys.DATABASE_VALUES);
|
||||
return handle.get(ConfigKeys.DATABASE_VALUES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStorageMethod() {
|
||||
return master.get(ConfigKeys.STORAGE_METHOD);
|
||||
return handle.get(ConfigKeys.STORAGE_METHOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getSplitStorage() {
|
||||
return master.get(ConfigKeys.SPLIT_STORAGE);
|
||||
return handle.get(ConfigKeys.SPLIT_STORAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getSplitStorageOptions() {
|
||||
return master.get(ConfigKeys.SPLIT_STORAGE_OPTIONS);
|
||||
return handle.get(ConfigKeys.SPLIT_STORAGE_OPTIONS);
|
||||
}
|
||||
}
|
||||
|
@ -39,100 +39,100 @@ import static me.lucko.luckperms.common.api.ApiUtils.checkName;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public class LogDelegate implements Log {
|
||||
private final me.lucko.luckperms.common.data.Log master;
|
||||
private final me.lucko.luckperms.common.data.Log handle;
|
||||
|
||||
@Override
|
||||
public SortedSet<LogEntry> getContent() {
|
||||
return master.getContent();
|
||||
return handle.getContent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<LogEntry> getRecent() {
|
||||
return master.getRecent();
|
||||
return handle.getRecent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedMap<Integer, LogEntry> getRecent(int pageNo) {
|
||||
return master.getRecent(pageNo);
|
||||
return handle.getRecent(pageNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecentMaxPages() {
|
||||
return master.getRecentMaxPages();
|
||||
return handle.getRecentMaxPages();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<LogEntry> getRecent(@NonNull UUID actor) {
|
||||
return master.getRecent(actor);
|
||||
return handle.getRecent(actor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedMap<Integer, LogEntry> getRecent(int pageNo, @NonNull UUID actor) {
|
||||
return master.getRecent(pageNo, actor);
|
||||
return handle.getRecent(pageNo, actor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecentMaxPages(@NonNull UUID actor) {
|
||||
return master.getRecentMaxPages(actor);
|
||||
return handle.getRecentMaxPages(actor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<LogEntry> getUserHistory(@NonNull UUID uuid) {
|
||||
return master.getUserHistory(uuid);
|
||||
return handle.getUserHistory(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedMap<Integer, LogEntry> getUserHistory(int pageNo, @NonNull UUID uuid) {
|
||||
return master.getUserHistory(pageNo, uuid);
|
||||
return handle.getUserHistory(pageNo, uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUserHistoryMaxPages(@NonNull UUID uuid) {
|
||||
return master.getUserHistoryMaxPages(uuid);
|
||||
return handle.getUserHistoryMaxPages(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<LogEntry> getGroupHistory(@NonNull String name) {
|
||||
return master.getGroupHistory(checkName(name));
|
||||
return handle.getGroupHistory(checkName(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedMap<Integer, LogEntry> getGroupHistory(int pageNo, @NonNull String name) {
|
||||
return master.getGroupHistory(pageNo, checkName(name));
|
||||
return handle.getGroupHistory(pageNo, checkName(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGroupHistoryMaxPages(@NonNull String name) {
|
||||
return master.getGroupHistoryMaxPages(checkName(name));
|
||||
return handle.getGroupHistoryMaxPages(checkName(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<LogEntry> getTrackHistory(@NonNull String name) {
|
||||
return master.getTrackHistory(checkName(name));
|
||||
return handle.getTrackHistory(checkName(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedMap<Integer, LogEntry> getTrackHistory(int pageNo, @NonNull String name) {
|
||||
return master.getTrackHistory(pageNo, checkName(name));
|
||||
return handle.getTrackHistory(pageNo, checkName(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTrackHistoryMaxPages(@NonNull String name) {
|
||||
return master.getTrackHistoryMaxPages(checkName(name));
|
||||
return handle.getTrackHistoryMaxPages(checkName(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<LogEntry> getSearch(@NonNull String query) {
|
||||
return master.getSearch(query);
|
||||
return handle.getSearch(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedMap<Integer, LogEntry> getSearch(int pageNo, @NonNull String query) {
|
||||
return master.getSearch(pageNo, query);
|
||||
return handle.getSearch(pageNo, query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSearchMaxPages(@NonNull String query) {
|
||||
return master.getSearchMaxPages(query);
|
||||
return handle.getSearchMaxPages(query);
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ package me.lucko.luckperms.common.api.delegates;
|
||||
|
||||
import lombok.NonNull;
|
||||
|
||||
import me.lucko.luckperms.api.Group;
|
||||
import me.lucko.luckperms.api.Node;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
|
||||
@ -50,6 +51,11 @@ public class NodeFactoryDelegate implements me.lucko.luckperms.api.NodeFactory {
|
||||
return NodeFactory.builderFromSerializedNode(serialisedPermission, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node.Builder makeGroupNode(Group group) {
|
||||
return NodeFactory.newBuilder("group." + GroupDelegate.cast(group).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node.Builder makeMetaNode(@NonNull String key, @NonNull String value) {
|
||||
return NodeFactory.makeMetaNode(key, value);
|
||||
|
@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedSet;
|
||||
|
||||
import me.lucko.luckperms.api.Contexts;
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.LocalizedNode;
|
||||
import me.lucko.luckperms.api.Node;
|
||||
import me.lucko.luckperms.api.PermissionHolder;
|
||||
@ -53,201 +54,221 @@ import static me.lucko.luckperms.common.api.ApiUtils.checkTime;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public class PermissionHolderDelegate implements PermissionHolder {
|
||||
private final me.lucko.luckperms.common.core.model.PermissionHolder master;
|
||||
private final me.lucko.luckperms.common.core.model.PermissionHolder handle;
|
||||
|
||||
@Override
|
||||
public String getObjectName() {
|
||||
return master.getObjectName();
|
||||
return handle.getObjectName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<? extends Node> getPermissions() {
|
||||
return ImmutableSortedSet.copyOfSorted(master.mergePermissionsToSortedSet());
|
||||
return ImmutableSortedSet.copyOfSorted(handle.mergePermissionsToSortedSet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Node> getEnduringPermissions() {
|
||||
return ImmutableSet.copyOf(master.getNodes().values());
|
||||
return ImmutableSet.copyOf(handle.getNodes().values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Node> getTransientPermissions() {
|
||||
return ImmutableSet.copyOf(master.getTransientNodes().values());
|
||||
return ImmutableSet.copyOf(handle.getTransientNodes().values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedSet<LocalizedNode> getAllNodes(@NonNull Contexts contexts) {
|
||||
return new TreeSet<>(master.resolveInheritancesAlmostEqual(ExtractedContexts.generate(contexts)));
|
||||
return new TreeSet<>(handle.resolveInheritancesAlmostEqual(ExtractedContexts.generate(contexts)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<LocalizedNode> getAllNodesFiltered(@NonNull Contexts contexts) {
|
||||
return new HashSet<>(master.getAllNodes(ExtractedContexts.generate(contexts)));
|
||||
return new HashSet<>(handle.getAllNodes(ExtractedContexts.generate(contexts)));
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
public Tristate hasPermission(@NonNull Node node) {
|
||||
return master.hasPermission(node, false);
|
||||
return handle.hasPermission(node, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tristate hasTransientPermission(@NonNull Node node) {
|
||||
return master.hasPermission(node, true);
|
||||
return handle.hasPermission(node, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(@NonNull String node, @NonNull boolean b) {
|
||||
return master.hasPermission(node, b);
|
||||
return handle.hasPermission(node, b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server) {
|
||||
return master.hasPermission(node, b, server);
|
||||
return handle.hasPermission(node, b, server);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world) {
|
||||
return master.hasPermission(node, b, server, world);
|
||||
return handle.hasPermission(node, b, server, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull boolean temporary) {
|
||||
return master.hasPermission(node, b, temporary);
|
||||
return handle.hasPermission(node, b, temporary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull boolean temporary) {
|
||||
return master.hasPermission(node, b, server, temporary);
|
||||
return handle.hasPermission(node, b, server, temporary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world, @NonNull boolean temporary) {
|
||||
return master.hasPermission(node, b, server, world, temporary);
|
||||
return handle.hasPermission(node, b, server, world, temporary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tristate inheritsPermission(@NonNull Node node) {
|
||||
return master.inheritsPermission(node);
|
||||
return handle.inheritsPermission(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b) {
|
||||
return master.inheritsPermission(node, b);
|
||||
return handle.inheritsPermission(node, b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server) {
|
||||
return master.inheritsPermission(node, b, server);
|
||||
return handle.inheritsPermission(node, b, server);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world) {
|
||||
return master.inheritsPermission(node, b, server, world);
|
||||
return handle.inheritsPermission(node, b, server, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull boolean temporary) {
|
||||
return master.inheritsPermission(node, b, temporary);
|
||||
return handle.inheritsPermission(node, b, temporary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull boolean temporary) {
|
||||
return master.inheritsPermission(node, b, server, temporary);
|
||||
return handle.inheritsPermission(node, b, server, temporary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inheritsPermission(@NonNull String node, @NonNull boolean b, @NonNull String server, @NonNull String world, @NonNull boolean temporary) {
|
||||
return master.inheritsPermission(node, b, server, world, temporary);
|
||||
return handle.inheritsPermission(node, b, server, world, temporary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPermission(@NonNull Node node) throws ObjectAlreadyHasException {
|
||||
master.setPermission(node).throwException();
|
||||
handle.setPermission(node).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataMutateResult setPermissionUnchecked(Node node) {
|
||||
return handle.setPermission(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTransientPermission(@NonNull Node node) throws ObjectAlreadyHasException {
|
||||
master.setTransientPermission(node).throwException();
|
||||
handle.setTransientPermission(node).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataMutateResult setTransientPermissionUnchecked(Node node) {
|
||||
return handle.setTransientPermission(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPermission(@NonNull String node, @NonNull boolean value) throws ObjectAlreadyHasException {
|
||||
master.setPermission(NodeFactory.make(node, value)).throwException();
|
||||
handle.setPermission(NodeFactory.make(node, value)).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server) throws ObjectAlreadyHasException {
|
||||
master.setPermission(NodeFactory.make(node, value, server)).throwException();
|
||||
handle.setPermission(NodeFactory.make(node, value, server)).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server, @NonNull String world) throws ObjectAlreadyHasException {
|
||||
master.setPermission(NodeFactory.make(node, value, server, world)).throwException();
|
||||
handle.setPermission(NodeFactory.make(node, value, server, world)).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull long expireAt) throws ObjectAlreadyHasException {
|
||||
master.setPermission(NodeFactory.make(node, value, checkTime(expireAt))).throwException();
|
||||
handle.setPermission(NodeFactory.make(node, value, checkTime(expireAt))).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server, @NonNull long expireAt) throws ObjectAlreadyHasException {
|
||||
master.setPermission(NodeFactory.make(node, value, server, checkTime(expireAt))).throwException();
|
||||
handle.setPermission(NodeFactory.make(node, value, server, checkTime(expireAt))).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPermission(@NonNull String node, @NonNull boolean value, @NonNull String server, @NonNull String world, @NonNull long expireAt) throws ObjectAlreadyHasException {
|
||||
master.setPermission(NodeFactory.make(node, value, server, world, checkTime(expireAt))).throwException();
|
||||
handle.setPermission(NodeFactory.make(node, value, server, world, checkTime(expireAt))).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsetPermission(@NonNull Node node) throws ObjectLacksException {
|
||||
master.unsetPermission(node).throwException();
|
||||
handle.unsetPermission(node).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataMutateResult unsetPermissionUnchecked(Node node) {
|
||||
return handle.unsetPermission(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsetTransientPermission(@NonNull Node node) throws ObjectLacksException {
|
||||
master.unsetTransientPermission(node).throwException();
|
||||
handle.unsetTransientPermission(node).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataMutateResult unsetTransientPermissionUnchecked(Node node) {
|
||||
return handle.unsetTransientPermission(node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsetPermission(@NonNull String node, @NonNull boolean temporary) throws ObjectLacksException {
|
||||
master.unsetPermission(NodeFactory.make(node, temporary)).throwException();
|
||||
handle.unsetPermission(NodeFactory.make(node, temporary)).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsetPermission(@NonNull String node) throws ObjectLacksException {
|
||||
master.unsetPermission(NodeFactory.make(node)).throwException();
|
||||
handle.unsetPermission(NodeFactory.make(node)).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsetPermission(@NonNull String node, @NonNull String server) throws ObjectLacksException {
|
||||
master.unsetPermission(NodeFactory.make(node, server)).throwException();
|
||||
handle.unsetPermission(NodeFactory.make(node, server)).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsetPermission(@NonNull String node, @NonNull String server, @NonNull String world) throws ObjectLacksException {
|
||||
master.unsetPermission(NodeFactory.make(node, server, world)).throwException();
|
||||
handle.unsetPermission(NodeFactory.make(node, server, world)).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsetPermission(@NonNull String node, @NonNull String server, @NonNull boolean temporary) throws ObjectLacksException {
|
||||
master.unsetPermission(NodeFactory.make(node, server, temporary)).throwException();
|
||||
handle.unsetPermission(NodeFactory.make(node, server, temporary)).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsetPermission(@NonNull String node, @NonNull String server, @NonNull String world, @NonNull boolean temporary) throws ObjectLacksException {
|
||||
master.unsetPermission(NodeFactory.make(node, server, world, temporary)).throwException();
|
||||
handle.unsetPermission(NodeFactory.make(node, server, world, temporary)).throwException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearNodes() {
|
||||
master.clearNodes();
|
||||
handle.clearNodes();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -257,7 +278,7 @@ public class PermissionHolderDelegate implements PermissionHolder {
|
||||
set.add("server", server);
|
||||
}
|
||||
|
||||
master.clearNodes(set);
|
||||
handle.clearNodes(set);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -270,12 +291,12 @@ public class PermissionHolderDelegate implements PermissionHolder {
|
||||
set.add("world", world);
|
||||
}
|
||||
|
||||
master.clearNodes(set);
|
||||
handle.clearNodes(set);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearParents() {
|
||||
master.clearParents(true);
|
||||
handle.clearParents(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -285,7 +306,7 @@ public class PermissionHolderDelegate implements PermissionHolder {
|
||||
set.add("server", server);
|
||||
}
|
||||
|
||||
master.clearParents(set, true);
|
||||
handle.clearParents(set, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -298,12 +319,12 @@ public class PermissionHolderDelegate implements PermissionHolder {
|
||||
set.add("world", world);
|
||||
}
|
||||
|
||||
master.clearParents(set, true);
|
||||
handle.clearParents(set, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearMeta() {
|
||||
master.clearMeta();
|
||||
handle.clearMeta();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -313,7 +334,7 @@ public class PermissionHolderDelegate implements PermissionHolder {
|
||||
set.add("server", server);
|
||||
}
|
||||
|
||||
master.clearMeta(set);
|
||||
handle.clearMeta(set);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -326,7 +347,7 @@ public class PermissionHolderDelegate implements PermissionHolder {
|
||||
set.add("world", world);
|
||||
}
|
||||
|
||||
master.clearMeta(set);
|
||||
handle.clearMeta(set);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -339,27 +360,27 @@ public class PermissionHolderDelegate implements PermissionHolder {
|
||||
set.add("world", world);
|
||||
}
|
||||
|
||||
master.clearMetaKeys(key, set, temporary);
|
||||
handle.clearMetaKeys(key, set, temporary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearTransientNodes() {
|
||||
master.clearTransientNodes();
|
||||
handle.clearTransientNodes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Node> getTemporaryPermissionNodes() {
|
||||
return master.getTemporaryNodes();
|
||||
return handle.getTemporaryNodes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Node> getPermanentPermissionNodes() {
|
||||
return master.getPermanentNodes();
|
||||
return handle.getPermanentNodes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void auditTemporaryPermissions() {
|
||||
master.auditTemporaryPermissions();
|
||||
handle.auditTemporaryPermissions();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -52,16 +52,16 @@ import static me.lucko.luckperms.common.api.ApiUtils.checkUsername;
|
||||
@AllArgsConstructor
|
||||
public class StorageDelegate implements Storage {
|
||||
private final LuckPermsPlugin plugin;
|
||||
private final me.lucko.luckperms.common.storage.Storage master;
|
||||
private final me.lucko.luckperms.common.storage.Storage handle;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return master.getName();
|
||||
return handle.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptingLogins() {
|
||||
return master.isAcceptingLogins();
|
||||
return handle.isAcceptingLogins();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -76,57 +76,57 @@ public class StorageDelegate implements Storage {
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> logAction(@NonNull LogEntry entry) {
|
||||
return master.force().logAction(entry);
|
||||
return handle.force().logAction(entry);
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
public CompletableFuture<Boolean> loadUser(UUID uuid, String username) {
|
||||
return master.force().loadUser(uuid, checkUsername(username));
|
||||
return handle.force().loadUser(uuid, checkUsername(username));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> saveUser(User user) {
|
||||
return master.force().saveUser(UserDelegate.cast(user));
|
||||
return handle.force().saveUser(UserDelegate.cast(user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> cleanupUsers() {
|
||||
return master.force().cleanupUsers();
|
||||
return handle.force().cleanupUsers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Set<UUID>> getUniqueUsers() {
|
||||
return master.force().getUniqueUsers();
|
||||
return handle.force().getUniqueUsers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<List<HeldPermission<UUID>>> getUsersWithPermission(@NonNull String permission) {
|
||||
return master.force().getUsersWithPermission(permission);
|
||||
return handle.force().getUsersWithPermission(permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> createAndLoadGroup(String name) {
|
||||
return master.force().createAndLoadGroup(checkName(name), CreationCause.API);
|
||||
return handle.force().createAndLoadGroup(checkName(name), CreationCause.API);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> loadGroup(String name) {
|
||||
return master.force().loadGroup(checkName(name));
|
||||
return handle.force().loadGroup(checkName(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> loadAllGroups() {
|
||||
return master.force().loadAllGroups();
|
||||
return handle.force().loadAllGroups();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> saveGroup(Group group) {
|
||||
return master.force().saveGroup(GroupDelegate.cast(group));
|
||||
return handle.force().saveGroup(GroupDelegate.cast(group));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -134,51 +134,51 @@ public class StorageDelegate implements Storage {
|
||||
if (group.getName().equalsIgnoreCase(plugin.getConfiguration().get(ConfigKeys.DEFAULT_GROUP_NAME))) {
|
||||
throw new IllegalArgumentException("Cannot delete the default group.");
|
||||
}
|
||||
return master.force().deleteGroup(GroupDelegate.cast(group), DeletionCause.API);
|
||||
return handle.force().deleteGroup(GroupDelegate.cast(group), DeletionCause.API);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<List<HeldPermission<String>>> getGroupsWithPermission(@NonNull String permission) {
|
||||
return master.force().getGroupsWithPermission(permission);
|
||||
return handle.force().getGroupsWithPermission(permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> createAndLoadTrack(String name) {
|
||||
return master.force().createAndLoadTrack(checkName(name), CreationCause.API);
|
||||
return handle.force().createAndLoadTrack(checkName(name), CreationCause.API);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> loadTrack(String name) {
|
||||
return master.force().loadTrack(checkName(name));
|
||||
return handle.force().loadTrack(checkName(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> loadAllTracks() {
|
||||
return master.force().loadAllTracks();
|
||||
return handle.force().loadAllTracks();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Boolean> saveTrack(Track track) {
|
||||
return master.force().saveTrack(TrackDelegate.cast(track));
|
||||
return handle.force().saveTrack(TrackDelegate.cast(track));
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
public CompletableFuture<Boolean> saveUUIDData(String username, UUID uuid) {
|
||||
return master.force().saveUUIDData(checkUsername(username), uuid);
|
||||
return handle.force().saveUUIDData(checkUsername(username), uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<UUID> getUUID(String username) {
|
||||
return master.force().getUUID(checkUsername(username));
|
||||
return handle.force().getUUID(checkUsername(username));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletableFuture<String> getName(@NonNull UUID uuid) {
|
||||
return master.force().getName(uuid);
|
||||
return handle.force().getName(uuid);
|
||||
}
|
||||
}
|
||||
|
@ -34,15 +34,15 @@ import java.util.UUID;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public class UuidCacheDelegate implements UuidCache {
|
||||
private final me.lucko.luckperms.common.core.UuidCache master;
|
||||
private final me.lucko.luckperms.common.core.UuidCache handle;
|
||||
|
||||
@Override
|
||||
public UUID getUUID(@NonNull UUID external) {
|
||||
return master.getUUID(external);
|
||||
return handle.getUUID(external);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getExternalUUID(@NonNull UUID internal) {
|
||||
return master.getExternalUUID(internal);
|
||||
return handle.getExternalUUID(internal);
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ import lombok.ToString;
|
||||
|
||||
import me.lucko.luckperms.api.LocalizedNode;
|
||||
import me.lucko.luckperms.common.caching.stacking.MetaStack;
|
||||
import me.lucko.luckperms.common.caching.stacking.NoopMetaStack;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
@ -60,10 +59,6 @@ public class MetaAccumulator {
|
||||
this.suffixStack = suffixStack;
|
||||
}
|
||||
|
||||
public MetaAccumulator() {
|
||||
this(NoopMetaStack.INSTANCE, NoopMetaStack.INSTANCE);
|
||||
}
|
||||
|
||||
public void accumulateNode(LocalizedNode n) {
|
||||
if (n.isMeta()) {
|
||||
Map.Entry<String, String> entry = n.getMeta();
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.meta;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
import me.lucko.luckperms.common.commands.CommandException;
|
||||
@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
|
||||
import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.data.LogEntry;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.meta;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.Node;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
@ -34,7 +35,6 @@ import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.TemporaryModifier;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.meta;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
import me.lucko.luckperms.common.commands.CommandException;
|
||||
@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
|
||||
import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.data.LogEntry;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.meta;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
import me.lucko.luckperms.common.commands.CommandException;
|
||||
@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
|
||||
import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.data.LogEntry;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.parent;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
import me.lucko.luckperms.common.commands.CommandException;
|
||||
@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
|
||||
import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.model.Group;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.data.LogEntry;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.parent;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.Node;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
@ -34,7 +35,6 @@ import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.TemporaryModifier;
|
||||
import me.lucko.luckperms.common.core.model.Group;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.parent;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
import me.lucko.luckperms.common.commands.CommandException;
|
||||
@ -33,7 +34,6 @@ import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.core.model.User;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.parent;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
import me.lucko.luckperms.common.commands.CommandException;
|
||||
@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
|
||||
import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.data.LogEntry;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.permission;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
import me.lucko.luckperms.common.commands.CommandException;
|
||||
@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
|
||||
import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.data.LogEntry;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.permission;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.Node;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
@ -34,7 +35,6 @@ import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.TemporaryModifier;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.permission;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
import me.lucko.luckperms.common.commands.CommandException;
|
||||
@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
|
||||
import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.data.LogEntry;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
package me.lucko.luckperms.common.commands.impl.generic.permission;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
import me.lucko.luckperms.common.commands.Arg;
|
||||
import me.lucko.luckperms.common.commands.CommandException;
|
||||
@ -32,7 +33,6 @@ import me.lucko.luckperms.common.commands.utils.ArgumentUtils;
|
||||
import me.lucko.luckperms.common.commands.utils.Util;
|
||||
import me.lucko.luckperms.common.constants.Message;
|
||||
import me.lucko.luckperms.common.constants.Permission;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.data.LogEntry;
|
||||
|
@ -35,6 +35,7 @@ import com.google.common.collect.MultimapBuilder;
|
||||
import com.google.common.collect.SortedSetMultimap;
|
||||
|
||||
import me.lucko.luckperms.api.Contexts;
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.LocalizedNode;
|
||||
import me.lucko.luckperms.api.Node;
|
||||
import me.lucko.luckperms.api.Tristate;
|
||||
@ -46,7 +47,6 @@ import me.lucko.luckperms.common.caching.handlers.GroupReference;
|
||||
import me.lucko.luckperms.common.caching.handlers.HolderReference;
|
||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||
import me.lucko.luckperms.common.core.ContextSetComparator;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.InheritanceInfo;
|
||||
import me.lucko.luckperms.common.core.NodeComparator;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
|
6
pom.xml
6
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>me.lucko.luckperms</groupId>
|
||||
<artifactId>luckperms</artifactId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
<modules>
|
||||
<module>api</module>
|
||||
<module>common</module>
|
||||
@ -40,12 +40,12 @@
|
||||
<skipTests>true</skipTests>
|
||||
<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>
|
||||
|
||||
<compiler.version>3.6.1</compiler.version>
|
||||
<shade.version>3.0.0</shade.version>
|
||||
<lombok.version>1.16.14</lombok.version>
|
||||
<lombok.version>1.16.16</lombok.version>
|
||||
</properties>
|
||||
|
||||
<distributionManagement>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>luckperms</artifactId>
|
||||
<groupId>me.lucko.luckperms</groupId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -29,12 +29,12 @@ import lombok.NonNull;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.Node;
|
||||
import me.lucko.luckperms.api.Tristate;
|
||||
import me.lucko.luckperms.api.context.ContextSet;
|
||||
import me.lucko.luckperms.api.context.ImmutableContextSet;
|
||||
import me.lucko.luckperms.common.caching.MetaAccumulator;
|
||||
import me.lucko.luckperms.common.core.DataMutateResult;
|
||||
import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.Group;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
|
Loading…
Reference in New Issue
Block a user