From 7267d3385d4823c5126add92b8cf452e1e63f6d0 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Tue, 9 Sep 2025 11:59:03 -0400 Subject: [PATCH] Fix PWT diff --- ...0047-SparklyPaper-Parallel-world-ticking.patch | 15 ++++++--------- .../features/0059-Toggleable-async-catcher.patch | 4 ++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/leaf-server/paper-patches/features/0047-SparklyPaper-Parallel-world-ticking.patch b/leaf-server/paper-patches/features/0047-SparklyPaper-Parallel-world-ticking.patch index 5d81a87c..b15cd38b 100644 --- a/leaf-server/paper-patches/features/0047-SparklyPaper-Parallel-world-ticking.patch +++ b/leaf-server/paper-patches/features/0047-SparklyPaper-Parallel-world-ticking.patch @@ -337,7 +337,7 @@ index 61121d2efd0df2fcafdc4c272e1cd1b986f42e24..ee5f342995a335593932a497c2bafd36 } // Paper end diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index dd122bbbe2c33183017dbde6997d3f1cd08479b5..4d8c87bd55e3503a84ad9a24b04a11a472d68f3c 100644 +index dd122bbbe2c33183017dbde6997d3f1cd08479b5..d164d50bcee7281283c6d9a7b85ee2596d89bcd1 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -74,12 +74,97 @@ public class CraftBlock implements Block { @@ -1104,7 +1104,7 @@ index dd122bbbe2c33183017dbde6997d3f1cd08479b5..4d8c87bd55e3503a84ad9a24b04a11a4 } @Override -@@ -598,31 +941,70 @@ public class CraftBlock implements Block { +@@ -598,20 +941,45 @@ public class CraftBlock implements Block { @Override public Collection getDrops(ItemStack item, Entity entity) { @@ -1155,12 +1155,9 @@ index dd122bbbe2c33183017dbde6997d3f1cd08479b5..4d8c87bd55e3503a84ad9a24b04a11a4 public boolean isPreferredTool(ItemStack item) { + // Leaf - SparklyPaper - parallel world ticking - Uses safe getNMS() net.minecraft.world.level.block.state.BlockState state = this.getNMS(); -- net.minecraft.world.item.ItemStack nms = CraftItemStack.asNMSCopy(item); -- return CraftBlockData.isPreferredTool(state, nms); -+ net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item); -+ return state.requiresCorrectToolForDrops() && nmsItem.isCorrectToolForDrops(state); // Leaf - SparklyPaper - parallel world ticking - Delegate to helper which checks tool tags - } - + net.minecraft.world.item.ItemStack nms = CraftItemStack.asNMSCopy(item); + return CraftBlockData.isPreferredTool(state, nms); +@@ -620,9 +988,23 @@ public class CraftBlock implements Block { @Override public float getBreakSpeed(Player player) { Preconditions.checkArgument(player != null, "player cannot be null"); @@ -1542,7 +1539,7 @@ index 18f09de5c6549df3562e710ede825f75d69c046e..1b06f97caeda6f33938ff5391ecaad5a } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 658385b2887d6debec7fc941c28621da5d263411..2e7ee5faf114e9b8619826c0252c5daac333f0b5 100644 +index b4ee0f809c1524c74eca74ee6bc471a3051d92a6..96177467807e75bacb8c7c11ba7263f89bc0933a 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -829,6 +829,28 @@ public class CraftEventFactory { diff --git a/leaf-server/paper-patches/features/0059-Toggleable-async-catcher.patch b/leaf-server/paper-patches/features/0059-Toggleable-async-catcher.patch index d10d20a8..9ea9e1a9 100644 --- a/leaf-server/paper-patches/features/0059-Toggleable-async-catcher.patch +++ b/leaf-server/paper-patches/features/0059-Toggleable-async-catcher.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Taiyou06 Date: Tue, 8 Jul 2025 12:08:25 +0200 -Subject: [PATCH] Toggleable-async-catcher +Subject: [PATCH] Toggleable async catcher diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java @@ -12,7 +12,7 @@ index 7e7a0ed944961af5ab7a49bc659da2862d2e2c82..e584205c3e1412bf2f2c4e4eb114a29c public class AsyncCatcher { public static void catchOp(String reason) { -+ if (!org.dreeam.leaf.config.modules.misc.AsyncCatcherConfig.enabled) {return;} ++ if (!org.dreeam.leaf.config.modules.misc.AsyncCatcherConfig.enabled) return; // Leaf - Toggleable async catcher if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThread()) { // Paper - chunk system MinecraftServer.LOGGER.error("Thread {} failed main thread check: {}", Thread.currentThread().getName(), reason, new Throwable()); // Paper throw new IllegalStateException("Asynchronous " + reason + "!");