Expose MetaStacks in the API, general cleanup, release 3.2
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>luckperms</artifactId>
|
||||
<groupId>me.lucko.luckperms</groupId>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
<version>3.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import me.lucko.luckperms.api.ChatMetaType;
|
||||
import me.lucko.luckperms.api.LocalizedNode;
|
||||
import me.lucko.luckperms.api.Node;
|
||||
import me.lucko.luckperms.api.Tristate;
|
||||
import me.lucko.luckperms.api.context.ImmutableContextSet;
|
||||
import me.lucko.luckperms.common.caching.MetaAccumulator;
|
||||
import me.lucko.luckperms.common.core.model.Group;
|
||||
import me.lucko.luckperms.common.metastacking.MetaType;
|
||||
import me.lucko.luckperms.common.utils.ExtractedContexts;
|
||||
import me.lucko.luckperms.sponge.LPSpongePlugin;
|
||||
import me.lucko.luckperms.sponge.service.LuckPermsService;
|
||||
@@ -198,10 +198,10 @@ public class SpongeGroup extends Group {
|
||||
try (Timing ignored = plugin.getService().getPlugin().getTimings().time(LPTiming.GROUP_GET_OPTION)) {
|
||||
Optional<String> option;
|
||||
if (s.equalsIgnoreCase("prefix")) {
|
||||
option = getChatMeta(contexts, MetaType.PREFIX);
|
||||
option = getChatMeta(contexts, ChatMetaType.PREFIX);
|
||||
|
||||
} else if (s.equalsIgnoreCase("suffix")) {
|
||||
option = getChatMeta(contexts, MetaType.SUFFIX);
|
||||
option = getChatMeta(contexts, ChatMetaType.SUFFIX);
|
||||
|
||||
} else {
|
||||
option = getMeta(contexts, s);
|
||||
@@ -227,7 +227,7 @@ public class SpongeGroup extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
private Optional<String> getChatMeta(ImmutableContextSet contexts, MetaType type) {
|
||||
private Optional<String> getChatMeta(ImmutableContextSet contexts, ChatMetaType type) {
|
||||
MetaAccumulator metaAccumulator = parent.accumulateMeta(null, null, ExtractedContexts.generate(plugin.getService().calculateContexts(contexts)));
|
||||
return Optional.ofNullable(metaAccumulator.getStack(type).toFormattedString());
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import lombok.NonNull;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import me.lucko.luckperms.api.ChatMetaType;
|
||||
import me.lucko.luckperms.api.DataMutateResult;
|
||||
import me.lucko.luckperms.api.Node;
|
||||
import me.lucko.luckperms.api.Tristate;
|
||||
@@ -41,7 +42,6 @@ import me.lucko.luckperms.common.core.NodeFactory;
|
||||
import me.lucko.luckperms.common.core.model.Group;
|
||||
import me.lucko.luckperms.common.core.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.core.model.User;
|
||||
import me.lucko.luckperms.common.metastacking.MetaType;
|
||||
import me.lucko.luckperms.common.utils.ExtractedContexts;
|
||||
import me.lucko.luckperms.sponge.service.model.LPSubject;
|
||||
import me.lucko.luckperms.sponge.service.model.LPSubjectData;
|
||||
@@ -370,7 +370,7 @@ public class LuckPermsSubjectData implements LPSubjectData {
|
||||
try (Timing i = service.getPlugin().getTimings().time(LPTiming.LP_SUBJECT_SET_OPTION)) {
|
||||
if (key.equalsIgnoreCase("prefix") || key.equalsIgnoreCase("suffix")) {
|
||||
// special handling.
|
||||
MetaType type = MetaType.valueOf(key.toUpperCase());
|
||||
ChatMetaType type = ChatMetaType.valueOf(key.toUpperCase());
|
||||
|
||||
// remove all prefixes/suffixes from the user
|
||||
List<Node> toRemove = streamNodes(enduring)
|
||||
|
||||
Reference in New Issue
Block a user