mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-04-16 00:45:49 +02:00
Implement world blacklist config
This commit is contained in:
parent
c569bc797f
commit
6888783d01
@ -7,6 +7,8 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class WorldConfig {
|
||||
private final WorldConfigNodes configNodes;
|
||||
private final ConfigurationSectionHandle configHandle;
|
||||
@ -44,4 +46,12 @@ public class WorldConfig {
|
||||
public boolean isHidden() {
|
||||
return configHandle.get(configNodes.HIDDEN);
|
||||
}
|
||||
|
||||
public List<String> getWorldBlacklist() {
|
||||
return (List<String>) configHandle.get(configNodes.WORLD_BLACKLIST);
|
||||
}
|
||||
|
||||
public void setWorldBlacklist(List<String> worldBlacklist) {
|
||||
configHandle.set(configNodes.WORLD_BLACKLIST, worldBlacklist);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,9 @@ import org.bukkit.Difficulty;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class WorldConfigNodes {
|
||||
private static final NodeSerializer<?> ENUM_NODE_SERIALIZER = new EnumNodeSerializer<>();
|
||||
|
||||
@ -126,6 +129,11 @@ public class WorldConfigNodes {
|
||||
.name("seed")
|
||||
.build());
|
||||
|
||||
public final ConfigNode<List> WORLD_BLACKLIST = node(ConfigNode.builder("world-blacklist", List.class)
|
||||
.defaultValue(new ArrayList<>())
|
||||
.name("world-blacklist")
|
||||
.build());
|
||||
|
||||
//todo: color and style
|
||||
//todo: spawning
|
||||
//todo: entryfee
|
||||
|
Loading…
Reference in New Issue
Block a user