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(); 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); 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/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; diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6b08b0484..88476b2bd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,11 +18,11 @@ adventure-platform-bukkit = "4.0.1" # Plugins worldedit = "7.2.9" -fawe = "2.0.1" +fawe = "2.1.0" 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 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 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": [