From 0f8c334de8c834d97786a5950159b470e9b36d34 Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 22 Jan 2017 19:01:34 +0000 Subject: [PATCH] FIx stacking backwards compatibility --- .../me/lucko/luckperms/common/config/ConfigKeys.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java index 0f245238..033007ca 100644 --- a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java +++ b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java @@ -40,7 +40,7 @@ import me.lucko.luckperms.common.defaults.Rule; import me.lucko.luckperms.common.storage.DatastoreConfiguration; import me.lucko.luckperms.common.utils.ImmutableCollectors; -import java.util.Collections; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -72,7 +72,10 @@ public class ConfigKeys { ); }); public static final ConfigKey PREFIX_FORMATTING_OPTIONS = AbstractKey.of(l -> { - List format = l.getList("meta-formatting.prefix.format", Collections.singletonList("highest")); + List format = l.getList("meta-formatting.prefix.format", new ArrayList<>()); + if (format.isEmpty()) { + format.add("highest"); + } String startSpacer = l.getString("meta-formatting.prefix.start-spacer", ""); String middleSpacer = l.getString("meta-formatting.prefix.middle-spacer", " "); String endSpacer = l.getString("meta-formatting.prefix.end-spacer", ""); @@ -80,7 +83,10 @@ public class ConfigKeys { return new GenericMetaStack(StackElementFactory.fromList(l.getPlugin(), format, true), startSpacer, middleSpacer, endSpacer); }); public static final ConfigKey SUFFIX_FORMATTING_OPTIONS = AbstractKey.of(l -> { - List format = l.getList("meta-formatting.suffix.format", Collections.singletonList("highest")); + List format = l.getList("meta-formatting.suffix.format", new ArrayList<>()); + if (format.isEmpty()) { + format.add("highest"); + } String startSpacer = l.getString("meta-formatting.suffix.start-spacer", ""); String middleSpacer = l.getString("meta-formatting.suffix.middle-spacer", " "); String endSpacer = l.getString("meta-formatting.suffix.end-spacer", "");