mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
Show old flag value in remove command (#3711)
This commit is contained in:
parent
26bec7fe2f
commit
005600c99e
@ -462,6 +462,7 @@ public final class FlagCommand extends Command {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Plot plot = player.getLocation().getPlotAbs();
|
final Plot plot = player.getLocation().getPlotAbs();
|
||||||
|
final PlotFlag<?, ?> flagWithOldValue = plot.getFlagContainer().getFlag(flag.getClass());
|
||||||
PlotFlagRemoveEvent event = eventDispatcher.callFlagRemove(flag, plot);
|
PlotFlagRemoveEvent event = eventDispatcher.callFlagRemove(flag, plot);
|
||||||
if (event.getEventResult() == Result.DENY) {
|
if (event.getEventResult() == Result.DENY) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
@ -506,7 +507,7 @@ public final class FlagCommand extends Command {
|
|||||||
if (plot.removeFlag(flag)) {
|
if (plot.removeFlag(flag)) {
|
||||||
player.sendMessage(TranslatableCaption.of("flag.flag_removed"), Template.of("flag", args[0]), Template.of(
|
player.sendMessage(TranslatableCaption.of("flag.flag_removed"), Template.of("flag", args[0]), Template.of(
|
||||||
"value",
|
"value",
|
||||||
String.valueOf(flag)
|
String.valueOf(flagWithOldValue)
|
||||||
));
|
));
|
||||||
return;
|
return;
|
||||||
} else {
|
} 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(
|
player.sendMessage(TranslatableCaption.of("flag.flag_removed"), Template.of("flag", args[0]), Template.of(
|
||||||
"value",
|
"value",
|
||||||
String.valueOf(flag)
|
String.valueOf(flagWithOldValue)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user