From 0558fcf5d5759867f70435a3038e78dff108726c Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sat, 21 Jan 2023 22:27:20 +0100 Subject: [PATCH 1/6] Provide full verbosity for invalid components --- .../java/com/plotsquared/core/components/ComponentPreset.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/main/java/com/plotsquared/core/components/ComponentPreset.java b/Core/src/main/java/com/plotsquared/core/components/ComponentPreset.java index 5f6a37d44..cb1e989c4 100644 --- a/Core/src/main/java/com/plotsquared/core/components/ComponentPreset.java +++ b/Core/src/main/java/com/plotsquared/core/components/ComponentPreset.java @@ -62,7 +62,7 @@ public class ComponentPreset implements ConfigurationSerializable { public static ComponentPreset deserialize(final @NonNull Map map) { final ClassicPlotManagerComponent classicPlotManagerComponent = ClassicPlotManagerComponent .fromString(map.getOrDefault("component", "").toString()).orElseThrow(() -> - new IllegalArgumentException("The preset needs a valid target component")); + new IllegalArgumentException("The preset in components.yml needs a valid target component, got: " + map.get("component"))); final String pattern = map.getOrDefault("pattern", "").toString(); final double cost = Double.parseDouble(map.getOrDefault("cost", "0.0").toString()); final String permission = map.getOrDefault("permission", "").toString(); From 0dd8b1053cfac7b137dc04e254dbe0582d77a6d3 Mon Sep 17 00:00:00 2001 From: Matthew Kaulfers <42121989+mkaulfers@users.noreply.github.com> Date: Sat, 21 Jan 2023 17:02:15 -0600 Subject: [PATCH 2/6] PS-3908: Cleanup deprecated methods to improve code maturity. (#3944) https://github.com/IntellectualSites/PlotSquared/issues/3908 --- .../main/java/com/plotsquared/core/command/Area.java | 11 +++++++---- .../plotsquared/core/generator/HybridPlotWorld.java | 2 +- 2 files changed, 8 insertions(+), 5 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..5d9925f1a 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,12 +229,14 @@ 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); 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 532cc691a..37a56329e 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.isAccessible(); + final boolean accessible = field.canAccess(field); field.setAccessible(true); value = field.get(this); field.setAccessible(accessible); From 83e274ff9f103156e47c0255c655f3ab0d38c877 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sun, 22 Jan 2023 11:21:01 +0100 Subject: [PATCH 3/6] 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); From 08800ec16daf1398c47fe191047a32764151a5f3 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sun, 22 Jan 2023 11:26:07 +0100 Subject: [PATCH 4/6] 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); From be8903128df2c1f5c8af7f37e579886c5cfb5084 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Mon, 23 Jan 2023 12:28:33 +0100 Subject: [PATCH 5/6] Release 6.10.9 --- .../main/java/com/plotsquared/bukkit/player/BukkitPlayer.java | 4 ++-- .../com/plotsquared/core/plot/PlotModificationManager.java | 2 +- build.gradle.kts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java index 268258ead..75aeb647a 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java @@ -75,7 +75,7 @@ public class BukkitPlayer extends PlotPlayer { * @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects. * This method will be made private in a future release. */ - @Deprecated(forRemoval = true, since = "TODO") + @Deprecated(forRemoval = true, since = "6.10.9") public BukkitPlayer( final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher, final @NonNull Player player, final @NonNull PermissionHandler permissionHandler @@ -92,7 +92,7 @@ public class BukkitPlayer extends PlotPlayer { * @deprecated Please do not use this method. Instead use {@link BukkitUtil#adapt(Player)}, as it caches player objects. * This method will be made private in a future release. */ - @Deprecated(forRemoval = true, since = "TODO") + @Deprecated(forRemoval = true, since = "6.10.9") public BukkitPlayer( final @NonNull PlotAreaManager plotAreaManager, final @NonNull EventDispatcher eventDispatcher, final @NonNull Player player, diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotModificationManager.java b/Core/src/main/java/com/plotsquared/core/plot/PlotModificationManager.java index c170dec7e..81a2f740b 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotModificationManager.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotModificationManager.java @@ -334,7 +334,7 @@ public final class PlotModificationManager { * @param createSign whether to recreate signs * @param whenDone Task to run when unlink is complete * @return success/!cancelled - * @since TODO + * @since 6.10.9 */ public boolean unlinkPlot(final boolean createRoad, final boolean createSign, final Runnable whenDone) { if (!this.plot.isMerged()) { diff --git a/build.gradle.kts b/build.gradle.kts index 0a8df0130..bdfdc7923 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,7 @@ plugins { } group = "com.plotsquared" -version = "6.10.9-SNAPSHOT" +version = "6.10.9" if (!File("$rootDir/.git").exists()) { logger.lifecycle(""" From b40383b5a4322cdb0b008c55aa98ee1c7100f238 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Mon, 23 Jan 2023 12:33:51 +0100 Subject: [PATCH 6/6] Back to snapshot for development --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index bdfdc7923..3ef77914f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,7 @@ plugins { } group = "com.plotsquared" -version = "6.10.9" +version = "6.10.10-SNAPSHOT" if (!File("$rootDir/.git").exists()) { logger.lifecycle("""