Fix EditSession initialisation without a World (#2435)

This commit is contained in:
Maddy Miller 2023-11-21 21:33:35 +10:00 committed by GitHub
parent 98d396f5bf
commit e7c9e64645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -372,6 +372,10 @@ public class EditSession implements Extent, AutoCloseable {
*/
@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!");
}