mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-24 11:44:24 +00:00
Implement default assignment system (#25)
This commit is contained in:
12 files changed
+578
-54
No files matched your search
@@ -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.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -97,9 +98,33 @@ class SpongeConfig extends AbstractConfiguration<LPSpongePlugin> {
|
||||
return getNode(path).getBoolean(def);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> getList(String path, List<String> def) {
|
||||
ConfigurationNode node = getNode(path);
|
||||
if (node.isVirtual()) {
|
||||
return def;
|
||||
}
|
||||
|
||||
return node.getList(Object::toString);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> getObjectList(String path, List<String> def) {
|
||||
ConfigurationNode node = getNode(path);
|
||||
if (node.isVirtual()) {
|
||||
return def;
|
||||
}
|
||||
|
||||
return node.getChildrenList().stream().map(n -> (String) n.getKey()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getMap(String path, Map<String, String> def) {
|
||||
ConfigurationNode node = getNode(path);
|
||||
if (node.isVirtual()) {
|
||||
return def;
|
||||
}
|
||||
|
||||
return node.getChildrenList().stream().collect(Collectors.toMap(n -> (String) n.getKey(), ConfigurationNode::getString));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user