mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Correctly handle road flags
This commit is contained in:
parent
b55d836871
commit
cfd432886d
1 changed files with 8 additions and 11 deletions
|
@ -374,24 +374,21 @@ 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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.getRoadFlagContainer().addAll(parseFlags(roadflags));
|
this.getRoadFlagContainer().addAll(parseFlags(roadflags));
|
||||||
|
|
||||||
StringBuilder roadFlagBuilder = new StringBuilder();
|
StringBuilder roadFlagBuilder = new StringBuilder();
|
||||||
Collection<PlotFlag<?, ?>> roadFlagCollection = this.getFlagContainer().getFlagMap().values();
|
Collection<PlotFlag<?, ?>> roadFlagCollection = this.getRoadFlagContainer().getFlagMap().values();
|
||||||
if (roadFlagCollection.isEmpty()) {
|
if (roadFlagCollection.isEmpty()) {
|
||||||
roadFlagBuilder.append(Captions.NONE.getTranslated());
|
roadFlagBuilder.append(Captions.NONE.getTranslated());
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue