Fixed issue with default flags not being parsed when added

This commit is contained in:
boy0001 2015-03-10 21:21:38 +11:00
parent 61ebd2a144
commit 073b0b612c
2 changed files with 11 additions and 1 deletions

View File

@ -936,4 +936,8 @@ public class PlotSquared {
public static Set<String> getPlotWorlds() {
return plotworlds.keySet();
}
public static Collection<PlotWorld> getPlotWorldObjects() {
return plotworlds.values();
}
}

View File

@ -59,7 +59,13 @@ public class FlagManager {
*/
public static boolean addFlag(final AbstractFlag af) {
PlotSquared.log(C.PREFIX.s() + "&8 - Adding flag: &7" + af);
af.getKey();
for (PlotWorld plotworld : PlotSquared.getPlotWorldObjects()) {
for (final Flag flag : plotworld.DEFAULT_FLAGS) {
if (flag.getAbstractFlag().getKey().equals(af.getKey())) {
flag.setKey(af);
}
}
}
if (PlotSquared.getAllPlotsRaw() != null) {
for (final Plot plot : PlotSquared.getPlots()) {
for (final Flag flag : plot.settings.flags) {