diff --git a/patches/server/0151-Add-PlayerJumpEvent.patch b/patches/server/0151-Add-PlayerJumpEvent.patch index 884503c512..aed4af669b 100644 --- a/patches/server/0151-Add-PlayerJumpEvent.patch +++ b/patches/server/0151-Add-PlayerJumpEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerJumpEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2cc5663878a7c0f4b4d5f4b9a0f69de2326bf415..73d9451f4419dfe47620aed0edc7bd386a2c87da 100644 +index 2cc5663878a7c0f4b4d5f4b9a0f69de2326bf415..f80bf569089bdc049f861f876ab91183a1860d54 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1201,7 +1201,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -37,7 +37,7 @@ index 2cc5663878a7c0f4b4d5f4b9a0f69de2326bf415..73d9451f4419dfe47620aed0edc7bd38 + this.player.jumpFromGround(); + } else { + from = event.getFrom(); -+ this.internalTeleport(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch(), Collections.emptySet()); ++ this.internalTeleport(new PositionMoveRotation(org.bukkit.craftbukkit.util.CraftLocation.toVec3D(from), Vec3.ZERO, from.getYaw(), from.getPitch()), Collections.emptySet()); + return; + } + // Paper end - Add PlayerJumpEvent diff --git a/patches/server/0161-AsyncTabCompleteEvent.patch b/patches/server/0161-AsyncTabCompleteEvent.patch index 864c8ee1f1..fba56c021a 100644 --- a/patches/server/0161-AsyncTabCompleteEvent.patch +++ b/patches/server/0161-AsyncTabCompleteEvent.patch @@ -16,7 +16,7 @@ Also adds isCommand and getLocation to the sync TabCompleteEvent Co-authored-by: Aikar diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 73d9451f4419dfe47620aed0edc7bd386a2c87da..0cce81cb61665b2dbd445fa9a0fcfeb42ce3be2c 100644 +index f80bf569089bdc049f861f876ab91183a1860d54..fd5ce79bb1e976dac5109be12aa4b9b550e94f41 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -714,21 +714,58 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0207-InventoryCloseEvent-Reason-API.patch b/patches/server/0207-InventoryCloseEvent-Reason-API.patch index 9c9fca7807..94f20cfc2c 100644 --- a/patches/server/0207-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0207-InventoryCloseEvent-Reason-API.patch @@ -75,7 +75,7 @@ index 98aeafcc51e23a7534c8d57e4db0eb58abb3f30b..29b836a75b835f0d5233db419fc5ca8d this.doCloseContainer(); } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0cce81cb61665b2dbd445fa9a0fcfeb42ce3be2c..bcceb9d18524ddcf7cdf2ab6dcb95a67f1155414 100644 +index fd5ce79bb1e976dac5109be12aa4b9b550e94f41..9033c0e720a432d9abffdd7aebee2d26e595ee93 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2633,10 +2633,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0221-Break-up-and-make-tab-spam-limits-configurable.patch b/patches/server/0221-Break-up-and-make-tab-spam-limits-configurable.patch index 2320ac4554..25b1469681 100644 --- a/patches/server/0221-Break-up-and-make-tab-spam-limits-configurable.patch +++ b/patches/server/0221-Break-up-and-make-tab-spam-limits-configurable.patch @@ -22,26 +22,18 @@ to take the burden of this into their own hand without having to rely on plugins doing unsafe things. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index bcceb9d18524ddcf7cdf2ab6dcb95a67f1155414..816b53894c6420a6b1603252e53facacecc07c52 100644 +index 9033c0e720a432d9abffdd7aebee2d26e595ee93..c20ae23e4ca340cd5ec093578f88d16529c3523a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -7,6 +7,7 @@ import com.mojang.brigadier.ParseResults; - import com.mojang.brigadier.StringReader; - import com.mojang.brigadier.suggestion.Suggestions; - import com.mojang.logging.LogUtils; -+import io.papermc.paper.configuration.GlobalConfiguration; - import it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry; - import it.unimi.dsi.fastutil.ints.Int2ObjectMaps; - import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -@@ -272,6 +273,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -272,6 +272,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private int tickCount; private int ackBlockChangesUpTo = -1; private final TickThrottler chatSpamThrottler = new TickThrottler(20, 200); -+ private final TickThrottler tabSpamThrottler = new TickThrottler(GlobalConfiguration.get().spamLimiter.tabSpamIncrement, GlobalConfiguration.get().spamLimiter.tabSpamLimit); // Paper - configurable tab spam limits ++ private final TickThrottler tabSpamThrottler = new TickThrottler(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement, io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit); // Paper - configurable tab spam limits private final TickThrottler dropSpamThrottler = new TickThrottler(20, 1480); private double firstGoodX; private double firstGoodY; -@@ -387,6 +389,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -387,6 +388,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.keepConnectionAlive(); this.chatSpamThrottler.tick(); @@ -49,7 +41,7 @@ index bcceb9d18524ddcf7cdf2ab6dcb95a67f1155414..816b53894c6420a6b1603252e53facac this.dropSpamThrottler.tick(); if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) { this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 -@@ -722,7 +725,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -722,7 +724,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async // CraftBukkit start diff --git a/patches/server/0257-Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/0257-Add-option-to-prevent-players-from-moving-into-unloa.patch index e09aa17911..15dac08b66 100644 --- a/patches/server/0257-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/patches/server/0257-Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 816b53894c6420a6b1603252e53facacecc07c52..825e181edc612daa2deaee2977d82a0d048720e7 100644 +index c20ae23e4ca340cd5ec093578f88d16529c3523a..ff378b29a2dfec293f7a926d1e8383627795303a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -491,9 +491,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -490,9 +490,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d0 = entity.getX(); double d1 = entity.getY(); double d2 = entity.getZ(); @@ -22,7 +22,7 @@ index 816b53894c6420a6b1603252e53facacecc07c52..825e181edc612daa2deaee2977d82a0d float f = Mth.wrapDegrees(packet.getYRot()); float f1 = Mth.wrapDegrees(packet.getXRot()); double d6 = d3 - this.vehicleFirstGoodX; -@@ -527,6 +527,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -526,6 +526,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } speed *= 2f; // TODO: Get the speed of the vehicle instead of the player @@ -39,7 +39,7 @@ index 816b53894c6420a6b1603252e53facacecc07c52..825e181edc612daa2deaee2977d82a0d if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // CraftBukkit end ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); -@@ -1160,9 +1170,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1159,9 +1169,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } if (!this.updateAwaitingTeleport()) { @@ -52,7 +52,7 @@ index 816b53894c6420a6b1603252e53facacecc07c52..825e181edc612daa2deaee2977d82a0d float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot())); float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot())); -@@ -1220,6 +1230,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1219,6 +1229,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } else { speed = this.player.getAbilities().walkingSpeed * 10f; } diff --git a/patches/server/0264-Don-t-allow-digging-into-unloaded-chunks.patch b/patches/server/0264-Don-t-allow-digging-into-unloaded-chunks.patch index 15b8e300bb..1ec1ba0901 100644 --- a/patches/server/0264-Don-t-allow-digging-into-unloaded-chunks.patch +++ b/patches/server/0264-Don-t-allow-digging-into-unloaded-chunks.patch @@ -59,10 +59,10 @@ index 4c8189a2a7edea824545a24dccb376b8eceac001..4623c8acd125dff4919c4e2045b84831 this.level.destroyBlockProgress(this.player.getId(), pos, -1); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 825e181edc612daa2deaee2977d82a0d048720e7..5b5c5864fa1ad96946b0892998284fab26e54095 100644 +index ff378b29a2dfec293f7a926d1e8383627795303a..3f9025405e90ebcbab5ce4c1edef55fe74e529c6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1599,6 +1599,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1598,6 +1598,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl case START_DESTROY_BLOCK: case ABORT_DESTROY_BLOCK: case STOP_DESTROY_BLOCK: diff --git a/patches/server/0268-Book-size-limits.patch b/patches/server/0268-Book-size-limits.patch index 73f2ff470b..9f54605774 100644 --- a/patches/server/0268-Book-size-limits.patch +++ b/patches/server/0268-Book-size-limits.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Book size limits Puts some limits on the size of books. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5b5c5864fa1ad96946b0892998284fab26e54095..9c04eb00c80a343502ece3001a6b21382d011d30 100644 +index 3f9025405e90ebcbab5ce4c1edef55fe74e529c6..c234ee2b72249accbaee4f8005fa4c2f1be0fdc8 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1049,6 +1049,44 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1048,6 +1048,44 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleEditBook(ServerboundEditBookPacket packet) { diff --git a/patches/server/0275-Brigadier-Mojang-API.patch b/patches/server/0275-Brigadier-Mojang-API.patch index 993a47ccdb..080f3c0fe5 100644 --- a/patches/server/0275-Brigadier-Mojang-API.patch +++ b/patches/server/0275-Brigadier-Mojang-API.patch @@ -119,10 +119,10 @@ index e812cc865baaa1ee03872f7969ee98600b82483b..c847fbdb6f52386570eb4c070fcc01d3 if (commandnode2.canUse(source)) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9c04eb00c80a343502ece3001a6b21382d011d30..0552007b5f12055b72b01ddeef17c30236642eaf 100644 +index c234ee2b72249accbaee4f8005fa4c2f1be0fdc8..77e111973ae33389315af72eb950b6f9d9abee12 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -773,19 +773,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -772,19 +772,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip())); } } diff --git a/patches/server/0276-Limit-Client-Sign-length-more.patch b/patches/server/0276-Limit-Client-Sign-length-more.patch index 082d51bacd..0cbe0df00c 100644 --- a/patches/server/0276-Limit-Client-Sign-length-more.patch +++ b/patches/server/0276-Limit-Client-Sign-length-more.patch @@ -22,10 +22,10 @@ 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 0552007b5f12055b72b01ddeef17c30236642eaf..0b7e47418aa7a9891ee4a070430de6b2599f66e3 100644 +index 77e111973ae33389315af72eb950b6f9d9abee12..fd5ad700154a7b75f2ecff6a8d47f6d75ac789e4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -307,6 +307,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -306,6 +306,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault(); private final FutureChain chatMessageChain; private boolean waitingForSwitchToConfig; @@ -33,7 +33,7 @@ index 0552007b5f12055b72b01ddeef17c30236642eaf..0b7e47418aa7a9891ee4a070430de6b2 public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) { super(server, connection, clientData, player); // CraftBukkit -@@ -3197,7 +3198,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3196,7 +3197,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleSignUpdate(ServerboundSignUpdatePacket packet) { diff --git a/patches/server/0346-Validate-PickItem-Packet-and-kick-for-invalid.patch b/patches/server/0346-Validate-PickItem-Packet-and-kick-for-invalid.patch index 9f4314b9de..324c88b698 100644 --- a/patches/server/0346-Validate-PickItem-Packet-and-kick-for-invalid.patch +++ b/patches/server/0346-Validate-PickItem-Packet-and-kick-for-invalid.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0b7e47418aa7a9891ee4a070430de6b2599f66e3..01dbc23369661e141ee81a2357f7b0b5602b56d5 100644 +index fd5ad700154a7b75f2ecff6a8d47f6d75ac789e4..7d3a64ad036470e9cd540131c2c3a58d871bc392 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -899,7 +899,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -898,7 +898,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handlePickItem(ServerboundPickItemPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); diff --git a/patches/server/0349-Prevent-teleporting-dead-entities.patch b/patches/server/0349-Prevent-teleporting-dead-entities.patch index dffc392392..8016bc2454 100644 --- a/patches/server/0349-Prevent-teleporting-dead-entities.patch +++ b/patches/server/0349-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 01dbc23369661e141ee81a2357f7b0b5602b56d5..7b8aaf763020cf7be7114f329f22af75f7a80ef0 100644 +index 7d3a64ad036470e9cd540131c2c3a58d871bc392..452fdd64669765d5dc73faa90d94bf474cbe1a07 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1564,6 +1564,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1563,6 +1563,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } public void internalTeleport(PositionMoveRotation positionmoverotation, Set set) { diff --git a/patches/server/0364-Prevent-position-desync-causing-tp-exploit.patch b/patches/server/0364-Prevent-position-desync-causing-tp-exploit.patch index 29816e7a49..9acb04239e 100644 --- a/patches/server/0364-Prevent-position-desync-causing-tp-exploit.patch +++ b/patches/server/0364-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 7b8aaf763020cf7be7114f329f22af75f7a80ef0..e329503681961566a76a383245303e88acef37a4 100644 +index 452fdd64669765d5dc73faa90d94bf474cbe1a07..4ac071f31583cd7fa0d80d8bbaddd3f5de8d648c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1352,6 +1352,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1351,6 +1351,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/0366-Add-PlayerRecipeBookClickEvent.patch b/patches/server/0366-Add-PlayerRecipeBookClickEvent.patch index e2e9336c48..e6174267bc 100644 --- a/patches/server/0366-Add-PlayerRecipeBookClickEvent.patch +++ b/patches/server/0366-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 e329503681961566a76a383245303e88acef37a4..5b1c8fb2765407cab1ca41d8d2fce83df1cc5fe1 100644 +index 4ac071f31583cd7fa0d80d8bbaddd3f5de8d648c..b180bc19f4a8fa413a84429895bcd5d0f6a30a43 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -200,6 +200,7 @@ import net.minecraft.world.phys.Vec3; +@@ -199,6 +199,7 @@ import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; @@ -16,7 +16,7 @@ index e329503681961566a76a383245303e88acef37a4..5b1c8fb2765407cab1ca41d8d2fce83d import org.slf4j.Logger; // CraftBukkit start -@@ -3086,21 +3087,41 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3085,21 +3086,41 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl ServerGamePacketListenerImpl.LOGGER.debug("Player {} tried to place impossible recipe {}", this.player, recipeholder.id().location()); return; } diff --git a/patches/server/0368-Add-permission-for-command-blocks.patch b/patches/server/0368-Add-permission-for-command-blocks.patch index 9a0f361096..f7d0a92c42 100644 --- a/patches/server/0368-Add-permission-for-command-blocks.patch +++ b/patches/server/0368-Add-permission-for-command-blocks.patch @@ -18,10 +18,10 @@ index 4623c8acd125dff4919c4e2045b848310d785da5..86e4559da2344f228ef4d1c4ac3c115f return false; } else if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5b1c8fb2765407cab1ca41d8d2fce83df1cc5fe1..fc595e04191ffe3434d54156e924cec0f4b19cee 100644 +index b180bc19f4a8fa413a84429895bcd5d0f6a30a43..ac073dab2d2552f9bb0394379a237a4dc37c8fb2 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -811,7 +811,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -810,7 +810,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (!this.server.isCommandBlockEnabled()) { this.player.sendSystemMessage(Component.translatable("advMode.notEnabled")); @@ -30,7 +30,7 @@ index 5b1c8fb2765407cab1ca41d8d2fce83df1cc5fe1..fc595e04191ffe3434d54156e924cec0 this.player.sendSystemMessage(Component.translatable("advMode.notAllowed")); } else { BaseCommandBlock commandblocklistenerabstract = null; -@@ -878,7 +878,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -877,7 +877,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (!this.server.isCommandBlockEnabled()) { this.player.sendSystemMessage(Component.translatable("advMode.notEnabled")); diff --git a/patches/server/0370-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0370-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index d6a667ddb7..b0483140f3 100644 --- a/patches/server/0370-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/0370-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -76,10 +76,10 @@ index 82d5f1235d158326ce6fb1eb6d481c00f57467d3..20a3138c6c2a6c8ada8b6008913abae0 @Override diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index fc595e04191ffe3434d54156e924cec0f4b19cee..510c97062d77541425aed6ddaaad58be4290967b 100644 +index ac073dab2d2552f9bb0394379a237a4dc37c8fb2..7865ff33b0163460a9ffdb7ed4bb3970b5674344 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3304,7 +3304,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3303,7 +3303,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()) { diff --git a/patches/server/0376-Do-not-accept-invalid-client-settings.patch b/patches/server/0376-Do-not-accept-invalid-client-settings.patch index 65e274aa2b..590c7811c8 100644 --- a/patches/server/0376-Do-not-accept-invalid-client-settings.patch +++ b/patches/server/0376-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 510c97062d77541425aed6ddaaad58be4290967b..09bb38460ab6fa7b6132e245d52b60244bd248eb 100644 +index 7865ff33b0163460a9ffdb7ed4bb3970b5674344..f146787c935287eb5cc545643036eeb2a2d7dc9b 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3296,6 +3296,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3295,6 +3295,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleClientInformation(ServerboundClientInformationPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); diff --git a/patches/server/0404-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/0404-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index 254c21a45f..2cb92d0cf8 100644 --- a/patches/server/0404-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/patches/server/0404-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -9,10 +9,10 @@ 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 09bb38460ab6fa7b6132e245d52b60244bd248eb..319717d5b67b9bc2a261bc69679c2e6634d7696c 100644 +index f146787c935287eb5cc545643036eeb2a2d7dc9b..c430434485baa7fc5a213efd9523cee8c2c46b44 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -678,7 +678,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -677,7 +677,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return; } diff --git a/patches/unapplied/server/0408-Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/0405-Add-additional-open-container-api-to-HumanEntity.patch similarity index 97% rename from patches/unapplied/server/0408-Add-additional-open-container-api-to-HumanEntity.patch rename to patches/server/0405-Add-additional-open-container-api-to-HumanEntity.patch index 15f9a92e44..4f9cf8d9d9 100644 --- a/patches/unapplied/server/0408-Add-additional-open-container-api-to-HumanEntity.patch +++ b/patches/server/0405-Add-additional-open-container-api-to-HumanEntity.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Add additional open container api to HumanEntity public net/minecraft/world/level/block/state/BlockBehaviour getMenuProvider(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/MenuProvider; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index c17dd4205983855615289cf0a5619056d237f325..6cda13df52ee4d56dd1d3c213307bfd38175584c 100644 +index b2ab430392fc0f214ba8c5383e3f3ad5c548bda2..9022555db0df8c269fc039c895422cf36c08097e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -471,6 +471,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/patches/unapplied/server/0409-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch b/patches/server/0406-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch similarity index 100% rename from patches/unapplied/server/0409-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch rename to patches/server/0406-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch diff --git a/patches/unapplied/server/0410-Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/0407-Extend-block-drop-capture-to-capture-all-items-added.patch similarity index 88% rename from patches/unapplied/server/0410-Extend-block-drop-capture-to-capture-all-items-added.patch rename to patches/server/0407-Extend-block-drop-capture-to-capture-all-items-added.patch index 9cb478d120..12a14918c3 100644 --- a/patches/unapplied/server/0410-Extend-block-drop-capture-to-capture-all-items-added.patch +++ b/patches/server/0407-Extend-block-drop-capture-to-capture-all-items-added.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 9114ba1742a4fc8683848d431fa92046a85fe871..c60967b7833a23cff0305219b02b308d92448109 100644 +index 465b6a1bbdbb193c6ecf5fd1598e1e4a4f8dbbbc..a3ce6feff0826dcfb2a11b0f6cd01a5368c2de3a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1228,6 +1228,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1223,6 +1223,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit return false; } else { @@ -23,10 +23,10 @@ index 9114ba1742a4fc8683848d431fa92046a85fe871..c60967b7833a23cff0305219b02b308d if (spawnReason != null && !CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { return false; diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index d4bd44210d58b30696feeea48e1909472a546702..5de472df78940d1b8320f73d18b2edf3a796227e 100644 +index 86e4559da2344f228ef4d1c4ac3c115fa0266d23..546be40a8e4470fb5a6686072cdd342cdaa6fe15 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -437,10 +437,12 @@ public class ServerPlayerGameMode { +@@ -435,10 +435,12 @@ public class ServerPlayerGameMode { // return true; // CraftBukkit } // CraftBukkit start diff --git a/patches/unapplied/server/0411-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0408-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch similarity index 85% rename from patches/unapplied/server/0411-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch rename to patches/server/0408-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index 587ee1ed67..a9c355af59 100644 --- a/patches/unapplied/server/0411-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/0408-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f1383906dbd16e088f57c9c77c051c8501b155cc..c01a9305eb1c3e2ee5effab1e11980c2540d3c2a 100644 +index f8fd729d53248c7598a118d89fedf340f82cdd61..ac1b2b3982e5ceb8fecf20867dd2ac6e143463c3 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4508,4 +4508,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4704,4 +4704,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess void accept(Entity entity, double x, double y, double z); } @@ -21,7 +21,7 @@ index f1383906dbd16e088f57c9c77c051c8501b155cc..c01a9305eb1c3e2ee5effab1e11980c2 + // Paper end - Expose entity id counter } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 8b11f5f8cec74c57d614d73233a449c97cd56d18..d7e8663e21ade1b53d4b936147f57b632f67a156 100644 +index 180259d1e5401777e121a8c1ec95034afbc0917b..3448ada171a9fb8c8294b0ba93eb2c846788a679 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -511,6 +511,11 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0412-Lazily-track-plugin-scoreboards-by-default.patch b/patches/server/0409-Lazily-track-plugin-scoreboards-by-default.patch similarity index 100% rename from patches/unapplied/server/0412-Lazily-track-plugin-scoreboards-by-default.patch rename to patches/server/0409-Lazily-track-plugin-scoreboards-by-default.patch diff --git a/patches/unapplied/server/0413-Entity-isTicking.patch b/patches/server/0410-Entity-isTicking.patch similarity index 80% rename from patches/unapplied/server/0413-Entity-isTicking.patch rename to patches/server/0410-Entity-isTicking.patch index 502eb20937..e90c16901d 100644 --- a/patches/unapplied/server/0413-Entity-isTicking.patch +++ b/patches/server/0410-Entity-isTicking.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity#isTicking diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index c01a9305eb1c3e2ee5effab1e11980c2540d3c2a..6ab665efcac4c2543bab9d95472026e0ec8580c5 100644 +index ac1b2b3982e5ceb8fecf20867dd2ac6e143463c3..0bd608894ab596c773570f92b4662aee5a6934cc 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4513,5 +4513,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4709,5 +4709,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public static int nextEntityId() { return ENTITY_COUNTER.incrementAndGet(); } @@ -19,10 +19,10 @@ index c01a9305eb1c3e2ee5effab1e11980c2540d3c2a..6ab665efcac4c2543bab9d95472026e0 // Paper end - Expose entity id counter } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 5f5788a502642463091fb76e98703aaec7a86836..98e8ad81b8c9c0636abe59f70ce891fe926a37fe 100644 +index abecb0235eee3e62a84f15f2ef100efcf3fcbf2a..925626b74005ec9c031c3773171f7684ecc9ccd3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1062,4 +1062,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1063,4 +1063,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return getHandle().isInLava(); } // Paper end - entity liquid API diff --git a/patches/unapplied/server/0414-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/0411-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch similarity index 90% rename from patches/unapplied/server/0414-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch rename to patches/server/0411-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch index 284340c436..ebe55acb10 100644 --- a/patches/unapplied/server/0414-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch +++ b/patches/server/0411-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d2866b9f7e6c8f0ca30d451c93c56caefb2c1b5c..05aa3323e9ae971fba5ab8c6c319c7805a3808aa 100644 +index b1447fb684f5cbdc9106363870f5551ee9e1342c..263ed74fd8a8a53ce6d676201f75c5b334345c84 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2270,13 +2270,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 1.0D) { -@@ -1309,9 +1327,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1312,9 +1330,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl AABB axisalignedbb = this.player.getBoundingBox(); diff --git a/patches/unapplied/server/0418-Optimise-getType-calls.patch b/patches/server/0415-Optimise-getType-calls.patch similarity index 91% rename from patches/unapplied/server/0418-Optimise-getType-calls.patch rename to patches/server/0415-Optimise-getType-calls.patch index 1b14b0202b..07a3b551c2 100644 --- a/patches/unapplied/server/0418-Optimise-getType-calls.patch +++ b/patches/server/0415-Optimise-getType-calls.patch @@ -27,10 +27,10 @@ index 065d140ca4f987e14138a37f4c7d60879dd7b6e1..601135f3368272bf1ca3a43ec9c199e3 super(block, propertyMap, codec); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java -index f2ce97e46cdbda0f8960eed9b601c797d8eaef48..85029f1acfdbb411d9ebdf95838d6db3898f4e58 100644 +index a845ebd6262e05a1395c9a503480319e4b4a65ce..c88e4ba701b2a2325b76478b7f47278157afd2ef 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java -@@ -99,7 +99,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { +@@ -100,7 +100,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { public Material getBlockType(int x, int y, int z) { this.validateChunkCoordinates(x, y, z); @@ -40,7 +40,7 @@ index f2ce97e46cdbda0f8960eed9b601c797d8eaef48..85029f1acfdbb411d9ebdf95838d6db3 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index a586442422a2b2c06b785af0d261d3e19eb1d59b..aa644231425b9622437538b5c092d4064a40cced 100644 +index 3fa3de9a89550ec2fcb8ca663742826c0c3136b6..5f4dcf6d86db66186dc31075bdb739f5dbae6480 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -220,7 +220,7 @@ public class CraftBlock implements Block { @@ -66,10 +66,10 @@ index fabdec2d66cc6d676ed58fa570e2c318ab0927e2..1002123cd0c6f57cecc4e80f5f21cc6f public void setFlag(int flag) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 67ff2241aa8869b41abb0a93467b8694618264e2..9953b6b36cbcbfd1756bac478b568ca5700fc898 100644 +index f73858663162cb594db382d584b6500bb03e74b1..7f0d87bd43a54885fc521068116888083327f37e 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -61,7 +61,7 @@ public class CraftBlockData implements BlockData { +@@ -63,7 +63,7 @@ public class CraftBlockData implements BlockData { @Override public Material getMaterial() { diff --git a/patches/unapplied/server/0419-Villager-resetOffers.patch b/patches/server/0416-Villager-resetOffers.patch similarity index 94% rename from patches/unapplied/server/0419-Villager-resetOffers.patch rename to patches/server/0416-Villager-resetOffers.patch index ce8f9949cd..2b919a8646 100644 --- a/patches/unapplied/server/0419-Villager-resetOffers.patch +++ b/patches/server/0416-Villager-resetOffers.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Villager#resetOffers diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -index 89e14bb2662fe03b4661aaa54fd65af41b1d438b..fcb3b66617150ad503bffe65de4900b1e3af8764 100644 +index 3cdd48c35d50fa3107e0f2bf439e75b7f306b3d1..c8231e421e6c3f1cf8a5aaf8cc64741abe868f41 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java @@ -114,6 +114,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa diff --git a/patches/unapplied/server/0420-Retain-block-place-order-when-capturing-blockstates.patch b/patches/server/0417-Retain-block-place-order-when-capturing-blockstates.patch similarity index 89% rename from patches/unapplied/server/0420-Retain-block-place-order-when-capturing-blockstates.patch rename to patches/server/0417-Retain-block-place-order-when-capturing-blockstates.patch index bac1a1074b..7bb12e9275 100644 --- a/patches/unapplied/server/0420-Retain-block-place-order-when-capturing-blockstates.patch +++ b/patches/server/0417-Retain-block-place-order-when-capturing-blockstates.patch @@ -10,10 +10,10 @@ In general, look at making this logic more robust (i.e properly handling cases where a captured entry is overriden) - but for now this will do. diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 60b04a16c6cb0a7109bda5c16e23c1d56ab7afad..144d243e0d6ba3ae3f0b0bf457fa516e2b4f416f 100644 +index dc38a23f027b4fe516f3963632d01f66c02b0681..aff89d2e3274b91238989fc1e7d8c119c2a3c097 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -152,7 +152,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -153,7 +153,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public boolean captureBlockStates = false; public boolean captureTreeGeneration = false; public Map capturedBlockStates = new java.util.LinkedHashMap<>(); // Paper diff --git a/patches/unapplied/server/0421-Fix-item-locations-dropped-from-campfires.patch b/patches/server/0418-Fix-item-locations-dropped-from-campfires.patch similarity index 89% rename from patches/unapplied/server/0421-Fix-item-locations-dropped-from-campfires.patch rename to patches/server/0418-Fix-item-locations-dropped-from-campfires.patch index 26a43eb186..df4949c1b8 100644 --- a/patches/unapplied/server/0421-Fix-item-locations-dropped-from-campfires.patch +++ b/patches/server/0418-Fix-item-locations-dropped-from-campfires.patch @@ -7,10 +7,10 @@ Fixes #4259 by not flooring the blockposition among other weirdness Vanilla Issue: MC-267622 diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java -index 391acc9dadc653e9e1285a71b4f1e7c063e8ca49..80f911692c97585a696a19ebbe616d6aa312b2d9 100644 +index 0694b2a041c0012bbb7ab5c4c787c1e08db7757c..30035d534e144bf31f94073c57b0195be7e62772 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java -@@ -86,7 +86,14 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { +@@ -85,7 +85,14 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { result = blockCookEvent.getResult(); itemstack1 = CraftItemStack.asNMSCopy(result); // CraftBukkit end @@ -23,6 +23,6 @@ index 391acc9dadc653e9e1285a71b4f1e7c063e8ca49..80f911692c97585a696a19ebbe616d6a + world.addFreshEntity(droppedItem); + } + // Paper end - Fix item locations dropped from campfires - campfire.items.set(i, ItemStack.EMPTY); + blockEntity.items.set(i, ItemStack.EMPTY); world.sendBlockUpdated(pos, state, state, 3); world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(state)); diff --git a/patches/unapplied/server/0422-Fix-bell-block-entity-memory-leak.patch b/patches/server/0419-Fix-bell-block-entity-memory-leak.patch similarity index 100% rename from patches/unapplied/server/0422-Fix-bell-block-entity-memory-leak.patch rename to patches/server/0419-Fix-bell-block-entity-memory-leak.patch diff --git a/patches/unapplied/server/0423-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch b/patches/server/0420-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch similarity index 93% rename from patches/unapplied/server/0423-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch rename to patches/server/0420-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch index 6ab78855c4..67b54defca 100644 --- a/patches/unapplied/server/0423-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch +++ b/patches/server/0420-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch @@ -8,10 +8,10 @@ This can realistically only happen if there's custom loot active on fishing which can return 0 items. This would disconnect the player who's fishing. diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -index 0b4c67b9de6893601f032a8fae103e8a98f2c767..5b7734020b496ade3740d92908ad2d399bfd55e6 100644 +index 9d24d4c3802c525546dae92530c9c5b3cf77924e..536196a740f607adda2a5ae7f644981ac26bef98 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -@@ -506,9 +506,15 @@ public class FishingHook extends Projectile { +@@ -511,9 +511,15 @@ public class FishingHook extends Projectile { while (iterator.hasNext()) { ItemStack itemstack1 = (ItemStack) iterator.next(); @@ -29,7 +29,7 @@ index 0b4c67b9de6893601f032a8fae103e8a98f2c767..5b7734020b496ade3740d92908ad2d39 playerFishEvent.setExpToDrop(this.random.nextInt(6) + 1); this.level().getCraftServer().getPluginManager().callEvent(playerFishEvent); -@@ -521,8 +527,12 @@ public class FishingHook extends Projectile { +@@ -526,8 +532,12 @@ public class FishingHook extends Projectile { double d2 = entityhuman.getZ() - this.getZ(); double d3 = 0.1D; diff --git a/patches/unapplied/server/0424-Add-getOfflinePlayerIfCached-String.patch b/patches/server/0421-Add-getOfflinePlayerIfCached-String.patch similarity index 89% rename from patches/unapplied/server/0424-Add-getOfflinePlayerIfCached-String.patch rename to patches/server/0421-Add-getOfflinePlayerIfCached-String.patch index 5eeace36f6..83fd69cf3d 100644 --- a/patches/unapplied/server/0424-Add-getOfflinePlayerIfCached-String.patch +++ b/patches/server/0421-Add-getOfflinePlayerIfCached-String.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 42ec4aed187b41729a3c985ae440097db0388d3c..25bfb93568ea0a6c0b827c6d6a736f950981144e 100644 +index dfe625f406ac323ede270d3773e71b09a3ba0054..dd3940c2aacfa835b528a882f3ec5dd4d98bd59f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1965,6 +1965,28 @@ public final class CraftServer implements Server { +@@ -1969,6 +1969,28 @@ public final class CraftServer implements Server { return result; } diff --git a/patches/unapplied/server/0425-Add-ignore-discounts-API.patch b/patches/server/0422-Add-ignore-discounts-API.patch similarity index 97% rename from patches/unapplied/server/0425-Add-ignore-discounts-API.patch rename to patches/server/0422-Add-ignore-discounts-API.patch index b2ed91d9bf..84103c5a2e 100644 --- a/patches/unapplied/server/0425-Add-ignore-discounts-API.patch +++ b/patches/server/0422-Add-ignore-discounts-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ignore discounts API diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index e23674dd5db3c429efd3b7c71fe36b420494c03a..9d5a5a7fff7f75871e167f83edb0e9d5348748d7 100644 +index 82ed0ce824e84ea09ea963caa61fbb75f6ce6fe7..f51078e4b9e6267fa43795d009f5d149b86acb5a 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -493,6 +493,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -490,6 +490,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler while (iterator.hasNext()) { MerchantOffer merchantrecipe = (MerchantOffer) iterator.next(); @@ -16,7 +16,7 @@ index e23674dd5db3c429efd3b7c71fe36b420494c03a..9d5a5a7fff7f75871e167f83edb0e9d5 merchantrecipe.addToSpecialPriceDiff(-Mth.floor((float) i * merchantrecipe.getPriceMultiplier())); } -@@ -505,6 +506,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -502,6 +503,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler while (iterator1.hasNext()) { MerchantOffer merchantrecipe1 = (MerchantOffer) iterator1.next(); diff --git a/patches/unapplied/server/0426-Toggle-for-removing-existing-dragon.patch b/patches/server/0423-Toggle-for-removing-existing-dragon.patch similarity index 88% rename from patches/unapplied/server/0426-Toggle-for-removing-existing-dragon.patch rename to patches/server/0423-Toggle-for-removing-existing-dragon.patch index 26ae1ded8a..5efff5ff3f 100644 --- a/patches/unapplied/server/0426-Toggle-for-removing-existing-dragon.patch +++ b/patches/server/0423-Toggle-for-removing-existing-dragon.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Toggle for removing existing dragon 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 a12299604ea88c268db5065191d641eb7d52c3e3..d6deedb96583c19eeb27e671289c4edc8a9245b4 100644 +index 0f34a5ce0352f627099a719b78e530e5e572581a..323fbf684b7062c1b9084f1718538a3b3414d5bf 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 -@@ -211,7 +211,7 @@ public class EndDragonFight { +@@ -212,7 +212,7 @@ public class EndDragonFight { this.dragonUUID = entityenderdragon.getUUID(); EndDragonFight.LOGGER.info("Found that there's a dragon still alive ({})", entityenderdragon); this.dragonKilled = false; diff --git a/patches/unapplied/server/0427-Fix-client-lag-on-advancement-loading.patch b/patches/server/0424-Fix-client-lag-on-advancement-loading.patch similarity index 95% rename from patches/unapplied/server/0427-Fix-client-lag-on-advancement-loading.patch rename to patches/server/0424-Fix-client-lag-on-advancement-loading.patch index 5cc82219f2..e62e28f8d5 100644 --- a/patches/unapplied/server/0427-Fix-client-lag-on-advancement-loading.patch +++ b/patches/server/0424-Fix-client-lag-on-advancement-loading.patch @@ -15,7 +15,7 @@ manually reload the advancement data for all players, which normally takes place as a part of the datapack reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index d7e8663e21ade1b53d4b936147f57b632f67a156..66249c5caefb0879e13c02d5553b09b4122418b9 100644 +index 3448ada171a9fb8c8294b0ba93eb2c846788a679..ea9c9ae832c4044a2eccbf901e20ff042df68bf3 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -323,7 +323,13 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0428-Item-no-age-no-player-pickup.patch b/patches/server/0425-Item-no-age-no-player-pickup.patch similarity index 100% rename from patches/unapplied/server/0428-Item-no-age-no-player-pickup.patch rename to patches/server/0425-Item-no-age-no-player-pickup.patch diff --git a/patches/unapplied/server/0429-Beacon-API-custom-effect-ranges.patch b/patches/server/0426-Beacon-API-custom-effect-ranges.patch similarity index 93% rename from patches/unapplied/server/0429-Beacon-API-custom-effect-ranges.patch rename to patches/server/0426-Beacon-API-custom-effect-ranges.patch index b80f1772cd..6afe0e8f7c 100644 --- a/patches/unapplied/server/0429-Beacon-API-custom-effect-ranges.patch +++ b/patches/server/0426-Beacon-API-custom-effect-ranges.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Beacon API - custom effect ranges diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index fc915797d2a085447747d9ce23a5a354fb3eb6b6..52776ce9b7b4edd1eb474f14705d7fd83f5a66ca 100644 +index 8332296663b845df1d09d403b49a4769b2d54afc..dc3171b1493d7c4c8ddf1c79587c4e27bd819c17 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java @@ -86,6 +86,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -81,7 +81,7 @@ index fc915797d2a085447747d9ce23a5a354fb3eb6b6..52776ce9b7b4edd1eb474f14705d7fd8 @@ -395,6 +425,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } - this.lockKey = LockCode.fromTag(nbt); + this.lockKey = LockCode.fromTag(nbt, registries); + this.effectRange = nbt.contains(PAPER_RANGE_TAG, 6) ? nbt.getDouble(PAPER_RANGE_TAG) : -1; // Paper - Custom beacon ranges } @@ -89,16 +89,16 @@ index fc915797d2a085447747d9ce23a5a354fb3eb6b6..52776ce9b7b4edd1eb474f14705d7fd8 @@ -408,6 +439,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } - this.lockKey.addToTag(nbt); + this.lockKey.addToTag(nbt, registries); + nbt.putDouble(PAPER_RANGE_TAG, this.effectRange); // Paper - Custom beacon ranges } public void setCustomName(@Nullable Component customName) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java -index 2dfbe061a064b0c79b96f644a1c3639bb900eca4..3f1bb225c4e6acdd9104e856d6a11d519119c9f4 100644 +index 8021ac39cb9c1ff45123d51e6f13b840d1290bb2..275d4f9e07ff7383b18238071e067b7f44483ece 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java -@@ -33,7 +33,7 @@ public class CraftBeacon extends CraftBlockEntityState implem +@@ -42,7 +42,7 @@ public class CraftBeacon extends CraftBlockEntityState implem if (tileEntity instanceof BeaconBlockEntity) { BeaconBlockEntity beacon = (BeaconBlockEntity) tileEntity; @@ -107,7 +107,7 @@ index 2dfbe061a064b0c79b96f644a1c3639bb900eca4..3f1bb225c4e6acdd9104e856d6a11d51 Collection bukkit = new ArrayList(nms.size()); for (Player human : nms) { -@@ -120,4 +120,21 @@ public class CraftBeacon extends CraftBlockEntityState implem +@@ -145,4 +145,21 @@ public class CraftBeacon extends CraftBlockEntityState implem public CraftBeacon copy(Location location) { return new CraftBeacon(this, location); } diff --git a/patches/unapplied/server/0430-Add-API-for-quit-reason.patch b/patches/server/0427-Add-API-for-quit-reason.patch similarity index 91% rename from patches/unapplied/server/0430-Add-API-for-quit-reason.patch rename to patches/server/0427-Add-API-for-quit-reason.patch index c4ed7bf11f..fe4c28762d 100644 --- a/patches/unapplied/server/0430-Add-API-for-quit-reason.patch +++ b/patches/server/0427-Add-API-for-quit-reason.patch @@ -28,10 +28,10 @@ index 134810ac91d828d67759cd1ed56f11b71e292917..ba41646a5edb57c4d9766df08bbc5701 Connection.LOGGER.debug("Failed to sent packet", throwable); if (this.getSending() == PacketFlow.CLIENTBOUND) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 45181bc9c422507682d479e4d43177ecd3253971..2ea613f818403f8e8ece4b36891738139345cf89 100644 +index c468947990cf05e554006e51d87b72fad7c28e55..0ae490bb9b4cd781876054d0824c5392060208eb 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -295,6 +295,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { +@@ -323,6 +323,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { public boolean isRealPlayer; // Paper public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent public @Nullable String clientBrandName = null; // Paper - Brand support @@ -40,10 +40,10 @@ index 45181bc9c422507682d479e4d43177ecd3253971..2ea613f818403f8e8ece4b3689173813 public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index 48085b2e7197dc44e76b812bdd514af729e21e83..a1124405412cdac673f34a63988e7be957506dba 100644 +index 9a8b08d4b70b8890961e4af7ce6e870aa1c7c810..f8ae8c8eff73e4e87eb34d0f2635517f1688a6f1 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -@@ -376,6 +376,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -383,6 +383,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack private void disconnect0(DisconnectionDetails disconnectiondetails) { // CraftBukkit end @@ -52,10 +52,10 @@ index 48085b2e7197dc44e76b812bdd514af729e21e83..a1124405412cdac673f34a63988e7be9 this.connection.disconnect(disconnectiondetails); })); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 6f587c4bb4704d93552ba61335d87b1852fc169c..98eb00a8ee23543714d424d3ff5ca19887d6db19 100644 +index c8c27311ade7d4a70d5398b3a4cb50eedd02a2f9..4975b4222d52eddbb42e9c9cd08eef56859080c8 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -570,7 +570,7 @@ public abstract class PlayerList { +@@ -520,7 +520,7 @@ public abstract class PlayerList { entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason } diff --git a/patches/unapplied/server/0431-Add-Wandering-Trader-spawn-rate-config-options.patch b/patches/server/0428-Add-Wandering-Trader-spawn-rate-config-options.patch similarity index 98% rename from patches/unapplied/server/0431-Add-Wandering-Trader-spawn-rate-config-options.patch rename to patches/server/0428-Add-Wandering-Trader-spawn-rate-config-options.patch index 98525387d7..30e4e03f24 100644 --- a/patches/unapplied/server/0431-Add-Wandering-Trader-spawn-rate-config-options.patch +++ b/patches/server/0428-Add-Wandering-Trader-spawn-rate-config-options.patch @@ -11,7 +11,7 @@ in IWorldServerData are removed as they were only used in certain places, with h values used in other places. diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java -index 4b7e9bc8aa253d0eb12a2195416c618cccdc8690..d5d27b0d352ca3fd57a26605cb35c499e88b57fc 100644 +index cfa1787b955fd9b80bf9906b88d423cb59b12ff1..08a3c7140867f339dd99a95094ed0fd8ff344fca 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java @@ -40,43 +40,53 @@ public class WanderingTraderSpawner implements CustomSpawner { diff --git a/patches/unapplied/server/0432-Add-Destroy-Speed-API.patch b/patches/server/0429-Add-Destroy-Speed-API.patch similarity index 97% rename from patches/unapplied/server/0432-Add-Destroy-Speed-API.patch rename to patches/server/0429-Add-Destroy-Speed-API.patch index 22e992d6a9..2274f8a5d4 100644 --- a/patches/unapplied/server/0432-Add-Destroy-Speed-API.patch +++ b/patches/server/0429-Add-Destroy-Speed-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Destroy Speed API Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java -index 36c943d709c1c0ae49ec0baf0ccf7b6cb9a2ecf3..d28f9e077a50122e86848cfa9db83f6b0e8eef6c 100644 +index a2fe7149a837040cf9f23eb426d398a5f90be394..27a7852a5d3f8c8960f098646ff5587c50556aa5 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java -@@ -143,20 +143,20 @@ public class AttributeInstance { +@@ -153,20 +153,20 @@ public class AttributeInstance { double d = this.getBaseValue(); for (AttributeModifier attributeModifier : this.getModifiersOrEmpty(AttributeModifier.Operation.ADD_VALUE)) { @@ -35,10 +35,10 @@ index 36c943d709c1c0ae49ec0baf0ccf7b6cb9a2ecf3..d28f9e077a50122e86848cfa9db83f6b private Collection getModifiersOrEmpty(AttributeModifier.Operation operation) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 9953b6b36cbcbfd1756bac478b568ca5700fc898..33869e725c3b3f2120fa36ca468019a78321e862 100644 +index 7f0d87bd43a54885fc521068116888083327f37e..a17c1d1651d4d36c40ef97c1cf0b1e0d61f53418 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -721,4 +721,35 @@ public class CraftBlockData implements BlockData { +@@ -725,4 +725,35 @@ public class CraftBlockData implements BlockData { public BlockState createBlockState() { return CraftBlockStates.getBlockState(this.state, null); } diff --git a/patches/unapplied/server/0433-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0430-Fix-Player-spawnParticle-x-y-z-precision-loss.patch similarity index 89% rename from patches/unapplied/server/0433-Fix-Player-spawnParticle-x-y-z-precision-loss.patch rename to patches/server/0430-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index e34ff10d4d..185bc677ac 100644 --- a/patches/unapplied/server/0433-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0430-Fix-Player-spawnParticle-x-y-z-precision-loss.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 854533854dfba24b59a15265ac759331e3ddfc74..73fde8be0098238582fb3661ae67d4139be417dc 100644 +index eb2954c9b51d4fd76cf5aec17899218f4de7076d..786b8c10a647d777b951b760e4c51eef057b2edd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2707,7 +2707,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2720,7 +2720,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { diff --git a/patches/unapplied/server/0434-Add-LivingEntity-clearActiveItem.patch b/patches/server/0431-Add-LivingEntity-clearActiveItem.patch similarity index 84% rename from patches/unapplied/server/0434-Add-LivingEntity-clearActiveItem.patch rename to patches/server/0431-Add-LivingEntity-clearActiveItem.patch index c22e85e858..3c6621ccfa 100644 --- a/patches/unapplied/server/0434-Add-LivingEntity-clearActiveItem.patch +++ b/patches/server/0431-Add-LivingEntity-clearActiveItem.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 8a8189e8f2f201880748eb79805bb0b33688e814..925c842fcf546ad270641b3be7e8a8c432571501 100644 +index db15382f35464de43a2fe0a41aca070a8c834777..de41ee2cc1be6ef412ec15c79a65cbca653b35d3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -948,6 +948,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -967,6 +967,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return this.getHandle().getUseItem().asBukkitMirror(); } diff --git a/patches/unapplied/server/0435-Add-PlayerItemCooldownEvent.patch b/patches/server/0432-Add-PlayerItemCooldownEvent.patch similarity index 78% rename from patches/unapplied/server/0435-Add-PlayerItemCooldownEvent.patch rename to patches/server/0432-Add-PlayerItemCooldownEvent.patch index 4b90903dd2..70845dd2e6 100644 --- a/patches/unapplied/server/0435-Add-PlayerItemCooldownEvent.patch +++ b/patches/server/0432-Add-PlayerItemCooldownEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerItemCooldownEvent diff --git a/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java b/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java -index 47283d2a49209839002212e663a503a82ea86587..e0c4c0a9bab0bbc32358030a482aa04c2e1d3894 100644 +index 3a45a149ec4a28f25ea9e45803ecbb7392b63f86..872813ef19fc08cad93786367e15f59400825c33 100644 --- a/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java +++ b/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java -@@ -10,6 +10,16 @@ public class ServerItemCooldowns extends ItemCooldowns { +@@ -11,6 +11,16 @@ public class ServerItemCooldowns extends ItemCooldowns { this.player = player; } @@ -23,5 +23,5 @@ index 47283d2a49209839002212e663a503a82ea86587..e0c4c0a9bab0bbc32358030a482aa04c + // Paper end - Add PlayerItemCooldownEvent + @Override - protected void onCooldownStarted(Item item, int duration) { - super.onCooldownStarted(item, duration); + protected void onCooldownStarted(ResourceLocation groupId, int duration) { + super.onCooldownStarted(groupId, duration); diff --git a/patches/unapplied/server/0436-Significantly-improve-performance-of-the-end-generat.patch b/patches/server/0433-Significantly-improve-performance-of-the-end-generat.patch similarity index 100% rename from patches/unapplied/server/0436-Significantly-improve-performance-of-the-end-generat.patch rename to patches/server/0433-Significantly-improve-performance-of-the-end-generat.patch diff --git a/patches/unapplied/server/0437-More-lightning-API.patch b/patches/server/0434-More-lightning-API.patch similarity index 100% rename from patches/unapplied/server/0437-More-lightning-API.patch rename to patches/server/0434-More-lightning-API.patch diff --git a/patches/unapplied/server/0438-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0435-Climbing-should-not-bypass-cramming-gamerule.patch similarity index 75% rename from patches/unapplied/server/0438-Climbing-should-not-bypass-cramming-gamerule.patch rename to patches/server/0435-Climbing-should-not-bypass-cramming-gamerule.patch index 0f9101c994..e27625ee8e 100644 --- a/patches/unapplied/server/0438-Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/0435-Climbing-should-not-bypass-cramming-gamerule.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Climbing should not bypass cramming gamerule diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 6ab665efcac4c2543bab9d95472026e0ec8580c5..dae7643897b47dba304cbea56112445df2736cff 100644 +index 0bd608894ab596c773570f92b4662aee5a6934cc..25f625e28c8c9f63a1b2207d5e8d1a48e2fea039 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2079,6 +2079,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2195,6 +2195,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public boolean isPushable() { @@ -22,10 +22,10 @@ index 6ab665efcac4c2543bab9d95472026e0ec8580c5..dae7643897b47dba304cbea56112445d } diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java -index eb425fac573881f3aad09ae75a32184fb0e325a6..302decdccd37c5579473c8fc33adda3956be7603 100644 +index b8d57e25851dd7da905100dfd4022e4b99fd7f02..721321a19ce056f82de2bef44a8791dc9d5b3418 100644 --- a/src/main/java/net/minecraft/world/entity/EntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java -@@ -46,11 +46,16 @@ public final class EntitySelector { +@@ -45,11 +45,16 @@ public final class EntitySelector { } public static Predicate pushableBy(Entity entity) { @@ -44,19 +44,19 @@ index eb425fac573881f3aad09ae75a32184fb0e325a6..302decdccd37c5579473c8fc33adda39 } else if (entity1 instanceof Player && entity instanceof Player && !io.papermc.paper.configuration.GlobalConfiguration.get().collisions.enablePlayerCollisions) { // Paper - Configurable player collision return false; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 906e8589483b93bcdb55677f7f942f6c7a89caf8..d94c3e86885c5a8ba636988d29f98b496e13b627 100644 +index 91a5166e69a03d846a1b396ba964003c12a0dcdb..7ea58478d3cde175a056f41cf945636a04128828 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3573,7 +3573,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3712,7 +3712,7 @@ public abstract class LivingEntity extends Entity implements Attackable { return; } // Paper end - don't run getEntities if we're not going to use its result -- List list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushableBy(this)); -+ List list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule)); // Paper - Climbing should not bypass cramming gamerule +- List list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushableBy(this)); ++ List list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule)); // Paper - Climbing should not bypass cramming gamerule if (!list.isEmpty()) { // Paper - don't run getEntities if we're not going to use its result; moved up -@@ -3765,9 +3765,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3917,9 +3917,16 @@ public abstract class LivingEntity extends Entity implements Attackable { return !this.isRemoved() && this.collides; // CraftBukkit } @@ -75,10 +75,10 @@ index 906e8589483b93bcdb55677f7f942f6c7a89caf8..d94c3e86885c5a8ba636988d29f98b49 // CraftBukkit start - collidable API diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -index 934fa26b8f347b8b2d90f79370b62165c0cdc312..dc27ddf5131e7398a5390a5187261d4c7fb6ccaa 100644 +index d8a2fbb33f4b77ffb1b3c928a369c2824ad815d7..60c2868f255d372226e0c1389caaa5477bbef41e 100644 --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -@@ -88,7 +88,7 @@ public class Bat extends AmbientCreature { +@@ -91,7 +91,7 @@ public class Bat extends AmbientCreature { } @Override @@ -88,10 +88,10 @@ index 934fa26b8f347b8b2d90f79370b62165c0cdc312..dc27ddf5131e7398a5390a5187261d4c } diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -index 12b2267cba476547d510d9161b25a28f4f5c798e..97931bfd360725945ab9606ff698b518ae101076 100644 +index 9a187b9b20e4e5ee4cdb7df31629faee9d3ebb60..8883894da73c7d5975a8826d23ee7f542db98b0b 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -@@ -362,8 +362,8 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder()); @@ -68,7 +68,7 @@ index aa8667f0b14dc8944dd3457b431162e59bf54ada..5f5b2dd2bb45a0d3ae7de063b3bc611d ); itemEntity.setDeltaMovement( 0.05 * (double)direction2.getStepX() + world.random.nextDouble() * 0.02, -@@ -57,6 +65,7 @@ public class PumpkinBlock extends Block { +@@ -55,6 +63,7 @@ public class PumpkinBlock extends Block { 0.05 * (double)direction2.getStepZ() + world.random.nextDouble() * 0.02 ); world.addFreshEntity(itemEntity); diff --git a/patches/server/0438-Limit-recipe-packets.patch b/patches/server/0438-Limit-recipe-packets.patch new file mode 100644 index 0000000000..5ce5387ca5 --- /dev/null +++ b/patches/server/0438-Limit-recipe-packets.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Sat, 12 Dec 2020 23:45:28 +0000 +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 e3e43c361d8612dbc79fe88730a3794eb44d85e4..b61cb778196a31df2139deb31dfd924abc6e5d1c 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -275,6 +275,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + private final TickThrottler chatSpamThrottler = new TickThrottler(20, 200); + private final TickThrottler tabSpamThrottler = new TickThrottler(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement, io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit); // Paper - configurable tab spam limits + private final TickThrottler dropSpamThrottler = new TickThrottler(20, 1480); ++ private final TickThrottler recipeSpamPackets = new TickThrottler(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement, io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit); + private double firstGoodX; + private double firstGoodY; + private double firstGoodZ; +@@ -391,6 +392,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + this.keepConnectionAlive(); + this.chatSpamThrottler.tick(); + this.tabSpamThrottler.tick(); // Paper - configurable tab spam limits ++ this.recipeSpamPackets.tick(); // Paper - auto recipe limit + this.dropSpamThrottler.tick(); + if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) { + this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 +@@ -3083,6 +3085,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + + @Override + public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { ++ // Paper start - auto recipe limit ++ if (!org.bukkit.Bukkit.isPrimaryThread()) { ++ if (!this.recipeSpamPackets.isIncrementAndUnderThreshold()) { ++ this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam")); ++ return; ++ } ++ } ++ // Paper end - auto recipe limit + PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); + this.player.resetLastActionTime(); + if (!this.player.isSpectator() && this.player.containerMenu.containerId == packet.containerId()) { diff --git a/patches/unapplied/server/0442-Fix-CraftSound-backwards-compatibility.patch b/patches/server/0439-Fix-CraftSound-backwards-compatibility.patch similarity index 100% rename from patches/unapplied/server/0442-Fix-CraftSound-backwards-compatibility.patch rename to patches/server/0439-Fix-CraftSound-backwards-compatibility.patch diff --git a/patches/unapplied/server/0443-Player-Chunk-Load-Unload-Events.patch b/patches/server/0440-Player-Chunk-Load-Unload-Events.patch similarity index 100% rename from patches/unapplied/server/0443-Player-Chunk-Load-Unload-Events.patch rename to patches/server/0440-Player-Chunk-Load-Unload-Events.patch diff --git a/patches/unapplied/server/0444-Optimize-Dynamic-get-Missing-Keys.patch b/patches/server/0441-Optimize-Dynamic-get-Missing-Keys.patch similarity index 100% rename from patches/unapplied/server/0444-Optimize-Dynamic-get-Missing-Keys.patch rename to patches/server/0441-Optimize-Dynamic-get-Missing-Keys.patch diff --git a/patches/unapplied/server/0445-Expose-LivingEntity-hurt-direction.patch b/patches/server/0442-Expose-LivingEntity-hurt-direction.patch similarity index 86% rename from patches/unapplied/server/0445-Expose-LivingEntity-hurt-direction.patch rename to patches/server/0442-Expose-LivingEntity-hurt-direction.patch index 5df6e30894..86eb7976a7 100644 --- a/patches/unapplied/server/0445-Expose-LivingEntity-hurt-direction.patch +++ b/patches/server/0442-Expose-LivingEntity-hurt-direction.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose LivingEntity hurt direction diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index cb89b020d93ac838843ec2cbad562326a1e4257b..513e6505706e64f9410fa190014976dc469793af 100644 +index 917ac21794f1aabc6e95ab2fff2ea7547b9778a8..78bb666dbc5ccd84820e1c7b382249510dd5795c 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -188,7 +188,7 @@ public abstract class Player extends LivingEntity { @@ -18,7 +18,7 @@ index cb89b020d93ac838843ec2cbad562326a1e4257b..513e6505706e64f9410fa190014976dc public Vec3 currentImpulseImpactPos; @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 6cda13df52ee4d56dd1d3c213307bfd38175584c..24aa891ffa9115c05439b06aece85df7a382b7c4 100644 +index 9022555db0df8c269fc039c895422cf36c08097e..cb56c75be83e839bafdae4356f85d33499d01d8a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -125,6 +125,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -36,10 +36,10 @@ index 6cda13df52ee4d56dd1d3c213307bfd38175584c..24aa891ffa9115c05439b06aece85df7 public int getSleepTicks() { return this.getHandle().sleepCounter; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 925c842fcf546ad270641b3be7e8a8c432571501..10f3defa8f4b57fb45cf7de06d415b72102e47d5 100644 +index de41ee2cc1be6ef412ec15c79a65cbca653b35d3..ff3b53eff8f5fc1e02e7b30d59ff27dfe8f5d431 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -1005,4 +1005,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -1024,4 +1024,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { this.getHandle().take(((CraftItem) item).getHandle(), quantity); } // Paper end - pickup animation API diff --git a/patches/unapplied/server/0446-Add-OBSTRUCTED-reason-to-BedEnterResult.patch b/patches/server/0443-Add-OBSTRUCTED-reason-to-BedEnterResult.patch similarity index 86% rename from patches/unapplied/server/0446-Add-OBSTRUCTED-reason-to-BedEnterResult.patch rename to patches/server/0443-Add-OBSTRUCTED-reason-to-BedEnterResult.patch index f1f4c227ee..dde19c16ca 100644 --- a/patches/unapplied/server/0446-Add-OBSTRUCTED-reason-to-BedEnterResult.patch +++ b/patches/server/0443-Add-OBSTRUCTED-reason-to-BedEnterResult.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add OBSTRUCTED reason to BedEnterResult diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index dbe7931dd7eb43f9381463d3a57ba1eb53820985..24fcb0eb139174671ffb7a8e5222ec9833835f87 100644 +index c7d78f54694b464696c0f1edd0b135d1d5bcde3e..9e3037ac041da5ec2e15a4cd475ec52fee591aac 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -313,6 +313,10 @@ public class CraftEventFactory { +@@ -312,6 +312,10 @@ public class CraftEventFactory { return BedEnterResult.TOO_FAR_AWAY; case NOT_SAFE: return BedEnterResult.NOT_SAFE; diff --git a/patches/unapplied/server/0447-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch b/patches/server/0444-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch similarity index 93% rename from patches/unapplied/server/0447-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch rename to patches/server/0444-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch index 7ac0fb0202..8c0b0c171b 100644 --- a/patches/unapplied/server/0447-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch +++ b/patches/server/0444-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix crash from invalid ingredient lists in diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -index fcb3b66617150ad503bffe65de4900b1e3af8764..2a155d3611ca2370830ca763d40074df6641958f 100644 +index c8231e421e6c3f1cf8a5aaf8cc64741abe868f41..39cb40b077e9c07471437d5bec16ba9a7e6bce52 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java @@ -273,7 +273,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa diff --git a/patches/unapplied/server/0441-Limit-recipe-packets.patch b/patches/unapplied/server/0441-Limit-recipe-packets.patch deleted file mode 100644 index a18fe75650..0000000000 --- a/patches/unapplied/server/0441-Limit-recipe-packets.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Sat, 12 Dec 2020 23:45:28 +0000 -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 d33cf08f7c47111823abbce481505946db249577..57063f01993445a9965976332306c7f2ab20ed1f 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 - // CraftBukkit start - multithreaded fields - private final AtomicInteger chatSpamTickCount = new AtomicInteger(); - private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits -+ private final java.util.concurrent.atomic.AtomicInteger recipeSpamPackets = new java.util.concurrent.atomic.AtomicInteger(); // Paper - auto recipe limit - // CraftBukkit end - private int dropSpamTickCount; - private double firstGoodX; -@@ -384,6 +385,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - // CraftBukkit start - for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; - if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - configurable tab spam limits -+ if (recipeSpamPackets.get() > 0) recipeSpamPackets.getAndDecrement(); // Paper - auto recipe limit - /* Use thread-safe field access instead - if (this.chatSpamTickCount > 0) { - --this.chatSpamTickCount; -@@ -3068,6 +3070,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - - @Override - public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { -+ // 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) { -+ this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam")); -+ return; -+ } -+ } -+ // Paper end - auto recipe limit - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); - this.player.resetLastActionTime(); - if (!this.player.isSpectator() && this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu instanceof RecipeBookMenu) {