diff --git a/patches/unapplied/server/0839-Don-t-print-component-in-resource-pack-rejection-mes.patch b/patches/removed/1.20.2/0839-Don-t-print-component-in-resource-pack-rejection-mes.patch similarity index 100% rename from patches/unapplied/server/0839-Don-t-print-component-in-resource-pack-rejection-mes.patch rename to patches/removed/1.20.2/0839-Don-t-print-component-in-resource-pack-rejection-mes.patch diff --git a/patches/unapplied/server/0836-Don-t-broadcast-messages-to-command-blocks.patch b/patches/server/0814-Don-t-broadcast-messages-to-command-blocks.patch similarity index 92% rename from patches/unapplied/server/0836-Don-t-broadcast-messages-to-command-blocks.patch rename to patches/server/0814-Don-t-broadcast-messages-to-command-blocks.patch index 6cd97dbb5..fe8d55b49 100644 --- a/patches/unapplied/server/0836-Don-t-broadcast-messages-to-command-blocks.patch +++ b/patches/server/0814-Don-t-broadcast-messages-to-command-blocks.patch @@ -20,10 +20,10 @@ index e05eb08a9c229b371887676da510df948b896a85..ceeedbd88c56c08ec8b047c9ca2f14cc Date date = new Date(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0a980eb63e6116f91322fd8bf94db7c5dae7b79a..6c8fc3a00109c3c64f9dc32ecdcc98e1b5d0d622 100644 +index 17eaf05dbf0542f7867e92421148cf4edf47bd80..097ceaa948469f6b63362dfa00525cd0fd01d907 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1774,7 +1774,7 @@ public final class CraftServer implements Server { +@@ -1777,7 +1777,7 @@ public final class CraftServer implements Server { // Paper end Set recipients = new HashSet<>(); for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) { diff --git a/patches/unapplied/server/0837-Prevent-empty-items-from-being-added-to-world.patch b/patches/server/0815-Prevent-empty-items-from-being-added-to-world.patch similarity index 94% rename from patches/unapplied/server/0837-Prevent-empty-items-from-being-added-to-world.patch rename to patches/server/0815-Prevent-empty-items-from-being-added-to-world.patch index b55dfc566..51774c470 100644 --- a/patches/unapplied/server/0837-Prevent-empty-items-from-being-added-to-world.patch +++ b/patches/server/0815-Prevent-empty-items-from-being-added-to-world.patch @@ -7,10 +7,10 @@ The previous solution caused a bunch of bandaid fixes inorder to resolve edge ca Just simply prevent them from being added to the world instead. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 653c9c41ab7c5cd332565436564396d18f26c17c..06df21e55fdb70558b85fc095a04b3bb64fbe770 100644 +index 0a57c11f1b9811e4fb980268bc561df4290494cf..565b5aca5854876ae640d9d93b3ae24da6e12b70 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1645,6 +1645,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1296,6 +1296,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit return false; } else { diff --git a/patches/unapplied/server/0838-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch b/patches/server/0816-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch similarity index 100% rename from patches/unapplied/server/0838-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch rename to patches/server/0816-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch diff --git a/patches/unapplied/server/0840-Add-Player-getFishHook.patch b/patches/server/0817-Add-Player-getFishHook.patch similarity index 92% rename from patches/unapplied/server/0840-Add-Player-getFishHook.patch rename to patches/server/0817-Add-Player-getFishHook.patch index 3298fb848..aa6a534aa 100644 --- a/patches/unapplied/server/0840-Add-Player-getFishHook.patch +++ b/patches/server/0817-Add-Player-getFishHook.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Player#getFishHook diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 3f64d57b7d92820226c323d1d560432f5c27e650..6f694f68c2792da7088c2aba1d2b201f802b3a5c 100644 +index 268d0abadb1c6de78f7b2de964808ca7029970a8..beefbb0d04bd995bc8750707487183c3ffc22239 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -161,6 +161,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/patches/unapplied/server/0841-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch b/patches/server/0818-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch similarity index 100% rename from patches/unapplied/server/0841-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch rename to patches/server/0818-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch diff --git a/patches/unapplied/server/0842-Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/0819-Add-various-missing-EntityDropItemEvent-calls.patch similarity index 87% rename from patches/unapplied/server/0842-Add-various-missing-EntityDropItemEvent-calls.patch rename to patches/server/0819-Add-various-missing-EntityDropItemEvent-calls.patch index b2016d68d..7861f36ae 100644 --- a/patches/unapplied/server/0842-Add-various-missing-EntityDropItemEvent-calls.patch +++ b/patches/server/0819-Add-various-missing-EntityDropItemEvent-calls.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add various missing EntityDropItemEvent calls diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 34f5919448a408e7f4c72299fe72d8daabe34402..f9704cefbc1a3b6546dfefd0708fa5485e0a8e72 100644 +index a45f7b96fb3afc9ebe1354d9c61c4a66a67fae69..56060d5d962a1827873d3b2311f30b766c64575f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2677,6 +2677,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2559,6 +2559,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe entityitem.setDefaultPickUpDelay(); @@ -37,10 +37,10 @@ index 1c4b8b29faac3dbcfc14a07b24c64650982ece00..8448c5d778998390cf2b683f36e4e18c } } diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java -index 24ae11d300d0856350f185f03552ba592f3d218a..5052bcf16bb09b7bcf39566fef1378b1c4970fe6 100644 +index df06cad9447982ebe57d07c9967cb68c6dd20ca3..9f24fb3ea75b9dcb41f70f6e4b0d6cd5dca57ff6 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java -@@ -503,14 +503,14 @@ public class Fox extends Animal implements VariantHolder { +@@ -509,14 +509,14 @@ public class Fox extends Animal implements VariantHolder { entityitem.setPickUpDelay(40); entityitem.setThrower(this.getUUID()); this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F); @@ -58,10 +58,10 @@ index 24ae11d300d0856350f185f03552ba592f3d218a..5052bcf16bb09b7bcf39566fef1378b1 @Override diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -index a3a5dbaed7a7647249747154ac0c024bddd7eb13..c7b914cc0d702c6dd04add5247ec509d5870abb3 100644 +index 3ec2f590dfe9410f1a9d2afb530eebfcce917798..363892e0c26bab89d2abaa44d8736e2fd84d292f 100644 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -@@ -355,8 +355,7 @@ public class Goat extends Animal { +@@ -357,8 +357,7 @@ public class Goat extends Animal { double d2 = (double) Mth.randomBetween(this.random, -0.2F, 0.2F); ItemEntity entityitem = new ItemEntity(this.level(), vec3d.x(), vec3d.y(), vec3d.z(), itemstack, d0, d1, d2); @@ -72,10 +72,10 @@ index a3a5dbaed7a7647249747154ac0c024bddd7eb13..c7b914cc0d702c6dd04add5247ec509d } diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -index c0f19138c6a00ce6ae837c972ae4af522ddd2895..3de0424a18e0a3b0cd2f755adfa859e474d5c643 100644 +index 1d9913cbc7fd0c6e29278b02c38703b52af1245b..36b3945832733b5ad66d25aa3a31335234d2acff 100644 --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -@@ -355,8 +355,9 @@ public class Sniffer extends Animal { +@@ -352,8 +352,9 @@ public class Sniffer extends Animal { entityitem.setDefaultPickUpDelay(); this.finalizeSpawnChildFromBreeding(world, other, (AgeableMob) null); diff --git a/patches/unapplied/server/0843-Add-some-minimal-debug-information-to-chat-packet-er.patch b/patches/server/0820-Add-some-minimal-debug-information-to-chat-packet-er.patch similarity index 87% rename from patches/unapplied/server/0843-Add-some-minimal-debug-information-to-chat-packet-er.patch rename to patches/server/0820-Add-some-minimal-debug-information-to-chat-packet-er.patch index f349b2419..e812b3d8e 100644 --- a/patches/unapplied/server/0843-Add-some-minimal-debug-information-to-chat-packet-er.patch +++ b/patches/server/0820-Add-some-minimal-debug-information-to-chat-packet-er.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add some minimal debug information to chat packet errors TODO: potentially add some kick leeway diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5c4a4b7efff2a00d7a35d902b4e18e02d4489122..e60478b96c6dc67a16b08e418971aa3bef63c0fc 100644 +index aabd4a28cef4a31e0eed34d2e7c490199203bfd5..5d62bf8a1031295ca63289ebbdc11cf0910ccb14 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2295,7 +2295,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2134,7 +2134,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private Optional tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { if (!this.updateChatOrder(timestamp)) { diff --git a/patches/unapplied/server/0844-Fix-Bee-flower-NPE.patch b/patches/server/0821-Fix-Bee-flower-NPE.patch similarity index 100% rename from patches/unapplied/server/0844-Fix-Bee-flower-NPE.patch rename to patches/server/0821-Fix-Bee-flower-NPE.patch diff --git a/patches/unapplied/server/0845-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/0822-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch similarity index 85% rename from patches/unapplied/server/0845-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch rename to patches/server/0822-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch index e77aac5a7..11cf12673 100644 --- a/patches/unapplied/server/0845-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch +++ b/patches/server/0822-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 e60478b96c6dc67a16b08e418971aa3bef63c0fc..f876cd2320788570137d9f59411bf7e908e9e81b 100644 +index 5d62bf8a1031295ca63289ebbdc11cf0910ccb14..4428b7310bcce3fd1471e5b89bc4eb9ec16deb4e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2515,7 +2515,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2354,7 +2354,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Spigot end // this.chatSpamTickCount += 20; diff --git a/patches/unapplied/server/0846-More-Teleport-API.patch b/patches/server/0823-More-Teleport-API.patch similarity index 94% rename from patches/unapplied/server/0846-More-Teleport-API.patch rename to patches/server/0823-More-Teleport-API.patch index 5ddfdd948..4bbc4a6f4 100644 --- a/patches/unapplied/server/0846-More-Teleport-API.patch +++ b/patches/server/0823-More-Teleport-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] More Teleport API public net.minecraft.server.network.ServerGamePacketListenerImpl internalTeleport(DDDFFLjava/util/Set;Z)V diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f876cd2320788570137d9f59411bf7e908e9e81b..13e5c0bc9e3cef3dd68f2d415649a183583eb606 100644 +index 4428b7310bcce3fd1471e5b89bc4eb9ec16deb4e..57d2bffd55db5f7833121c6781984985689c4188 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1713,11 +1713,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1591,11 +1591,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return false; // CraftBukkit - Return event status } @@ -31,7 +31,7 @@ index f876cd2320788570137d9f59411bf7e908e9e81b..13e5c0bc9e3cef3dd68f2d415649a183 d0 = to.getX(); d1 = to.getY(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index f61d3cd3cdbfe17f6818fbbb163f80ba3de50ca1..df554fa92065bc4c8566a9638f4f6f6ca9ba54db 100644 +index 87c303ff576cd05291d50d5676e86ca93a13b301..b19665fd570c86274caef62dc3e365f0e6a7ca8e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -567,15 +567,36 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -74,10 +74,10 @@ index f61d3cd3cdbfe17f6818fbbb163f80ba3de50ca1..df554fa92065bc4c8566a9638f4f6f6c // Let the server handle cross world teleports if (location.getWorld() != null && !location.getWorld().equals(this.getWorld())) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 166c7d1c23862b65b332ca6573a2a75c5926c9e8..5ad3f284f0d25ec4f7ea8789c2205f88b349f715 100644 +index 91d572075ea018e4768f11115723d67b06018bf0..17a4390514b72481de6dc0676eb8130428fabf89 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1210,13 +1210,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1170,13 +1170,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setRotation(float yaw, float pitch) { @@ -180,7 +180,7 @@ index 166c7d1c23862b65b332ca6573a2a75c5926c9e8..5ad3f284f0d25ec4f7ea8789c2205f88 location.checkFinite(); ServerPlayer entity = this.getHandle(); -@@ -1229,7 +1317,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1189,7 +1277,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return false; } @@ -189,7 +189,7 @@ index 166c7d1c23862b65b332ca6573a2a75c5926c9e8..5ad3f284f0d25ec4f7ea8789c2205f88 return false; } -@@ -1247,7 +1335,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1207,7 +1295,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // If this player is riding another entity, we must dismount before teleporting. @@ -198,7 +198,7 @@ index 166c7d1c23862b65b332ca6573a2a75c5926c9e8..5ad3f284f0d25ec4f7ea8789c2205f88 // SPIGOT-5509: Wakeup, similar to riding if (this.isSleeping()) { -@@ -1263,13 +1351,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1223,13 +1311,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { ServerLevel toWorld = ((CraftWorld) to.getWorld()).getHandle(); // Close any foreign inventory diff --git a/patches/unapplied/server/0847-Add-EntityPortalReadyEvent.patch b/patches/server/0824-Add-EntityPortalReadyEvent.patch similarity index 88% rename from patches/unapplied/server/0847-Add-EntityPortalReadyEvent.patch rename to patches/server/0824-Add-EntityPortalReadyEvent.patch index af281cff3..b3cccfa7c 100644 --- a/patches/unapplied/server/0847-Add-EntityPortalReadyEvent.patch +++ b/patches/server/0824-Add-EntityPortalReadyEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityPortalReadyEvent diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f9704cefbc1a3b6546dfefd0708fa5485e0a8e72..e09a4ebbbcd2e3f55b8b764cbc36d72bc3092085 100644 +index 56060d5d962a1827873d3b2311f30b766c64575f..2a13d5f4cf86b4ae5e5cf2d0602fbcd275b1c080 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3016,6 +3016,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2922,6 +2922,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit this.level().getProfiler().push("portal"); this.portalTime = i; @@ -22,7 +22,7 @@ index f9704cefbc1a3b6546dfefd0708fa5485e0a8e72..e09a4ebbbcd2e3f55b8b764cbc36d72b this.setPortalCooldown(); // CraftBukkit start if (this instanceof ServerPlayer) { -@@ -3023,6 +3030,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2929,6 +2936,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } else { this.changeDimension(worldserver1); } diff --git a/patches/unapplied/server/0848-Don-t-use-level-random-in-entity-constructors.patch b/patches/server/0825-Don-t-use-level-random-in-entity-constructors.patch similarity index 100% rename from patches/unapplied/server/0848-Don-t-use-level-random-in-entity-constructors.patch rename to patches/server/0825-Don-t-use-level-random-in-entity-constructors.patch diff --git a/patches/unapplied/server/0849-Send-block-entities-after-destroy-prediction.patch b/patches/server/0826-Send-block-entities-after-destroy-prediction.patch similarity index 93% rename from patches/unapplied/server/0849-Send-block-entities-after-destroy-prediction.patch rename to patches/server/0826-Send-block-entities-after-destroy-prediction.patch index c384f9921..7f00c7799 100644 --- a/patches/unapplied/server/0849-Send-block-entities-after-destroy-prediction.patch +++ b/patches/server/0826-Send-block-entities-after-destroy-prediction.patch @@ -7,7 +7,7 @@ Minecraft's prediction system does not handle block entities, so if we are manua block breaking we need to set it after the prediction is finished. This fixes block entities not showing when cancelling the BlockBreakEvent. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 96fde7b84ce4d195d0c54deff71df9fcf8447979..6cc9c28032cafd15d884223a01208ce6f027c151 100644 +index f968dee743f58fe71935097701866800c0f382a1..73e2948210139e40e234b5e2107f9008f3094964 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -62,6 +62,8 @@ public class ServerPlayerGameMode { @@ -43,7 +43,7 @@ index 96fde7b84ce4d195d0c54deff71df9fcf8447979..6cc9c28032cafd15d884223a01208ce6 return; } // CraftBukkit end -@@ -394,10 +390,12 @@ public class ServerPlayerGameMode { +@@ -392,10 +388,12 @@ public class ServerPlayerGameMode { } // Update any tile entity data for this block @@ -57,10 +57,10 @@ index 96fde7b84ce4d195d0c54deff71df9fcf8447979..6cc9c28032cafd15d884223a01208ce6 } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 13e5c0bc9e3cef3dd68f2d415649a183583eb606..bf73cdaa4f05e4415b9d072ad46774361deddad8 100644 +index 57d2bffd55db5f7833121c6781984985689c4188..58fdede705e55801c4dff11db1b9d29b2430c19c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1859,8 +1859,28 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1737,8 +1737,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return; } // Paper end - Don't allow digging in unloaded chunks diff --git a/patches/unapplied/server/0850-Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/0827-Warn-on-plugins-accessing-faraway-chunks.patch similarity index 89% rename from patches/unapplied/server/0850-Warn-on-plugins-accessing-faraway-chunks.patch rename to patches/server/0827-Warn-on-plugins-accessing-faraway-chunks.patch index 16f0868cd..f51556323 100644 --- a/patches/unapplied/server/0850-Warn-on-plugins-accessing-faraway-chunks.patch +++ b/patches/server/0827-Warn-on-plugins-accessing-faraway-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Warn on plugins accessing faraway chunks diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index af7ffeb70ea696e03d3b8188ed167aa4755e308d..6b9b5af04fe06c3f5f20a56955bd12bd2ddb7e5c 100644 +index 7d39cdfec62884a8ee98af3ca71aa3c9908cc3d8..aa5879aef6e6e517ead13a422fed7674f715c994 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -505,7 +505,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -440,7 +440,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } private static boolean isInWorldBoundsHorizontal(BlockPos pos) { @@ -18,7 +18,7 @@ index af7ffeb70ea696e03d3b8188ed167aa4755e308d..6b9b5af04fe06c3f5f20a56955bd12bd private static boolean isOutsideSpawnableHeight(int y) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e36c535ede104fe6c60348558e31ad5571c5ac2a..550dcb7d595221b221e4710890d8a3cad789fc07 100644 +index 2ec9d65ce7c9947021cf95f0827c3bc1cc2166ab..c7e6e73507ab198224de1b549f7c71887341c6a6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -310,9 +310,24 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -54,7 +54,7 @@ index e36c535ede104fe6c60348558e31ad5571c5ac2a..550dcb7d595221b221e4710890d8a3ca // Paper start - implement regenerateChunk method final ServerLevel serverLevel = this.world; final net.minecraft.server.level.ServerChunkCache serverChunkCache = serverLevel.getChunkSource(); -@@ -522,6 +538,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -514,6 +530,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot @@ -62,7 +62,7 @@ index e36c535ede104fe6c60348558e31ad5571c5ac2a..550dcb7d595221b221e4710890d8a3ca // Paper start - Optimize this method ChunkPos chunkPos = new ChunkPos(x, z); ChunkAccess immediate = world.getChunkSource().getChunkAtIfLoadedImmediately(x, z); // Paper -@@ -585,6 +602,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -577,6 +594,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean addPluginChunkTicket(int x, int z, Plugin plugin) { @@ -70,7 +70,7 @@ index e36c535ede104fe6c60348558e31ad5571c5ac2a..550dcb7d595221b221e4710890d8a3ca Preconditions.checkArgument(plugin != null, "null plugin"); Preconditions.checkArgument(plugin.isEnabled(), "plugin is not enabled"); -@@ -653,6 +671,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -658,6 +676,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setChunkForceLoaded(int x, int z, boolean forced) { @@ -78,7 +78,7 @@ index e36c535ede104fe6c60348558e31ad5571c5ac2a..550dcb7d595221b221e4710890d8a3ca this.getHandle().setChunkForced(x, z, forced); } -@@ -965,6 +984,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -970,6 +989,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) { @@ -86,7 +86,7 @@ index e36c535ede104fe6c60348558e31ad5571c5ac2a..550dcb7d595221b221e4710890d8a3ca // Transient load for this tick return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z); } -@@ -2376,6 +2396,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2342,6 +2362,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Spigot end // Paper start public java.util.concurrent.CompletableFuture getChunkAtAsync(int x, int z, boolean gen, boolean urgent) { diff --git a/patches/unapplied/server/0851-Custom-Chat-Completion-Suggestions-API.patch b/patches/server/0828-Custom-Chat-Completion-Suggestions-API.patch similarity index 90% rename from patches/unapplied/server/0851-Custom-Chat-Completion-Suggestions-API.patch rename to patches/server/0828-Custom-Chat-Completion-Suggestions-API.patch index 026ed506e..c4e65e6af 100644 --- a/patches/unapplied/server/0851-Custom-Chat-Completion-Suggestions-API.patch +++ b/patches/server/0828-Custom-Chat-Completion-Suggestions-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Custom Chat Completion Suggestions API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5ad3f284f0d25ec4f7ea8789c2205f88b349f715..d4fd2fa83d1d8e9d97465b92edd913c05d20c69c 100644 +index 17a4390514b72481de6dc0676eb8130428fabf89..ba93dbec8b22809133335e975f64caa85df30c9b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -650,6 +650,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -610,6 +610,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().getServer().getPlayerList().sendPlayerPermissionLevel(this.getHandle(), level, false); } diff --git a/patches/unapplied/server/0852-Add-and-fix-missing-BlockFadeEvents.patch b/patches/server/0829-Add-and-fix-missing-BlockFadeEvents.patch similarity index 100% rename from patches/unapplied/server/0852-Add-and-fix-missing-BlockFadeEvents.patch rename to patches/server/0829-Add-and-fix-missing-BlockFadeEvents.patch diff --git a/patches/unapplied/server/0853-Collision-API.patch b/patches/server/0830-Collision-API.patch similarity index 96% rename from patches/unapplied/server/0853-Collision-API.patch rename to patches/server/0830-Collision-API.patch index 331bec635..24c5f6349 100644 --- a/patches/unapplied/server/0853-Collision-API.patch +++ b/patches/server/0830-Collision-API.patch @@ -22,7 +22,7 @@ index 5be114bc70c6fdbcb7d804e7558a5172c4461b96..3b9d7f92f4e47da2d7eb1e9cb9e996ee // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index df554fa92065bc4c8566a9638f4f6f6ca9ba54db..bc0a46a6f2ae24b40d3997074c9084cdbb595602 100644 +index b19665fd570c86274caef62dc3e365f0e6a7ca8e..ba0c1be4f5303bd6a33fd27f4e8c9910a8325695 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1419,4 +1419,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/unapplied/server/0854-Fix-suggest-command-message-for-brigadier-syntax-exc.patch b/patches/server/0831-Fix-suggest-command-message-for-brigadier-syntax-exc.patch similarity index 89% rename from patches/unapplied/server/0854-Fix-suggest-command-message-for-brigadier-syntax-exc.patch rename to patches/server/0831-Fix-suggest-command-message-for-brigadier-syntax-exc.patch index aa73cbbdd..bffcadeb4 100644 --- a/patches/unapplied/server/0854-Fix-suggest-command-message-for-brigadier-syntax-exc.patch +++ b/patches/server/0831-Fix-suggest-command-message-for-brigadier-syntax-exc.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix suggest command message for brigadier syntax exceptions This is a bug accidentally introduced in upstream CB diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index f967e9039c87ec458da3f133743df834437b3e02..80c2c8d565f03ae0ea24fbdecdbe2bc5b9aa4b82 100644 +index c704761bd5dae98f7c77780a4f7058b737fdb664..3eec879bf3975636739b2491cc05b8177032d16d 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -342,7 +342,7 @@ public class Commands { +@@ -348,7 +348,7 @@ public class Commands { if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) { int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor()); MutableComponent ichatmutablecomponent = Component.empty().withStyle(ChatFormatting.GRAY).withStyle((chatmodifier) -> { diff --git a/patches/unapplied/server/0855-Block-Ticking-API.patch b/patches/server/0832-Block-Ticking-API.patch similarity index 100% rename from patches/unapplied/server/0855-Block-Ticking-API.patch rename to patches/server/0832-Block-Ticking-API.patch diff --git a/patches/unapplied/server/0856-Add-Velocity-IP-Forwarding-Support.patch b/patches/server/0833-Add-Velocity-IP-Forwarding-Support.patch similarity index 89% rename from patches/unapplied/server/0856-Add-Velocity-IP-Forwarding-Support.patch rename to patches/server/0833-Add-Velocity-IP-Forwarding-Support.patch index 4caa04567..e2525d625 100644 --- a/patches/unapplied/server/0856-Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/0833-Add-Velocity-IP-Forwarding-Support.patch @@ -95,7 +95,7 @@ index 0000000000000000000000000000000000000000..c4934979b1ed85bfc4f8d9e6f8848b2b + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 23c39cc77ae0d2ab7100fff0a3e8ff6752706dbb..c49802c936ae8e3f4dc1badd98414d96714ecd60 100644 +index f1e5798c47ee6c8d8b9d599fa503e8cefe18aa19..c1882185ad93315925ca97a085482197f6ae9f4a 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -274,13 +274,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -123,18 +123,18 @@ index 23c39cc77ae0d2ab7100fff0a3e8ff6752706dbb..c49802c936ae8e3f4dc1badd98414d96 DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose."); } diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 3fcd7bfdb8945b276c94a263e9da6b85ce470366..3431b1132e55c53cda7cf47f021f23068b63322d 100644 +index ced150fa9160310408f57e89d115de740097eaf5..5012405cc3dd98c05d271ee4003968717f93f3e9 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -61,6 +61,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - @Nullable - private ServerPlayer delayedAcceptPlayer; +@@ -62,6 +62,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, + private final String serverId; + private ServerPlayer player; // CraftBukkit public boolean iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation = false; // Paper - username validation overriding + private int velocityLoginMessageId = -1; // Paper - Velocity support public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) { this.state = ServerLoginPacketListenerImpl.State.HELLO; -@@ -256,6 +257,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -175,6 +176,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, this.state = ServerLoginPacketListenerImpl.State.KEY; this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.challenge)); } else { @@ -151,23 +151,23 @@ index 3fcd7bfdb8945b276c94a263e9da6b85ce470366..3431b1132e55c53cda7cf47f021f2306 // Spigot start // Paper start - Cache authenticator threads authenticatorPool.execute(new Runnable() { -@@ -363,6 +374,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -318,6 +329,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, public class LoginHandler { - public void fireEvents() throws Exception { + public void fireEvents(GameProfile gameprofile) throws Exception { + // Paper start - Velocity support + if (ServerLoginPacketListenerImpl.this.velocityLoginMessageId == -1 && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) { + disconnect("This server requires you to connect with Velocity."); + return; + } + // Paper end - String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); + String playerName = gameprofile.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); - java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.channel.remoteAddress()).getAddress(); // Paper -@@ -411,6 +428,47 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - // Spigot end + java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.channel.remoteAddress()).getAddress(); // Paper +@@ -367,6 +384,47 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - public void handleCustomQueryPacket(ServerboundCustomQueryPacket packet) { + @Override + public void handleCustomQueryPacket(ServerboundCustomQueryAnswerPacket packet) { + // Paper start - Velocity support + if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled && packet.getTransactionId() == this.velocityLoginMessageId) { + net.minecraft.network.FriendlyByteBuf buf = packet.getData(); @@ -193,30 +193,30 @@ index 3fcd7bfdb8945b276c94a263e9da6b85ce470366..3431b1132e55c53cda7cf47f021f2306 + } + this.connection.address = new java.net.InetSocketAddress(com.destroystokyo.paper.proxy.VelocityProxy.readAddress(buf), port); + -+ this.gameProfile = com.destroystokyo.paper.proxy.VelocityProxy.createProfile(buf); ++ this.authenticatedProfile = com.destroystokyo.paper.proxy.VelocityProxy.createProfile(buf); + + //TODO Update handling for lazy sessions, might not even have to do anything? + + // Proceed with login + authenticatorPool.execute(() -> { + try { -+ new LoginHandler().fireEvents(); ++ new LoginHandler().fireEvents(this.authenticatedProfile); + } catch (Exception ex) { + disconnect("Failed to verify username!"); -+ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + gameProfile.getName(), ex); ++ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + this.authenticatedProfile.getName(), ex); + } + }); + return; + } + // Paper end - this.disconnect(Component.translatable("multiplayer.disconnect.unexpected_query_response")); + this.disconnect(ServerLoginPacketListenerImpl.DISCONNECT_UNEXPECTED_QUERY); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6c8fc3a00109c3c64f9dc32ecdcc98e1b5d0d622..03fcdb0eb145d60b96bf241523ade1f4595abdef 100644 +index 097ceaa948469f6b63362dfa00525cd0fd01d907..615baf99dd8680b97aa1f03d4a961e15bcdd832b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -803,7 +803,7 @@ public final class CraftServer implements Server { +@@ -806,7 +806,7 @@ public final class CraftServer implements Server { @Override public long getConnectionThrottle() { // Spigot Start - Automatically set connection throttle for bungee configurations diff --git a/patches/unapplied/server/0857-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch b/patches/server/0834-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch similarity index 76% rename from patches/unapplied/server/0857-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch rename to patches/server/0834-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch index 2e38ad24c..12aaabd18 100644 --- a/patches/unapplied/server/0857-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch +++ b/patches/server/0834-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch @@ -5,14 +5,13 @@ Subject: [PATCH] Use thread safe random in ServerLoginPacketListenerImpl diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 3431b1132e55c53cda7cf47f021f23068b63322d..2ff578e4a953ffcf5176815ba8e3f06f73499989 100644 +index 5012405cc3dd98c05d271ee4003968717f93f3e9..dc8e2d31cf90d76e64d0b6a4783040df91ae2568 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -49,7 +49,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - private static final AtomicInteger UNIQUE_THREAD_ID = new AtomicInteger(0); +@@ -50,6 +50,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, static final Logger LOGGER = LogUtils.getLogger(); private static final int MAX_TICKS_BEFORE_LOGIN = 600; -- private static final RandomSource RANDOM = RandomSource.create(); + private static final Component DISCONNECT_UNEXPECTED_QUERY = Component.translatable("multiplayer.disconnect.unexpected_query_response"); + private static final RandomSource RANDOM = new org.bukkit.craftbukkit.util.RandomSourceWrapper(new java.util.Random()); // Paper - This is called across threads, make safe private final byte[] challenge; final MinecraftServer server; diff --git a/patches/unapplied/server/0858-Add-NamespacedKey-biome-methods.patch b/patches/server/0835-Add-NamespacedKey-biome-methods.patch similarity index 92% rename from patches/unapplied/server/0858-Add-NamespacedKey-biome-methods.patch rename to patches/server/0835-Add-NamespacedKey-biome-methods.patch index e03f769d7..0c72cf269 100644 --- a/patches/unapplied/server/0858-Add-NamespacedKey-biome-methods.patch +++ b/patches/server/0835-Add-NamespacedKey-biome-methods.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add NamespacedKey biome methods Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com> diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index e8e26cca7fc8090a3b22925ae37e2362a44ced80..83cef5ec27c31f133a23cd27349f722799c786ea 100644 +index e169c16626e967c30c6f9a324a40550adf5476dd..58f2eaf81f24f1548bdc9f46528cb4b94b18de69 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -609,6 +609,19 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -610,6 +610,19 @@ public final class CraftMagicNumbers implements UnsafeValues { Preconditions.checkArgument(material.isBlock(), material + " is not a block"); return getBlock(material).hasCollision; } diff --git a/patches/unapplied/server/0859-Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/0836-Fix-plugin-loggers-on-server-shutdown.patch similarity index 90% rename from patches/unapplied/server/0859-Fix-plugin-loggers-on-server-shutdown.patch rename to patches/server/0836-Fix-plugin-loggers-on-server-shutdown.patch index a9f67b471..b038ba671 100644 --- a/patches/unapplied/server/0859-Fix-plugin-loggers-on-server-shutdown.patch +++ b/patches/server/0836-Fix-plugin-loggers-on-server-shutdown.patch @@ -37,10 +37,10 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 42f566c9155b70e04d457eb05934d678a92fcdb1..f1b8ebb9718c8ff824d2707a0d1eb08cdcd18f39 100644 +index ff70a2d03ffb85b64829e15bfdfd7a2f35dc9323..bf9e396505c5004b0fb640837b41a4885bcab08e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -997,6 +997,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 418853323314597f746b2f8e74b9766efcbf98be..66a2ae4b03a99613be03458dab23a904956fcfee 100644 +index a3fc80627627a4ad991ec8e674ac528fd69580df..c3b9d590497bf96fd0df4c00f863ab64ec91115e 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3027,37 +3027,15 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3062,37 +3062,15 @@ public abstract class LivingEntity extends Entity implements Attackable { this.level().getProfiler().pop(); this.level().getProfiler().push("rangeChecks"); diff --git a/patches/unapplied/server/0861-Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/0838-Fire-EntityChangeBlockEvent-in-more-places.patch similarity index 98% rename from patches/unapplied/server/0861-Fire-EntityChangeBlockEvent-in-more-places.patch rename to patches/server/0838-Fire-EntityChangeBlockEvent-in-more-places.patch index 66e4d6367..3bf6e9822 100644 --- a/patches/unapplied/server/0861-Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/0838-Fire-EntityChangeBlockEvent-in-more-places.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fire EntityChangeBlockEvent in more places Co-authored-by: ChristopheG <61288881+chrisgdt@users.noreply.github.com> diff --git a/src/main/java/net/minecraft/world/entity/LightningBolt.java b/src/main/java/net/minecraft/world/entity/LightningBolt.java -index 611028d65925053c47510185abc526201e5df6bb..a01a8ba27534d2b0d544423bc2c48fd29d0a6d64 100644 +index 80740ca823915fb2c854f13445d81964e0e971e5..255fb5e922c63130708e4bcab208b4db52a58387 100644 --- a/src/main/java/net/minecraft/world/entity/LightningBolt.java +++ b/src/main/java/net/minecraft/world/entity/LightningBolt.java @@ -98,7 +98,7 @@ public class LightningBolt extends Entity { @@ -59,7 +59,7 @@ index 611028d65925053c47510185abc526201e5df6bb..a01a8ba27534d2b0d544423bc2c48fd2 - Optional optional = LightningBolt.randomStepCleaningCopper(world, mutablePos); + Optional optional = LightningBolt.randomStepCleaningCopper(world, mutablePos, lightning); // Paper - transmit LightningBolt instance to call EntityChangeBlockEvent - if (!optional.isPresent()) { + if (optional.isEmpty()) { break; @@ -234,7 +239,7 @@ public class LightningBolt extends Entity { @@ -260,7 +260,7 @@ index 4f24d5453522c68c22f15beed87e5237163c701a..38cb52d185e543c4df9eebfcd856df6f generatoraccess.setBlock(blockposition, iblockdata1, 3); generatoraccess.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of(entity, iblockdata1)); diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java -index 80026dcdb66cc88a080b33ef290a6a7fb7bcbbaa..0b7d882551bcb8be149754209aad5fe4142f0fac 100644 +index 0bb9cbdceaca055860e7a2a887426c6ba3194b3e..9cfb2d3dbb06b189765293233a28b3ebd1898946 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java @@ -120,7 +120,7 @@ public class DummyGeneratorAccess implements WorldGenLevel { diff --git a/patches/unapplied/server/0862-Missing-eating-regain-reason.patch b/patches/server/0839-Missing-eating-regain-reason.patch similarity index 81% rename from patches/unapplied/server/0862-Missing-eating-regain-reason.patch rename to patches/server/0839-Missing-eating-regain-reason.patch index c3b9f6bde..e04644ebf 100644 --- a/patches/unapplied/server/0862-Missing-eating-regain-reason.patch +++ b/patches/server/0839-Missing-eating-regain-reason.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Missing eating regain reason diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java -index 438d7c26cc3a4a3b5a1affffbbe26e4d272b0c00..90ce201bc7c47cef9bc59d7b535a7453854bac75 100644 +index 40af8405c6f3ecc5a8168bb62607eb79862cefa6..de51ce9875e12961e6e549e87d76f492d2f19787 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -386,7 +386,7 @@ public class Cat extends TamableAnimal implements VariantHolder { +@@ -387,7 +387,7 @@ public class Cat extends TamableAnimal implements VariantHolder { if (!(item instanceof DyeItem)) { if (item.isEdible() && this.isFood(itemstack) && this.getHealth() < this.getMaxHealth()) { this.usePlayerItem(player, hand, itemstack); @@ -18,10 +18,10 @@ index 438d7c26cc3a4a3b5a1affffbbe26e4d272b0c00..90ce201bc7c47cef9bc59d7b535a7453 } diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index c853123c451c41beb42209c7edc14a5dcffa2a50..2030fdb3124f793d7b545135b1db32fe9be27050 100644 +index 3aa98f7c282cb4884589cb83b1546b924e66f096..faf3e31f23d71bbc345bf98d4240490ac4677843 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -386,7 +386,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider +@@ -384,7 +384,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl } else { boolean bl = this.getHealth() < this.getMaxHealth(); if (bl) { @@ -31,10 +31,10 @@ index c853123c451c41beb42209c7edc14a5dcffa2a50..2030fdb3124f793d7b545135b1db32fe boolean bl2 = this.isTamed() && this.getAge() == 0 && this.canFallInLove(); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java -index 7379e99c4d599aa0119bae9ebdc5e2058ada10cb..d28089c37707f323f73e60cb0ebed4e3cdf8c0fd 100644 +index 91fb62807b3c5600c83d4dc8d3fadf36e94e2133..5f61c97478f005aaaaad1b027118079db7275cf7 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java -@@ -216,7 +216,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder 0.0F) { diff --git a/patches/unapplied/server/0863-Missing-effect-cause.patch b/patches/server/0840-Missing-effect-cause.patch similarity index 75% rename from patches/unapplied/server/0863-Missing-effect-cause.patch rename to patches/server/0840-Missing-effect-cause.patch index 2b4bcfc18..cdde10584 100644 --- a/patches/unapplied/server/0863-Missing-effect-cause.patch +++ b/patches/server/0840-Missing-effect-cause.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Missing effect cause diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -index 10029f37fd70955483f12ba525ec3a598f9994f1..2682a49cd3948e0f80e2d7e58abcd3e6d8f7ac4e 100644 +index c1b95715a1ae8c89ce98848332b1e9e1c905a6f5..aa850cfaa0534d57e83f37360724da2428a48a18 100644 --- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -@@ -429,7 +429,7 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder user.addEffect(effect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD)); // Paper + listPotionEffects(itemStack, (effect) -> { +- user.addEffect(effect.createEffectInstance()); ++ user.addEffect(effect.createEffectInstance(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // Paper + }); return user instanceof Player && ((Player)user).getAbilities().instabuild ? itemStack : new ItemStack(Items.BOWL); } - } diff --git a/patches/unapplied/server/0864-Added-byte-array-serialization-deserialization-for-P.patch b/patches/server/0841-Added-byte-array-serialization-deserialization-for-P.patch similarity index 100% rename from patches/unapplied/server/0864-Added-byte-array-serialization-deserialization-for-P.patch rename to patches/server/0841-Added-byte-array-serialization-deserialization-for-P.patch diff --git a/patches/unapplied/server/0865-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch b/patches/server/0842-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch similarity index 86% rename from patches/unapplied/server/0865-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch rename to patches/server/0842-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch index 48013a4a3..d88f3876b 100644 --- a/patches/unapplied/server/0865-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch +++ b/patches/server/0842-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add a consumer parameter to ProjectileSource#launchProjectile diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 1377400a8762158fa1dd40e425bd0999a9275895..9add16b4bacd5b823f5f0ffa957f8d79b063edb5 100644 +index 661638716cd4d1b20745f3a196f6d060b3de570c..c45d7e1262534255025392a804c9e4f47213f637 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -509,8 +509,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -38,10 +38,10 @@ index 1377400a8762158fa1dd40e425bd0999a9275895..9add16b4bacd5b823f5f0ffa957f8d79 world.addFreshEntity(launch); return (T) launch.getBukkitEntity(); diff --git a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java -index 9d5194676f1d84c69ddc756a94ae6e5ca628727b..1cb5875ae9a55fba589697ec66d3e95c35e0e6a0 100644 +index 7f9a716ea65f98d1c8487438949f1d5bc8becc4a..24156e1cd819584c1856cf6d30b4d510691136b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java +++ b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java -@@ -57,6 +57,13 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { +@@ -56,6 +56,13 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { @Override public T launchProjectile(Class projectile, Vector velocity) { @@ -54,8 +54,8 @@ index 9d5194676f1d84c69ddc756a94ae6e5ca628727b..1cb5875ae9a55fba589697ec66d3e95c + // Paper end - launchProjectile consumer Preconditions.checkArgument(this.getBlock().getType() == Material.DISPENSER, "Block is no longer dispenser"); // Copied from BlockDispenser.dispense() - BlockSourceImpl isourceblock = new BlockSourceImpl((ServerLevel) this.dispenserBlock.getLevel(), this.dispenserBlock.getBlockPos()); -@@ -147,6 +154,11 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { + BlockSource sourceblock = new BlockSource((ServerLevel) this.dispenserBlock.getLevel(), this.dispenserBlock.getBlockPos(), this.dispenserBlock.getBlockState(), this.dispenserBlock); +@@ -146,6 +153,11 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { if (velocity != null) { ((T) launch.getBukkitEntity()).setVelocity(velocity); } diff --git a/patches/unapplied/server/0866-Call-BlockPhysicsEvent-more-often.patch b/patches/server/0843-Call-BlockPhysicsEvent-more-often.patch similarity index 86% rename from patches/unapplied/server/0866-Call-BlockPhysicsEvent-more-often.patch rename to patches/server/0843-Call-BlockPhysicsEvent-more-often.patch index 83450685d..ea04c3e24 100644 --- a/patches/unapplied/server/0866-Call-BlockPhysicsEvent-more-often.patch +++ b/patches/server/0843-Call-BlockPhysicsEvent-more-often.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Call BlockPhysicsEvent more often diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java -index a0d035dde5a4976db2d4a9b0ae474e944583f722..ec81be70cd6f92bbf9011395cb361f0ce54c5ad0 100644 +index 7d54abc2553f4b319df4d533a0b689c1807b6102..598dc0d3a2b9387e76d7e4e19e54c4573a24bc54 100644 --- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java +++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java @@ -119,7 +119,27 @@ public class CollectingNeighborUpdater implements NeighborUpdater { public boolean runNext(Level world) { BlockPos blockPos = this.sourcePos.relative(NeighborUpdater.UPDATE_ORDER[this.idx++]); BlockState blockState = world.getBlockState(blockPos); -- blockState.neighborChanged(world, blockPos, this.sourceBlock, this.sourcePos, false); +- NeighborUpdater.executeUpdate(world, blockState, blockPos, this.sourceBlock, this.sourcePos, false); + // Paper start + try { + boolean cancelled = false; @@ -28,7 +28,7 @@ index a0d035dde5a4976db2d4a9b0ae474e944583f722..ec81be70cd6f92bbf9011395cb361f0c + } + } + if (!cancelled) { // continue to check for adjacent block (increase idx) -+ blockState.neighborChanged(world, blockPos, this.sourceBlock, this.sourcePos, false); ++ NeighborUpdater.executeUpdate(world, blockState, blockPos, this.sourceBlock, this.sourcePos, false); + } + } catch (StackOverflowError ex) { + world.lastPhysicsProblem = new BlockPos(blockPos); diff --git a/patches/unapplied/server/0867-Configurable-chat-thread-limit.patch b/patches/server/0844-Configurable-chat-thread-limit.patch similarity index 95% rename from patches/unapplied/server/0867-Configurable-chat-thread-limit.patch rename to patches/server/0844-Configurable-chat-thread-limit.patch index 4d82e8999..a59b030b0 100644 --- a/patches/unapplied/server/0867-Configurable-chat-thread-limit.patch +++ b/patches/server/0844-Configurable-chat-thread-limit.patch @@ -22,10 +22,10 @@ is actually processed, this is honestly really just exposed for the misnomers or who just wanna ensure that this won't grow over a specific size if chat gets stupidly active diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -index 3a5abb89d3742a6f38799c183a098947686e16ab..3bc7230ca62ebe3426da293e436a962bb0134f85 100644 +index 4b3bb5fad1d80c9baea20ca224663b1ebc2b83e9..eb4a70f4e21e46f61e60235fb0569c0d6b2672f9 100644 --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -@@ -286,13 +286,26 @@ public class GlobalConfiguration extends ConfigurationPart { +@@ -262,13 +262,26 @@ public class GlobalConfiguration extends ConfigurationPart { public Misc misc; public class Misc extends ConfigurationPart {