mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-02-11 19:50:38 +00:00
Fixes #1126
This commit is contained in:
parent
b2b90a8d17
commit
4319300b34
1 changed files with 15 additions and 11 deletions
|
@ -217,18 +217,22 @@ public class FlagManager {
|
|||
* @param id the flag to remove
|
||||
* @return true if the plot contained the flag and was removed successfully
|
||||
*/
|
||||
public static boolean removePlotFlag(Plot plot, Flag<?> id) {
|
||||
Object value = plot.getFlags().remove(id);
|
||||
if (value == null) {
|
||||
return false;
|
||||
public static boolean removePlotFlag(Plot origin, Flag<?> id) {
|
||||
for (Plot plot : origin.getConnectedPlots()) {
|
||||
Object value = plot.getFlags().remove(id);
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
if (plot == origin) {
|
||||
boolean result = EventUtil.manager.callFlagRemove(id, plot, value);
|
||||
if (!result) {
|
||||
plot.getFlags().put(id, value);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
plot.reEnter();
|
||||
DBFunc.setFlags(plot, plot.getFlags());
|
||||
}
|
||||
boolean result = EventUtil.manager.callFlagRemove(id, plot, value);
|
||||
if (!result) {
|
||||
plot.getFlags().put(id, value);
|
||||
return false;
|
||||
}
|
||||
plot.reEnter();
|
||||
DBFunc.setFlags(plot, plot.getFlags());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue