From 2c2d27893de7ef6fe50011ae2b02d6c2041a5bcb Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 5 Aug 2022 12:32:06 +0200 Subject: [PATCH] Fix redo too --- .../de/steamwar/bausystem/region/Region.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java index 834f266d..ef66d4c8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java @@ -517,20 +517,15 @@ public class Region { public boolean redo() { initSessions(); - EditSession session = null; - try { - session = redoSessions.pop(); - if (session == null) { - return false; - } - session.redo(session); - undoSessions.push(session); - return true; - } finally { - if (session != null) { - session.flushSession(); - } + EditSession session = redoSessions.pop(); + if (session == null) + return false; + + try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) { + session.redo(e); + undoSessions.push(e); } + return true; } public boolean backup() {