From 073b0b612c92387435b8b0eefca876eed16245b1 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Tue, 10 Mar 2015 21:21:38 +1100 Subject: [PATCH] Fixed issue with default flags not being parsed when added --- .../java/com/intellectualcrafters/plot/PlotSquared.java | 4 ++++ .../com/intellectualcrafters/plot/flag/FlagManager.java | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java index 16b6f6de1..3ead9f356 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java @@ -936,4 +936,8 @@ public class PlotSquared { public static Set getPlotWorlds() { return plotworlds.keySet(); } + + public static Collection getPlotWorldObjects() { + return plotworlds.values(); + } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java index dfd8b7cf0..355a7390e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java @@ -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) {