mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Add whenDone task to setCuboids and ensure whenDone tasks are added to the queue before FAWE might do something
This commit is contained in:
@ -107,11 +107,7 @@ public class DebugRoadRegen extends SubCommand {
|
||||
} else {
|
||||
PlotManager manager = area.getPlotManager();
|
||||
QueueCoordinator queue = area.getQueue();
|
||||
manager.createRoadEast(plot, queue);
|
||||
manager.createRoadSouth(plot, queue);
|
||||
manager.createRoadSouthEast(plot, queue);
|
||||
queue.setCompleteTask(() -> {
|
||||
;
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("debugroadregen.regen_done"),
|
||||
Template.of("value", plot.getId().toString())
|
||||
@ -121,6 +117,9 @@ public class DebugRoadRegen extends SubCommand {
|
||||
Template.of("value", "/plot regenallroads")
|
||||
);
|
||||
});
|
||||
manager.createRoadEast(plot, queue);
|
||||
manager.createRoadSouth(plot, queue);
|
||||
manager.createRoadSouthEast(plot, queue);
|
||||
queue.enqueue();
|
||||
}
|
||||
return true;
|
||||
|
@ -161,9 +161,6 @@ public class Set extends SubCommand {
|
||||
BackupManager.backup(player, plot, () -> {
|
||||
plot.addRunning();
|
||||
QueueCoordinator queue = plotArea.getQueue();
|
||||
for (final Plot current : plot.getConnectedPlots()) {
|
||||
current.getPlotModificationManager().setComponent(component, pattern, player, queue);
|
||||
}
|
||||
queue.setCompleteTask(() -> {
|
||||
plot.removeRunning();
|
||||
player.sendMessage(
|
||||
@ -179,6 +176,9 @@ public class Set extends SubCommand {
|
||||
.getInstance(ProgressSubscriberFactory.class)
|
||||
.createWithActor(player));
|
||||
}
|
||||
for (final Plot current : plot.getConnectedPlots()) {
|
||||
current.getPlotModificationManager().setComponent(component, pattern, player, queue);
|
||||
}
|
||||
queue.enqueue();
|
||||
player.sendMessage(TranslatableCaption.of("working.generating_component"));
|
||||
});
|
||||
|
@ -222,6 +222,7 @@ public class ComponentPresetManager {
|
||||
BackupManager.backup(getPlayer(), plot, () -> {
|
||||
plot.addRunning();
|
||||
QueueCoordinator queue = plot.getArea().getQueue();
|
||||
queue.setCompleteTask(plot::removeRunning);
|
||||
for (Plot current : plot.getConnectedPlots()) {
|
||||
current.getPlotModificationManager().setComponent(
|
||||
componentPreset.getComponent().name(),
|
||||
@ -230,7 +231,6 @@ public class ComponentPresetManager {
|
||||
queue
|
||||
);
|
||||
}
|
||||
queue.setCompleteTask(plot::removeRunning);
|
||||
queue.enqueue();
|
||||
getPlayer().sendMessage(TranslatableCaption.of("working.generating_component"));
|
||||
});
|
||||
|
@ -263,6 +263,12 @@ public class HybridPlotManager extends ClassicPlotManager {
|
||||
enqueue = true;
|
||||
queue = hybridPlotWorld.getQueue();
|
||||
}
|
||||
if (actor != null && Settings.QUEUE.NOTIFY_PROGRESS) {
|
||||
queue.addProgressSubscriber(subscriberFactory.createWithActor(actor));
|
||||
}
|
||||
if (whenDone != null) {
|
||||
queue.setCompleteTask(whenDone);
|
||||
}
|
||||
if (!canRegen) {
|
||||
queue.setCuboid(pos1.withY(0), pos2.withY(0), bedrock);
|
||||
// Each component has a different layer
|
||||
@ -274,12 +280,6 @@ public class HybridPlotManager extends ClassicPlotManager {
|
||||
queue.setRegenRegion(new CuboidRegion(pos1.getBlockVector3(), pos2.getBlockVector3()));
|
||||
}
|
||||
pastePlotSchematic(queue, pos1, pos2);
|
||||
if (actor != null && Settings.QUEUE.NOTIFY_PROGRESS) {
|
||||
queue.addProgressSubscriber(subscriberFactory.createWithActor(actor));
|
||||
}
|
||||
if (whenDone != null) {
|
||||
queue.setCompleteTask(whenDone);
|
||||
}
|
||||
return !enqueue || queue.enqueue();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user