Implement group weights

This commit is contained in:
Luck
2016-11-05 09:04:26 +00:00
Unverified
parent e15d03ed4e
commit 5361b1e87b
7 changed files with 45 additions and 2 deletions
@@ -34,6 +34,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -118,6 +119,7 @@ class SpongeConfig extends AbstractConfiguration<LPSpongePlugin> {
return node.getChildrenList().stream().map(n -> (String) n.getKey()).collect(Collectors.toList());
}
@SuppressWarnings("unchecked")
@Override
protected Map<String, String> getMap(String path, Map<String, String> def) {
ConfigurationNode node = getNode(path);
@@ -125,6 +127,7 @@ class SpongeConfig extends AbstractConfiguration<LPSpongePlugin> {
return def;
}
return node.getChildrenList().stream().collect(Collectors.toMap(n -> (String) n.getKey(), ConfigurationNode::getString));
Map<String, Object> m = (Map<String, Object>) node.getValue(Collections.emptyMap());
return m.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, v -> v.getValue().toString()));
}
}
+6
View File
@@ -75,6 +75,12 @@ apply-regex=true
# If set to true, LuckPerms will detect and expand shorthand node patterns.
apply-shorthand=true
# Define special group weights for this server.
# Default is just 0.
group-weight {
# admin=10
}