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) {