From 19e8e8024bb220a68c73b0d64bb6e7d2e18682bc Mon Sep 17 00:00:00 2001 From: Madeline Miller Date: Sat, 4 Nov 2023 16:25:29 +1000 Subject: [PATCH] Fix EditSession initialisation without a World --- .../src/main/java/com/sk89q/worldedit/EditSession.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 4ef5244fcd..c2b7754db2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -303,7 +303,7 @@ public String getDisplayName() { this.bypassNone = extent; } - setReorderMode(this.reorderMode); + setReorderMode(ReorderMode.MULTI_STAGE); } private Extent traceIfNeeded(Extent input) { @@ -372,6 +372,10 @@ public void enableStandardMode() { */ @Deprecated public void setReorderMode(ReorderMode reorderMode) { + if (world == null && reorderMode == ReorderMode.FAST) { + // Fast requires a world, for now we can fallback to multi stage, but use "none" in the future. + reorderMode = ReorderMode.MULTI_STAGE; + } if (reorderMode == ReorderMode.FAST && sideEffectExtent == null) { throw new IllegalArgumentException("An EditSession without a fast mode tried to use it for reordering!"); }