From cfd432886d6789a0bba34374de6904a3a2e2c5ed Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 11 Oct 2020 19:19:17 +0100 Subject: [PATCH] Correctly handle road flags --- .../com/plotsquared/core/plot/PlotArea.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java index 704068a3d..0076b27e2 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java @@ -374,24 +374,21 @@ public abstract class PlotArea { this.spawnCustom = config.getBoolean("event.spawn.custom"); this.spawnBreeding = config.getBoolean("event.spawn.breeding"); - List roadflags = config.getStringList("flags.default"); + List roadflags = config.getStringList("road.flags"); if (roadflags.isEmpty()) { - roadflags = config.getStringList("road.flags"); - if (roadflags.isEmpty()) { - roadflags = new ArrayList<>(); - ConfigurationSection section = config.getConfigurationSection("road.flags"); - Set keys = section.getKeys(false); - for (String key : keys) { - if (!"default".equals(key)) { - roadflags.add(key + ';' + section.get(key)); - } + roadflags = new ArrayList<>(); + ConfigurationSection section = config.getConfigurationSection("road.flags"); + Set keys = section.getKeys(false); + for (String key : keys) { + if (!"default".equals(key)) { + roadflags.add(key + ';' + section.get(key)); } } } this.getRoadFlagContainer().addAll(parseFlags(roadflags)); StringBuilder roadFlagBuilder = new StringBuilder(); - Collection> roadFlagCollection = this.getFlagContainer().getFlagMap().values(); + Collection> roadFlagCollection = this.getRoadFlagContainer().getFlagMap().values(); if (roadFlagCollection.isEmpty()) { roadFlagBuilder.append(Captions.NONE.getTranslated()); } else {