From 420ec2bf1ad4f2201500e695a51b68041a441d47 Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 18 Apr 2019 23:14:23 +0100 Subject: [PATCH] Don't attempt to read a boolean 'value' from parent/chatmeta/meta entries in file based storage files (#1505) --- .../file/AbstractConfigurateStorage.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/AbstractConfigurateStorage.java b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/AbstractConfigurateStorage.java index c704259ee..a7e379198 100644 --- a/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/AbstractConfigurateStorage.java +++ b/common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/AbstractConfigurateStorage.java @@ -456,8 +456,7 @@ public abstract class AbstractConfigurateStorage implements StorageImplementatio return this.uuidCache.lookupUsername(uuid); } - private static NodeDataContainer readAttributes(ConfigurationNode attributes, Function permissionFunction) { - boolean value = attributes.getNode("value").getBoolean(true); + private static NodeDataContainer readMetaAttributes(ConfigurationNode attributes, Function permissionFunction) { String server = attributes.getNode("server").getString("global"); String world = attributes.getNode("world").getString("global"); long expiry = attributes.getNode("expiry").getLong(0L); @@ -468,7 +467,7 @@ public abstract class AbstractConfigurateStorage implements StorageImplementatio context = ContextSetConfigurateSerializer.deserializeContextSet(contextMap).makeImmutable(); } - return NodeDataContainer.of(permissionFunction.apply(attributes), value, server, world, expiry, context); + return NodeDataContainer.of(permissionFunction.apply(attributes), true, server, world, expiry, context); } private static Collection readAttributes(ConfigurationNode attributes, String permission) { @@ -561,7 +560,7 @@ public abstract class AbstractConfigurateStorage implements StorageImplementatio if (entry == null) { continue; } - nodes.add(readAttributes(entry.getValue(), c -> NodeFactory.groupNode(entry.getKey()))); + nodes.add(readMetaAttributes(entry.getValue(), c -> NodeFactory.groupNode(entry.getKey()))); } } @@ -574,7 +573,7 @@ public abstract class AbstractConfigurateStorage implements StorageImplementatio if (entry == null) { continue; } - nodes.add(readAttributes(entry.getValue(), c -> NodeFactory.chatMetaNode(chatMetaType, c.getNode("priority").getInt(0), entry.getKey()))); + nodes.add(readMetaAttributes(entry.getValue(), c -> NodeFactory.chatMetaNode(chatMetaType, c.getNode("priority").getInt(0), entry.getKey()))); } } } @@ -586,7 +585,7 @@ public abstract class AbstractConfigurateStorage implements StorageImplementatio if (entry == null) { continue; } - nodes.add(readAttributes(entry.getValue(), c -> NodeFactory.metaNode(entry.getKey(), c.getNode("value").getString("null")))); + nodes.add(readMetaAttributes(entry.getValue(), c -> NodeFactory.metaNode(entry.getKey(), c.getNode("value").getString("null")))); } }