allow plugins extending and replacing RegionManager to be notified of, and "accept" plot clear "requests".

.
.
.
.
.
FAWE
This commit is contained in:
dordsor21 2020-07-01 20:04:37 +01:00
parent eff410d1da
commit b71de856a8

View File

@ -29,6 +29,7 @@ import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotManager;
import com.plotsquared.core.queue.LocalBlockQueue; import com.plotsquared.core.queue.LocalBlockQueue;
import com.plotsquared.core.util.task.RunnableVal; import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.TaskManager; import com.plotsquared.core.util.task.TaskManager;
@ -163,6 +164,20 @@ public abstract class RegionManager {
return queue.enqueue(); return queue.enqueue();
} }
/**
* Notify any plugins that may want to modify clear behaviour that a clear is occuring
*
* @return true if the notified will accept the clear task
*/
public boolean notifyClear() {
return false;
}
/**
* Only called when {@link RegionManager#notifyClear()} returns true in specific PlotManagers
*/
public abstract boolean handleClear(Plot plot, final Runnable whenDone, PlotManager manager);
/** /**
* Copy a region to a new location (in the same world) * Copy a region to a new location (in the same world)
*/ */