mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-09-09 05:40:47 +02:00
Web editor changes
This commit is contained in:
@@ -61,15 +61,15 @@ public interface PlayerSaveResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the old username involved in the result.
|
||||
* Gets the previous username involved in the result.
|
||||
*
|
||||
* <p>Returns null when the result doesn't {@link #includes(Outcome) include} the
|
||||
* {@link Outcome#USERNAME_UPDATED} status.</p>
|
||||
*
|
||||
* @return the old username
|
||||
* @return the previous username
|
||||
* @see Outcome#USERNAME_UPDATED
|
||||
*/
|
||||
@Nullable String getOldUsername();
|
||||
@Nullable String getPreviousUsername();
|
||||
|
||||
/**
|
||||
* Gets the other uuids involved in the result.
|
||||
|
@@ -26,6 +26,8 @@
|
||||
package net.luckperms.api.node;
|
||||
|
||||
import net.luckperms.api.node.types.ChatMetaNode;
|
||||
import net.luckperms.api.node.types.PrefixNode;
|
||||
import net.luckperms.api.node.types.SuffixNode;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
@@ -37,12 +39,32 @@ public enum ChatMetaType {
|
||||
/**
|
||||
* Represents a prefix
|
||||
*/
|
||||
PREFIX(NodeType.PREFIX),
|
||||
PREFIX(NodeType.PREFIX) {
|
||||
@Override
|
||||
public ChatMetaNode.@NonNull Builder<?, ?> builder() {
|
||||
return PrefixNode.builder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatMetaNode.@NonNull Builder<?, ?> builder(@NonNull String prefix, int priority) {
|
||||
return PrefixNode.builder(prefix, priority);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Represents a suffix
|
||||
*/
|
||||
SUFFIX(NodeType.SUFFIX);
|
||||
SUFFIX(NodeType.SUFFIX) {
|
||||
@Override
|
||||
public ChatMetaNode.@NonNull Builder<?, ?> builder() {
|
||||
return SuffixNode.builder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatMetaNode.@NonNull Builder<?, ?> builder(@NonNull String suffix, int priority) {
|
||||
return SuffixNode.builder(suffix, priority);
|
||||
}
|
||||
};
|
||||
|
||||
private final String name;
|
||||
private final NodeType<? extends ChatMetaNode<?, ?>> nodeType;
|
||||
@@ -61,6 +83,22 @@ public enum ChatMetaType {
|
||||
return this.nodeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link ChatMetaNode.Builder} for the {@link ChatMetaType}.
|
||||
*
|
||||
* @return a builder
|
||||
*/
|
||||
public abstract ChatMetaNode.@NonNull Builder<?, ?> builder();
|
||||
|
||||
/**
|
||||
* Creates a {@link ChatMetaNode.Builder} for the {@link ChatMetaType}.
|
||||
*
|
||||
* @param value the value to set
|
||||
* @param priority the priority to set
|
||||
* @return a builder
|
||||
*/
|
||||
public abstract ChatMetaNode.@NonNull Builder<?, ?> builder(@NonNull String value, int priority);
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name;
|
||||
|
@@ -26,7 +26,6 @@
|
||||
package net.luckperms.api.node;
|
||||
|
||||
import net.luckperms.api.LuckPermsProvider;
|
||||
import net.luckperms.api.context.ContextSet;
|
||||
import net.luckperms.api.context.ImmutableContextSet;
|
||||
import net.luckperms.api.node.metadata.NodeMetadataKey;
|
||||
import net.luckperms.api.node.types.DisplayNameNode;
|
||||
@@ -42,7 +41,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -134,21 +133,6 @@ public interface Node {
|
||||
return !getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if this node applies globally, and therefore has no specific context.
|
||||
*
|
||||
* @return true if this node applies globally, and has no specific context
|
||||
*/
|
||||
boolean appliesGlobally();
|
||||
|
||||
/**
|
||||
* Gets if this node should apply in the given context
|
||||
*
|
||||
* @param contextSet the context set
|
||||
* @return true if the node should apply
|
||||
*/
|
||||
boolean shouldApplyWithContext(@NonNull ContextSet contextSet);
|
||||
|
||||
/**
|
||||
* Resolves any shorthand parts of this node and returns the full list of
|
||||
* resolved nodes.
|
||||
@@ -157,7 +141,7 @@ public interface Node {
|
||||
*
|
||||
* @return a list of full nodes
|
||||
*/
|
||||
@NonNull List<String> resolveShorthand();
|
||||
@NonNull Collection<String> resolveShorthand();
|
||||
|
||||
/**
|
||||
* Gets if this node is assigned temporarily.
|
||||
@@ -172,7 +156,7 @@ public interface Node {
|
||||
* @return the {@link Instant} when this node will expire, or null if it
|
||||
* doesn't have an expiry time
|
||||
*/
|
||||
@Nullable Instant getExpiry() throws IllegalStateException;
|
||||
@Nullable Instant getExpiry();
|
||||
|
||||
/**
|
||||
* Gets if the node has expired.
|
||||
|
Reference in New Issue
Block a user