diff --git a/patches/server/0270-Book-size-limits.patch b/patches/server/0270-Book-size-limits.patch index f4a8924ba4..280b12514c 100644 --- a/patches/server/0270-Book-size-limits.patch +++ b/patches/server/0270-Book-size-limits.patch @@ -5,38 +5,57 @@ Subject: [PATCH] Book size limits Puts some limits on the size of books. +diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java +index ed61767a64cdce37dc7c226ebd0d693a60de24a9..f634a830a2b58a419e84f969bd53eeae4f4513bb 100644 +--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java ++++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java +@@ -16,9 +16,9 @@ public record ServerboundEditBookPacket(int slot, List pages, Optional STREAM_CODEC = StreamCodec.composite( + ByteBufCodecs.VAR_INT, + ServerboundEditBookPacket::slot, +- ByteBufCodecs.stringUtf8(8192).apply(ByteBufCodecs.list(200)), ++ ByteBufCodecs.stringUtf8(net.minecraft.world.item.component.WritableBookContent.PAGE_EDIT_LENGTH).apply(ByteBufCodecs.list(net.minecraft.world.item.component.WritableBookContent.MAX_PAGES)), // Paper - limit books + ServerboundEditBookPacket::pages, +- ByteBufCodecs.stringUtf8(128).apply(ByteBufCodecs::optional), ++ ByteBufCodecs.stringUtf8(net.minecraft.world.item.component.WrittenBookContent.TITLE_MAX_LENGTH).apply(ByteBufCodecs::optional), // Paper - limit books + ServerboundEditBookPacket::title, + ServerboundEditBookPacket::new + ); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2e35c6cfdf0cded5adc9f512612faaa68876961c..d69b678b2611f3d1b1ef64541863256868969671 100644 +index ce06a41d98bafc878918507404bd5d6cabc45776..aff0f55623365130f079818af9d6a2e448cfe342 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1043,6 +1043,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1043,6 +1043,43 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleEditBook(ServerboundEditBookPacket packet) { + // Paper start - Book size limits + if (!this.cserver.isPrimaryThread()) { -+ List pageList = packet.pages(); ++ final List pageList = packet.pages(); + long byteTotal = 0; -+ int maxBookPageSize = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax; -+ double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D); ++ final int maxBookPageSize = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax; ++ final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D); + long byteAllowed = maxBookPageSize; -+ for (String testString : pageList) { -+ int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; ++ for (final String page : pageList) { ++ final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; + byteTotal += byteLength; -+ int length = testString.length(); -+ int multibytes = 0; ++ final int length = page.length(); ++ int multiByteCharacters = 0; + if (byteLength != length) { -+ for (char c : testString.toCharArray()) { ++ // Count the number of multi byte characters ++ for (final char c : page.toCharArray()) { + if (c > 127) { -+ multibytes++; ++ multiByteCharacters++; + } + } + } ++ ++ // Allow pages with fewer characters to consume less of the allowed byte quota + byteAllowed += maxBookPageSize * Math.clamp((double) length / 255D, 0.1D, 1) * multiplier; + -+ if (multibytes > 1) { -+ // penalize MB -+ byteAllowed -= multibytes; ++ if (multiByteCharacters > 1) { ++ // Penalize multibyte characters ++ byteAllowed -= multiByteCharacters; + } + } + diff --git a/patches/server/0279-Limit-Client-Sign-length-more.patch b/patches/server/0279-Limit-Client-Sign-length-more.patch index d24066269f..7535b4c602 100644 --- a/patches/server/0279-Limit-Client-Sign-length-more.patch +++ b/patches/server/0279-Limit-Client-Sign-length-more.patch @@ -22,7 +22,7 @@ it only impacts data sent from the client. Set -DPaper.maxSignLength=XX to change limit or -1 to disable diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1c91e1812e536bb59dbb37aec47afca1d59ffa8d..e78a6234d6699e7f14c5ac7faa7d1ee60e46d7f9 100644 +index c8c64a55f6470e161a595279e0d9016b7ab63a93..6a8e6f518919a40f32dbdce5f112e2fb004882c4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -299,6 +299,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -33,7 +33,7 @@ index 1c91e1812e536bb59dbb37aec47afca1d59ffa8d..e78a6234d6699e7f14c5ac7faa7d1ee6 public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) { super(server, connection, clientData, player); // CraftBukkit -@@ -3146,7 +3147,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3149,7 +3150,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleSignUpdate(ServerboundSignUpdatePacket packet) { diff --git a/patches/server/0354-Prevent-teleporting-dead-entities.patch b/patches/server/0354-Prevent-teleporting-dead-entities.patch index 4eb4569139..e2e053f762 100644 --- a/patches/server/0354-Prevent-teleporting-dead-entities.patch +++ b/patches/server/0354-Prevent-teleporting-dead-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent teleporting dead entities diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2fb31c0223f2638de0ebec170095fa20991738ff..e62415cf6a13634f85289c875092bb706c316fd3 100644 +index cd2d2178746a53906b1dc253d73c01ffd24d616d..6ecf770c279dec421627d9b3a04d7c588056c391 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1548,6 +1548,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1551,6 +1551,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set) { // Paper diff --git a/patches/server/0369-Prevent-position-desync-causing-tp-exploit.patch b/patches/server/0369-Prevent-position-desync-causing-tp-exploit.patch index d6354e0fa5..972f46cef4 100644 --- a/patches/server/0369-Prevent-position-desync-causing-tp-exploit.patch +++ b/patches/server/0369-Prevent-position-desync-causing-tp-exploit.patch @@ -13,10 +13,10 @@ behaviour, we need to move all of this dangerous logic outside of the move call and into an appropriate place in the tick method. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e62415cf6a13634f85289c875092bb706c316fd3..d93415023bed72d736f625977ca3e21497bc8f74 100644 +index 6ecf770c279dec421627d9b3a04d7c588056c391..8e607b86ba854bf3a3bcf35d3eeeb406a82323c9 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1345,6 +1345,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1348,6 +1348,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8)); this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move diff --git a/patches/server/0371-Add-PlayerRecipeBookClickEvent.patch b/patches/server/0371-Add-PlayerRecipeBookClickEvent.patch index e5ffda1446..c015b5840b 100644 --- a/patches/server/0371-Add-PlayerRecipeBookClickEvent.patch +++ b/patches/server/0371-Add-PlayerRecipeBookClickEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerRecipeBookClickEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d93415023bed72d736f625977ca3e21497bc8f74..d003494e741b97cbb8541d3132c7c448219e8ced 100644 +index 8e607b86ba854bf3a3bcf35d3eeeb406a82323c9..f9e1dbc5a2690492f837db7b9c196c853c091908 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3053,16 +3053,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3056,16 +3056,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (!this.player.containerMenu.stillValid(this.player)) { ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu); } else { diff --git a/patches/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index d0a4c576b7..d452311406 100644 --- a/patches/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -76,10 +76,10 @@ index d6dc8c983d26ce89f17a990be4284fdc78ad164b..2b1d7a2360a9ee7bca9d93a2dc8c61d1 @Override diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index dae64538b34c7cc7d1af0f58e3a150c7f5e3c1c9..19f49465cfc80c1cf36755f24aa246e0656da75a 100644 +index 53162e8373acce77ab5dd873ddf734aef8dbf3e9..561ffd0cc579227092c501f29007333d70f103e5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3256,7 +3256,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3259,7 +3259,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) { @@ -89,7 +89,7 @@ index dae64538b34c7cc7d1af0f58e3a150c7f5e3c1c9..19f49465cfc80c1cf36755f24aa246e0 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c2ccd10efd5096b2683fe235de1e8176ee7d2083..ebe69ce183b8bba43ed4d6fdbac09fdc1eaaa988 100644 +index 1b3f1b06155e114cd5ab76a406c1b4e745ef58c6..52e8664f8d0368daed43e349aa67e3b295697f26 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -996,8 +996,8 @@ public final class CraftServer implements Server { diff --git a/patches/server/0381-Do-not-accept-invalid-client-settings.patch b/patches/server/0381-Do-not-accept-invalid-client-settings.patch index 9760be5dbe..29994366f6 100644 --- a/patches/server/0381-Do-not-accept-invalid-client-settings.patch +++ b/patches/server/0381-Do-not-accept-invalid-client-settings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Do not accept invalid client settings diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 19f49465cfc80c1cf36755f24aa246e0656da75a..19f13d845467364a25417ac8fd6404f16e18eaa2 100644 +index 561ffd0cc579227092c501f29007333d70f103e5..36f89eee2506a65cfd344042d4de2a18eba3ff7f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3248,6 +3248,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3251,6 +3251,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleClientInformation(ServerboundClientInformationPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); diff --git a/patches/server/0409-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/0409-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index 7a5f2e8a41..647d9004a0 100644 --- a/patches/server/0409-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/patches/server/0409-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -9,7 +9,7 @@ as this is how Vanilla teleports entities. Cancel any pending motion when teleported. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 19f13d845467364a25417ac8fd6404f16e18eaa2..45313a53ef181e4494e4d024c5b79a3ca7f803e1 100644 +index 36f89eee2506a65cfd344042d4de2a18eba3ff7f..fd12b5e386e4582f605266b7840c73c7c8d582b1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -679,7 +679,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -21,7 +21,7 @@ index 19f13d845467364a25417ac8fd6404f16e18eaa2..45313a53ef181e4494e4d024c5b79a3c this.lastGoodX = this.awaitingPositionFromClient.x; this.lastGoodY = this.awaitingPositionFromClient.y; this.lastGoodZ = this.awaitingPositionFromClient.z; -@@ -1590,7 +1590,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1593,7 +1593,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // CraftBukkit end this.awaitingTeleportTime = this.tickCount; diff --git a/patches/server/0419-Fix-for-large-move-vectors-crashing-server.patch b/patches/server/0419-Fix-for-large-move-vectors-crashing-server.patch index bdedd8e886..8d24758e16 100644 --- a/patches/server/0419-Fix-for-large-move-vectors-crashing-server.patch +++ b/patches/server/0419-Fix-for-large-move-vectors-crashing-server.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix for large move vectors crashing server Check movement distance also based on current position. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 45313a53ef181e4494e4d024c5b79a3ca7f803e1..ffdd7c427bf563b1d87d65586b125fd081e73dd8 100644 +index fd12b5e386e4582f605266b7840c73c7c8d582b1..0475be28b412c8aa0f89e0f4bdab2cd54839d1bb 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -492,9 +492,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -53,7 +53,7 @@ index 45313a53ef181e4494e4d024c5b79a3ca7f803e1..ffdd7c427bf563b1d87d65586b125fd0 boolean flag1 = entity.verticalCollisionBelow; if (entity instanceof LivingEntity) { -@@ -1249,7 +1258,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1252,7 +1261,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d7 = d1 - this.firstGoodY; double d8 = d2 - this.firstGoodZ; double d9 = this.player.getDeltaMovement().lengthSqr(); @@ -71,7 +71,7 @@ index 45313a53ef181e4494e4d024c5b79a3ca7f803e1..ffdd7c427bf563b1d87d65586b125fd0 if (this.player.isSleeping()) { if (d10 > 1.0D) { -@@ -1305,9 +1323,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1308,9 +1326,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl AABB axisalignedbb = this.player.getBoundingBox(); diff --git a/patches/server/0443-Limit-recipe-packets.patch b/patches/server/0443-Limit-recipe-packets.patch index 8b3e4ef5c1..4611d863bd 100644 --- a/patches/server/0443-Limit-recipe-packets.patch +++ b/patches/server/0443-Limit-recipe-packets.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ffdd7c427bf563b1d87d65586b125fd081e73dd8..cdf29c17cac7a5bcfcd12d6e306efad0bc87a382 100644 +index 0475be28b412c8aa0f89e0f4bdab2cd54839d1bb..58b0df52a1abcdc6332ac51020e44bad87e54596 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -266,6 +266,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -24,7 +24,7 @@ index ffdd7c427bf563b1d87d65586b125fd081e73dd8..cdf29c17cac7a5bcfcd12d6e306efad0 /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -3065,6 +3067,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3068,6 +3070,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { diff --git a/patches/server/0458-Fix-interact-event-not-being-called-sometimes.patch b/patches/server/0458-Fix-interact-event-not-being-called-sometimes.patch index 50207db6c0..8a2bea0757 100644 --- a/patches/server/0458-Fix-interact-event-not-being-called-sometimes.patch +++ b/patches/server/0458-Fix-interact-event-not-being-called-sometimes.patch @@ -11,10 +11,10 @@ Subject: [PATCH] Fix interact event not being called sometimes Co-authored-by: Moulberry diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cdf29c17cac7a5bcfcd12d6e306efad0bc87a382..afed142d5155c178807c6b26cb5766ae7d6e328a 100644 +index 58b0df52a1abcdc6332ac51020e44bad87e54596..56d13a402a57def163f7ffb5360a27909f8acd19 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1766,7 +1766,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1769,7 +1769,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl MutableComponent ichatmutablecomponent = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED); this.player.sendSystemMessage(ichatmutablecomponent, true); @@ -23,7 +23,7 @@ index cdf29c17cac7a5bcfcd12d6e306efad0bc87a382..afed142d5155c178807c6b26cb5766ae this.player.swing(enumhand, true); } } -@@ -2387,13 +2387,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2390,13 +2390,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d3 = Math.max(this.player.blockInteractionRange(), this.player.entityInteractionRange()); // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time // SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities diff --git a/patches/server/0502-Allow-using-signs-inside-spawn-protection.patch b/patches/server/0502-Allow-using-signs-inside-spawn-protection.patch index cac2a775a6..2bb61f9a2b 100644 --- a/patches/server/0502-Allow-using-signs-inside-spawn-protection.patch +++ b/patches/server/0502-Allow-using-signs-inside-spawn-protection.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow using signs inside spawn protection diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index afed142d5155c178807c6b26cb5766ae7d6e328a..8e888be601190e69389fa5a8596a4e7d52dd1749 100644 +index 56d13a402a57def163f7ffb5360a27909f8acd19..4d522309f4682089b2c982e49720a847265a8acf 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1754,8 +1754,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1757,8 +1757,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl int i = this.player.level().getMaxBuildHeight(); if (blockposition.getY() < i) { diff --git a/patches/server/0507-Don-t-ignore-result-of-PlayerEditBookEvent.patch b/patches/server/0507-Don-t-ignore-result-of-PlayerEditBookEvent.patch index 55667fd1f5..4874a0763c 100644 --- a/patches/server/0507-Don-t-ignore-result-of-PlayerEditBookEvent.patch +++ b/patches/server/0507-Don-t-ignore-result-of-PlayerEditBookEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't ignore result of PlayerEditBookEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8e888be601190e69389fa5a8596a4e7d52dd1749..773ada940f3bb2cf6a9ff1c32b3306d91dda27d9 100644 +index 4d522309f4682089b2c982e49720a847265a8acf..fb78890ad229f7ead611e8b4ceb759e9ad24728e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1150,7 +1150,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1153,7 +1153,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl List> list1 = pages.stream().map(this::filterableFromOutgoing).toList(); itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1)); diff --git a/patches/server/0517-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0517-fix-PlayerItemHeldEvent-firing-twice.patch index c5f9160f22..47892025f7 100644 --- a/patches/server/0517-fix-PlayerItemHeldEvent-firing-twice.patch +++ b/patches/server/0517-fix-PlayerItemHeldEvent-firing-twice.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 773ada940f3bb2cf6a9ff1c32b3306d91dda27d9..4ed4a2f5f03790fab394429334881377c1b3ab60 100644 +index fb78890ad229f7ead611e8b4ceb759e9ad24728e..5c16b407076a45748db9c4dd5906f6abae1af6dd 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1929,6 +1929,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1932,6 +1932,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (this.player.isImmobile()) return; // CraftBukkit if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) { diff --git a/patches/server/0534-Expand-PlayerGameModeChangeEvent.patch b/patches/server/0534-Expand-PlayerGameModeChangeEvent.patch index e24fdaca27..298adf5381 100644 --- a/patches/server/0534-Expand-PlayerGameModeChangeEvent.patch +++ b/patches/server/0534-Expand-PlayerGameModeChangeEvent.patch @@ -134,10 +134,10 @@ index 5de472df78940d1b8320f73d18b2edf3a796227e..073cf184a0e7af41048ae67a9b17b4cd } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7721d329e9949bf84f31792d4c06ab9e04ab4ade..75cb96d392eff322eb93894b5c2b5ad22c3fd261 100644 +index 5c16b407076a45748db9c4dd5906f6abae1af6dd..ca814548e94214f1ab356dd803940a5047a87baa 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2727,7 +2727,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2730,7 +2730,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED, RespawnReason.DEATH); // CraftBukkit if (this.server.isHardcore()) { diff --git a/patches/server/0537-Move-range-check-for-block-placing-up.patch b/patches/server/0537-Move-range-check-for-block-placing-up.patch index 34cf22d1fa..933b62b6b5 100644 --- a/patches/server/0537-Move-range-check-for-block-placing-up.patch +++ b/patches/server/0537-Move-range-check-for-block-placing-up.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Move range check for block placing up diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e91200b8b1da00b4b13697e950433de661a4e419..091863f559b74b93f129cc0bf5413ab4b81a0155 100644 +index ca814548e94214f1ab356dd803940a5047a87baa..b63ffe1f67403db42c9f48147b9a349680f05b9c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1741,6 +1741,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1744,6 +1744,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (itemstack.isItemEnabled(worldserver.enabledFeatures())) { BlockHitResult movingobjectpositionblock = packet.getHitResult(); Vec3 vec3d = movingobjectpositionblock.getLocation(); diff --git a/patches/server/0540-Add-Unix-domain-socket-support.patch b/patches/server/0540-Add-Unix-domain-socket-support.patch index 8f22e1a8a7..d7bbb761c7 100644 --- a/patches/server/0540-Add-Unix-domain-socket-support.patch +++ b/patches/server/0540-Add-Unix-domain-socket-support.patch @@ -87,10 +87,10 @@ index d6d7f1c446ba5507f67038ff27775ba75156f4a7..c63c194c44646e6bc1a5942655278701 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 091863f559b74b93f129cc0bf5413ab4b81a0155..9aceb641acde6840b45899e60fe3319a4a89b357 100644 +index b63ffe1f67403db42c9f48147b9a349680f05b9c..fcbdf2c6efe8229a0f82ae4a730f2217aa6a76f6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2546,6 +2546,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2549,6 +2549,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Spigot Start public SocketAddress getRawAddress() { diff --git a/patches/server/0546-Add-PlayerKickEvent-causes.patch b/patches/server/0546-Add-PlayerKickEvent-causes.patch index 0aaf3a8854..8827547149 100644 --- a/patches/server/0546-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0546-Add-PlayerKickEvent-causes.patch @@ -218,7 +218,7 @@ index 24bf661e76fb421a8be565d9ea68edf7205254d2..feb529adf2168025c785ab92d95a3246 if (this.cserver.getServer().isRunning()) { this.cserver.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e7550dcc61d0 100644 +index fcbdf2c6efe8229a0f82ae4a730f2217aa6a76f6..703543684461acb38f99bf0f2b100ffc61ece2a4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -349,7 +349,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -284,7 +284,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 return; } this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed -@@ -1106,14 +1106,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1109,14 +1109,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (byteTotal > byteAllowed) { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send a book too large. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size()); @@ -301,7 +301,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 return; } this.lastBookTick = MinecraftServer.currentTick; -@@ -1225,7 +1225,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1228,7 +1228,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void handleMovePlayer(ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) { @@ -310,7 +310,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 } else { ServerLevel worldserver = this.player.serverLevel(); -@@ -1663,7 +1663,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1666,7 +1666,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.dropCount++; if (this.dropCount >= 20) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!"); @@ -319,7 +319,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 return; } } -@@ -1951,7 +1951,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1954,7 +1954,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.resetLastActionTime(); } else { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); @@ -328,7 +328,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 } } -@@ -2149,7 +2149,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2152,7 +2152,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private void tryHandleChat(String s, Runnable runnable, boolean sync) { // CraftBukkit if (ServerGamePacketListenerImpl.isChatMessageIllegal(s)) { @@ -337,7 +337,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); } else { -@@ -2172,7 +2172,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2175,7 +2175,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (optional.isEmpty()) { ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); @@ -346,7 +346,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 } return optional; -@@ -2358,7 +2358,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2361,7 +2361,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // this.chatSpamTickCount += 20; if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // CraftBukkit end @@ -355,7 +355,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 } } -@@ -2370,7 +2370,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2373,7 +2373,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl synchronized (this.lastSeenMessages) { if (!this.lastSeenMessages.applyOffset(packet.offset())) { ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString()); @@ -364,7 +364,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 } } -@@ -2518,7 +2518,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2521,7 +2521,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } if (i > 4096) { @@ -373,7 +373,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 } } -@@ -2576,7 +2576,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2579,7 +2579,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Spigot Start if ( entity == this.player && !this.player.isSpectator() ) { @@ -382,7 +382,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 return; } // Spigot End -@@ -2690,7 +2690,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2693,7 +2693,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } @@ -391,7 +391,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString()); } }); -@@ -3087,7 +3087,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3090,7 +3090,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Paper start - auto recipe limit if (!org.bukkit.Bukkit.isPrimaryThread()) { if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { @@ -400,7 +400,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 return; } } -@@ -3329,7 +3329,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3332,7 +3332,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (!Objects.equals(profilepublickey_a, profilepublickey_a1)) { if (profilepublickey_a != null && profilepublickey_a1.expiresAt().isBefore(profilepublickey_a.expiresAt())) { @@ -409,7 +409,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755 } else { try { SignatureValidator signaturevalidator = this.server.getProfileKeySignatureValidator(); -@@ -3342,7 +3342,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3345,7 +3345,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator)); } catch (ProfilePublicKey.ValidationException profilepublickey_b) { ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); diff --git a/patches/server/0564-Add-PlayerArmSwingEvent.patch b/patches/server/0564-Add-PlayerArmSwingEvent.patch index 3c7532588e..a183343e75 100644 --- a/patches/server/0564-Add-PlayerArmSwingEvent.patch +++ b/patches/server/0564-Add-PlayerArmSwingEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerArmSwingEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 3a656daa941993f240fa7fc54ee1106eaa504673..633c13dc22793f5a5c4c137c614c1bb695308888 100644 +index 703543684461acb38f99bf0f2b100ffc61ece2a4..10cd79cb1452f15a1d0c8957023314c97dc4bc96 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2408,7 +2408,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2411,7 +2411,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Paper end - Call interact event // Arm swing animation diff --git a/patches/server/0565-Fix-kick-event-leave-message-not-being-sent.patch b/patches/server/0565-Fix-kick-event-leave-message-not-being-sent.patch index 716ccd113a..130b07d26e 100644 --- a/patches/server/0565-Fix-kick-event-leave-message-not-being-sent.patch +++ b/patches/server/0565-Fix-kick-event-leave-message-not-being-sent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix kick event leave message not being sent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 38d493b03c02bbfed297b7735590e799d26c07f7..09e72aee16ceb7b300482fbaf28f856d4ed472d3 100644 +index f20019261a09f425137731f7a4b92e889b617334..9982940af7d10ca7799e2c21ac994ea3afa0b805 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -290,7 +290,6 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -55,10 +55,10 @@ index feb529adf2168025c785ab92d95a3246e73c0236..b43f87ff4b9853b5d4bbea5ff9686d64 MinecraftServer minecraftserver = this.server; Connection networkmanager = this.connection; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 633c13dc22793f5a5c4c137c614c1bb695308888..5276ce5b6fa19e0810da61c9a3c51b6318356339 100644 +index 10cd79cb1452f15a1d0c8957023314c97dc4bc96..90cde6b752e0c09d47d719bbe9641a162f63ed86 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1890,6 +1890,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1893,6 +1893,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void onDisconnect(DisconnectionDetails info) { @@ -71,7 +71,7 @@ index 633c13dc22793f5a5c4c137c614c1bb695308888..5276ce5b6fa19e0810da61c9a3c51b63 // CraftBukkit start - Rarely it would send a disconnect line twice if (this.processedDisconnect) { return; -@@ -1898,11 +1904,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1901,11 +1907,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // CraftBukkit end ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), info.reason().getString()); @@ -91,7 +91,7 @@ index 633c13dc22793f5a5c4c137c614c1bb695308888..5276ce5b6fa19e0810da61c9a3c51b63 this.chatMessageChain.close(); // CraftBukkit start - Replace vanilla quit message handling with our own. /* -@@ -1912,7 +1924,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1915,7 +1927,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.disconnect(); // Paper start - Adventure @@ -101,7 +101,7 @@ index 633c13dc22793f5a5c4c137c614c1bb695308888..5276ce5b6fa19e0810da61c9a3c51b63 this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); // Paper end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 46f46685081c3c164bd4ba306dfb1220a4e13e52..b36cb031b153c452c7f030105f6963072b5858fc 100644 +index 2b15648549245962c6427af27c3ea34e443b37f3..2f22ae87cd467b73883a38553fab23f8590d17a1 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -561,6 +561,11 @@ public abstract class PlayerList { diff --git a/patches/server/0600-Improve-and-expand-AsyncCatcher.patch b/patches/server/0600-Improve-and-expand-AsyncCatcher.patch index 9d162a5387..00bec9ad23 100644 --- a/patches/server/0600-Improve-and-expand-AsyncCatcher.patch +++ b/patches/server/0600-Improve-and-expand-AsyncCatcher.patch @@ -17,10 +17,10 @@ Async catch modifications to critical entity state Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1e442429d30886eee96f68d212548ff741e3e07e..fa1fbd41fce44bb8bb9e3435abfcac4e0652c968 100644 +index eee9f019e71799a58911368458df759e707c1078..c909fd98d9fa59c7c4db290c7c3386225d8b4960 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1573,6 +1573,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1576,6 +1576,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set) { // Paper @@ -29,7 +29,7 @@ index 1e442429d30886eee96f68d212548ff741e3e07e..fa1fbd41fce44bb8bb9e3435abfcac4e if (player.isRemoved()) { LOGGER.info("Attempt to teleport removed player {} restricted", player.getScoreboardName()); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 85f3dcdc8349683cb79ce1d9fe56eff02af2a7a7..4714931fd5218df160e39f013278b7996cc5eca6 100644 +index a3a19f288643ce290c1e2119ba794f2409e83ed0..6625d0b4cec8e5660c0dbd7965130495e3c94682 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -1122,7 +1122,7 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/patches/server/0692-Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/0692-Prevent-tile-entity-copies-loading-chunks.patch index bcd195d880..d8c959c48a 100644 --- a/patches/server/0692-Prevent-tile-entity-copies-loading-chunks.patch +++ b/patches/server/0692-Prevent-tile-entity-copies-loading-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity copies loading chunks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 15bee10f167ebd134688ff570c4773fe088e149a..efa6e8a85f27c18bddd91b7f83656457e58a16bd 100644 +index 44850aedff2913a5faed4eef5e947edc6ed29281..422f7889c5d1fb87db725430ef19c9e1c64157d9 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3197,7 +3197,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3200,7 +3200,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl BlockPos blockposition = BlockEntity.getPosFromTag(customdata.getUnsafe()); if (this.player.level().isLoaded(blockposition)) { diff --git a/patches/server/0723-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/0723-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch index fcf350cf20..86f520d07c 100644 --- a/patches/server/0723-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch +++ b/patches/server/0723-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Spigot Config not using commands.spam-exclusions diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index efa6e8a85f27c18bddd91b7f83656457e58a16bd..52ff31d33edb0c55e2ec4a982525d47e4a19428b 100644 +index 422f7889c5d1fb87db725430ef19c9e1c64157d9..a9183f4ee27a67a29c26e5ef27164f389c594077 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2379,7 +2379,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2382,7 +2382,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Spigot end // this.chatSpamTickCount += 20; diff --git a/patches/server/0724-More-Teleport-API.patch b/patches/server/0724-More-Teleport-API.patch index 0093c773e6..35ef929678 100644 --- a/patches/server/0724-More-Teleport-API.patch +++ b/patches/server/0724-More-Teleport-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] More Teleport API diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1d91e106b5cef0ab735e916ae32970fd793c8915..48470ab53797a14955ecc1c8368de4ca53dc560b 100644 +index a9183f4ee27a67a29c26e5ef27164f389c594077..5b18dbe258d41a2bdb1442497c5a1e812e624c35 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1561,11 +1561,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1564,11 +1564,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return true; // CraftBukkit - Return event status } diff --git a/patches/server/0727-Send-block-entities-after-destroy-prediction.patch b/patches/server/0727-Send-block-entities-after-destroy-prediction.patch index 88deca43ca..f6d17537a4 100644 --- a/patches/server/0727-Send-block-entities-after-destroy-prediction.patch +++ b/patches/server/0727-Send-block-entities-after-destroy-prediction.patch @@ -57,10 +57,10 @@ index 4d024956156aefde7df308642dfd0a40779e0633..6abecaac8407b992d208a9108e11fd49 } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 77e31c3851813651dc00e59f8ef31134e3540b91..719f44cf1bca2cd834b7909e135b0a636c4ccb5e 100644 +index 5b18dbe258d41a2bdb1442497c5a1e812e624c35..e1c0f97b11efcc4008e81e9cd9b82d68c5205c57 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1707,8 +1707,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1710,8 +1710,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return; } // Paper end - Don't allow digging into unloaded chunks diff --git a/patches/server/0785-Improve-logging-and-errors.patch b/patches/server/0785-Improve-logging-and-errors.patch index 13a5a1f58b..26b691f34d 100644 --- a/patches/server/0785-Improve-logging-and-errors.patch +++ b/patches/server/0785-Improve-logging-and-errors.patch @@ -52,10 +52,10 @@ index aa39bdb0a4ba8fedf5052ea9700afa7d4d2a4300..b4af03c4bdd1ce0861f36c3b75fc7e89 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 719f44cf1bca2cd834b7909e135b0a636c4ccb5e..af2fb05406616849c8f65bbd971b354d1931a6ac 100644 +index e1c0f97b11efcc4008e81e9cd9b82d68c5205c57..4ada3d66c946bd7e6755adb4d40e47708690c3c7 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3395,7 +3395,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3398,7 +3398,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator)); } catch (ProfilePublicKey.ValidationException profilepublickey_b) { diff --git a/patches/server/0788-Add-missing-SpigotConfig-logCommands-check.patch b/patches/server/0788-Add-missing-SpigotConfig-logCommands-check.patch index 75fc07c3c6..68b7a46ada 100644 --- a/patches/server/0788-Add-missing-SpigotConfig-logCommands-check.patch +++ b/patches/server/0788-Add-missing-SpigotConfig-logCommands-check.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add missing SpigotConfig logCommands check Co-authored-by: david diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index af2fb05406616849c8f65bbd971b354d1931a6ac..50896a73387f9467b83f9a685ab346e3edb4e040 100644 +index 4ada3d66c946bd7e6755adb4d40e47708690c3c7..d46cc9a7af7a396083197993c0b95a0cc73d609a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2053,7 +2053,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2056,7 +2056,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private void performUnsignedChatCommand(String command) { // CraftBukkit start String command1 = "/" + command; @@ -19,7 +19,7 @@ index af2fb05406616849c8f65bbd971b354d1931a6ac..50896a73387f9467b83f9a685ab346e3 PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(this.getCraftPlayer(), command1, new LazyPlayerSet(this.server)); this.cserver.getPluginManager().callEvent(event); -@@ -2093,7 +2095,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2096,7 +2098,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private void performSignedChatCommand(ServerboundChatCommandSignedPacket packet, LastSeenMessages lastSeenMessages) { // CraftBukkit start String command = "/" + packet.command(); diff --git a/patches/server/0793-Use-single-player-info-update-packet-on-join.patch b/patches/server/0793-Use-single-player-info-update-packet-on-join.patch index 7067fafbf3..d9501eef30 100644 --- a/patches/server/0793-Use-single-player-info-update-packet-on-join.patch +++ b/patches/server/0793-Use-single-player-info-update-packet-on-join.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use single player info update packet on join diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 50896a73387f9467b83f9a685ab346e3edb4e040..e38c437a2e55d0e1cc7ed60f7994232880342c9e 100644 +index d46cc9a7af7a396083197993c0b95a0cc73d609a..d83650ea63a6ec76efd0a46dc1eb0b4735b81490 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3433,7 +3433,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3436,7 +3436,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.signedMessageDecoder = session.createMessageDecoder(this.player.getUUID()); this.chatMessageChain.append(() -> { this.player.setChatSession(session); @@ -18,7 +18,7 @@ index 50896a73387f9467b83f9a685ab346e3edb4e040..e38c437a2e55d0e1cc7ed60f79942328 } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 84add5cc89ec912389500b6140a39d6b7ddc9e86..944c727fd7770fe4c06af67304005664a7ab9e8a 100644 +index b54e8da2209d99696e12c65a23323a68b7da272b..d210df131bac0604eb44e7a772ec48089c043746 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -361,6 +361,7 @@ public abstract class PlayerList { diff --git a/patches/server/0810-Treat-sequence-violations-like-they-should-be.patch b/patches/server/0810-Treat-sequence-violations-like-they-should-be.patch index 0ba419a953..c98c95dc42 100644 --- a/patches/server/0810-Treat-sequence-violations-like-they-should-be.patch +++ b/patches/server/0810-Treat-sequence-violations-like-they-should-be.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Treat sequence violations like they should be diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e38c437a2e55d0e1cc7ed60f7994232880342c9e..207cc06d857ffca4c0aac98221a31014b42fac3f 100644 +index d83650ea63a6ec76efd0a46dc1eb0b4735b81490..6eee43f2005f4bc937f7411c17d431a3b95093c1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1972,6 +1972,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1975,6 +1975,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void ackBlockChangesUpTo(int sequence) { if (sequence < 0) { diff --git a/patches/server/0811-Prevent-causing-expired-keys-from-impacting-new-join.patch b/patches/server/0811-Prevent-causing-expired-keys-from-impacting-new-join.patch index ca01894b5f..0ade1c461d 100644 --- a/patches/server/0811-Prevent-causing-expired-keys-from-impacting-new-join.patch +++ b/patches/server/0811-Prevent-causing-expired-keys-from-impacting-new-join.patch @@ -26,7 +26,7 @@ index 68c062cbaa030d62d97c9c003651f8fc17a00a6b..6247a21c9c391abf1f6db3482c659593 UPDATE_GAME_MODE((serialized, buf) -> serialized.gameMode = GameType.byId(buf.readVarInt()), (buf, entry) -> buf.writeVarInt(entry.gameMode().getId())), UPDATE_LISTED((serialized, buf) -> serialized.listed = buf.readBoolean(), (buf, entry) -> buf.writeBoolean(entry.listed())), diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 207cc06d857ffca4c0aac98221a31014b42fac3f..d3e0fb1292e1bae22ea70835b45fc36aa9cf254c 100644 +index 6eee43f2005f4bc937f7411c17d431a3b95093c1..a5d7a1769ca0fd32427a98b2029b787b549831e5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -295,6 +295,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -51,7 +51,7 @@ index 207cc06d857ffca4c0aac98221a31014b42fac3f..d3e0fb1292e1bae22ea70835b45fc36a } private int getMaximumFlyingTicks(Entity vehicle) { -@@ -3431,6 +3439,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3434,6 +3442,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private void resetPlayerChatState(RemoteChatSession session) { this.chatSession = session; diff --git a/patches/server/0847-Implement-PlayerFailMoveEvent.patch b/patches/server/0847-Implement-PlayerFailMoveEvent.patch index 0e5b8355f0..1a73a0110a 100644 --- a/patches/server/0847-Implement-PlayerFailMoveEvent.patch +++ b/patches/server/0847-Implement-PlayerFailMoveEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerFailMoveEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d3e0fb1292e1bae22ea70835b45fc36aa9cf254c..be9c3a48fd1c44b5b5e2680c35c91c5058010e23 100644 +index a5d7a1769ca0fd32427a98b2029b787b549831e5..62779e108793e2a90c4f1356ee840bdeebce464e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1256,8 +1256,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1259,8 +1259,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d0 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX(this.player.getX())); final double toX = d0; // Paper - OBFHELPER double d1 = ServerGamePacketListenerImpl.clampVertical(packet.getY(this.player.getY())); final double toY = d1; // Paper - OBFHELPER double d2 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ(this.player.getZ())); final double toZ = d2; // Paper - OBFHELPER @@ -19,7 +19,7 @@ index d3e0fb1292e1bae22ea70835b45fc36aa9cf254c..be9c3a48fd1c44b5b5e2680c35c91c50 if (this.player.isPassenger()) { this.player.absMoveTo(this.player.getX(), this.player.getY(), this.player.getZ(), f, f1); -@@ -1324,8 +1324,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1327,8 +1327,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Paper start - Prevent moving into unloaded chunks if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) { @@ -36,7 +36,7 @@ index d3e0fb1292e1bae22ea70835b45fc36aa9cf254c..be9c3a48fd1c44b5b5e2680c35c91c50 } // Paper end - Prevent moving into unloaded chunks -@@ -1334,9 +1340,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1337,9 +1343,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // CraftBukkit end @@ -56,7 +56,7 @@ index d3e0fb1292e1bae22ea70835b45fc36aa9cf254c..be9c3a48fd1c44b5b5e2680c35c91c50 } } } -@@ -1398,14 +1411,31 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1401,14 +1414,31 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl d8 = d2 - this.player.getZ(); d10 = d6 * d6 + d7 * d7 + d8 * d8; @@ -91,7 +91,7 @@ index d3e0fb1292e1bae22ea70835b45fc36aa9cf254c..be9c3a48fd1c44b5b5e2680c35c91c50 this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet()); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet. this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packet.isOnGround()); } else { -@@ -3462,4 +3492,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3465,4 +3495,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl InteractionResult run(ServerPlayer player, Entity entity, InteractionHand hand); } diff --git a/patches/server/0883-Add-slot-sanity-checks-in-container-clicks.patch b/patches/server/0883-Add-slot-sanity-checks-in-container-clicks.patch index 36fc080610..d9ab5ba2e7 100644 --- a/patches/server/0883-Add-slot-sanity-checks-in-container-clicks.patch +++ b/patches/server/0883-Add-slot-sanity-checks-in-container-clicks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add slot sanity checks in container clicks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index c17115368e36bce710a494334969676edb0f9a5c..599c620cfbf478cd3674bf4691d70000d1fd6987 100644 +index a5b7907485f91501edd9705294b1f8dc3dae9315..c9b77c0eb288b564effab5ee75e8cf6e8b5a0dca 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2982,6 +2982,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2985,6 +2985,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl break; case SWAP: if ((packet.getButtonNum() >= 0 && packet.getButtonNum() < 9) || packet.getButtonNum() == 40) { @@ -22,7 +22,7 @@ index c17115368e36bce710a494334969676edb0f9a5c..599c620cfbf478cd3674bf4691d70000 Slot clickedSlot = this.player.containerMenu.getSlot(packet.getSlotNum()); if (clickedSlot.mayPickup(this.player)) { diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 85fb19177690ea7235c10f64789066599db08b05..428e454116804c27496cfbf796edd44780890d33 100644 +index 0e380151b038e2133013eb7d73621cf247b5b954..afd8f48bd41d2cac413c292f7988c903da1dc700 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -423,6 +423,7 @@ public abstract class AbstractContainerMenu { diff --git a/patches/server/0940-Add-CartographyItemEvent.patch b/patches/server/0940-Add-CartographyItemEvent.patch index cabd85961e..ea39efbcf6 100644 --- a/patches/server/0940-Add-CartographyItemEvent.patch +++ b/patches/server/0940-Add-CartographyItemEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add CartographyItemEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 599c620cfbf478cd3674bf4691d70000d1fd6987..137754d5fe819956f29f2dd2a97bb4427e0d5339 100644 +index c9b77c0eb288b564effab5ee75e8cf6e8b5a0dca..4de7507139ff222d2ea3c6dd65e98bbf56e9263f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3104,6 +3104,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3107,6 +3107,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } diff --git a/patches/server/0971-Brigadier-based-command-API.patch b/patches/server/0971-Brigadier-based-command-API.patch index ad3eff5ecd..f0568e7e89 100644 --- a/patches/server/0971-Brigadier-based-command-API.patch +++ b/patches/server/0971-Brigadier-based-command-API.patch @@ -2356,10 +2356,10 @@ index b4af03c4bdd1ce0861f36c3b75fc7e89d701c46a..0761d5bc5f2813bb4a9f664ac7a05b97 this.setPvpAllowed(dedicatedserverproperties.pvp); this.setFlightAllowed(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ef646b717323933f4b84e963ab8139dd241843bc..4f9a17e7cd5aca2e8bd55b4892a20dce181289cd 100644 +index 8952b0351ab9e747ae51d2b2c538aac1e996545d..1da3c0304d5900eac180a22c0875186438e8d441 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2403,33 +2403,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2406,33 +2406,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } diff --git a/patches/server/0975-Prevent-sending-oversized-item-data-in-equipment-and.patch b/patches/server/0975-Prevent-sending-oversized-item-data-in-equipment-and.patch index ce1eb08d18..ee638f3a91 100644 --- a/patches/server/0975-Prevent-sending-oversized-item-data-in-equipment-and.patch +++ b/patches/server/0975-Prevent-sending-oversized-item-data-in-equipment-and.patch @@ -209,10 +209,10 @@ index 0e7ace92522fbd4cef7b2c2b8a0f8b86c2cce192..1d849ce4e2c85f149af25318b8ffb6dc ((LivingEntity) this.entity).detectEquipmentUpdatesPublic(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d5f33021754047971b69f90caff3664f596d6eec..9da231673888bb8ba2ed922204ddfd0220f091b1 100644 +index 1da3c0304d5900eac180a22c0875186438e8d441..0e1384f6231e03ea7c71d6e48f490ab70011317a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2727,7 +2727,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2730,7 +2730,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl entity.refreshEntityData(ServerGamePacketListenerImpl.this.player); // SPIGOT-7136 - Allays if (entity instanceof Allay) { diff --git a/patches/server/0979-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch b/patches/server/0979-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch index 2edb9f6db4..5c2476dc41 100644 --- a/patches/server/0979-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch +++ b/patches/server/0979-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Deprecate InvAction#HOTBAR_MOVE_AND_READD diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a04fdcecf00f128f0afba1a33fad1d9e7694ef63..566bbc8f2976bc492049fcddca5976a0ae48d14d 100644 +index 0e1384f6231e03ea7c71d6e48f490ab70011317a..2d334e938fe17e57496999ccbfee752db048c53d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2993,14 +2993,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2996,14 +2996,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl Slot clickedSlot = this.player.containerMenu.getSlot(packet.getSlotNum()); if (clickedSlot.mayPickup(this.player)) { ItemStack hotbar = this.player.getInventory().getItem(packet.getButtonNum()); diff --git a/patches/server/1019-Properly-resend-entities.patch b/patches/server/1019-Properly-resend-entities.patch index ffba1508ba..fd409a38d2 100644 --- a/patches/server/1019-Properly-resend-entities.patch +++ b/patches/server/1019-Properly-resend-entities.patch @@ -81,10 +81,10 @@ index e9dcdb1e09e84a9b451034ff4bdfa6eae2dd1c04..24b1715397ba8e6f5e9841a030d0e3d9 } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 566bbc8f2976bc492049fcddca5976a0ae48d14d..f1ca57b98fe04df2722114743c2d746c0a679c1f 100644 +index 2d334e938fe17e57496999ccbfee752db048c53d..13887e050d8d40924212f7fb0bf43054c042a294 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1944,6 +1944,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1947,6 +1947,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } if (cancelled) { @@ -92,7 +92,7 @@ index 566bbc8f2976bc492049fcddca5976a0ae48d14d..f1ca57b98fe04df2722114743c2d746c this.player.getBukkitEntity().updateInventory(); // SPIGOT-2524 return; } -@@ -2713,7 +2714,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2716,7 +2717,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // Entity in bucket - SPIGOT-4048 and SPIGOT-6859a if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) { @@ -102,7 +102,7 @@ index 566bbc8f2976bc492049fcddca5976a0ae48d14d..f1ca57b98fe04df2722114743c2d746c } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index e597a7ef6e702c7e3703e1ba29a7b919d1c20877..ca9b909a783733f2af1e36f4ac2fd463362b9685 100644 +index 24ff10c4ed69deed2ce9ba25835575419165e2af..83759ce35c66e45d04eaa494bd8bc95e51e9836a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -393,7 +393,7 @@ public abstract class PlayerList { @@ -167,7 +167,7 @@ index 6b4a7930efabd29f00690a79e8080faaa9767190..935f88542a10360ec21dfced9272313f public boolean equals(Object object) { return object instanceof Entity ? ((Entity) object).id == this.id : false; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 8a876b2d964b70b9ddd2d90bf8fbb983566ef747..aff6cd6b717b8fdff373be1db32d26f1305e2be9 100644 +index 0eea726a703e7d5b128f39b31929963aa27d82cc..53e4ce13f0ce1a7609fdc82f0ae3f3dabef38c54 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -3879,6 +3879,11 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/patches/server/1041-Make-interaction-leniency-distance-configurable.patch b/patches/server/1041-Make-interaction-leniency-distance-configurable.patch index c5462f81e2..51f09a24ed 100644 --- a/patches/server/1041-Make-interaction-leniency-distance-configurable.patch +++ b/patches/server/1041-Make-interaction-leniency-distance-configurable.patch @@ -12,10 +12,10 @@ This value however may be too low in high latency environments. The patch exposes a new configuration option to configure said value. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f1ca57b98fe04df2722114743c2d746c0a679c1f..4d697cd7aa5a74c2016644385f59e461f660c8bd 100644 +index 13887e050d8d40924212f7fb0bf43054c042a294..60d008840855e051b5faa0dae2bbfcdb40269620 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2698,7 +2698,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2701,7 +2701,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl AABB axisalignedbb = entity.getBoundingBox(); diff --git a/patches/server/1046-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/1046-Optimise-collision-checking-in-player-move-packet-ha.patch index 11cb0df057..39ba77e40f 100644 --- a/patches/server/1046-Optimise-collision-checking-in-player-move-packet-ha.patch +++ b/patches/server/1046-Optimise-collision-checking-in-player-move-packet-ha.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimise collision checking in player move packet handling Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 60ff21c8df4168f14da04a12073bde47cd4693c4..750f216400a473ed6895273c99ff89960bb56833 100644 +index 60d008840855e051b5faa0dae2bbfcdb40269620..8837a6b19cab18eb47b7723236c7761c6661edda 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -572,7 +572,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -87,7 +87,7 @@ index 60ff21c8df4168f14da04a12073bde47cd4693c4..750f216400a473ed6895273c99ff8996 } @Override -@@ -1382,7 +1416,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1385,7 +1419,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } @@ -96,7 +96,7 @@ index 60ff21c8df4168f14da04a12073bde47cd4693c4..750f216400a473ed6895273c99ff8996 d6 = d0 - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above d7 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above -@@ -1424,6 +1458,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1427,6 +1461,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8)); this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move @@ -104,7 +104,7 @@ index 60ff21c8df4168f14da04a12073bde47cd4693c4..750f216400a473ed6895273c99ff8996 // Paper start - prevent position desync if (this.awaitingPositionFromClient != null) { return; // ... thanks Mojang for letting move calls teleport across dimensions. -@@ -1454,7 +1489,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1457,7 +1492,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Paper start - Add fail move event @@ -123,7 +123,7 @@ index 60ff21c8df4168f14da04a12073bde47cd4693c4..750f216400a473ed6895273c99ff8996 if (teleportBack) { io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.CLIPPED_INTO_BLOCK, toX, toY, toZ, toYaw, toPitch, false); -@@ -1565,7 +1610,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1568,7 +1613,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private boolean updateAwaitingTeleport() { if (this.awaitingPositionFromClient != null) { @@ -132,7 +132,7 @@ index 60ff21c8df4168f14da04a12073bde47cd4693c4..750f216400a473ed6895273c99ff8996 this.awaitingTeleportTime = this.tickCount; this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); } -@@ -1578,6 +1623,33 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1581,6 +1626,33 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } diff --git a/patches/server/1050-Fix-CraftBukkit-drag-system.patch b/patches/server/1050-Fix-CraftBukkit-drag-system.patch index eec68004e0..f553e2fcda 100644 --- a/patches/server/1050-Fix-CraftBukkit-drag-system.patch +++ b/patches/server/1050-Fix-CraftBukkit-drag-system.patch @@ -10,10 +10,10 @@ public net.minecraft.world.inventory.AbstractContainerMenu quickcraftType public net.minecraft.world.inventory.AbstractContainerMenu resetQuickCraft()V diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index bb74747ba19e882c820e2dac8d2f34166acb530b..238114d295df0508be6b47b94f478b9906384be0 100644 +index 8837a6b19cab18eb47b7723236c7761c6661edda..744e07877b8837b789cc117e33bd2a8f2c58ab17 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3123,6 +3123,25 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3126,6 +3126,25 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } break; case QUICK_CRAFT: