From 055b8ab9cf94769aaab0cc6c4a0f70c93fc3c6f1 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Thu, 25 Nov 2021 00:10:26 -0800 Subject: [PATCH] even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even more patches --- .../1.18}/0836-Cache-palette-array.patch | 2 + ...27-Add-Raw-Byte-Entity-Serialization.patch | 4 +- ...city-compression-and-cipher-natives.patch} | 63 +++++++++---------- ...hread-worker-count-for-low-core-cou.patch} | 4 +- ...tity-loads-in-CraftChunk-getEntitie.patch} | 8 +-- ...ifications-to-critical-entity-state.patch} | 20 +++--- ...ix-Bukkit-NamespacedKey-shenanigans.patch} | 0 ...ntory-not-closing-on-entity-removal.patch} | 4 +- ...rement-before-suggesting-root-nodes.patch} | 0 ...ServerboundCommandSuggestionPacket-.patch} | 4 +- ...nColor-on-tropical-fish-bucket-meta.patch} | 0 .../0780-Ensure-valid-vehicle-status.patch} | 4 +- ...ftlocked-end-exit-portal-generation.patch} | 4 +- ...r-causing-a-crash-when-trying-to-ge.patch} | 0 ...-t-log-debug-logging-being-disabled.patch} | 0 ...axolotls-from-buckets-as-persistent.patch} | 8 +-- ...ous-menus-with-empty-level-accesses.patch} | 0 ...-O-threads-with-chunk-data-while-fl.patch} | 8 +-- .../0787-Preserve-overstacked-loot.patch} | 10 +-- ...ate-head-rotation-in-missing-places.patch} | 6 +- ...unintended-light-block-manipulation.patch} | 2 +- ...piglins-and-hoglins-towards-mob-cap.patch} | 2 +- ...0791-Fix-CraftCriteria-defaults-map.patch} | 0 ...Fix-upstreams-block-state-factories.patch} | 4 +- ...ion-for-logging-player-ip-addresses.patch} | 16 ++--- ...pper-didnt-account-for-entity-sende.patch} | 0 .../0795-Add-root-admin-user-detection.patch} | 4 +- ...ays-allow-item-changing-in-Fireball.patch} | 4 +- ...t-attempt-to-teleport-dead-entities.patch} | 4 +- ...l-onRemove-logic-for-breakNaturally.patch} | 4 +- ...pare-event-not-working-with-zero-xp.patch} | 4 +- 31 files changed, 96 insertions(+), 97 deletions(-) rename patches/{unapplied/server => removed/1.18}/0836-Cache-palette-array.patch (99%) rename patches/{unapplied/server/0797-Use-Velocity-compression-and-cipher-natives.patch => server/0771-Use-Velocity-compression-and-cipher-natives.patch} (89%) rename patches/{unapplied/server/0799-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch => server/0772-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch} (90%) rename patches/{unapplied/server/0801-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch => server/0773-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch} (90%) rename patches/{unapplied/server/0835-Async-catch-modifications-to-critical-entity-state.patch => server/0774-Async-catch-modifications-to-critical-entity-state.patch} (90%) rename patches/{unapplied/server/0837-Fix-Bukkit-NamespacedKey-shenanigans.patch => server/0775-Fix-Bukkit-NamespacedKey-shenanigans.patch} (100%) rename patches/{unapplied/server/0824-Fix-merchant-inventory-not-closing-on-entity-removal.patch => server/0776-Fix-merchant-inventory-not-closing-on-entity-removal.patch} (89%) rename patches/{unapplied/server/0832-Check-requirement-before-suggesting-root-nodes.patch => server/0777-Check-requirement-before-suggesting-root-nodes.patch} (100%) rename patches/{unapplied/server/0833-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch => server/0778-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch} (86%) rename patches/{unapplied/server/0840-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch => server/0779-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch} (100%) rename patches/{unapplied/server/0808-Ensure-valid-vehicle-status.patch => server/0780-Ensure-valid-vehicle-status.patch} (84%) rename patches/{unapplied/server/0802-Prevent-softlocked-end-exit-portal-generation.patch => server/0781-Prevent-softlocked-end-exit-portal-generation.patch} (87%) rename patches/{unapplied/server/0804-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch => server/0782-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch} (100%) rename patches/{unapplied/server/0805-Don-t-log-debug-logging-being-disabled.patch => server/0783-Don-t-log-debug-logging-being-disabled.patch} (100%) rename patches/{unapplied/server/0806-Mark-fish-and-axolotls-from-buckets-as-persistent.patch => server/0784-Mark-fish-and-axolotls-from-buckets-as-persistent.patch} (84%) rename patches/{unapplied/server/0807-fix-various-menus-with-empty-level-accesses.patch => server/0785-fix-various-menus-with-empty-level-accesses.patch} (100%) rename patches/{unapplied/server/0825-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch => server/0786-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch} (89%) rename patches/{unapplied/server/0811-Preserve-overstacked-loot.patch => server/0787-Preserve-overstacked-loot.patch} (90%) rename patches/{unapplied/server/0812-Update-head-rotation-in-missing-places.patch => server/0788-Update-head-rotation-in-missing-places.patch} (79%) rename patches/{unapplied/server/0813-prevent-unintended-light-block-manipulation.patch => server/0789-prevent-unintended-light-block-manipulation.patch} (92%) rename patches/{unapplied/server/0815-Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch => server/0790-Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch} (93%) rename patches/{unapplied/server/0816-Fix-CraftCriteria-defaults-map.patch => server/0791-Fix-CraftCriteria-defaults-map.patch} (100%) rename patches/{unapplied/server/0818-Fix-upstreams-block-state-factories.patch => server/0792-Fix-upstreams-block-state-factories.patch} (99%) rename patches/{unapplied/server/0819-Add-config-option-for-logging-player-ip-addresses.patch => server/0793-Add-config-option-for-logging-player-ip-addresses.patch} (91%) rename patches/{unapplied/server/0821-VanillaCommandWrapper-didnt-account-for-entity-sende.patch => server/0794-VanillaCommandWrapper-didnt-account-for-entity-sende.patch} (100%) rename patches/{unapplied/server/0822-Add-root-admin-user-detection.patch => server/0795-Add-root-admin-user-detection.patch} (96%) rename patches/{unapplied/server/0823-Always-allow-item-changing-in-Fireball.patch => server/0796-Always-allow-item-changing-in-Fireball.patch} (84%) rename patches/{unapplied/server/0834-don-t-attempt-to-teleport-dead-entities.patch => server/0797-don-t-attempt-to-teleport-dead-entities.patch} (81%) rename patches/{unapplied/server/0843-Call-onRemove-logic-for-breakNaturally.patch => server/0798-Call-onRemove-logic-for-breakNaturally.patch} (88%) rename patches/{unapplied/server/0845-Fix-anvil-prepare-event-not-working-with-zero-xp.patch => server/0799-Fix-anvil-prepare-event-not-working-with-zero-xp.patch} (84%) diff --git a/patches/unapplied/server/0836-Cache-palette-array.patch b/patches/removed/1.18/0836-Cache-palette-array.patch similarity index 99% rename from patches/unapplied/server/0836-Cache-palette-array.patch rename to patches/removed/1.18/0836-Cache-palette-array.patch index 2c787bbbc..d9d2dd18c 100644 --- a/patches/unapplied/server/0836-Cache-palette-array.patch +++ b/patches/removed/1.18/0836-Cache-palette-array.patch @@ -7,6 +7,8 @@ Instead of allocating the 4KB for every chunk section, cache it locally and reuse it for other chunk sections to save on allocations. These allocations add up very quickly when saving chunks frequently. +1.18: PalettedContainer changed + diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java index c9e942669458668a184aaec3bc0a5509dd6ab5f0..ac84d49d7819666a89cacbe9ef1199cf22ac2ac3 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java diff --git a/patches/server/0727-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0727-Add-Raw-Byte-Entity-Serialization.patch index 6eeb7bafe..4d71c5113 100644 --- a/patches/server/0727-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0727-Add-Raw-Byte-Entity-Serialization.patch @@ -25,7 +25,7 @@ index dcfc726ab96dccc05848219e824ad7612dbfbdab..7713f26d4a97df94c27694d28881d298 return this.isPassenger() ? false : this.saveAsPassenger(nbt); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index ee50ea695585639d0ff184b675f3fb3b205b9f86..0bd800e1aeda87689a6c56ee6fadda381c74a4ff 100644 +index ee50ea695585639d0ff184b675f3fb3b205b9f86..5aae88e20bc04560d6ad52cfcaa872d28bfcee8f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1276,5 +1276,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -40,7 +40,7 @@ index ee50ea695585639d0ff184b675f3fb3b205b9f86..0bd800e1aeda87689a6c56ee6fadda38 + entity.level = ((CraftWorld) location.getWorld()).getHandle(); + entity.setPos(location.getX(), location.getY(), location.getZ()); + entity.setRot(location.getYaw(), location.getPitch()); -+ return !entity.valid && entity.level.addEntity(entity, reason); ++ return !entity.valid && entity.level.addFreshEntity(entity, reason); + } // Paper end } diff --git a/patches/unapplied/server/0797-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/0771-Use-Velocity-compression-and-cipher-natives.patch similarity index 89% rename from patches/unapplied/server/0797-Use-Velocity-compression-and-cipher-natives.patch rename to patches/server/0771-Use-Velocity-compression-and-cipher-natives.patch index 2d7569820..5114c456c 100644 --- a/patches/unapplied/server/0797-Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/0771-Use-Velocity-compression-and-cipher-natives.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Use Velocity compression and cipher natives diff --git a/build.gradle.kts b/build.gradle.kts -index c7ebad49e04c36c27341cabc4a024f170d762f3f..f46f11c32560da6f4955284d93da3dd7e22555a3 100644 +index 7d69f9e39361644796895254dfa518ef83d9e578..e572f524046d4799adec7f08b1609d82a64ab94f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -55,6 +55,7 @@ dependencies { - implementation("io.netty:netty-all:4.1.65.Final") // Paper +@@ -49,6 +49,7 @@ dependencies { + runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.0") implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation + implementation("com.velocitypowered:velocity-native:1.1.0-SNAPSHOT") // Paper @@ -17,10 +17,10 @@ index c7ebad49e04c36c27341cabc4a024f170d762f3f..f46f11c32560da6f4955284d93da3dd7 testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test testImplementation("junit:junit:4.13.1") diff --git a/src/main/java/net/minecraft/network/CipherDecoder.java b/src/main/java/net/minecraft/network/CipherDecoder.java -index 06d545bc7206dd0d56cf27c31935c0f5ed21ef08..201e5eb2d0ec985ea60c59ac89593bd88ad3ee4d 100644 +index 778beb445eac5769b9e4e07b4d1294c50ae2602b..c712fb8193115e1ab71b5e40fb0ccb9413062b03 100644 --- a/src/main/java/net/minecraft/network/CipherDecoder.java +++ b/src/main/java/net/minecraft/network/CipherDecoder.java -@@ -7,14 +7,30 @@ import java.util.List; +@@ -7,13 +7,29 @@ import java.util.List; import javax.crypto.Cipher; public class CipherDecoder extends MessageToMessageDecoder { @@ -33,7 +33,6 @@ index 06d545bc7206dd0d56cf27c31935c0f5ed21ef08..201e5eb2d0ec985ea60c59ac89593bd8 + this.cipher = cipher; // Paper } - @Override protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List list) throws Exception { - list.add(this.cipher.decipher(channelHandlerContext, byteBuf)); + // Paper start @@ -56,10 +55,10 @@ index 06d545bc7206dd0d56cf27c31935c0f5ed21ef08..201e5eb2d0ec985ea60c59ac89593bd8 + // Paper end } diff --git a/src/main/java/net/minecraft/network/CipherEncoder.java b/src/main/java/net/minecraft/network/CipherEncoder.java -index 50a7058b18a8ca05363b73eaefbd812ef50d53f1..7319da27dfa5029c9893ec04bfd4325531af8a98 100644 +index 0f3d502a9680006bcdcd7d272240a2e5c3b46790..5dd7be70603e8754d2625bb9d16900cb01b9c730 100644 --- a/src/main/java/net/minecraft/network/CipherEncoder.java +++ b/src/main/java/net/minecraft/network/CipherEncoder.java -@@ -4,16 +4,33 @@ import io.netty.buffer.ByteBuf; +@@ -4,15 +4,32 @@ import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToByteEncoder; import javax.crypto.Cipher; @@ -76,7 +75,6 @@ index 50a7058b18a8ca05363b73eaefbd812ef50d53f1..7319da27dfa5029c9893ec04bfd43255 + this.cipher = cipher; // Paper } - @Override - protected void encode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, ByteBuf byteBuf2) throws Exception { - this.cipher.encipher(byteBuf, byteBuf2); + protected void encode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List list) throws Exception { @@ -100,7 +98,7 @@ index 50a7058b18a8ca05363b73eaefbd812ef50d53f1..7319da27dfa5029c9893ec04bfd43255 + // Paper end } diff --git a/src/main/java/net/minecraft/network/CompressionDecoder.java b/src/main/java/net/minecraft/network/CompressionDecoder.java -index efd05c8c1114aab4c237ccbc2e4e935a08c076ee..3569fc49e87b773dce0e59b9069797834ae32613 100644 +index b62be99c57b0a5bba0dc29809557d4d247698b13..f4d4ad983baf24d889441541d5a84dc1f49ea4d4 100644 --- a/src/main/java/net/minecraft/network/CompressionDecoder.java +++ b/src/main/java/net/minecraft/network/CompressionDecoder.java @@ -12,13 +12,20 @@ public class CompressionDecoder extends ByteToMessageDecoder { @@ -112,20 +110,20 @@ index efd05c8c1114aab4c237ccbc2e4e935a08c076ee..3569fc49e87b773dce0e59b906979783 private boolean validateDecompressed; + // Paper start - public CompressionDecoder(int compressionThreshold, boolean bl) { -+ this(null, compressionThreshold, bl); + public CompressionDecoder(int compressionThreshold, boolean rejectsBadPackets) { ++ this(null, compressionThreshold, rejectsBadPackets); + } -+ public CompressionDecoder(com.velocitypowered.natives.compression.VelocityCompressor compressor, int compressionThreshold, boolean bl) { ++ public CompressionDecoder(com.velocitypowered.natives.compression.VelocityCompressor compressor, int compressionThreshold, boolean rejectsBadPackets) { this.threshold = compressionThreshold; - this.validateDecompressed = bl; + this.validateDecompressed = rejectsBadPackets; - this.inflater = new Inflater(); + this.inflater = compressor == null ? new Inflater() : null; + this.compressor = compressor; + // Paper end } - @Override -@@ -39,6 +46,8 @@ public class CompressionDecoder extends ByteToMessageDecoder { + protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List list) throws Exception { +@@ -38,6 +45,8 @@ public class CompressionDecoder extends ByteToMessageDecoder { } } @@ -134,7 +132,7 @@ index efd05c8c1114aab4c237ccbc2e4e935a08c076ee..3569fc49e87b773dce0e59b906979783 byte[] bs = new byte[friendlyByteBuf.readableBytes()]; friendlyByteBuf.readBytes(bs); this.inflater.setInput(bs); -@@ -46,10 +55,36 @@ public class CompressionDecoder extends ByteToMessageDecoder { +@@ -45,10 +54,36 @@ public class CompressionDecoder extends ByteToMessageDecoder { this.inflater.inflate(cs); list.add(Unpooled.wrappedBuffer(cs)); this.inflater.reset(); @@ -168,14 +166,14 @@ index efd05c8c1114aab4c237ccbc2e4e935a08c076ee..3569fc49e87b773dce0e59b906979783 + } + // Paper end + - public void setThreshold(int compressionThreshold, boolean bl) { + public void setThreshold(int compressionThreshold, boolean rejectsBadPackets) { this.threshold = compressionThreshold; - this.validateDecompressed = bl; + this.validateDecompressed = rejectsBadPackets; diff --git a/src/main/java/net/minecraft/network/CompressionEncoder.java b/src/main/java/net/minecraft/network/CompressionEncoder.java -index 524c0c674f63cfcb601416a18348f37aabb4e3ff..89bf5066b83e8d79c77c90fce1f7858c06b01730 100644 +index 792883afe53d2b7989c25a81c2f9a639d5e21d20..c04379ca8a4db0f4de46ad2b3b3384310eebddf3 100644 --- a/src/main/java/net/minecraft/network/CompressionEncoder.java +++ b/src/main/java/net/minecraft/network/CompressionEncoder.java -@@ -6,23 +6,38 @@ import io.netty.handler.codec.MessageToByteEncoder; +@@ -6,22 +6,37 @@ import io.netty.handler.codec.MessageToByteEncoder; import java.util.zip.Deflater; public class CompressionEncoder extends MessageToByteEncoder { @@ -203,7 +201,6 @@ index 524c0c674f63cfcb601416a18348f37aabb4e3ff..89bf5066b83e8d79c77c90fce1f7858c + // Paper end } - @Override - protected void encode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, ByteBuf byteBuf2) { + protected void encode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, ByteBuf byteBuf2) throws Exception { // Paper int i = byteBuf.readableBytes(); @@ -217,7 +214,7 @@ index 524c0c674f63cfcb601416a18348f37aabb4e3ff..89bf5066b83e8d79c77c90fce1f7858c byte[] bs = new byte[i]; byteBuf.readBytes(bs); friendlyByteBuf.writeVarInt(bs.length); -@@ -35,10 +50,48 @@ public class CompressionEncoder extends MessageToByteEncoder { +@@ -34,10 +49,48 @@ public class CompressionEncoder extends MessageToByteEncoder { } this.deflater.reset(); @@ -267,10 +264,10 @@ index 524c0c674f63cfcb601416a18348f37aabb4e3ff..89bf5066b83e8d79c77c90fce1f7858c return this.threshold; } diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 0dae504f49a4a3c66a01eb03896833a010cd5821..5f43459884daea61178c3fdb913204e64f833f61 100644 +index a1aafb037fd340dc93dd2afb758ffc7457d15f84..a7e7fe4be2784ff34f7f8d0b6c2f82d65de8c145 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -657,11 +657,28 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -628,11 +628,28 @@ public class Connection extends SimpleChannelInboundHandler> { return networkmanager; } @@ -303,16 +300,16 @@ index 0dae504f49a4a3c66a01eb03896833a010cd5821..5f43459884daea61178c3fdb913204e6 public boolean isEncrypted() { return this.encrypted; -@@ -690,16 +707,17 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -661,16 +678,17 @@ public class Connection extends SimpleChannelInboundHandler> { - public void setupCompression(int compressionThreshold, boolean flag) { + public void setupCompression(int compressionThreshold, boolean rejectsBadPackets) { if (compressionThreshold >= 0) { + com.velocitypowered.natives.compression.VelocityCompressor compressor = com.velocitypowered.natives.util.Natives.compress.get().create(-1); // Paper if (this.channel.pipeline().get("decompress") instanceof CompressionDecoder) { - ((CompressionDecoder) this.channel.pipeline().get("decompress")).setThreshold(compressionThreshold, flag); + ((CompressionDecoder) this.channel.pipeline().get("decompress")).setThreshold(compressionThreshold, rejectsBadPackets); } else { -- this.channel.pipeline().addBefore("decoder", "decompress", new CompressionDecoder(compressionThreshold, flag)); -+ this.channel.pipeline().addBefore("decoder", "decompress", new CompressionDecoder(compressor, compressionThreshold, flag)); // Paper +- this.channel.pipeline().addBefore("decoder", "decompress", new CompressionDecoder(compressionThreshold, rejectsBadPackets)); ++ this.channel.pipeline().addBefore("decoder", "decompress", new CompressionDecoder(compressor, compressionThreshold, rejectsBadPackets)); // Paper } if (this.channel.pipeline().get("compress") instanceof CompressionEncoder) { @@ -324,7 +321,7 @@ index 0dae504f49a4a3c66a01eb03896833a010cd5821..5f43459884daea61178c3fdb913204e6 } else { if (this.channel.pipeline().get("decompress") instanceof CompressionDecoder) { diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -index 961660f6f9e00b93252519e38b74c66c53388ed2..a7046da8c097254907e01cd17f4107c8744f4a6e 100644 +index f7aa0125e4724f1efddf28814f926289c1ae37d4..477aa83c3b342705a8a9b7ab41b2f77008e2e281 100644 --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java +++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java @@ -104,6 +104,11 @@ public class ServerConnectionListener { @@ -340,10 +337,10 @@ index 961660f6f9e00b93252519e38b74c66c53388ed2..a7046da8c097254907e01cd17f4107c8 protected void initChannel(Channel channel) { try { diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 45e77d96f673ce68cf15ce3d45fd1eeffed4d8d8..01fee879c946b6640da34d5890d686f0152437dc 100644 +index 45db764f4499ee71bef691d37b604f21da120fe7..d2dd8b802ecea7fd2efe5f07fcef65c26e1adfbc 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -275,12 +275,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener +@@ -276,12 +276,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener } SecretKey secretkey = packet.getSecretKey(privatekey); diff --git a/patches/unapplied/server/0799-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch b/patches/server/0772-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch similarity index 90% rename from patches/unapplied/server/0799-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch rename to patches/server/0772-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch index 5b9fbcac1..d95c023f1 100644 --- a/patches/unapplied/server/0799-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch +++ b/patches/server/0772-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Reduce worldgen thread worker count for low core count CPUs diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java -index 69faebb95924946f648cf9f86ff777d3274e3f28..505546d32eea4682452dbac02311433157f6a30e 100644 +index f4b8dca0a3cbccb55b23b2408e9a17185fd2896f..faffd25b11836915764add5c6afd63cfe424979a 100644 --- a/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java -@@ -120,7 +120,19 @@ public class Util { +@@ -124,7 +124,19 @@ public class Util { private static ExecutorService makeExecutor(String s, int priorityModifier) { // Paper - add priority // Paper start - use simpler thread pool that allows 1 thread diff --git a/patches/unapplied/server/0801-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch b/patches/server/0773-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch similarity index 90% rename from patches/unapplied/server/0801-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch rename to patches/server/0773-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch index 12edb886b..5af448e0c 100644 --- a/patches/unapplied/server/0801-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch +++ b/patches/server/0773-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch @@ -16,17 +16,17 @@ of a chance that we're about to eat a dirtload of chunk load callbacks, thus making this issue much more of an issue diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 07dfe575dea0f41a75bb9dad0ee2d541e983f6d7..f194dbf29fefab6c94fe5aa11f565349499f4706 100644 +index fa1b3762ce94290f3a162f7b9628779cf8a2849c..587d5535c9ad3aa5a6b91d63a52e57b4f3fe008b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -127,46 +127,6 @@ public class CraftChunk implements Chunk { +@@ -128,46 +128,6 @@ public class CraftChunk implements Chunk { this.getWorld().getChunkAt(x, z); // Transient load for this tick } - PersistentEntitySectionManager entityManager = this.getCraftWorld().getHandle().entityManager; - long pair = ChunkPos.asLong(x, z); - -- if (entityManager.areEntitiesLoaded(pair)) { // PAIL rename isEntitiesLoaded +- if (entityManager.areEntitiesLoaded(pair)) { - return getCraftWorld().getHandle().getChunkEntities(this.x, this.z); // Paper - optimise this - } - @@ -55,7 +55,7 @@ index 07dfe575dea0f41a75bb9dad0ee2d541e983f6d7..f194dbf29fefab6c94fe5aa11f565349 - // now we wait until the entities are loaded, - // the converting from NBT to entity object is done on the main Thread which is why we wait - while (!supplier.getAsBoolean()) { -- if (mailbox.size() != 0) { // PAIL rename size +- if (mailbox.size() != 0) { - mailbox.run(); - } else { - Thread.yield(); diff --git a/patches/unapplied/server/0835-Async-catch-modifications-to-critical-entity-state.patch b/patches/server/0774-Async-catch-modifications-to-critical-entity-state.patch similarity index 90% rename from patches/unapplied/server/0835-Async-catch-modifications-to-critical-entity-state.patch rename to patches/server/0774-Async-catch-modifications-to-critical-entity-state.patch index 48b3a5b71..cc9ccd741 100644 --- a/patches/unapplied/server/0835-Async-catch-modifications-to-critical-entity-state.patch +++ b/patches/server/0774-Async-catch-modifications-to-critical-entity-state.patch @@ -8,7 +8,7 @@ Now in 1.17, this state is _even more_ critical than it was before, so these must exist to catch stupid plugins. diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java -index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095026c4f39 100644 +index d963243431e1a75f95e673e1268faa7c2320c6b6..114569250b8bb99ebf5714f334b7a23dc3d3ca37 100644 --- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java +++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java @@ -138,6 +138,7 @@ public class PersistentEntitySectionManager implements A @@ -59,14 +59,14 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095 long i = chunkPos.toLong(); if (trackingStatus == Visibility.HIDDEN) { -@@ -295,6 +302,7 @@ public class PersistentEntitySectionManager implements A +@@ -280,6 +287,7 @@ public class PersistentEntitySectionManager implements A + } - private boolean storeChunkSections(long chunkPos, Consumer action, boolean callEvent) { - // CraftBukkit end + public void ensureChunkQueuedForLoad(long chunkPos) { + org.spigotmc.AsyncCatcher.catchOp("Entity chunk save"); // Paper PersistentEntitySectionManager.ChunkLoadStatus persistententitysectionmanager_b = (PersistentEntitySectionManager.ChunkLoadStatus) this.chunkLoadStatuses.get(chunkPos); - if (persistententitysectionmanager_b == PersistentEntitySectionManager.ChunkLoadStatus.PENDING) { + if (persistententitysectionmanager_b == PersistentEntitySectionManager.ChunkLoadStatus.FRESH) { @@ -324,6 +332,7 @@ public class PersistentEntitySectionManager implements A } @@ -91,7 +91,7 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095 ChunkEntities chunkentities; // CraftBukkit - decompile error while ((chunkentities = (ChunkEntities) this.loadingInbox.poll()) != null) { -@@ -383,6 +394,7 @@ public class PersistentEntitySectionManager implements A +@@ -377,6 +388,7 @@ public class PersistentEntitySectionManager implements A } public void tick() { @@ -99,7 +99,7 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095 this.processPendingLoads(); this.processUnloads(); } -@@ -403,6 +415,7 @@ public class PersistentEntitySectionManager implements A +@@ -397,6 +409,7 @@ public class PersistentEntitySectionManager implements A } public void autoSave() { @@ -107,7 +107,7 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095 this.getAllChunksToSave().forEach((java.util.function.LongConsumer) (i) -> { // CraftBukkit - decompile error boolean flag = this.chunkVisibility.get(i) == Visibility.HIDDEN; -@@ -417,6 +430,7 @@ public class PersistentEntitySectionManager implements A +@@ -411,6 +424,7 @@ public class PersistentEntitySectionManager implements A } public void saveAll() { @@ -115,7 +115,7 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095 LongSet longset = this.getAllChunksToSave(); while (!longset.isEmpty()) { -@@ -524,6 +538,7 @@ public class PersistentEntitySectionManager implements A +@@ -513,6 +527,7 @@ public class PersistentEntitySectionManager implements A long i = SectionPos.asLong(blockposition); final long newSectionPos = i; // Paper - diff on change, new position section if (i != this.currentSectionKey) { @@ -123,7 +123,7 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095 PersistentEntitySectionManager.this.entitySliceManager.moveEntity((Entity)this.entity); // Paper Visibility visibility = this.currentSection.getStatus(); final Visibility oldVisibility = visibility; // Paper - diff on change - this should be OLD section visibility // Paper start -@@ -589,6 +604,7 @@ public class PersistentEntitySectionManager implements A +@@ -578,6 +593,7 @@ public class PersistentEntitySectionManager implements A @Override public void onRemove(Entity.RemovalReason reason) { diff --git a/patches/unapplied/server/0837-Fix-Bukkit-NamespacedKey-shenanigans.patch b/patches/server/0775-Fix-Bukkit-NamespacedKey-shenanigans.patch similarity index 100% rename from patches/unapplied/server/0837-Fix-Bukkit-NamespacedKey-shenanigans.patch rename to patches/server/0775-Fix-Bukkit-NamespacedKey-shenanigans.patch diff --git a/patches/unapplied/server/0824-Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/0776-Fix-merchant-inventory-not-closing-on-entity-removal.patch similarity index 89% rename from patches/unapplied/server/0824-Fix-merchant-inventory-not-closing-on-entity-removal.patch rename to patches/server/0776-Fix-merchant-inventory-not-closing-on-entity-removal.patch index 136d0c2f9..bf3e8390c 100644 --- a/patches/unapplied/server/0824-Fix-merchant-inventory-not-closing-on-entity-removal.patch +++ b/patches/server/0776-Fix-merchant-inventory-not-closing-on-entity-removal.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 536c53fd1d009b86d2c1c3ca2364f458448bc38c..d40a367670ccea01978cabf7d45f3c1a690662fc 100644 +index 8837c9793eb25ad88bdb4b0f6198dc7ae353b9b2..e84969a7b4ed92727a9917b266e5fbe3c9dac1f9 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2419,6 +2419,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2406,6 +2406,11 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot end // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder) { diff --git a/patches/unapplied/server/0832-Check-requirement-before-suggesting-root-nodes.patch b/patches/server/0777-Check-requirement-before-suggesting-root-nodes.patch similarity index 100% rename from patches/unapplied/server/0832-Check-requirement-before-suggesting-root-nodes.patch rename to patches/server/0777-Check-requirement-before-suggesting-root-nodes.patch diff --git a/patches/unapplied/server/0833-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch b/patches/server/0778-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch similarity index 86% rename from patches/unapplied/server/0833-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch rename to patches/server/0778-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch index 4fc21d4b2..c34f26e3f 100644 --- a/patches/unapplied/server/0833-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch +++ b/patches/server/0778-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 71b4d5f7bbccf56cb519333ad2751d6a953f2c68..029c21d9416520469548293f9a2ec0c056507d05 100644 +index 7b6cf326dfab9bd0b13dfc330d143d2efeea9aa1..3eba6962040f33b7b31b16c9de22d90f225710b4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -796,6 +796,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -762,6 +762,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } // Paper end // CraftBukkit end diff --git a/patches/unapplied/server/0840-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch b/patches/server/0779-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch similarity index 100% rename from patches/unapplied/server/0840-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch rename to patches/server/0779-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch diff --git a/patches/unapplied/server/0808-Ensure-valid-vehicle-status.patch b/patches/server/0780-Ensure-valid-vehicle-status.patch similarity index 84% rename from patches/unapplied/server/0808-Ensure-valid-vehicle-status.patch rename to patches/server/0780-Ensure-valid-vehicle-status.patch index cb45c347b..4c6ebe2cf 100644 --- a/patches/unapplied/server/0808-Ensure-valid-vehicle-status.patch +++ b/patches/server/0780-Ensure-valid-vehicle-status.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ensure valid vehicle status diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 4dfd185e47849c18c552e28370d93b48799d2eb9..11f46c1b8f4c8414e0667d1873542c17d6e01f2a 100644 +index 67b482f6cafc55b6b262f23c2b56e4d8c6d089c2..510334bc98d2112489fcece46b660000b14ce6a5 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -509,7 +509,7 @@ public class ServerPlayer extends Player { +@@ -487,7 +487,7 @@ public class ServerPlayer extends Player { } } diff --git a/patches/unapplied/server/0802-Prevent-softlocked-end-exit-portal-generation.patch b/patches/server/0781-Prevent-softlocked-end-exit-portal-generation.patch similarity index 87% rename from patches/unapplied/server/0802-Prevent-softlocked-end-exit-portal-generation.patch rename to patches/server/0781-Prevent-softlocked-end-exit-portal-generation.patch index 42e617cf5..d7ec8ee0e 100644 --- a/patches/unapplied/server/0802-Prevent-softlocked-end-exit-portal-generation.patch +++ b/patches/server/0781-Prevent-softlocked-end-exit-portal-generation.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent softlocked end exit portal generation diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -index dec99c9d40705a89c395437d0d050f3ab36bc17b..44551fc6fc5888206c1a2da3ece5baa486faa1d5 100644 +index 467e2af08698ca40fbbe1fa7b0bafb9561f4fa65..be5952133720bf0ac3483cc2fed334967e6fc0c4 100644 --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -@@ -409,6 +409,12 @@ public class EndDragonFight { +@@ -412,6 +412,12 @@ public class EndDragonFight { } } diff --git a/patches/unapplied/server/0804-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch b/patches/server/0782-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch similarity index 100% rename from patches/unapplied/server/0804-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch rename to patches/server/0782-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch diff --git a/patches/unapplied/server/0805-Don-t-log-debug-logging-being-disabled.patch b/patches/server/0783-Don-t-log-debug-logging-being-disabled.patch similarity index 100% rename from patches/unapplied/server/0805-Don-t-log-debug-logging-being-disabled.patch rename to patches/server/0783-Don-t-log-debug-logging-being-disabled.patch diff --git a/patches/unapplied/server/0806-Mark-fish-and-axolotls-from-buckets-as-persistent.patch b/patches/server/0784-Mark-fish-and-axolotls-from-buckets-as-persistent.patch similarity index 84% rename from patches/unapplied/server/0806-Mark-fish-and-axolotls-from-buckets-as-persistent.patch rename to patches/server/0784-Mark-fish-and-axolotls-from-buckets-as-persistent.patch index ee3bb34c3..5a420fb24 100644 --- a/patches/unapplied/server/0806-Mark-fish-and-axolotls-from-buckets-as-persistent.patch +++ b/patches/server/0784-Mark-fish-and-axolotls-from-buckets-as-persistent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Mark fish and axolotls from buckets as persistent diff --git a/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java b/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java -index fc0cd86397b12e42756273a0317164d79ac51937..0701adf77a04a82df4fe1dceee196fee5d820961 100644 +index 58428eebf24e328b3faf32ca473be8f19d4f6cca..3484defdfd5a487b11917310d7b1d1543291eee1 100644 --- a/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java +++ b/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java -@@ -90,7 +90,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable { +@@ -81,7 +81,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable { @Override public void setFromBucket(boolean fromBucket) { this.entityData.set(AbstractFish.FROM_BUCKET, fromBucket); @@ -18,10 +18,10 @@ index fc0cd86397b12e42756273a0317164d79ac51937..0701adf77a04a82df4fe1dceee196fee @Override diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -index f75333190f8b824e0b52ad2d74739f420644f469..2b8725087fd3bfeca7162bda2783fdacd13a8390 100644 +index 67bb476693fa16aa391c120f8acae7c7279efc20..86acf89ce875e215da8469947b382f70e42314b0 100644 --- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -@@ -236,7 +236,7 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable { +@@ -237,7 +237,7 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable { @Override public void setFromBucket(boolean fromBucket) { this.entityData.set(Axolotl.FROM_BUCKET, fromBucket); diff --git a/patches/unapplied/server/0807-fix-various-menus-with-empty-level-accesses.patch b/patches/server/0785-fix-various-menus-with-empty-level-accesses.patch similarity index 100% rename from patches/unapplied/server/0807-fix-various-menus-with-empty-level-accesses.patch rename to patches/server/0785-fix-various-menus-with-empty-level-accesses.patch diff --git a/patches/unapplied/server/0825-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch b/patches/server/0786-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch similarity index 89% rename from patches/unapplied/server/0825-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch rename to patches/server/0786-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch index ab7e4fb93..736fe8fbf 100644 --- a/patches/unapplied/server/0825-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch +++ b/patches/server/0786-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch @@ -12,11 +12,11 @@ time to save, as flush saving performs a full flush at the end anyways. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 4b1797659f6bb5913b105641ecaac38954ce8bc0..65090afbb510231c05db3132ba416502d188f1c0 100644 +index 6fc7c1cf269466362dce91fa2cf525e67bee6c15..176065656029a8486f2bfb39bdd4da1e86fbca89 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -950,6 +950,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - // Paper end +@@ -665,6 +665,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + } protected void saveAllChunks(boolean flush) { + // Paper start - do not overload I/O threads with too much work when saving @@ -32,7 +32,7 @@ index 4b1797659f6bb5913b105641ecaac38954ce8bc0..65090afbb510231c05db3132ba416502 if (flush) { List list = (List) this.updatingChunks.getVisibleValuesCopy().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList()); // Paper MutableBoolean mutableboolean = new MutableBoolean(); -@@ -972,6 +982,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -687,6 +697,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }).filter((ichunkaccess) -> { return ichunkaccess instanceof ImposterProtoChunk || ichunkaccess instanceof LevelChunk; }).filter(this::save).forEach((ichunkaccess) -> { diff --git a/patches/unapplied/server/0811-Preserve-overstacked-loot.patch b/patches/server/0787-Preserve-overstacked-loot.patch similarity index 90% rename from patches/unapplied/server/0811-Preserve-overstacked-loot.patch rename to patches/server/0787-Preserve-overstacked-loot.patch index e5cd46277..87a51dce3 100644 --- a/patches/unapplied/server/0811-Preserve-overstacked-loot.patch +++ b/patches/server/0787-Preserve-overstacked-loot.patch @@ -10,10 +10,10 @@ chunk bans via the large amount of NBT created by unstacking the items. Fixes GH-5140 and GH-4748. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index f1b1e0455806443cd55c350f9b4f74ef8f3a1158..00e302a278c1aef17596a5f1b91230614b13ceb2 100644 +index 7eacd9265a8d4cee6e3c3608ab08603a3b6e5a15..a9c7aae7668c3dbc307b26680efba4cd827ba528 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -935,6 +935,11 @@ public class PaperWorldConfig { +@@ -844,6 +844,11 @@ public class PaperWorldConfig { allowPlayerCrammingDamage = getBoolean("allow-player-cramming-damage", allowPlayerCrammingDamage); } @@ -26,7 +26,7 @@ index f1b1e0455806443cd55c350f9b4f74ef8f3a1158..00e302a278c1aef17596a5f1b9123061 private Table behaviorTickRates; private void tickRates() { diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java b/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java -index db80db9d6382dd4748aa8f27dd3c3d3ae9fe9380..9827229d125addcfec8b0025724b9a4570c40a12 100644 +index 276c444a0fddb6962818635d5fc7721a56b30784..4f240fc74fb9551d752855dcdf2a376ff30f536b 100644 --- a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java +++ b/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java @@ -54,9 +54,17 @@ public class LootTable { @@ -58,10 +58,10 @@ index db80db9d6382dd4748aa8f27dd3c3d3ae9fe9380..9827229d125addcfec8b0025724b9a45 public List getRandomItems(LootContext context) { diff --git a/src/main/java/net/minecraft/world/level/storage/loot/functions/SetContainerContents.java b/src/main/java/net/minecraft/world/level/storage/loot/functions/SetContainerContents.java -index 6d63c5318e1711a27b254db950ae7576d333ad47..6b5e481980751ed83cda7badc160b738d5c56af9 100644 +index 057676201aa2d19032537832849f3857425d357a..b5c6b7280a9c6964e2ad4aa9bd4517146c98e727 100644 --- a/src/main/java/net/minecraft/world/level/storage/loot/functions/SetContainerContents.java +++ b/src/main/java/net/minecraft/world/level/storage/loot/functions/SetContainerContents.java -@@ -39,7 +39,7 @@ public class SetContainerContents extends LootItemConditionalFunction { +@@ -46,7 +46,7 @@ public class SetContainerContents extends LootItemConditionalFunction { NonNullList nonNullList = NonNullList.create(); this.entries.forEach((entry) -> { entry.expand(context, (choice) -> { diff --git a/patches/unapplied/server/0812-Update-head-rotation-in-missing-places.patch b/patches/server/0788-Update-head-rotation-in-missing-places.patch similarity index 79% rename from patches/unapplied/server/0812-Update-head-rotation-in-missing-places.patch rename to patches/server/0788-Update-head-rotation-in-missing-places.patch index dfc0762ec..84c254198 100644 --- a/patches/unapplied/server/0812-Update-head-rotation-in-missing-places.patch +++ b/patches/server/0788-Update-head-rotation-in-missing-places.patch @@ -8,10 +8,10 @@ This is because bukkit uses a separate head rotation field for yaw. This issue only applies to players. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..4f164f238177b5e2b18c76b7cc14596ec93409d1 100644 +index 96794dcb87c3606e9d112d4159be8be31ad4329e..9cb875b2904c902f3fb0af5b0dd571c3e02aacbd 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1742,6 +1742,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -1616,6 +1616,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F); this.yRotO = this.getYRot(); this.xRotO = this.getXRot(); @@ -19,7 +19,7 @@ index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..4f164f238177b5e2b18c76b7cc14596e } public void absMoveTo(double x, double y, double z) { -@@ -1780,6 +1781,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -1654,6 +1655,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i this.setXRot(pitch); this.setOldPosAndRot(); this.reapplyPosition(); diff --git a/patches/unapplied/server/0813-prevent-unintended-light-block-manipulation.patch b/patches/server/0789-prevent-unintended-light-block-manipulation.patch similarity index 92% rename from patches/unapplied/server/0813-prevent-unintended-light-block-manipulation.patch rename to patches/server/0789-prevent-unintended-light-block-manipulation.patch index ba7dcc0e9..08bd6164f 100644 --- a/patches/unapplied/server/0813-prevent-unintended-light-block-manipulation.patch +++ b/patches/server/0789-prevent-unintended-light-block-manipulation.patch @@ -5,7 +5,7 @@ Subject: [PATCH] prevent unintended light block manipulation diff --git a/src/main/java/net/minecraft/world/level/block/LightBlock.java b/src/main/java/net/minecraft/world/level/block/LightBlock.java -index 7f4acaab7e77f5184c8f8a30ed13b34949780227..59faf48727cfbccacdd5ffa067758466a240e90a 100644 +index d648902737350103c2078c80796038a054f16acc..98124ee3bea51e40a9a3cb9014ee84bfc26e91f7 100644 --- a/src/main/java/net/minecraft/world/level/block/LightBlock.java +++ b/src/main/java/net/minecraft/world/level/block/LightBlock.java @@ -46,6 +46,7 @@ public class LightBlock extends Block implements SimpleWaterloggedBlock { diff --git a/patches/unapplied/server/0815-Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch b/patches/server/0790-Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch similarity index 93% rename from patches/unapplied/server/0815-Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch rename to patches/server/0790-Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch index 351633a78..0ea2c9e0d 100644 --- a/patches/unapplied/server/0815-Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch +++ b/patches/server/0790-Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Dont count named piglins and hoglins towards mob cap diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 0b228b8bcae5ed2840ab244b6de35732f737504d..f316585ccf6baf5e7e514ba3a68b4344e781a82d 100644 +index e9a37fc6791366ea421f2766a36dc2e014ab7951..578d7282190ca97368529cd24b578d31399c4867 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java @@ -83,7 +83,7 @@ public final class NaturalSpawner { diff --git a/patches/unapplied/server/0816-Fix-CraftCriteria-defaults-map.patch b/patches/server/0791-Fix-CraftCriteria-defaults-map.patch similarity index 100% rename from patches/unapplied/server/0816-Fix-CraftCriteria-defaults-map.patch rename to patches/server/0791-Fix-CraftCriteria-defaults-map.patch diff --git a/patches/unapplied/server/0818-Fix-upstreams-block-state-factories.patch b/patches/server/0792-Fix-upstreams-block-state-factories.patch similarity index 99% rename from patches/unapplied/server/0818-Fix-upstreams-block-state-factories.patch rename to patches/server/0792-Fix-upstreams-block-state-factories.patch index 3a4d1c9bc..c349a27eb 100644 --- a/patches/unapplied/server/0818-Fix-upstreams-block-state-factories.patch +++ b/patches/server/0792-Fix-upstreams-block-state-factories.patch @@ -10,10 +10,10 @@ tile entity type to determine the block state factory and falls back on the material type of the block at that location. diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index 38c4dac82793930777eaf0189c5534234a9162ed..9b4a464fe820effa906af486cf71a74e283ccd4e 100644 +index 0e37da7227eaba0d089e5bd136eca088ab2b5eb3..5601d0c2fe635a2a4f073c333531e1a8adf1833c 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -@@ -232,7 +232,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { +@@ -270,7 +270,7 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject { // Paper end if (this.level == null) return null; org.bukkit.block.Block block = this.level.getWorld().getBlockAt(this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ()); diff --git a/patches/unapplied/server/0819-Add-config-option-for-logging-player-ip-addresses.patch b/patches/server/0793-Add-config-option-for-logging-player-ip-addresses.patch similarity index 91% rename from patches/unapplied/server/0819-Add-config-option-for-logging-player-ip-addresses.patch rename to patches/server/0793-Add-config-option-for-logging-player-ip-addresses.patch index e4c7591bd..55104ba13 100644 --- a/patches/unapplied/server/0819-Add-config-option-for-logging-player-ip-addresses.patch +++ b/patches/server/0793-Add-config-option-for-logging-player-ip-addresses.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add config option for logging player ip addresses diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index b3f4ac2ce6f515e406d2f31b1d2429729c9e2b60..0277627e97b51e20470ccf578cee48470e06a34b 100644 +index 95b52e9f6d2b87c525b9eac88fae2e73b08bca82..fee271d0f1200df6475db5aa463b921a958648d7 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -489,6 +489,11 @@ public class PaperConfig { +@@ -91,6 +91,11 @@ public class PaperConfig { } } @@ -52,7 +52,7 @@ index 3962e82d4e4c5f792a37e825891e6960e737452d..dddc97094f0a7847b2818e6ea3b3f6cd InetSocketAddress virtualHost = com.destroystokyo.paper.network.PaperNetworkClient.prepareVirtualHost(host, port); com.destroystokyo.paper.event.server.PaperServerListPingEvent event = PaperLegacyStatusClient.processRequest( diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -index a7046da8c097254907e01cd17f4107c8744f4a6e..43b085ee4c747a813ec5e2fa965c3369690789c5 100644 +index 477aa83c3b342705a8a9b7ab41b2f77008e2e281..a821b68fbe7e172c08540e4b04c857b8b5929120 100644 --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java +++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java @@ -204,7 +204,7 @@ public class ServerConnectionListener { @@ -65,10 +65,10 @@ index a7046da8c097254907e01cd17f4107c8744f4a6e..43b085ee4c747a813ec5e2fa965c3369 networkmanager.send(new ClientboundDisconnectPacket(chatcomponenttext), (future) -> { diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 01fee879c946b6640da34d5890d686f0152437dc..494ca8fa8c742d4eac9fb11878d3b3170d850265 100644 +index d2dd8b802ecea7fd2efe5f07fcef65c26e1adfbc..33a29890435d6065a2cc4f8e8bf8209c01d5d114 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -223,7 +223,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener +@@ -224,7 +224,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener } public String getUserName() { @@ -81,10 +81,10 @@ index 01fee879c946b6640da34d5890d686f0152437dc..494ca8fa8c742d4eac9fb11878d3b317 @Override diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 99aa8f2ba2f10578f37de621d1a5a8e222cd70b1..eaa005c1c9b4386bcdbe1d6eb28c3eca7635066c 100644 +index dca3b995c02507e5df299abe60f518480ce56d21..600005948a3106f2e074be5e816e4b4b82519a11 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -237,7 +237,7 @@ public abstract class PlayerList { +@@ -236,7 +236,7 @@ public abstract class PlayerList { String s1 = "local"; if (connection.getRemoteAddress() != null) { @@ -93,7 +93,7 @@ index 99aa8f2ba2f10578f37de621d1a5a8e222cd70b1..eaa005c1c9b4386bcdbe1d6eb28c3eca } // Spigot start - spawn location event -@@ -301,7 +301,7 @@ public abstract class PlayerList { +@@ -299,7 +299,7 @@ public abstract class PlayerList { playerconnection.playerJoinReady = () -> { postChunkLoadJoin( player, finalWorldserver, connection, playerconnection, diff --git a/patches/unapplied/server/0821-VanillaCommandWrapper-didnt-account-for-entity-sende.patch b/patches/server/0794-VanillaCommandWrapper-didnt-account-for-entity-sende.patch similarity index 100% rename from patches/unapplied/server/0821-VanillaCommandWrapper-didnt-account-for-entity-sende.patch rename to patches/server/0794-VanillaCommandWrapper-didnt-account-for-entity-sende.patch diff --git a/patches/unapplied/server/0822-Add-root-admin-user-detection.patch b/patches/server/0795-Add-root-admin-user-detection.patch similarity index 96% rename from patches/unapplied/server/0822-Add-root-admin-user-detection.patch rename to patches/server/0795-Add-root-admin-user-detection.patch index 053e03ef5..63ae0993b 100644 --- a/patches/unapplied/server/0822-Add-root-admin-user-detection.patch +++ b/patches/server/0795-Add-root-admin-user-detection.patch @@ -57,10 +57,10 @@ index 0000000000000000000000000000000000000000..6bd0afddbcc461149dfe9a5c7a86fff6 + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 7ce1ce59eeba8b57cd76b1c9c561733b476e7ebf..b6ee0e709b0f0529b99567bc9b8fb6bfd99bcd8e 100644 +index 82cee660a029547eda8abdf4188b9d1fb4ba0d53..38a0fb9a7c4ade9cacfd30dffabfea7e6b773981 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -190,6 +190,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -188,6 +188,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); } diff --git a/patches/unapplied/server/0823-Always-allow-item-changing-in-Fireball.patch b/patches/server/0796-Always-allow-item-changing-in-Fireball.patch similarity index 84% rename from patches/unapplied/server/0823-Always-allow-item-changing-in-Fireball.patch rename to patches/server/0796-Always-allow-item-changing-in-Fireball.patch index 1bb4c5dd5..fe4cbf2ef 100644 --- a/patches/unapplied/server/0823-Always-allow-item-changing-in-Fireball.patch +++ b/patches/server/0796-Always-allow-item-changing-in-Fireball.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Always allow item changing in Fireball diff --git a/src/main/java/net/minecraft/world/entity/projectile/Fireball.java b/src/main/java/net/minecraft/world/entity/projectile/Fireball.java -index 913edd9f55543332eb891a722d0b98a23637f85c..6a945497cdcd1aa607a1cb7fa9a96c7950902e7d 100644 +index 838ba52969550f783d26e626267c556ab09b5f3e..7f4e3dfab421591151fda7ec39d9c00b464d62de 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Fireball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Fireball.java @@ -28,7 +28,7 @@ public abstract class Fireball extends AbstractHurtingProjectile implements Item @@ -14,6 +14,6 @@ index 913edd9f55543332eb891a722d0b98a23637f85c..6a945497cdcd1aa607a1cb7fa9a96c79 public void setItem(ItemStack stack) { - if (!stack.is(Items.FIRE_CHARGE) || stack.hasTag()) { + if (true || !stack.is(Items.FIRE_CHARGE) || stack.hasTag()) { // Paper - always allow item changing - this.getEntityData().set(Fireball.DATA_ITEM_STACK, (ItemStack) Util.make(stack.copy(), (itemstack1) -> { // CraftBukkit - decompile error + this.getEntityData().set(Fireball.DATA_ITEM_STACK, (ItemStack) Util.make(stack.copy(), (itemstack1) -> { itemstack1.setCount(1); })); diff --git a/patches/unapplied/server/0834-don-t-attempt-to-teleport-dead-entities.patch b/patches/server/0797-don-t-attempt-to-teleport-dead-entities.patch similarity index 81% rename from patches/unapplied/server/0834-don-t-attempt-to-teleport-dead-entities.patch rename to patches/server/0797-don-t-attempt-to-teleport-dead-entities.patch index 8b1157986..939d4f6bc 100644 --- a/patches/unapplied/server/0834-don-t-attempt-to-teleport-dead-entities.patch +++ b/patches/server/0797-don-t-attempt-to-teleport-dead-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] don't attempt to teleport dead entities diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index e17bda0d13bae337cfad5ae31b118aa7a85499fc..2ce32495758abf64eeeeeea1cdbf4904be77b697 100644 +index 9cb875b2904c902f3fb0af5b0dd571c3e02aacbd..e8ed9ae272ee203b3e8ad036bd4e45aac14f9a6a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -702,7 +702,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -673,7 +673,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i // CraftBukkit start public void postTick() { // No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle diff --git a/patches/unapplied/server/0843-Call-onRemove-logic-for-breakNaturally.patch b/patches/server/0798-Call-onRemove-logic-for-breakNaturally.patch similarity index 88% rename from patches/unapplied/server/0843-Call-onRemove-logic-for-breakNaturally.patch rename to patches/server/0798-Call-onRemove-logic-for-breakNaturally.patch index 4db123eba..e7fd33704 100644 --- a/patches/unapplied/server/0843-Call-onRemove-logic-for-breakNaturally.patch +++ b/patches/server/0798-Call-onRemove-logic-for-breakNaturally.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Call onRemove logic for breakNaturally diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 5154cfffc414e1f6039e55f1a256bbaacb56bc55..6f01af8cc3f9ed4d2eaa3304990ca33f8692a453 100644 +index 808bdd0e8d6b679c2eee87c3078a4c3dbcd08b8b..2da1609c42bc85f173ed56767933bcafd5f0422e 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -513,8 +513,14 @@ public class CraftBlock implements Block { +@@ -516,8 +516,14 @@ public class CraftBlock implements Block { if (triggerEffect) world.levelEvent(org.bukkit.Effect.STEP_SOUND.getId(), position, net.minecraft.world.level.block.Block.getId(block.defaultBlockState())); // Paper result = true; } diff --git a/patches/unapplied/server/0845-Fix-anvil-prepare-event-not-working-with-zero-xp.patch b/patches/server/0799-Fix-anvil-prepare-event-not-working-with-zero-xp.patch similarity index 84% rename from patches/unapplied/server/0845-Fix-anvil-prepare-event-not-working-with-zero-xp.patch rename to patches/server/0799-Fix-anvil-prepare-event-not-working-with-zero-xp.patch index 1ee105fac..408215402 100644 --- a/patches/unapplied/server/0845-Fix-anvil-prepare-event-not-working-with-zero-xp.patch +++ b/patches/server/0799-Fix-anvil-prepare-event-not-working-with-zero-xp.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix anvil prepare event not working with zero xp diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -index 593e23c10f2b1616db7256158dfe564b2d289df1..b62c6b56867b645520cb3c3e382ec96d421e7e97 100644 +index b40377e882d9cc3571f527e706862e27c59b1fd0..073cec4838b88bf4e7444321a74ab73fff732486 100644 --- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -@@ -60,7 +60,7 @@ public class AnvilMenu extends ItemCombinerMenu { +@@ -59,7 +59,7 @@ public class AnvilMenu extends ItemCombinerMenu { @Override protected boolean mayPickup(Player player, boolean present) {