From a8c8a0fbd62d3bf1e0ea794fd1a6ed26c50a4153 Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 19 Jun 2023 15:34:54 +0200 Subject: [PATCH] fix: always return the changeset from EditSessionBuilder (#2302) - Ensure history will actually always be closed if combine-stages is false - Fixes #2148 --- .../main/java/com/sk89q/worldedit/EditSessionBuilder.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionBuilder.java index ead916f45..ea27f03b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionBuilder.java @@ -72,7 +72,6 @@ import org.apache.logging.log4j.Logger; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import java.util.Arrays; import java.util.HashSet; import java.util.Locale; import java.util.Set; @@ -99,7 +98,6 @@ public final class EditSessionBuilder { private RelightMode relightMode; private Relighter relighter; private Boolean wnaMode; - private AbstractChangeSet changeTask; private Extent bypassHistory; private Extent bypassAll; private Extent extent; @@ -522,7 +520,6 @@ public final class EditSessionBuilder { changeSet = new BlockBagChangeSet(changeSet, blockBag, limit.INVENTORY_MODE == 1); } if (combineStages) { - changeTask = changeSet; this.extent = extent.enableHistory(changeSet); } else { this.extent = new HistoryExtent(extent, changeSet); @@ -699,7 +696,7 @@ public final class EditSessionBuilder { * Get the change set that will be used for history */ public AbstractChangeSet getChangeTask() { - return changeTask; + return changeSet; } /**