From 29bebcd03499b333b6dc14579fc23e066607cf2c Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 25 Aug 2021 15:32:25 +0100 Subject: [PATCH] Fully fix #949 --- .../main/java/com/sk89q/worldedit/LocalSession.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index ede31707f..d9c3a4489 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -623,15 +623,17 @@ public class LocalSession implements TextureHolder { setDirty(); historyNegativeIndex--; ChangeSet changeSet = getChangeSet(history.get(getHistoryIndex())); - try (EditSession newEditSession = new EditSessionBuilder(world) - .allowedRegionsEverywhere() + EditSessionBuilder builder = new EditSessionBuilder(world) .checkMemory(false) .changeSetNull() .fastmode(false) .limitUnprocessed((Player) actor) .player((Player) actor) - .blockBag(getBlockBag((Player) actor)) - .build()) { + .blockBag(getBlockBag((Player) actor)); + if (!actor.getLimit().RESTRICT_HISTORY_TO_REGIONS) { + builder.allowedRegionsEverywhere(); + } + try (EditSession newEditSession = builder.build()) { newEditSession.setBlocks(changeSet, ChangeSetExecutor.Type.REDO); return newEditSession; }