Skip to content

Commit

Permalink
fix: Flag list parsing for console players (#3277)
Browse files Browse the repository at this point in the history
Instead of recreating the logic, we can simply reuse what we created above and string-ify that for parsing.
  • Loading branch information
NotMyFault authored Oct 18, 2021
1 parent cb596ee commit b022a97
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,9 @@ public void loadDefaultConfiguration(ConfigurationSection config) {
}
}
this.getFlagContainer().addAll(parseFlags(flags));

Component flagsComponent = null;
Collection<PlotFlag<?, ?>> flagCollection = this.getFlagContainer().getFlagMap().values();
flagsComponent = getFlagsComponent(flagsComponent, flagCollection);
ConsolePlayer.getConsole().sendMessage(
TranslatableCaption.of("flags.area_flags"),
Template.of("flags", flagsComponent)
Template.of("flags", flags.toString())
);

this.spawnEggs = config.getBoolean("event.spawn.egg");
Expand All @@ -433,13 +429,9 @@ public void loadDefaultConfiguration(ConfigurationSection config) {
}
}
this.getRoadFlagContainer().addAll(parseFlags(roadflags));

Component roadFlagsComponent = null;
Collection<PlotFlag<?, ?>> roadFlagCollection = this.getRoadFlagContainer().getFlagMap().values();
roadFlagsComponent = getFlagsComponent(roadFlagsComponent, roadFlagCollection);
ConsolePlayer.getConsole().sendMessage(
TranslatableCaption.of("flags.road_flags"),
Template.of("flags", roadFlagsComponent)
Template.of("flags", roadflags.toString())
);

loadConfiguration(config);
Expand Down

0 comments on commit b022a97

Please sign in to comment.