Fix wna when used internally

This commit is contained in:
dordsor21
2021-01-09 21:27:55 +00:00
parent 6f0180447f
commit 6bc3dd2293
18 changed files with 324 additions and 41 deletions

View File

@ -222,6 +222,8 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
private final int maxY;
private final List<WatchdogTickingExtent> watchdogExtents = new ArrayList<>(2);
private final boolean wnaMode;
@Deprecated
public EditSession(@NotNull EventBus bus, World world, @Nullable Player player,
@ -257,6 +259,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
this.maxY = world.getMaxY();
this.blockBag = builder.getBlockBag();
this.history = changeSet != null;
this.wnaMode = builder.isWNAMode();
}
/**
@ -1075,6 +1078,9 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
player.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.outside.level"));
}
}
if (wnaMode) {
getWorld().flush();
}
// Reset limit
limit.set(originalLimit);
// Enqueue it