correctly handle road flags

This commit is contained in:
dordsor21 2020-10-11 19:24:50 +01:00
parent 191666a2f2
commit a1bfc1cb26
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -388,17 +388,14 @@ public abstract class PlotArea {
this.spawnCustom = config.getBoolean("event.spawn.custom"); this.spawnCustom = config.getBoolean("event.spawn.custom");
this.spawnBreeding = config.getBoolean("event.spawn.breeding"); this.spawnBreeding = config.getBoolean("event.spawn.breeding");
List<String> roadflags = config.getStringList("flags.default"); List<String> roadflags = config.getStringList("road.flags");
if (roadflags.isEmpty()) { if (roadflags.isEmpty()) {
roadflags = config.getStringList("road.flags"); roadflags = new ArrayList<>();
if (roadflags.isEmpty()) { ConfigurationSection section = config.getConfigurationSection("road.flags");
roadflags = new ArrayList<>(); Set<String> keys = section.getKeys(false);
ConfigurationSection section = config.getConfigurationSection("road.flags"); for (String key : keys) {
Set<String> keys = section.getKeys(false); if (!"default".equals(key)) {
for (String key : keys) { roadflags.add(key + ';' + section.get(key));
if (!"default".equals(key)) {
roadflags.add(key + ';' + section.get(key));
}
} }
} }
} }