From af9e3d7653e90b3434042859a86e0406e838b6df Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Sat, 15 Jun 2024 09:16:52 +0200 Subject: [PATCH 1/3] Fix plot border mode on folia --- .../bukkit/towny/listeners/TownyCustomListener.java | 4 ++-- Towny/src/main/java/com/palmergames/bukkit/util/DrawUtil.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Towny/src/main/java/com/palmergames/bukkit/towny/listeners/TownyCustomListener.java b/Towny/src/main/java/com/palmergames/bukkit/towny/listeners/TownyCustomListener.java index bc63b19d8a..a10269f826 100644 --- a/Towny/src/main/java/com/palmergames/bukkit/towny/listeners/TownyCustomListener.java +++ b/Towny/src/main/java/com/palmergames/bukkit/towny/listeners/TownyCustomListener.java @@ -74,14 +74,14 @@ public void onPlayerChangePlotEvent(PlayerChangePlotEvent event) { return; // Run the following with a one tick delay, so that everything has a chance to take in the player's position. - plugin.getScheduler().runLater(() -> { + plugin.getScheduler().runLater(player, () -> { try { if (resident.hasMode("townclaim")) TownCommand.parseTownClaimCommand(player, new String[] {}); if (resident.hasMode("townunclaim")) TownCommand.parseTownUnclaimCommand(player, new String[] {}); if (resident.hasMode("plotgroup") && resident.hasPlotGroupName()) - Towny.getPlugin().getScheduler().runLater(player, () -> Bukkit.dispatchCommand(player, "plot group add " + resident.getPlotGroupName()), 1L); + Towny.getPlugin().getScheduler().runGlobalLater(task -> Bukkit.dispatchCommand(player, "plot group add " + resident.getPlotGroupName()), 1L); } catch (TownyException e) { TownyMessaging.sendErrorMsg(player, e.getMessage(player)); } diff --git a/Towny/src/main/java/com/palmergames/bukkit/util/DrawUtil.java b/Towny/src/main/java/com/palmergames/bukkit/util/DrawUtil.java index 793f4504ae..53ba289bdc 100644 --- a/Towny/src/main/java/com/palmergames/bukkit/util/DrawUtil.java +++ b/Towny/src/main/java/com/palmergames/bukkit/util/DrawUtil.java @@ -35,7 +35,7 @@ public static void runOnSurface(World world, int x1, int z1, int x2, int z2, int for (int x = _x1; x <= _x2; x++) { if (!world.isChunkLoaded(x >> 4, z >> 4)) { continue; - } + } int start = world.getHighestBlockYAt(x, z, HeightMap.MOTION_BLOCKING_NO_LEAVES); int end = (start + height) < world.getMaxHeight() ? (start + height - 1) : world.getMaxHeight(); From dfe03b2c4977868b6df70beb1f02f9dd3f9f91e3 Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Sat, 15 Jun 2024 09:17:27 +0200 Subject: [PATCH 2/3] diff --- Towny/src/main/java/com/palmergames/bukkit/util/DrawUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Towny/src/main/java/com/palmergames/bukkit/util/DrawUtil.java b/Towny/src/main/java/com/palmergames/bukkit/util/DrawUtil.java index 53ba289bdc..793f4504ae 100644 --- a/Towny/src/main/java/com/palmergames/bukkit/util/DrawUtil.java +++ b/Towny/src/main/java/com/palmergames/bukkit/util/DrawUtil.java @@ -35,7 +35,7 @@ public static void runOnSurface(World world, int x1, int z1, int x2, int z2, int for (int x = _x1; x <= _x2; x++) { if (!world.isChunkLoaded(x >> 4, z >> 4)) { continue; - } + } int start = world.getHighestBlockYAt(x, z, HeightMap.MOTION_BLOCKING_NO_LEAVES); int end = (start + height) < world.getMaxHeight() ? (start + height - 1) : world.getMaxHeight(); From b738602b54bf3312746c8d69e11f001ff48a21cf Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Sat, 15 Jun 2024 09:22:36 +0200 Subject: [PATCH 3/3] this one is fine --- .../palmergames/bukkit/towny/listeners/TownyCustomListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Towny/src/main/java/com/palmergames/bukkit/towny/listeners/TownyCustomListener.java b/Towny/src/main/java/com/palmergames/bukkit/towny/listeners/TownyCustomListener.java index a10269f826..efc2494a42 100644 --- a/Towny/src/main/java/com/palmergames/bukkit/towny/listeners/TownyCustomListener.java +++ b/Towny/src/main/java/com/palmergames/bukkit/towny/listeners/TownyCustomListener.java @@ -81,7 +81,7 @@ public void onPlayerChangePlotEvent(PlayerChangePlotEvent event) { if (resident.hasMode("townunclaim")) TownCommand.parseTownUnclaimCommand(player, new String[] {}); if (resident.hasMode("plotgroup") && resident.hasPlotGroupName()) - Towny.getPlugin().getScheduler().runGlobalLater(task -> Bukkit.dispatchCommand(player, "plot group add " + resident.getPlotGroupName()), 1L); + Towny.getPlugin().getScheduler().runLater(player, () -> Bukkit.dispatchCommand(player, "plot group add " + resident.getPlotGroupName()), 1L); } catch (TownyException e) { TownyMessaging.sendErrorMsg(player, e.getMessage(player)); }