From 5f233bb5d14fa04592f30f93e75405ff5781a34d Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 9 Mar 2022 13:58:00 +0000 Subject: [PATCH 1/8] Use new FAWE method including actor for schematic pasting --- .../com/plotsquared/bukkit/util/fawe/FaweSchematicHandler.java | 2 +- gradle/libs.versions.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/fawe/FaweSchematicHandler.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/fawe/FaweSchematicHandler.java index 26b1bb2c5..e38793e8f 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/fawe/FaweSchematicHandler.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/fawe/FaweSchematicHandler.java @@ -67,7 +67,7 @@ public class FaweSchematicHandler extends SchematicHandler { final PlotPlayer actor, final RunnableVal whenDone ) { - delegate.paste(schematic, plot, xOffset, yOffset, zOffset, autoHeight, whenDone); + delegate.paste(schematic, plot, xOffset, yOffset, zOffset, autoHeight, actor, whenDone); } @Override diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6b08b0484..4c2940179 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,7 +18,7 @@ adventure-platform-bukkit = "4.0.1" # Plugins worldedit = "7.2.9" -fawe = "2.0.1" +fawe = "2.0.2-SNAPSHOT" vault = "1.7.1" placeholderapi = "2.11.1" luckperms = "5.4" From 308dba5601e1b527b6ff966fe51cecf840005a1d Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 10 Mar 2022 21:40:09 +0000 Subject: [PATCH 2/8] Only add extent to WE operations once (#3537) --- .../main/java/com/plotsquared/core/listener/WESubscriber.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/src/main/java/com/plotsquared/core/listener/WESubscriber.java b/Core/src/main/java/com/plotsquared/core/listener/WESubscriber.java index ed0d15319..0c2fca1bd 100644 --- a/Core/src/main/java/com/plotsquared/core/listener/WESubscriber.java +++ b/Core/src/main/java/com/plotsquared/core/listener/WESubscriber.java @@ -35,6 +35,7 @@ import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.util.Permissions; import com.plotsquared.core.util.WEManager; import com.plotsquared.core.util.WorldUtil; +import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.extent.EditSessionEvent; @@ -67,6 +68,9 @@ public class WESubscriber { WorldEdit.getInstance().getEventBus().unregister(this); return; } + if (event.getStage() != EditSession.Stage.BEFORE_HISTORY) { + return; + } World worldObj = event.getWorld(); if (worldObj == null) { return; From 218be431435860433a31ed31229c1aa7bcef909f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 12:39:46 +0100 Subject: [PATCH 3/8] build: Update dependency gradle to v7.4.1 (#3539) Co-authored-by: Renovate Bot --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb8790..00e33edef 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 104cc4b7a4730a575a4cf1668f79bbdd415d3b75 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 12:40:03 +0100 Subject: [PATCH 4/8] build: Update dependency net.essentialsx:EssentialsX to v2.19.4 (#3540) Co-authored-by: Renovate Bot --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4c2940179..384212733 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,7 @@ fawe = "2.0.2-SNAPSHOT" vault = "1.7.1" placeholderapi = "2.11.1" luckperms = "5.4" -essentialsx = "2.19.3" +essentialsx = "2.19.4" mvdwapi = "3.1.1" # Third party From f43f4cbf5d7242391044dd2296d4bfd43f55aeab Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 15:36:43 +0100 Subject: [PATCH 5/8] build: Update com.fastasyncworldedit to v2.1.0 (#3541) Co-authored-by: Renovate Bot --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 384212733..88476b2bd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,7 +18,7 @@ adventure-platform-bukkit = "4.0.1" # Plugins worldedit = "7.2.9" -fawe = "2.0.2-SNAPSHOT" +fawe = "2.1.0" vault = "1.7.1" placeholderapi = "2.11.1" luckperms = "5.4" From 7efd42ae45e76dbefbbd5746335929621b3f2cf5 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Mon, 14 Mar 2022 20:09:52 +0100 Subject: [PATCH 6/8] build: Ignore kyori updates until we update MM Closes #3543 --- renovate.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 577d311e1..7b9ed9a16 100644 --- a/renovate.json +++ b/renovate.json @@ -8,7 +8,8 @@ "com.google.guava:guava", "com.google.code.gson:gson", "gson", - "snakeyaml" + "snakeyaml", + "net.kyori" ], "timezone": "Europe/Berlin", "schedule": [ From 3a6f845c012c2ebc3fe6c9c4aa140cc64cc5685d Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sat, 12 Mar 2022 15:04:31 +0000 Subject: [PATCH 7/8] Use correct field for unsaved in 1.18 --- .../plotsquared/bukkit/listener/SingleWorldListener.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/SingleWorldListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/SingleWorldListener.java index 12ef2146e..2c9358245 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/SingleWorldListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/SingleWorldListener.java @@ -46,7 +46,7 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass; public class SingleWorldListener implements Listener { private final Method methodGetHandleChunk; - private Field shouldSave; + private Field shouldSave = null; public SingleWorldListener() throws Exception { ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk"); @@ -59,9 +59,12 @@ public class SingleWorldListener implements Listener { } else { this.shouldSave = classChunk.getField("s").getRealField(); } - } else { + } else if (PlotSquared.platform().serverVersion()[1] == 17) { ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk"); this.shouldSave = classChunk.getField("r").getRealField(); + } else if (PlotSquared.platform().serverVersion()[1] == 18) { + ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.IChunkAccess"); + this.shouldSave = classChunk.getField("b").getRealField(); } } catch (NoSuchFieldException e) { e.printStackTrace(); From efc208379823e7f21a9e422a05d6cbcf9c73919d Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 2 Mar 2022 15:47:15 +0000 Subject: [PATCH 8/8] Change the default sign orientation to better match the wall location --- .../com/plotsquared/bukkit/util/BukkitUtil.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java index 73e9694da..8c51ddf6e 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java @@ -347,13 +347,15 @@ public class BukkitUtil extends WorldUtil { final Block block = world.getBlockAt(location.getX(), location.getY(), location.getZ()); final Material type = block.getType(); if (type != Material.LEGACY_SIGN && type != Material.LEGACY_WALL_SIGN) { - BlockFace facing = BlockFace.EAST; - if (world.getBlockAt(location.getX(), location.getY(), location.getZ() + 1).getType().isSolid()) { - facing = BlockFace.NORTH; - } else if (world.getBlockAt(location.getX() + 1, location.getY(), location.getZ()).getType().isSolid()) { - facing = BlockFace.WEST; - } else if (world.getBlockAt(location.getX(), location.getY(), location.getZ() - 1).getType().isSolid()) { - facing = BlockFace.SOUTH; + BlockFace facing = BlockFace.NORTH; + if (!world.getBlockAt(location.getX(), location.getY(), location.getZ() + 1).getType().isSolid()) { + if (world.getBlockAt(location.getX() - 1, location.getY(), location.getZ()).getType().isSolid()) { + facing = BlockFace.EAST; + } else if (world.getBlockAt(location.getX() + 1, location.getY(), location.getZ()).getType().isSolid()) { + facing = BlockFace.WEST; + } else if (world.getBlockAt(location.getX(), location.getY(), location.getZ() - 1).getType().isSolid()) { + facing = BlockFace.SOUTH; + } } if (PlotSquared.platform().serverVersion()[1] == 13) { block.setType(Material.valueOf(area.legacySignMaterial()), false);