From 005600c99eec6eac0ce5823cccb47a26de754bab Mon Sep 17 00:00:00 2001 From: Traks <58818927+traksag@users.noreply.github.com> Date: Mon, 27 Jun 2022 13:31:45 +0200 Subject: [PATCH] Show old flag value in remove command (#3711) --- .../main/java/com/plotsquared/core/command/FlagCommand.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/FlagCommand.java b/Core/src/main/java/com/plotsquared/core/command/FlagCommand.java index f5868c031..16d28c38a 100644 --- a/Core/src/main/java/com/plotsquared/core/command/FlagCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/FlagCommand.java @@ -462,6 +462,7 @@ public final class FlagCommand extends Command { return; } final Plot plot = player.getLocation().getPlotAbs(); + final PlotFlag flagWithOldValue = plot.getFlagContainer().getFlag(flag.getClass()); PlotFlagRemoveEvent event = eventDispatcher.callFlagRemove(flag, plot); if (event.getEventResult() == Result.DENY) { player.sendMessage( @@ -506,7 +507,7 @@ public final class FlagCommand extends Command { if (plot.removeFlag(flag)) { player.sendMessage(TranslatableCaption.of("flag.flag_removed"), Template.of("flag", args[0]), Template.of( "value", - String.valueOf(flag) + String.valueOf(flagWithOldValue) )); return; } else { @@ -544,7 +545,7 @@ public final class FlagCommand extends Command { } player.sendMessage(TranslatableCaption.of("flag.flag_removed"), Template.of("flag", args[0]), Template.of( "value", - String.valueOf(flag) + String.valueOf(flagWithOldValue) )); }