From 08800ec16daf1398c47fe191047a32764151a5f3 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sun, 22 Jan 2023 11:26:07 +0100 Subject: [PATCH] Cleanup deperecated WorldEdit met Co-authored-by: Matthew Kaulfers <42121989+mkaulfers@users.noreply.github.com> --- Core/src/main/java/com/plotsquared/core/command/Area.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Area.java b/Core/src/main/java/com/plotsquared/core/command/Area.java index 093ca744d..32e6d7ea6 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Area.java +++ b/Core/src/main/java/com/plotsquared/core/command/Area.java @@ -56,6 +56,7 @@ import com.plotsquared.core.util.TabCompletions; import com.plotsquared.core.util.WorldUtil; import com.plotsquared.core.util.task.RunnableVal3; import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.EditSessionBuilder; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.entity.Player; @@ -228,10 +229,9 @@ public class Area extends SubCommand { try (final ClipboardWriter clipboardWriter = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream( file))) { final BlockArrayClipboard clipboard = new BlockArrayClipboard(selectedRegion); - final EditSession editSession = WorldEdit - .getInstance() - .getEditSessionFactory() - .getEditSession(selectedRegion.getWorld(), -1); + EditSessionBuilder editSessionBuilder = WorldEdit.getInstance().newEditSessionBuilder(); + editSessionBuilder.world(selectedRegion.getWorld()); + final EditSession editSession = editSessionBuilder.build(); final ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy(editSession, selectedRegion, clipboard, selectedRegion.getMinimumPoint()); forwardExtentCopy.setCopyingBiomes(true);