From 83e274ff9f103156e47c0255c655f3ab0d38c877 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sun, 22 Jan 2023 11:21:01 +0100 Subject: [PATCH] Revert "PS-3908: Cleanup deprecated methods to improve code maturity. (#3944)" This reverts commit 0dd8b1053cfac7b137dc04e254dbe0582d77a6d3. --- .../main/java/com/plotsquared/core/command/Area.java | 11 ++++------- .../plotsquared/core/generator/HybridPlotWorld.java | 2 +- 2 files changed, 5 insertions(+), 8 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 5d9925f1a..093ca744d 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Area.java +++ b/Core/src/main/java/com/plotsquared/core/command/Area.java @@ -56,7 +56,6 @@ 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; @@ -229,14 +228,12 @@ public class Area extends SubCommand { try (final ClipboardWriter clipboardWriter = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream( file))) { final BlockArrayClipboard clipboard = new BlockArrayClipboard(selectedRegion); - - EditSessionBuilder editSessionBuilder = WorldEdit.getInstance().newEditSessionBuilder(); - editSessionBuilder.world(selectedRegion.getWorld()); - final EditSession editSession = editSessionBuilder.build(); - + final EditSession editSession = WorldEdit + .getInstance() + .getEditSessionFactory() + .getEditSession(selectedRegion.getWorld(), -1); final ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy(editSession, selectedRegion, clipboard, selectedRegion.getMinimumPoint()); - forwardExtentCopy.setCopyingBiomes(true); forwardExtentCopy.setCopyingEntities(true); Operations.complete(forwardExtentCopy); diff --git a/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java b/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java index 37a56329e..532cc691a 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java +++ b/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java @@ -204,7 +204,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { } Object value; try { - final boolean accessible = field.canAccess(field); + final boolean accessible = field.isAccessible(); field.setAccessible(true); value = field.get(this); field.setAccessible(accessible);