From e54f964eca6fc4904bdf70205a9361502f9ca3e2 Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Tue, 22 Jan 2019 18:51:13 +0100 Subject: [PATCH] Fix #2009 --- .../plotsquared/plot/commands/FlagCmd.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java index b33f672ca..a3d3e5b85 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java @@ -186,7 +186,17 @@ import java.util.*; if (flag1.isPresent()) { boolean o = flag1.get().removeAll((Collection) flag.parseValue(value)); if (o) { - MainUtil.sendMessage(player, C.FLAG_REMOVED); + if (flag1.get().isEmpty()) { + final boolean result = plot.removeFlag(flag); + if (result) { + MainUtil.sendMessage(player, C.FLAG_REMOVED); + } else { + MainUtil.sendMessage(player, C.FLAG_NOT_REMOVED); + } + return true; + } else { + MainUtil.sendMessage(player, C.FLAG_REMOVED); + } } else { MainUtil.sendMessage(player, C.FLAG_NOT_REMOVED); return false;