mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fixes #1126
This commit is contained in:
parent
b2b90a8d17
commit
4319300b34
@ -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) {
|
||||
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());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user