diff --git a/paper-server/patches/unapplied/net/minecraft/network/protocol/Packet.java.patch b/paper-server/patches/sources/net/minecraft/network/protocol/Packet.java.patch similarity index 91% rename from paper-server/patches/unapplied/net/minecraft/network/protocol/Packet.java.patch rename to paper-server/patches/sources/net/minecraft/network/protocol/Packet.java.patch index ba40a5940e..221a5587d3 100644 --- a/paper-server/patches/unapplied/net/minecraft/network/protocol/Packet.java.patch +++ b/paper-server/patches/sources/net/minecraft/network/protocol/Packet.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/network/protocol/Packet.java +++ b/net/minecraft/network/protocol/Packet.java -@@ -11,6 +11,19 @@ +@@ -11,6 +_,19 @@ - void handle(T listener); + void handle(T handler); + // Paper start + default boolean hasLargePacketFallback() { diff --git a/paper-server/patches/sources/net/minecraft/network/protocol/PacketUtils.java.patch b/paper-server/patches/sources/net/minecraft/network/protocol/PacketUtils.java.patch new file mode 100644 index 0000000000..0eaf929602 --- /dev/null +++ b/paper-server/patches/sources/net/minecraft/network/protocol/PacketUtils.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/network/protocol/PacketUtils.java ++++ b/net/minecraft/network/protocol/PacketUtils.java +@@ -21,6 +_,7 @@ + public static void ensureRunningOnSameThread(Packet packet, T processor, BlockableEventLoop executor) throws RunningOnDifferentThreadException { + if (!executor.isSameThread()) { + executor.executeIfPossible(() -> { ++ if (processor instanceof net.minecraft.server.network.ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // Paper - Don't handle sync packets for kicked players + if (processor.shouldHandleMessage(packet)) { + try { + packet.handle(processor); diff --git a/paper-server/patches/unapplied/net/minecraft/world/level/pathfinder/Path.java.patch b/paper-server/patches/sources/net/minecraft/world/level/pathfinder/Path.java.patch similarity index 93% rename from paper-server/patches/unapplied/net/minecraft/world/level/pathfinder/Path.java.patch rename to paper-server/patches/sources/net/minecraft/world/level/pathfinder/Path.java.patch index 94eb8f4856..7238ea6726 100644 --- a/paper-server/patches/unapplied/net/minecraft/world/level/pathfinder/Path.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/pathfinder/Path.java.patch @@ -1,10 +1,10 @@ --- a/net/minecraft/world/level/pathfinder/Path.java +++ b/net/minecraft/world/level/pathfinder/Path.java -@@ -18,6 +18,7 @@ +@@ -18,6 +_,7 @@ private final BlockPos target; private final float distToTarget; private final boolean reached; + public boolean hasNext() { return getNextNodeIndex() < this.nodes.size(); } // Paper - Mob Pathfinding API - public Path(List nodes, BlockPos target, boolean reachesTarget) { + public Path(List nodes, BlockPos target, boolean reached) { this.nodes = nodes; diff --git a/paper-server/patches/unapplied/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch b/paper-server/patches/sources/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch similarity index 74% rename from paper-server/patches/unapplied/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch rename to paper-server/patches/sources/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch index 96be982191..94a7ed2e86 100644 --- a/paper-server/patches/unapplied/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch @@ -1,12 +1,12 @@ --- a/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +++ b/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java -@@ -478,7 +478,12 @@ +@@ -480,7 +_,12 @@ } - protected static PathType getPathTypeFromState(BlockGetter world, BlockPos pos) { -- BlockState blockState = world.getBlockState(pos); + protected static PathType getPathTypeFromState(BlockGetter level, BlockPos pos) { +- BlockState blockState = level.getBlockState(pos); + // Paper start - Do not load chunks during pathfinding -+ BlockState blockState = world.getBlockStateIfLoaded(pos); ++ BlockState blockState = level.getBlockStateIfLoaded(pos); + if (blockState == null) { + return PathType.BLOCKED; + } diff --git a/paper-server/patches/unapplied/net/minecraft/network/protocol/PacketUtils.java.patch b/paper-server/patches/unapplied/net/minecraft/network/protocol/PacketUtils.java.patch deleted file mode 100644 index 67d49cd3f7..0000000000 --- a/paper-server/patches/unapplied/net/minecraft/network/protocol/PacketUtils.java.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/net/minecraft/network/protocol/PacketUtils.java -+++ b/net/minecraft/network/protocol/PacketUtils.java -@@ -6,10 +6,15 @@ - import net.minecraft.CrashReportCategory; - import net.minecraft.ReportedException; - import net.minecraft.network.PacketListener; -+import org.slf4j.Logger; -+ -+// CraftBukkit start -+import net.minecraft.server.MinecraftServer; - import net.minecraft.server.RunningOnDifferentThreadException; - import net.minecraft.server.level.ServerLevel; -+import net.minecraft.server.network.ServerCommonPacketListenerImpl; -+// CraftBukkit end - import net.minecraft.util.thread.BlockableEventLoop; --import org.slf4j.Logger; - - public class PacketUtils { - -@@ -24,6 +29,7 @@ - public static void ensureRunningOnSameThread(Packet packet, T listener, BlockableEventLoop engine) throws RunningOnDifferentThreadException { - if (!engine.isSameThread()) { - engine.executeIfPossible(() -> { -+ if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players - if (listener.shouldHandleMessage(packet)) { - try { - packet.handle(listener);