From a62835bbb19eb5874160b1040d47364fe1fcb3f3 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 21 Sep 2023 21:40:51 -0700 Subject: [PATCH] almost halfway done with server patches --- ...date-itemstack-legacy-name-and-lore.patch} | 6 +- ...wn-player-in-correct-world-on-login.patch} | 4 +- .../0430-Add-PrepareResultEvent.patch} | 14 ++-- ...-for-portal-on-world-gen-entity-add.patch} | 4 +- ...x-arrows-never-despawning-MC-125757.patch} | 2 +- ...Vanilla-Command-permission-checking.patch} | 4 +- .../0434-Fix-SPIGOT-5989.patch} | 10 +-- ...-Bukkit-world-container-is-not-used.patch} | 4 +- ...5885-Unable-to-disable-advancements.patch} | 4 +- ...taPlayer-leak-due-from-quitting-ear.patch} | 28 ++++--- ...ix-some-rails-connecting-improperly.patch} | 0 ...stake-in-CB-NBT-int-deserialization.patch} | 0 patches/server/0440-Brand-support.patch | 67 +++++++++++++++++ ...PickupItemAnimation-to-LivingEntity.patch} | 2 +- .../0442-Don-t-require-FACING-data.patch} | 8 +- ...eEvent-not-firing-for-all-use-cases.patch} | 6 +- .../0444-Add-moon-phase-API.patch} | 0 ...headless-pistons-from-being-created.patch} | 4 +- .../0446-Add-BellRingEvent.patch} | 4 +- ...dd-zombie-targets-turtle-egg-config.patch} | 4 +- .../0448-Buffer-joins-to-world.patch} | 6 +- ...-Eigencraft-redstone-implementation.patch} | 2 +- ...s-not-working-in-some-kick-messages.patch} | 14 ++-- ...reateEvent-needs-to-know-its-entity.patch} | 6 +- .../0452-Add-more-Evoker-API.patch} | 0 ...Add-methods-to-get-translation-keys.patch} | 0 ...te-HoverEvent-from-ItemStack-Entity.patch} | 0 .../0455-Cache-block-data-strings.patch} | 4 +- ...rtation-and-cancel-velocity-if-tele.patch} | 14 ++-- ...l-open-container-api-to-HumanEntity.patch} | 2 +- ...aFixerUpper-Rewrite-Rules-on-demand.patch} | 0 ...-capture-to-capture-all-items-added.patch} | 8 +- ...-Counter-to-allow-plugins-to-use-va.patch} | 8 +- ...track-plugin-scoreboards-by-default.patch} | 2 +- .../0462-Entity-isTicking.patch} | 6 +- ...non-whitelisted-player-when-white-l.patch} | 4 +- ...-Concurrency-issue-in-ShufflingList.patch} | 0 ...eset-Ender-Crystals-on-Dragon-Spawn.patch} | 4 +- ...-large-move-vectors-crashing-server.patch} | 12 +-- .../0467-Optimise-getType-calls.patch} | 0 .../0468-Villager-resetOffers.patch} | 4 +- ...ce-order-when-capturing-blockstates.patch} | 2 +- ...lockpos-allocation-from-pathfinding.patch} | 0 ...em-locations-dropped-from-campfires.patch} | 4 +- .../0472-Player-elytra-boost-API.patch} | 4 +- ...73-Fixed-TileEntityBell-memory-leak.patch} | 0 ...ing-up-when-item-stack-is-empty-in-.patch} | 2 +- ...Add-getOfflinePlayerIfCached-String.patch} | 4 +- .../0476-Add-ignore-discounts-API.patch} | 10 +-- ...Toggle-for-removing-existing-dragon.patch} | 2 +- ...x-client-lag-on-advancement-loading.patch} | 4 +- .../0479-Item-no-age-no-player-pickup.patch} | 0 ...er-Remove-Streams-Optimized-collect.patch} | 4 +- ...481-Beacon-API-custom-effect-ranges.patch} | 24 +++--- .../0482-Add-API-for-quit-reason.patch} | 34 ++++----- ...ng-Trader-spawn-rate-config-options.patch} | 0 .../0484-Expose-world-spawn-angle.patch} | 4 +- .../0485-Add-Destroy-Speed-API.patch} | 0 ...-spawnParticle-x-y-z-precision-loss.patch} | 4 +- ...87-Add-LivingEntity-clearActiveItem.patch} | 2 +- .../0488-Add-PlayerItemCooldownEvent.patch} | 0 ...rove-performance-of-the-end-generat.patch} | 0 .../0490-More-lightning-API.patch} | 0 ...should-not-bypass-cramming-gamerule.patch} | 28 +++---- ...-missing-default-perms-for-commands.patch} | 0 .../0493-Add-PlayerShearBlockEvent.patch} | 6 +- ...ng-zombie-villager-discount-exploit.patch} | 4 +- .../0495-Limit-recipe-packets.patch} | 8 +- ...-CraftSound-backwards-compatibility.patch} | 0 ...0497-Player-Chunk-Load-Unload-Events.patch | 34 +++++++++ ...8-Optimize-Dynamic-get-Missing-Keys.patch} | 0 ...-Expose-LivingEntity-hurt-direction.patch} | 8 +- ...OBSTRUCTED-reason-to-BedEnterResult.patch} | 4 +- ...-invalid-ingredient-lists-in-Villag.patch} | 6 +- ...rTradeEvent-and-PlayerPurchaseEvent.patch} | 8 +- .../0503-Implement-TargetHitEvent.patch} | 0 .../0504-MC-4-Fix-item-position-desync.patch} | 12 +-- ...505-Additional-Block-Material-API-s.patch} | 0 .../0506-Fix-harming-potion-dupe.patch} | 0 ...get-Material-from-Boats-and-Minecar.patch} | 0 .../0508-Cache-burn-durations.patch} | 2 +- ...ob-spawner-spawn-egg-transformation.patch} | 0 ...ix-Not-a-string-Map-Conversion-spam.patch} | 4 +- ...ment-PlayerFlowerPotManipulateEvent.patch} | 0 ...ct-event-not-being-called-sometimes.patch} | 6 +- .../0513-Zombie-API-breaking-doors.patch} | 0 ...514-Fix-nerfed-slime-when-splitting.patch} | 4 +- .../0515-Add-EntityLoadCrossbowEvent.patch} | 0 ...0516-Added-WorldGameRuleChangeEvent.patch} | 14 ++-- ...-Added-ServerResourcesReloadedEvent.patch} | 6 +- .../unapplied/server/0448-Brand-support.patch | 75 ------------------- ...0505-Player-Chunk-Load-Unload-Events.patch | 32 -------- ...ze-NetworkManager-Exception-Handling.patch | 0 ...erver-load-chunks-from-newer-version.patch | 0 94 files changed, 314 insertions(+), 322 deletions(-) rename patches/{unapplied/server/0434-Update-itemstack-legacy-name-and-lore.patch => server/0428-Update-itemstack-legacy-name-and-lore.patch} (93%) rename patches/{unapplied/server/0435-Spawn-player-in-correct-world-on-login.patch => server/0429-Spawn-player-in-correct-world-on-login.patch} (90%) rename patches/{unapplied/server/0436-Add-PrepareResultEvent.patch => server/0430-Add-PrepareResultEvent.patch} (94%) rename patches/{unapplied/server/0437-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch => server/0431-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch} (85%) rename patches/{unapplied/server/0439-Fix-arrows-never-despawning-MC-125757.patch => server/0432-Fix-arrows-never-despawning-MC-125757.patch} (91%) rename patches/{unapplied/server/0440-Thread-Safe-Vanilla-Command-permission-checking.patch => server/0433-Thread-Safe-Vanilla-Command-permission-checking.patch} (94%) rename patches/{unapplied/server/0441-Fix-SPIGOT-5989.patch => server/0434-Fix-SPIGOT-5989.patch} (90%) rename patches/{unapplied/server/0442-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch => server/0435-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch} (96%) rename patches/{unapplied/server/0443-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch => server/0436-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch} (85%) rename patches/{unapplied/server/0444-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch => server/0437-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch} (71%) rename patches/{unapplied/server/0445-Fix-some-rails-connecting-improperly.patch => server/0438-Fix-some-rails-connecting-improperly.patch} (100%) rename patches/{unapplied/server/0446-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch => server/0439-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch} (100%) create mode 100644 patches/server/0440-Brand-support.patch rename patches/{unapplied/server/0449-Add-playPickupItemAnimation-to-LivingEntity.patch => server/0441-Add-playPickupItemAnimation-to-LivingEntity.patch} (90%) rename patches/{unapplied/server/0450-Don-t-require-FACING-data.patch => server/0442-Don-t-require-FACING-data.patch} (77%) rename patches/{unapplied/server/0451-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch => server/0443-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch} (90%) rename patches/{unapplied/server/0452-Add-moon-phase-API.patch => server/0444-Add-moon-phase-API.patch} (100%) rename patches/{unapplied/server/0453-Prevent-headless-pistons-from-being-created.patch => server/0445-Prevent-headless-pistons-from-being-created.patch} (92%) rename patches/{unapplied/server/0454-Add-BellRingEvent.patch => server/0446-Add-BellRingEvent.patch} (90%) rename patches/{unapplied/server/0455-Add-zombie-targets-turtle-egg-config.patch => server/0447-Add-zombie-targets-turtle-egg-config.patch} (86%) rename patches/{unapplied/server/0456-Buffer-joins-to-world.patch => server/0448-Buffer-joins-to-world.patch} (91%) rename patches/{unapplied/server/0457-Eigencraft-redstone-implementation.patch => server/0449-Eigencraft-redstone-implementation.patch} (99%) rename patches/{unapplied/server/0458-Fix-hex-colors-not-working-in-some-kick-messages.patch => server/0450-Fix-hex-colors-not-working-in-some-kick-messages.patch} (80%) rename patches/{unapplied/server/0459-PortalCreateEvent-needs-to-know-its-entity.patch => server/0451-PortalCreateEvent-needs-to-know-its-entity.patch} (97%) rename patches/{unapplied/server/0460-Add-more-Evoker-API.patch => server/0452-Add-more-Evoker-API.patch} (100%) rename patches/{unapplied/server/0461-Add-methods-to-get-translation-keys.patch => server/0453-Add-methods-to-get-translation-keys.patch} (100%) rename patches/{unapplied/server/0462-Create-HoverEvent-from-ItemStack-Entity.patch => server/0454-Create-HoverEvent-from-ItemStack-Entity.patch} (100%) rename patches/{unapplied/server/0463-Cache-block-data-strings.patch => server/0455-Cache-block-data-strings.patch} (95%) rename patches/{unapplied/server/0464-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch => server/0456-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch} (87%) rename patches/{unapplied/server/0465-Add-additional-open-container-api-to-HumanEntity.patch => server/0457-Add-additional-open-container-api-to-HumanEntity.patch} (97%) rename patches/{unapplied/server/0466-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch => server/0458-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch} (100%) rename patches/{unapplied/server/0467-Extend-block-drop-capture-to-capture-all-items-added.patch => server/0459-Extend-block-drop-capture-to-capture-all-items-added.patch} (89%) rename patches/{unapplied/server/0468-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch => server/0460-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch} (81%) rename patches/{unapplied/server/0469-Lazily-track-plugin-scoreboards-by-default.patch => server/0461-Lazily-track-plugin-scoreboards-by-default.patch} (97%) rename patches/{unapplied/server/0470-Entity-isTicking.patch => server/0462-Entity-isTicking.patch} (83%) rename patches/{unapplied/server/0471-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch => server/0463-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch} (90%) rename patches/{unapplied/server/0472-Fix-Concurrency-issue-in-ShufflingList.patch => server/0464-Fix-Concurrency-issue-in-ShufflingList.patch} (100%) rename patches/{unapplied/server/0473-Reset-Ender-Crystals-on-Dragon-Spawn.patch => server/0465-Reset-Ender-Crystals-on-Dragon-Spawn.patch} (88%) rename patches/{unapplied/server/0474-Fix-for-large-move-vectors-crashing-server.patch => server/0466-Fix-for-large-move-vectors-crashing-server.patch} (90%) rename patches/{unapplied/server/0475-Optimise-getType-calls.patch => server/0467-Optimise-getType-calls.patch} (100%) rename patches/{unapplied/server/0476-Villager-resetOffers.patch => server/0468-Villager-resetOffers.patch} (90%) rename patches/{unapplied/server/0477-Retain-block-place-order-when-capturing-blockstates.patch => server/0469-Retain-block-place-order-when-capturing-blockstates.patch} (93%) rename patches/{unapplied/server/0478-Reduce-blockpos-allocation-from-pathfinding.patch => server/0470-Reduce-blockpos-allocation-from-pathfinding.patch} (100%) rename patches/{unapplied/server/0479-Fix-item-locations-dropped-from-campfires.patch => server/0471-Fix-item-locations-dropped-from-campfires.patch} (91%) rename patches/{unapplied/server/0480-Player-elytra-boost-API.patch => server/0472-Player-elytra-boost-API.patch} (90%) rename patches/{unapplied/server/0481-Fixed-TileEntityBell-memory-leak.patch => server/0473-Fixed-TileEntityBell-memory-leak.patch} (100%) rename patches/{unapplied/server/0482-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch => server/0474-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch} (97%) rename patches/{unapplied/server/0483-Add-getOfflinePlayerIfCached-String.patch => server/0475-Add-getOfflinePlayerIfCached-String.patch} (89%) rename patches/{unapplied/server/0484-Add-ignore-discounts-API.patch => server/0476-Add-ignore-discounts-API.patch} (96%) rename patches/{unapplied/server/0485-Toggle-for-removing-existing-dragon.patch => server/0477-Toggle-for-removing-existing-dragon.patch} (91%) rename patches/{unapplied/server/0486-Fix-client-lag-on-advancement-loading.patch => server/0478-Fix-client-lag-on-advancement-loading.patch} (91%) rename patches/{unapplied/server/0487-Item-no-age-no-player-pickup.patch => server/0479-Item-no-age-no-player-pickup.patch} (100%) rename patches/{unapplied/server/0488-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch => server/0480-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch} (98%) rename patches/{unapplied/server/0489-Beacon-API-custom-effect-ranges.patch => server/0481-Beacon-API-custom-effect-ranges.patch} (87%) rename patches/{unapplied/server/0490-Add-API-for-quit-reason.patch => server/0482-Add-API-for-quit-reason.patch} (65%) rename patches/{unapplied/server/0491-Add-Wandering-Trader-spawn-rate-config-options.patch => server/0483-Add-Wandering-Trader-spawn-rate-config-options.patch} (100%) rename patches/{unapplied/server/0492-Expose-world-spawn-angle.patch => server/0484-Expose-world-spawn-angle.patch} (87%) rename patches/{unapplied/server/0493-Add-Destroy-Speed-API.patch => server/0485-Add-Destroy-Speed-API.patch} (100%) rename patches/{unapplied/server/0494-Fix-Player-spawnParticle-x-y-z-precision-loss.patch => server/0486-Fix-Player-spawnParticle-x-y-z-precision-loss.patch} (89%) rename patches/{unapplied/server/0495-Add-LivingEntity-clearActiveItem.patch => server/0487-Add-LivingEntity-clearActiveItem.patch} (90%) rename patches/{unapplied/server/0496-Add-PlayerItemCooldownEvent.patch => server/0488-Add-PlayerItemCooldownEvent.patch} (100%) rename patches/{unapplied/server/0497-Significantly-improve-performance-of-the-end-generat.patch => server/0489-Significantly-improve-performance-of-the-end-generat.patch} (100%) rename patches/{unapplied/server/0498-More-lightning-API.patch => server/0490-More-lightning-API.patch} (100%) rename patches/{unapplied/server/0499-Climbing-should-not-bypass-cramming-gamerule.patch => server/0491-Climbing-should-not-bypass-cramming-gamerule.patch} (86%) rename patches/{unapplied/server/0500-Added-missing-default-perms-for-commands.patch => server/0492-Added-missing-default-perms-for-commands.patch} (100%) rename patches/{unapplied/server/0501-Add-PlayerShearBlockEvent.patch => server/0493-Add-PlayerShearBlockEvent.patch} (95%) rename patches/{unapplied/server/0502-Fix-curing-zombie-villager-discount-exploit.patch => server/0494-Fix-curing-zombie-villager-discount-exploit.patch} (91%) rename patches/{unapplied/server/0503-Limit-recipe-packets.patch => server/0495-Limit-recipe-packets.patch} (86%) rename patches/{unapplied/server/0504-Fix-CraftSound-backwards-compatibility.patch => server/0496-Fix-CraftSound-backwards-compatibility.patch} (100%) create mode 100644 patches/server/0497-Player-Chunk-Load-Unload-Events.patch rename patches/{unapplied/server/0506-Optimize-Dynamic-get-Missing-Keys.patch => server/0498-Optimize-Dynamic-get-Missing-Keys.patch} (100%) rename patches/{unapplied/server/0507-Expose-LivingEntity-hurt-direction.patch => server/0499-Expose-LivingEntity-hurt-direction.patch} (86%) rename patches/{unapplied/server/0508-Add-OBSTRUCTED-reason-to-BedEnterResult.patch => server/0500-Add-OBSTRUCTED-reason-to-BedEnterResult.patch} (86%) rename patches/{unapplied/server/0509-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch => server/0501-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch} (86%) rename patches/{unapplied/server/0510-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch => server/0502-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch} (97%) rename patches/{unapplied/server/0511-Implement-TargetHitEvent.patch => server/0503-Implement-TargetHitEvent.patch} (100%) rename patches/{unapplied/server/0512-MC-4-Fix-item-position-desync.patch => server/0504-MC-4-Fix-item-position-desync.patch} (84%) rename patches/{unapplied/server/0513-Additional-Block-Material-API-s.patch => server/0505-Additional-Block-Material-API-s.patch} (100%) rename patches/{unapplied/server/0514-Fix-harming-potion-dupe.patch => server/0506-Fix-harming-potion-dupe.patch} (100%) rename patches/{unapplied/server/0515-Implement-API-to-get-Material-from-Boats-and-Minecar.patch => server/0507-Implement-API-to-get-Material-from-Boats-and-Minecar.patch} (100%) rename patches/{unapplied/server/0516-Cache-burn-durations.patch => server/0508-Cache-burn-durations.patch} (94%) rename patches/{unapplied/server/0517-Allow-disabling-mob-spawner-spawn-egg-transformation.patch => server/0509-Allow-disabling-mob-spawner-spawn-egg-transformation.patch} (100%) rename patches/{unapplied/server/0518-Fix-Not-a-string-Map-Conversion-spam.patch => server/0510-Fix-Not-a-string-Map-Conversion-spam.patch} (94%) rename patches/{unapplied/server/0519-Implement-PlayerFlowerPotManipulateEvent.patch => server/0511-Implement-PlayerFlowerPotManipulateEvent.patch} (100%) rename patches/{unapplied/server/0520-Fix-interact-event-not-being-called-sometimes.patch => server/0512-Fix-interact-event-not-being-called-sometimes.patch} (92%) rename patches/{unapplied/server/0521-Zombie-API-breaking-doors.patch => server/0513-Zombie-API-breaking-doors.patch} (100%) rename patches/{unapplied/server/0522-Fix-nerfed-slime-when-splitting.patch => server/0514-Fix-nerfed-slime-when-splitting.patch} (83%) rename patches/{unapplied/server/0523-Add-EntityLoadCrossbowEvent.patch => server/0515-Add-EntityLoadCrossbowEvent.patch} (100%) rename patches/{unapplied/server/0524-Added-WorldGameRuleChangeEvent.patch => server/0516-Added-WorldGameRuleChangeEvent.patch} (92%) rename patches/{unapplied/server/0525-Added-ServerResourcesReloadedEvent.patch => server/0517-Added-ServerResourcesReloadedEvent.patch} (93%) delete mode 100644 patches/unapplied/server/0448-Brand-support.patch delete mode 100644 patches/unapplied/server/0505-Player-Chunk-Load-Unload-Events.patch rename patches/unapplied/{server => skipped}/0438-Optimize-NetworkManager-Exception-Handling.patch (100%) rename patches/unapplied/{server => skipped}/0447-Do-not-let-the-server-load-chunks-from-newer-version.patch (100%) diff --git a/patches/unapplied/server/0434-Update-itemstack-legacy-name-and-lore.patch b/patches/server/0428-Update-itemstack-legacy-name-and-lore.patch similarity index 93% rename from patches/unapplied/server/0434-Update-itemstack-legacy-name-and-lore.patch rename to patches/server/0428-Update-itemstack-legacy-name-and-lore.patch index d9936812c2..cf9a5df397 100644 --- a/patches/unapplied/server/0434-Update-itemstack-legacy-name-and-lore.patch +++ b/patches/server/0428-Update-itemstack-legacy-name-and-lore.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Update itemstack legacy name and lore diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 0caf3eeb7984e842f7a0bdfed3021d0b231a0dd0..ee274fb9c8292a807e438902cc5d7f49c30d6627 100644 +index 77db59d433d4189f96b9da006898bded5edbb0ba..8aaaa67549a75b7404d2865a09474dc2b6cf18fe 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -171,6 +171,44 @@ public final class ItemStack { +@@ -172,6 +172,44 @@ public final class ItemStack { list.sort((java.util.Comparator) enchantSorter); // Paper } catch (Exception ignored) {} } @@ -53,7 +53,7 @@ index 0caf3eeb7984e842f7a0bdfed3021d0b231a0dd0..ee274fb9c8292a807e438902cc5d7f49 // Paper end public ItemStack(ItemLike item) { -@@ -222,6 +260,7 @@ public final class ItemStack { +@@ -223,6 +261,7 @@ public final class ItemStack { this.tag = nbttagcompound.getCompound("tag").copy(); // CraftBukkit end this.processEnchantOrder(this.tag); // Paper diff --git a/patches/unapplied/server/0435-Spawn-player-in-correct-world-on-login.patch b/patches/server/0429-Spawn-player-in-correct-world-on-login.patch similarity index 90% rename from patches/unapplied/server/0435-Spawn-player-in-correct-world-on-login.patch rename to patches/server/0429-Spawn-player-in-correct-world-on-login.patch index 9eca8932f2..e0436de566 100644 --- a/patches/unapplied/server/0435-Spawn-player-in-correct-world-on-login.patch +++ b/patches/server/0429-Spawn-player-in-correct-world-on-login.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Spawn player in correct world on login diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index a8dcd1a07b835f665c74a8a531fef84435716b13..abfd8510c726e17d7a0c99d13cfe065615583fcd 100644 +index 2de6d47c2289faac019e4f68dcc7df910a03e206..55154eba25bc4724bc9523864b8308af4bfc5e87 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -212,7 +212,18 @@ public abstract class PlayerList { +@@ -204,7 +204,18 @@ public abstract class PlayerList { } // CraftBukkit end diff --git a/patches/unapplied/server/0436-Add-PrepareResultEvent.patch b/patches/server/0430-Add-PrepareResultEvent.patch similarity index 94% rename from patches/unapplied/server/0436-Add-PrepareResultEvent.patch rename to patches/server/0430-Add-PrepareResultEvent.patch index ba35d9fc85..c1323ff095 100644 --- a/patches/unapplied/server/0436-Add-PrepareResultEvent.patch +++ b/patches/server/0430-Add-PrepareResultEvent.patch @@ -56,7 +56,7 @@ index 4087e381b2250be387b608d8742f6a6009a52879..ff770b9ce68a62418de0c7ed38965062 } diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java -index edc8da447a531cec3a0590ee39811f0949ca7dda..c4766df6d64b484375e5e3474e97dee196c0fef4 100644 +index 5c209a3d81db5326f63c506077fa0bfd241b4b12..757ee83a0ec5d381eb328f31f3bef636a9b72d57 100644 --- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java +++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java @@ -248,7 +248,8 @@ public class LoomMenu extends AbstractContainerMenu { @@ -70,10 +70,10 @@ index edc8da447a531cec3a0590ee39811f0949ca7dda..c4766df6d64b484375e5e3474e97dee1 this.resultSlot.set(ItemStack.EMPTY); this.selectablePatterns = List.of(); diff --git a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java -index c63250e04cf7ea5ec2067438735b53e83d851a31..947f7f7e87534872660442947bb24ef5a806a972 100644 +index f7be3a69909ca0f0aa60619f70e87b5778cf3633..9db5275c43f25ea8ab595017a1b1a8d9db08cb4c 100644 --- a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java +++ b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java -@@ -114,6 +114,7 @@ public class SmithingMenu extends ItemCombinerMenu { +@@ -115,6 +115,7 @@ public class SmithingMenu extends ItemCombinerMenu { } } @@ -82,10 +82,10 @@ index c63250e04cf7ea5ec2067438735b53e83d851a31..947f7f7e87534872660442947bb24ef5 @Override diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java -index 8734a129244271b370f965fcbf488a14ce04684a..00f01ab2eff69c18b50ec07b7623af66c66a28b6 100644 +index 9c2fe69ced7a46bbd8b0fbe10fa67d0a39b0f375..70ecc3f673ebd56b65ad901e10f40c28368cbfac 100644 --- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java +++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java -@@ -180,6 +180,7 @@ public class StonecutterMenu extends AbstractContainerMenu { +@@ -181,6 +181,7 @@ public class StonecutterMenu extends AbstractContainerMenu { this.setupRecipeList(inventory, itemstack); } @@ -94,10 +94,10 @@ index 8734a129244271b370f965fcbf488a14ce04684a..00f01ab2eff69c18b50ec07b7623af66 private void setupRecipeList(Container input, ItemStack stack) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 10eb0eed4bf0cc93e4e32c282735c2863f10837c..7dc806760dbb26befde605d991d57660862484a1 100644 +index 7aba049b426a25981376205410acf41327993d30..6018dc7aa4eaac45c1eee121925f4a22625b0e55 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1667,26 +1667,53 @@ public class CraftEventFactory { +@@ -1669,26 +1669,53 @@ public class CraftEventFactory { return event; } diff --git a/patches/unapplied/server/0437-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/0431-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch similarity index 85% rename from patches/unapplied/server/0437-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch rename to patches/server/0431-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch index be68c732d1..d03d1dfbee 100644 --- a/patches/unapplied/server/0437-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch +++ b/patches/server/0431-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't check chunk for portal on world gen entity add diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 3ec6243f831330a8096e209a00e0164dea2ef9d0..7b0e6f975ee00be6fc36c22ef586d4f0d4ce06ee 100644 +index a8f51cb5be994783eca8ff13eb172fd651deb05e..4d9149d3a1d5711b88ce86fb34dbdc926cbe8c31 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3477,7 +3477,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3511,7 +3511,7 @@ public abstract class LivingEntity extends Entity implements Attackable { Entity entity = this.getVehicle(); super.stopRiding(suppressCancellation); // Paper - suppress diff --git a/patches/unapplied/server/0439-Fix-arrows-never-despawning-MC-125757.patch b/patches/server/0432-Fix-arrows-never-despawning-MC-125757.patch similarity index 91% rename from patches/unapplied/server/0439-Fix-arrows-never-despawning-MC-125757.patch rename to patches/server/0432-Fix-arrows-never-despawning-MC-125757.patch index bd9c1d6de4..be04919e89 100644 --- a/patches/unapplied/server/0439-Fix-arrows-never-despawning-MC-125757.patch +++ b/patches/server/0432-Fix-arrows-never-despawning-MC-125757.patch @@ -9,7 +9,7 @@ instead of getting stuck in a never despawn state (bubble columns, etc). diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 86a82ecdcffc27b523fddc2709bbd92f315e8590..a0d688128a1268fa1acf7c339cde15df5dce1c82 100644 +index c5512adfb2d38616bb741d03038158c379020ecf..f70f0764d9743dbfa2ead4c90d0df3dbc107672d 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -200,6 +200,7 @@ public abstract class AbstractArrow extends Projectile { diff --git a/patches/unapplied/server/0440-Thread-Safe-Vanilla-Command-permission-checking.patch b/patches/server/0433-Thread-Safe-Vanilla-Command-permission-checking.patch similarity index 94% rename from patches/unapplied/server/0440-Thread-Safe-Vanilla-Command-permission-checking.patch rename to patches/server/0433-Thread-Safe-Vanilla-Command-permission-checking.patch index c285fc1466..b99c971369 100644 --- a/patches/unapplied/server/0440-Thread-Safe-Vanilla-Command-permission-checking.patch +++ b/patches/server/0433-Thread-Safe-Vanilla-Command-permission-checking.patch @@ -26,7 +26,7 @@ index 20a7cdf87f307878d66922aaac0c60cff218e46c..39844531b03eb8a6c70700b4ecbf0ff1 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index 66bd75ee66840f17cc7d00ff89adcb88d83e4dc9..308b3a36f063c401a447f9b7f0364700eee5a54c 100644 +index e6bf044a0de278c568835e6150ce07ed0e39a44e..7dfd18cfda943ea4486249e20d9763b8465c9601 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java @@ -64,7 +64,7 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy @@ -38,7 +38,7 @@ index 66bd75ee66840f17cc7d00ff89adcb88d83e4dc9..308b3a36f063c401a447f9b7f0364700 public boolean bypassSelectorPermissions = false; // Paper public CommandSourceStack(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String name, Component displayName, MinecraftServer server, @Nullable Entity entity) { -@@ -203,9 +203,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy +@@ -199,9 +199,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy @Override public boolean hasPermission(int level) { // CraftBukkit start diff --git a/patches/unapplied/server/0441-Fix-SPIGOT-5989.patch b/patches/server/0434-Fix-SPIGOT-5989.patch similarity index 90% rename from patches/unapplied/server/0441-Fix-SPIGOT-5989.patch rename to patches/server/0434-Fix-SPIGOT-5989.patch index 431e528ce9..184d76bc65 100644 --- a/patches/unapplied/server/0441-Fix-SPIGOT-5989.patch +++ b/patches/server/0434-Fix-SPIGOT-5989.patch @@ -10,10 +10,10 @@ This fixes that by checking if the modified spawn location is still at a respawn anchor. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index abfd8510c726e17d7a0c99d13cfe065615583fcd..31e6da864b0ddf2f65ecc43ce8ef74d6c4e9d0aa 100644 +index 55154eba25bc4724bc9523864b8308af4bfc5e87..426594705780125607b9cd88f30f59bec949f882 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -794,6 +794,7 @@ public abstract class PlayerList { +@@ -789,6 +789,7 @@ public abstract class PlayerList { // Paper start boolean isBedSpawn = false; boolean isRespawn = false; @@ -21,7 +21,7 @@ index abfd8510c726e17d7a0c99d13cfe065615583fcd..31e6da864b0ddf2f65ecc43ce8ef74d6 // Paper end // CraftBukkit start - fire PlayerRespawnEvent -@@ -804,7 +805,7 @@ public abstract class PlayerList { +@@ -799,7 +800,7 @@ public abstract class PlayerList { Optional optional; if (blockposition != null) { @@ -30,7 +30,7 @@ index abfd8510c726e17d7a0c99d13cfe065615583fcd..31e6da864b0ddf2f65ecc43ce8ef74d6 } else { optional = Optional.empty(); } -@@ -848,7 +849,12 @@ public abstract class PlayerList { +@@ -843,7 +844,12 @@ public abstract class PlayerList { } // Spigot End @@ -44,7 +44,7 @@ index abfd8510c726e17d7a0c99d13cfe065615583fcd..31e6da864b0ddf2f65ecc43ce8ef74d6 if (!flag) entityplayer.reset(); // SPIGOT-4785 isRespawn = true; // Paper } else { -@@ -888,8 +894,14 @@ public abstract class PlayerList { +@@ -882,8 +888,14 @@ public abstract class PlayerList { } // entityplayer1.initInventoryMenu(); entityplayer1.setHealth(entityplayer1.getHealth()); diff --git a/patches/unapplied/server/0442-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/patches/server/0435-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch similarity index 96% rename from patches/unapplied/server/0442-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch rename to patches/server/0435-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch index e9f45cb86e..9c7eb0b8d7 100644 --- a/patches/unapplied/server/0442-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch +++ b/patches/server/0435-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SPIGOT-5824 Bukkit world-container is not used diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 839055c2cb941c36c3d7e3eaf61a277b25d16acb..f1f38d96206e7e10615eac0c53bbbc7426b7e615 100644 +index 6c3e0540dce5f810a7822cefe59228ef77528132..ef73e0a9b916ade0be91c837a82123c9fc4b5018 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -180,8 +180,17 @@ public class Main { +@@ -177,8 +177,17 @@ public class Main { return; } diff --git a/patches/unapplied/server/0443-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/0436-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch similarity index 85% rename from patches/unapplied/server/0443-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch rename to patches/server/0436-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch index 8803ddb9f4..dabede87f9 100644 --- a/patches/unapplied/server/0443-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch +++ b/patches/server/0436-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SPIGOT-5885 Unable to disable advancements diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index f1f38d96206e7e10615eac0c53bbbc7426b7e615..27eb466c3f5f4342f892d1c55c15108ae6861912 100644 +index ef73e0a9b916ade0be91c837a82123c9fc4b5018..6e89b87dec5f9cb5e5657be0a6d23ae5edf7d2bd 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -180,6 +180,7 @@ public class Main { +@@ -177,6 +177,7 @@ public class Main { return; } diff --git a/patches/unapplied/server/0444-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/patches/server/0437-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch similarity index 71% rename from patches/unapplied/server/0444-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch rename to patches/server/0437-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch index c043b42598..5c1357ca7c 100644 --- a/patches/unapplied/server/0444-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch +++ b/patches/server/0437-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch @@ -9,17 +9,15 @@ itself, so the criterion object stores no references - and thus needs no cleanup. diff --git a/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java b/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java -index 70d4467e8e4dd9be38a7bfe8494efb6e67e18b9a..4b0e967fac5adb54b2d26ee8f7a1ced259ad11db 100644 +index 8ae5d6bc6aa3b0bd51a88bf1ce27a01aad881b43..f0367a9cce13ef576fbb7023c0aba6eb48963606 100644 --- a/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java +++ b/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java -@@ -14,22 +14,24 @@ import net.minecraft.server.level.ServerPlayer; +@@ -16,22 +16,22 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.level.storage.loot.LootContext; - public abstract class SimpleCriterionTrigger implements CriterionTrigger { + public abstract class SimpleCriterionTrigger implements CriterionTrigger { - private final Map>> players = Maps.newIdentityHashMap(); -+ //private final Map>> players = Maps.newIdentityHashMap(); // Paper - moved into AdvancementDataPlayer to fix memory leak -+ -+ public SimpleCriterionTrigger() {} ++ // private final Map>> players = Maps.newIdentityHashMap(); // Paper - moved into AdvancementDataPlayer to fix memory leak @Override public final void addPlayerListener(PlayerAdvancements manager, CriterionTrigger.Listener conditions) { @@ -41,7 +39,7 @@ index 70d4467e8e4dd9be38a7bfe8494efb6e67e18b9a..4b0e967fac5adb54b2d26ee8f7a1ced2 } } -@@ -37,7 +39,7 @@ public abstract class SimpleCriterionTrigger predicate, DeserializationContext predicateDeserializer); +@@ -52,7 +52,7 @@ public abstract class SimpleCriterionTrigger predicate) { PlayerAdvancements playerAdvancements = player.getAdvancements(); @@ -60,14 +58,14 @@ index 70d4467e8e4dd9be38a7bfe8494efb6e67e18b9a..4b0e967fac5adb54b2d26ee8f7a1ced2 LootContext lootContext = EntityPredicate.createContext(player, player); List> list = null; diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java -index 100781852965e09c92aca34785673c5de51c7107..9034faaf7b169788abad01d3da9c65ad5ddc4b8b 100644 +index 6487bf016e646ca772b667a2a81c85e82c027c05..d03db10517b2df98b40ab48e450333960508aabf 100644 --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java -@@ -62,6 +62,7 @@ public class PlayerAdvancements { - @Nullable - private Advancement lastSelectedTab; +@@ -64,6 +64,7 @@ public class PlayerAdvancements { + private AdvancementHolder lastSelectedTab; private boolean isFirstPacket = true; -+ public final Map> criterionData = new java.util.IdentityHashMap<>(); // Paper - fix advancement data player leakage + private final Codec codec; ++ public final Map, Set>> criterionData = new java.util.IdentityHashMap<>(); // Paper - fix advancement data player leakage public PlayerAdvancements(DataFixer dataFixer, PlayerList playerManager, ServerAdvancementManager advancementLoader, Path filePath, ServerPlayer owner) { - this.dataFixer = dataFixer; + this.playerList = playerManager; diff --git a/patches/unapplied/server/0445-Fix-some-rails-connecting-improperly.patch b/patches/server/0438-Fix-some-rails-connecting-improperly.patch similarity index 100% rename from patches/unapplied/server/0445-Fix-some-rails-connecting-improperly.patch rename to patches/server/0438-Fix-some-rails-connecting-improperly.patch diff --git a/patches/unapplied/server/0446-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch b/patches/server/0439-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch similarity index 100% rename from patches/unapplied/server/0446-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch rename to patches/server/0439-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch diff --git a/patches/server/0440-Brand-support.patch b/patches/server/0440-Brand-support.patch new file mode 100644 index 0000000000..70ae9adebb --- /dev/null +++ b/patches/server/0440-Brand-support.patch @@ -0,0 +1,67 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: DigitalRegent +Date: Sat, 11 Apr 2020 13:10:58 +0200 +Subject: [PATCH] Brand support + + +diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +index d1808bf9dc19fad84da5eb3b4c3d549bc624b00a..cce6febce229abdad859f183716cdefbec4a8f2e 100644 +--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +@@ -54,6 +54,8 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + private int latency; + private volatile boolean suspendFlushingOnServerThread = false; + private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit ++ private @Nullable String clientBrandName = null; // Paper - Brand name ++ protected static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support + + public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit + this.server = minecraftserver; +@@ -140,6 +142,15 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + try { + byte[] data = new byte[payload.readableBytes()]; + payload.readBytes(data); ++ // Paper start - Brand support ++ if (identifier.equals(MINECRAFT_BRAND)) { ++ try { ++ this.clientBrandName = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.copiedBuffer(data)).readUtf(256); ++ } catch (StringIndexOutOfBoundsException ex) { ++ this.clientBrandName = "illegal"; ++ } ++ } ++ // Paper end + this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), identifier.toString(), data); + } catch (Exception ex) { + ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); +@@ -149,6 +160,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + + } + ++ // Paper start - brand support ++ @Nullable ++ public String getClientBrandName() { ++ return this.clientBrandName; ++ } ++ // Paper end ++ + public final boolean isDisconnected() { + return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index e28872e0f86a0106e4ea4e06d1ea8e41128de5c7..a32084082239b71222e72e8d7a1e1b84333d775e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -2965,6 +2965,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + // Paper end + }; + ++ // Paper start - brand support ++ @Override ++ public String getClientBrandName() { ++ return getHandle().connection != null ? getHandle().connection.getClientBrandName() : null; ++ } ++ // Paper end ++ + public Player.Spigot spigot() + { + return this.spigot; diff --git a/patches/unapplied/server/0449-Add-playPickupItemAnimation-to-LivingEntity.patch b/patches/server/0441-Add-playPickupItemAnimation-to-LivingEntity.patch similarity index 90% rename from patches/unapplied/server/0449-Add-playPickupItemAnimation-to-LivingEntity.patch rename to patches/server/0441-Add-playPickupItemAnimation-to-LivingEntity.patch index 3fd0b25510..1b6b0d9a7f 100644 --- a/patches/unapplied/server/0449-Add-playPickupItemAnimation-to-LivingEntity.patch +++ b/patches/server/0441-Add-playPickupItemAnimation-to-LivingEntity.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add playPickupItemAnimation to LivingEntity diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 5e874253a150bda008d8da29691ddeaad0fee1de..4bb7c18bcf5c551fa5121745938a9fa76d2a7173 100644 +index 02b7780a05f0119c2d1e9d379321105822629793..a0da8d022b9ab9c7b6ac6a32022739e863c2c9a0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -920,5 +920,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/patches/unapplied/server/0450-Don-t-require-FACING-data.patch b/patches/server/0442-Don-t-require-FACING-data.patch similarity index 77% rename from patches/unapplied/server/0450-Don-t-require-FACING-data.patch rename to patches/server/0442-Don-t-require-FACING-data.patch index fd2ab14906..bc170b7402 100644 --- a/patches/unapplied/server/0450-Don-t-require-FACING-data.patch +++ b/patches/server/0442-Don-t-require-FACING-data.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't require FACING data diff --git a/src/main/java/net/minecraft/core/dispenser/DefaultDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DefaultDispenseItemBehavior.java -index da6a145b06e217ff82b0a1b04410238dc50d4869..1e6ba6d9cceda1d4867b183c3dbc03d317ed287f 100644 +index b6c5976278f08c454492e0fabe6fac6c1a881d00..379890ae05b2fb4bd81b2fa907413d3736ba1169 100644 --- a/src/main/java/net/minecraft/core/dispenser/DefaultDispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DefaultDispenseItemBehavior.java @@ -14,6 +14,7 @@ import org.bukkit.event.block.BlockDispenseEvent; @@ -20,17 +20,17 @@ index da6a145b06e217ff82b0a1b04410238dc50d4869..1e6ba6d9cceda1d4867b183c3dbc03d3 @Override public final ItemStack dispense(BlockSource pointer, ItemStack stack) { -+ enumdirection = pointer.getBlockState().getValue(DispenserBlock.FACING); // Paper - cache facing direction ++ enumdirection = pointer.state().getValue(DispenserBlock.FACING); // Paper - cache facing direction ItemStack itemstack1 = this.execute(pointer, stack); this.playSound(pointer); -- this.playAnimation(pointer, (Direction) pointer.getBlockState().getValue(DispenserBlock.FACING)); +- this.playAnimation(pointer, (Direction) pointer.state().getValue(DispenserBlock.FACING)); + this.playAnimation(pointer, enumdirection); // Paper - cache facing direction return itemstack1; } protected ItemStack execute(BlockSource pointer, ItemStack stack) { -- Direction enumdirection = (Direction) pointer.getBlockState().getValue(DispenserBlock.FACING); +- Direction enumdirection = (Direction) pointer.state().getValue(DispenserBlock.FACING); + // Paper - cached enum direction Position iposition = DispenserBlock.getDispensePosition(pointer); ItemStack itemstack1 = stack.split(1); diff --git a/patches/unapplied/server/0451-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0443-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch similarity index 90% rename from patches/unapplied/server/0451-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch rename to patches/server/0443-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch index 3ce60a511b..90d8c3d0b7 100644 --- a/patches/unapplied/server/0451-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch +++ b/patches/server/0443-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 02ba7e25c649832aba2e742cb76be9d2b6b6f954..babc90ed1a85756545ac2b7631853d09f37125f2 100644 +index b84a5fcda10711c896c9a670343d961b9536f888..15a0bbc4e3bafb754b3de03f63b19ab848fe6635 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2003,9 +2003,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1762,9 +1762,11 @@ public class ServerLevel extends Level implements WorldGenLevel { public void setDefaultSpawnPos(BlockPos pos, float angle) { // Paper - configurable spawn radius BlockPos prevSpawn = this.getSharedSpawnPos(); @@ -21,7 +21,7 @@ index 02ba7e25c649832aba2e742cb76be9d2b6b6f954..babc90ed1a85756545ac2b7631853d09 // if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add this.removeTicketsForSpawn(this.paperConfig().spawn.keepSpawnLoadedRange * 16, prevSpawn); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 328bc95dd9298c1f666c35836ea157367f7ef1cd..e754bb3ce28c3bd253698e2065121aafdfe94230 100644 +index 6137e49ba4f7dd121bbb7b13add3d63285df52d5..b9a5d94c31b20a87ed96d8e85a28e63400353353 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -259,12 +259,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/unapplied/server/0452-Add-moon-phase-API.patch b/patches/server/0444-Add-moon-phase-API.patch similarity index 100% rename from patches/unapplied/server/0452-Add-moon-phase-API.patch rename to patches/server/0444-Add-moon-phase-API.patch diff --git a/patches/unapplied/server/0453-Prevent-headless-pistons-from-being-created.patch b/patches/server/0445-Prevent-headless-pistons-from-being-created.patch similarity index 92% rename from patches/unapplied/server/0453-Prevent-headless-pistons-from-being-created.patch rename to patches/server/0445-Prevent-headless-pistons-from-being-created.patch index a995521d2b..a044172f14 100644 --- a/patches/unapplied/server/0453-Prevent-headless-pistons-from-being-created.patch +++ b/patches/server/0445-Prevent-headless-pistons-from-being-created.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Prevent headless pistons from being created Prevent headless pistons from being created by explosions or tree/mushroom growth. diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index d646660f988994d4fdb05901349c5946a2f6c48c..316df76570a7a6843b5a8ed2c44467a0cdf2a6cd 100644 +index 93529defa5d36bb9b4c69eedda9b7ac3d0a189ce..e6e7ac7c5c31b6ff16a7bae6cc0706d31ea16c07 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -183,6 +183,15 @@ public class Explosion { +@@ -184,6 +184,15 @@ public class Explosion { if (f > 0.0F && this.damageCalculator.shouldBlockExplode(this, this.level, blockposition, iblockdata, f)) { set.add(blockposition); diff --git a/patches/unapplied/server/0454-Add-BellRingEvent.patch b/patches/server/0446-Add-BellRingEvent.patch similarity index 90% rename from patches/unapplied/server/0454-Add-BellRingEvent.patch rename to patches/server/0446-Add-BellRingEvent.patch index fd04ce804b..6ee48b9906 100644 --- a/patches/unapplied/server/0454-Add-BellRingEvent.patch +++ b/patches/server/0446-Add-BellRingEvent.patch @@ -7,10 +7,10 @@ Add a new event, BellRingEvent, to trigger whenever a player rings a village bell. Passes along the bell block and the player who rang it. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 7dc806760dbb26befde605d991d57660862484a1..ab6f24426031d47d25fcf94421569a3276cdca9a 100644 +index 6018dc7aa4eaac45c1eee121925f4a22625b0e55..9bdfb16720c9e5ca3254f8ea8463ca10077992ea 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -365,10 +365,11 @@ public class CraftEventFactory { +@@ -367,10 +367,11 @@ public class CraftEventFactory { return tradeSelectEvent; } diff --git a/patches/unapplied/server/0455-Add-zombie-targets-turtle-egg-config.patch b/patches/server/0447-Add-zombie-targets-turtle-egg-config.patch similarity index 86% rename from patches/unapplied/server/0455-Add-zombie-targets-turtle-egg-config.patch rename to patches/server/0447-Add-zombie-targets-turtle-egg-config.patch index e07acc412d..e75c42314d 100644 --- a/patches/unapplied/server/0455-Add-zombie-targets-turtle-egg-config.patch +++ b/patches/server/0447-Add-zombie-targets-turtle-egg-config.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add zombie targets turtle egg config diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index fae2c89900db222f7319b5675ef4b470beca251b..3ca308bb6668392a4f7ce1296e1ef6094060491f 100644 +index 55e4416a7988690ecfc8da6e83b43cbf9adda33b..6b8315ab1bdd963c04e56f214f6bdfd6b5eb8f48 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -108,7 +108,7 @@ public class Zombie extends Monster { +@@ -109,7 +109,7 @@ public class Zombie extends Monster { @Override protected void registerGoals() { diff --git a/patches/unapplied/server/0456-Buffer-joins-to-world.patch b/patches/server/0448-Buffer-joins-to-world.patch similarity index 91% rename from patches/unapplied/server/0456-Buffer-joins-to-world.patch rename to patches/server/0448-Buffer-joins-to-world.patch index c7c84cfc24..3aeacb5392 100644 --- a/patches/unapplied/server/0456-Buffer-joins-to-world.patch +++ b/patches/server/0448-Buffer-joins-to-world.patch @@ -8,12 +8,12 @@ the world per tick, this attempts to reduce the impact that join floods has on the server diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index dc3dea801a673462e767ad37268ec77ac95d214c..959d39e81cdde6fda90fcc95f842146448b4c6e4 100644 +index 81e49a770fd8a10e987f3e67a5ab99fc39d5e47f..a147c5e1929e8034b28af56f561f86478684fd08 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -449,14 +449,29 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -403,14 +403,29 @@ public class Connection extends SimpleChannelInboundHandler> { + } } - // Paper end + private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper + private static int joinAttemptsThisTick; // Paper diff --git a/patches/unapplied/server/0457-Eigencraft-redstone-implementation.patch b/patches/server/0449-Eigencraft-redstone-implementation.patch similarity index 99% rename from patches/unapplied/server/0457-Eigencraft-redstone-implementation.patch rename to patches/server/0449-Eigencraft-redstone-implementation.patch index 983cc81cfe..5991ef0146 100644 --- a/patches/unapplied/server/0457-Eigencraft-redstone-implementation.patch +++ b/patches/server/0449-Eigencraft-redstone-implementation.patch @@ -986,7 +986,7 @@ index 0000000000000000000000000000000000000000..22a2547810d0c029f29685faddf7ac21 + } +} diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java -index e7489dbdb0379f9bf3312e5253cd7ff9d8b3a185..1926daed1749e3481861f85f57612fe74450191b 100644 +index 8a18aab3115d2ee1e888769518704f2a5aa1d4cc..a0ae3635ae8c3fd3ac17dd9fa614ec84c7b1b0ca 100644 --- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java @@ -252,6 +252,116 @@ public class RedStoneWireBlock extends Block { diff --git a/patches/unapplied/server/0458-Fix-hex-colors-not-working-in-some-kick-messages.patch b/patches/server/0450-Fix-hex-colors-not-working-in-some-kick-messages.patch similarity index 80% rename from patches/unapplied/server/0458-Fix-hex-colors-not-working-in-some-kick-messages.patch rename to patches/server/0450-Fix-hex-colors-not-working-in-some-kick-messages.patch index d0a1da33db..5b1da0e606 100644 --- a/patches/unapplied/server/0458-Fix-hex-colors-not-working-in-some-kick-messages.patch +++ b/patches/server/0450-Fix-hex-colors-not-working-in-some-kick-messages.patch @@ -5,30 +5,30 @@ Subject: [PATCH] Fix hex colors not working in some kick messages diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index 94b062874ef9d4935a7ad2c7b45b2e6b786eaa81..4fb1fde4983d81cc35e2c8717984d929460959b8 100644 +index 1cdcb62ead4b9f2e88f1e282813d990ddf2297a5..ec11db0cfdc5977bff6198efd10f716393931335 100644 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java @@ -77,12 +77,12 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL } // CraftBukkit end - if (packet.getProtocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) { + if (packet.protocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) { - MutableComponent ichatmutablecomponent; + Component ichatmutablecomponent; // Paper - Fix hex colors not working in some kick messages - if (packet.getProtocolVersion() < 754) { + if (packet.protocolVersion() < 754) { - ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot -+ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages ++ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages } else { - ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot -+ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages ++ ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages } this.connection.send(new ClientboundLoginDisconnectPacket(ichatmutablecomponent)); diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 9858f907e58fa606510f87efbdf8793c35ec711c..c9f8f61c43428c519c0dac1b7416bad775e3429f 100644 +index f870c20ecce27ebd893107a35e1b8f15e462ff85..25afcd025d32c76232910bcc7d6607eef3c4167d 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -102,7 +102,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -97,7 +97,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, // CraftBukkit start @Deprecated public void disconnect(String s) { diff --git a/patches/unapplied/server/0459-PortalCreateEvent-needs-to-know-its-entity.patch b/patches/server/0451-PortalCreateEvent-needs-to-know-its-entity.patch similarity index 97% rename from patches/unapplied/server/0459-PortalCreateEvent-needs-to-know-its-entity.patch rename to patches/server/0451-PortalCreateEvent-needs-to-know-its-entity.patch index c6b3bbabfa..70e5553f18 100644 --- a/patches/unapplied/server/0459-PortalCreateEvent-needs-to-know-its-entity.patch +++ b/patches/server/0451-PortalCreateEvent-needs-to-know-its-entity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] PortalCreateEvent needs to know its entity diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index ee274fb9c8292a807e438902cc5d7f49c30d6627..34e54233d54f21cf4304c39e53aa6a7fb06a67cf 100644 +index 8aaaa67549a75b7404d2865a09474dc2b6cf18fe..58eb562aea9d3d19da0958ce9dcf0474f975e259 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -452,7 +452,7 @@ public final class ItemStack { +@@ -457,7 +457,7 @@ public final class ItemStack { net.minecraft.world.level.block.state.BlockState block = world.getBlockState(newblockposition); if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically @@ -79,7 +79,7 @@ index 8c6edd032c927f7d1e04e944b4ce5598d71cdd81..7f88b910dfd0303f69b4fd1c7918a401 private static int getFireTickDelay(RandomSource random) { diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index 74f84bfcb1da6186c7a6783512c2fc7ba995215f..a9e8d9c65a809562d4768df348dcd79bec4d0e3c 100644 +index a5942b6683d38f067f8ca1dfbe467b72df242632..96bdf69c8788aa0b1dff64789e6f13c856ee99ff 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java @@ -40,6 +40,7 @@ import net.minecraft.world.item.DyeColor; diff --git a/patches/unapplied/server/0460-Add-more-Evoker-API.patch b/patches/server/0452-Add-more-Evoker-API.patch similarity index 100% rename from patches/unapplied/server/0460-Add-more-Evoker-API.patch rename to patches/server/0452-Add-more-Evoker-API.patch diff --git a/patches/unapplied/server/0461-Add-methods-to-get-translation-keys.patch b/patches/server/0453-Add-methods-to-get-translation-keys.patch similarity index 100% rename from patches/unapplied/server/0461-Add-methods-to-get-translation-keys.patch rename to patches/server/0453-Add-methods-to-get-translation-keys.patch diff --git a/patches/unapplied/server/0462-Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/0454-Create-HoverEvent-from-ItemStack-Entity.patch similarity index 100% rename from patches/unapplied/server/0462-Create-HoverEvent-from-ItemStack-Entity.patch rename to patches/server/0454-Create-HoverEvent-from-ItemStack-Entity.patch diff --git a/patches/unapplied/server/0463-Cache-block-data-strings.patch b/patches/server/0455-Cache-block-data-strings.patch similarity index 95% rename from patches/unapplied/server/0463-Cache-block-data-strings.patch rename to patches/server/0455-Cache-block-data-strings.patch index 84607af12b..e48ba086de 100644 --- a/patches/unapplied/server/0463-Cache-block-data-strings.patch +++ b/patches/server/0455-Cache-block-data-strings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d62c09f7328af63112d9e6f1a06844047dbf6570..a8fea134ddd8bf19abea977871c77cd317090145 100644 +index e82e5df0abf64b27733beedb4a545a0a1a2119f3..c24e6d743da7f5e1dcd0be05a04bf3dd336ca7f4 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2048,6 +2048,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= level; } -@@ -1856,6 +1857,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1779,6 +1780,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public void moveTo(double x, double y, double z, float yaw, float pitch) { @@ -69,7 +69,7 @@ index 369298dfd437c1c83801f3d4ba63484ee1b969fe..ae2b95f53e875716489821dc9b0a3a35 if (entity instanceof Mob) { Mob entityinsentient = (Mob) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 5052432652c2e7f09a233e267bece5fb1e3e3bf1..efa3402b776551cddbfcab834740cdd75f65178d 100644 +index 91d199250d856baa869258282bb04ed5897b14e9..889b24adb50825a3c4bd83f10c3d253e5cf80a1a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -580,7 +580,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/unapplied/server/0465-Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/0457-Add-additional-open-container-api-to-HumanEntity.patch similarity index 97% rename from patches/unapplied/server/0465-Add-additional-open-container-api-to-HumanEntity.patch rename to patches/server/0457-Add-additional-open-container-api-to-HumanEntity.patch index e5751542de..1559443eb8 100644 --- a/patches/unapplied/server/0465-Add-additional-open-container-api-to-HumanEntity.patch +++ b/patches/server/0457-Add-additional-open-container-api-to-HumanEntity.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add additional open container api to HumanEntity diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 63208cf28a7ea005f9f328281676ed113ae23a00..f4cda5fbf12c59dc1ecec4aac6719837444382e2 100644 +index 80694a1d660a10909408c9b3169dda7847bf295e..05d9a9968588381aaa3aeb06ef4d18fed4085229 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -461,6 +461,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/patches/unapplied/server/0466-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch b/patches/server/0458-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch similarity index 100% rename from patches/unapplied/server/0466-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch rename to patches/server/0458-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch diff --git a/patches/unapplied/server/0467-Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/0459-Extend-block-drop-capture-to-capture-all-items-added.patch similarity index 89% rename from patches/unapplied/server/0467-Extend-block-drop-capture-to-capture-all-items-added.patch rename to patches/server/0459-Extend-block-drop-capture-to-capture-all-items-added.patch index aa2bd79094..51ac6461fd 100644 --- a/patches/unapplied/server/0467-Extend-block-drop-capture-to-capture-all-items-added.patch +++ b/patches/server/0459-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 babc90ed1a85756545ac2b7631853d09f37125f2..838907e8ae95d72797d01188836a05bff01d8a14 100644 +index 15a0bbc4e3bafb754b3de03f63b19ab848fe6635..720568b34c903c80d916a5915c9733c4ed565dcf 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1507,6 +1507,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1275,6 +1275,12 @@ 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 { @@ -23,10 +23,10 @@ index babc90ed1a85756545ac2b7631853d09f37125f2..838907e8ae95d72797d01188836a05bf 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 cf47536a2e37d53406fc9cb3f09095e034af8e15..c256423e9dc9d1837b847da44fb2920c58842c8b 100644 +index 3622708c453feb6da3d5be192291d63abbe83068..89f0c3d6e4dc9701f02fa7ed5331c3969de81ffc 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -436,10 +436,12 @@ public class ServerPlayerGameMode { +@@ -434,10 +434,12 @@ public class ServerPlayerGameMode { // return true; // CraftBukkit } // CraftBukkit start diff --git a/patches/unapplied/server/0468-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0460-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch similarity index 81% rename from patches/unapplied/server/0468-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch rename to patches/server/0460-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index fef92e82e8..4c0b82adb8 100644 --- a/patches/unapplied/server/0468-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/0460-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 fca862584439c87b049af4cdd9f79fe4ee30ea40..71d2557e6e244384042ce3b13cc6e3008227399d 100644 +index fcd8a25967f0eccb0da3e81d79baca9403b0d34f..74c9e96f196d293c7ef68a00829ab24822e16e76 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4433,4 +4433,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4364,4 +4364,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { void accept(Entity entity, double x, double y, double z); } @@ -21,10 +21,10 @@ index fca862584439c87b049af4cdd9f79fe4ee30ea40..71d2557e6e244384042ce3b13cc6e300 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 173d17adb76f5f08828048236f544d25f53152ea..6c6587c775162655581bd09e5eb7cc2d7fb8f782 100644 +index 3544ffd3af1e71cfd6fb198b4fa45da3167cd62d..336717e397d6d6572fd72da16f8585b349a80209 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -512,6 +512,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -513,6 +513,11 @@ public final class CraftMagicNumbers implements UnsafeValues { Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!"); return compound; } diff --git a/patches/unapplied/server/0469-Lazily-track-plugin-scoreboards-by-default.patch b/patches/server/0461-Lazily-track-plugin-scoreboards-by-default.patch similarity index 97% rename from patches/unapplied/server/0469-Lazily-track-plugin-scoreboards-by-default.patch rename to patches/server/0461-Lazily-track-plugin-scoreboards-by-default.patch index 6716cd5857..6095173a4f 100644 --- a/patches/unapplied/server/0469-Lazily-track-plugin-scoreboards-by-default.patch +++ b/patches/server/0461-Lazily-track-plugin-scoreboards-by-default.patch @@ -39,7 +39,7 @@ index 3f09420ba9268ac1dc5440c0739744370c0de319..052389310826ee6b97cf27dfd952e010 return new CraftObjective(this, objective); } diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java -index 282cb5e41fed48df890eaa30e42563289e065caa..afc43b52698db4bf7d89a576c2cbca0ddc9e04e2 100644 +index d5c15dd1287e0d5348dc9f7c622850705fcd4ac9..8f20fa2bfbe037fbaa9f4c4c3341a3d9b9a711b5 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java @@ -30,6 +30,7 @@ public final class CraftScoreboardManager implements ScoreboardManager { diff --git a/patches/unapplied/server/0470-Entity-isTicking.patch b/patches/server/0462-Entity-isTicking.patch similarity index 83% rename from patches/unapplied/server/0470-Entity-isTicking.patch rename to patches/server/0462-Entity-isTicking.patch index cfd12d32e2..dd0216b228 100644 --- a/patches/unapplied/server/0470-Entity-isTicking.patch +++ b/patches/server/0462-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 71d2557e6e244384042ce3b13cc6e3008227399d..73a2ddf2806ea1e1826d553b7d13cf4d58be43fc 100644 +index 74c9e96f196d293c7ef68a00829ab24822e16e76..a1f704600b8b4a43e05584cefdbeedacde6f2ed2 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4438,5 +4438,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4369,5 +4369,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { public static int nextEntityId() { return ENTITY_COUNTER.incrementAndGet(); } @@ -19,7 +19,7 @@ index 71d2557e6e244384042ce3b13cc6e3008227399d..73a2ddf2806ea1e1826d553b7d13cf4d // 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 efa3402b776551cddbfcab834740cdd75f65178d..2a0299d5dcafb9659ffd66fe2cc12843208a7408 100644 +index 889b24adb50825a3c4bd83f10c3d253e5cf80a1a..3f2a8efc6ad9e6e2043bf96894c47e578c68e263 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1347,5 +1347,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/unapplied/server/0471-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/0463-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch similarity index 90% rename from patches/unapplied/server/0471-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch rename to patches/server/0463-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch index 87818b0d38..36f12a1c89 100644 --- a/patches/unapplied/server/0471-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch +++ b/patches/server/0463-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 a8fea134ddd8bf19abea977871c77cd317090145..8c9ebc501282e929503c39607048e032f05fbb9c 100644 +index c24e6d743da7f5e1dcd0be05a04bf3dd336ca7f4..22b1efc8927d6f168694b2bde957d960661bb1c4 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2131,13 +2131,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 1.0D) { -@@ -1405,9 +1427,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1293,9 +1315,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl AABB axisalignedbb = this.player.getBoundingBox(); diff --git a/patches/unapplied/server/0475-Optimise-getType-calls.patch b/patches/server/0467-Optimise-getType-calls.patch similarity index 100% rename from patches/unapplied/server/0475-Optimise-getType-calls.patch rename to patches/server/0467-Optimise-getType-calls.patch diff --git a/patches/unapplied/server/0476-Villager-resetOffers.patch b/patches/server/0468-Villager-resetOffers.patch similarity index 90% rename from patches/unapplied/server/0476-Villager-resetOffers.patch rename to patches/server/0468-Villager-resetOffers.patch index b964f1ff26..ba42f14185 100644 --- a/patches/unapplied/server/0476-Villager-resetOffers.patch +++ b/patches/server/0468-Villager-resetOffers.patch @@ -5,10 +5,10 @@ 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 78f7f1602b34e9d2162446810b0ee1357fd4922c..0a62cf36a95d7bf1287acdd17464fc677c7a4b7d 100644 +index 8f2d68890297521274a5c23daa272f0341427eec..629b79c6e59944994295768904c449733764cf99 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -@@ -115,6 +115,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa +@@ -114,6 +114,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa return this.tradingPlayer != null; } diff --git a/patches/unapplied/server/0477-Retain-block-place-order-when-capturing-blockstates.patch b/patches/server/0469-Retain-block-place-order-when-capturing-blockstates.patch similarity index 93% rename from patches/unapplied/server/0477-Retain-block-place-order-when-capturing-blockstates.patch rename to patches/server/0469-Retain-block-place-order-when-capturing-blockstates.patch index d825fe5c79..4f20419c05 100644 --- a/patches/unapplied/server/0477-Retain-block-place-order-when-capturing-blockstates.patch +++ b/patches/server/0469-Retain-block-place-order-when-capturing-blockstates.patch @@ -10,7 +10,7 @@ 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 221a1e66814dda35feff9fa9ca0fe54feec335f9..1577b7317b85708d39d4171321df785a8107bdb2 100644 +index ea11bea03a15bfd79b82da60c48bfb23a44acda4..8236bfd8d0bdd322d1aeee7d4b1e32ae5dc1ae1f 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -157,7 +157,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/unapplied/server/0478-Reduce-blockpos-allocation-from-pathfinding.patch b/patches/server/0470-Reduce-blockpos-allocation-from-pathfinding.patch similarity index 100% rename from patches/unapplied/server/0478-Reduce-blockpos-allocation-from-pathfinding.patch rename to patches/server/0470-Reduce-blockpos-allocation-from-pathfinding.patch diff --git a/patches/unapplied/server/0479-Fix-item-locations-dropped-from-campfires.patch b/patches/server/0471-Fix-item-locations-dropped-from-campfires.patch similarity index 91% rename from patches/unapplied/server/0479-Fix-item-locations-dropped-from-campfires.patch rename to patches/server/0471-Fix-item-locations-dropped-from-campfires.patch index b69c339697..d8e81d50ef 100644 --- a/patches/unapplied/server/0479-Fix-item-locations-dropped-from-campfires.patch +++ b/patches/server/0471-Fix-item-locations-dropped-from-campfires.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix item locations dropped from campfires Fixes #4259 by not flooring the blockposition among other weirdness 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 ba4ce804d1d239ca842b06b3599605847effc35b..ca995270c9b8d7024504a9ba885b1c0214b33a8b 100644 +index c4cf6abf0a962794ddbb4d7a691406054062ffee..24e2063db933bfbc8fc1f34edb8106ae4d7c633c 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 -@@ -81,7 +81,11 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { +@@ -82,7 +82,11 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { result = blockCookEvent.getResult(); itemstack1 = CraftItemStack.asNMSCopy(result); // CraftBukkit end diff --git a/patches/unapplied/server/0480-Player-elytra-boost-API.patch b/patches/server/0472-Player-elytra-boost-API.patch similarity index 90% rename from patches/unapplied/server/0480-Player-elytra-boost-API.patch rename to patches/server/0472-Player-elytra-boost-API.patch index c97e3a78f4..a4b048f701 100644 --- a/patches/unapplied/server/0480-Player-elytra-boost-API.patch +++ b/patches/server/0472-Player-elytra-boost-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player elytra boost API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c96efc055e44dcc7880abb3a6e7b4c441aa9a112..63160efd1f5b555d024264edec479aa99e2b519b 100644 +index a32084082239b71222e72e8d7a1e1b84333d775e..f842cbe25832b17d7225132eea0bd7704c8c6f08 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -624,6 +624,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -584,6 +584,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } throw new RuntimeException("Unknown settings type"); } diff --git a/patches/unapplied/server/0481-Fixed-TileEntityBell-memory-leak.patch b/patches/server/0473-Fixed-TileEntityBell-memory-leak.patch similarity index 100% rename from patches/unapplied/server/0481-Fixed-TileEntityBell-memory-leak.patch rename to patches/server/0473-Fixed-TileEntityBell-memory-leak.patch diff --git a/patches/unapplied/server/0482-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch b/patches/server/0474-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch similarity index 97% rename from patches/unapplied/server/0482-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch rename to patches/server/0474-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch index 46bd818262..27b0ff407c 100644 --- a/patches/unapplied/server/0482-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch +++ b/patches/server/0474-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch @@ -8,7 +8,7 @@ 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 dbff697927e6a6c745377aafd3b476b58f005882..b8c238287e0639b578170c6fec0d4db5a1a59fe7 100644 +index 5c77992e0c49eb217dd66657b35164225b400518..a9eaa079a43bc8a5e81deaf6df5ce2f9c53cb319 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java @@ -503,9 +503,15 @@ public class FishingHook extends Projectile { diff --git a/patches/unapplied/server/0483-Add-getOfflinePlayerIfCached-String.patch b/patches/server/0475-Add-getOfflinePlayerIfCached-String.patch similarity index 89% rename from patches/unapplied/server/0483-Add-getOfflinePlayerIfCached-String.patch rename to patches/server/0475-Add-getOfflinePlayerIfCached-String.patch index e60e46353e..622b7869df 100644 --- a/patches/unapplied/server/0483-Add-getOfflinePlayerIfCached-String.patch +++ b/patches/server/0475-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 0e552fdcc48b0f3f68cbf65113b94782863cb092..f7acc0c4e385c48ca651166baf33caa247e582f6 100644 +index 970a604108c0b7e410af356e3d12559af0b0b78b..d09fb11e67364a2c54bf6412b1a8a48797ece3be 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1811,6 +1811,28 @@ public final class CraftServer implements Server { +@@ -1814,6 +1814,28 @@ public final class CraftServer implements Server { return result; } diff --git a/patches/unapplied/server/0484-Add-ignore-discounts-API.patch b/patches/server/0476-Add-ignore-discounts-API.patch similarity index 96% rename from patches/unapplied/server/0484-Add-ignore-discounts-API.patch rename to patches/server/0476-Add-ignore-discounts-API.patch index 74bbe0572c..76c60665da 100644 --- a/patches/unapplied/server/0484-Add-ignore-discounts-API.patch +++ b/patches/server/0476-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 1e775178f346ef3d2f121e539ba81a75c8a37c36..24434b66d158b10d21579b2db6efb0bdcc788a5c 100644 +index cc829161404c0f98a403c5219d5c535de1d5c5ba..f58be4e2529759cc64df2c70a69ef56eabbb762d 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -507,6 +507,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -508,6 +508,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler while (iterator.hasNext()) { MerchantOffer merchantrecipe = (MerchantOffer) iterator.next(); @@ -16,7 +16,7 @@ index 1e775178f346ef3d2f121e539ba81a75c8a37c36..24434b66d158b10d21579b2db6efb0bd merchantrecipe.addToSpecialPriceDiff(-Mth.floor((float) i * merchantrecipe.getPriceMultiplier())); } -@@ -519,6 +520,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -520,6 +521,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler while (iterator1.hasNext()) { MerchantOffer merchantrecipe1 = (MerchantOffer) iterator1.next(); @@ -25,7 +25,7 @@ index 1e775178f346ef3d2f121e539ba81a75c8a37c36..24434b66d158b10d21579b2db6efb0bd int k = (int) Math.floor(d0 * (double) merchantrecipe1.getBaseCostA().getCount()); diff --git a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java -index dc5908374565dd3080679779cbfe7620a4810015..28bdcb14cb5b458d3c990fcf343ef97f08e4f3c6 100644 +index 1d755d04515f20dbd69931084b4cc894e52d35c9..4f7457578ab3118d10e0d5dfc23d79c9b20c2f44 100644 --- a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java +++ b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java @@ -19,6 +19,7 @@ public class MerchantOffer { @@ -82,7 +82,7 @@ index dc5908374565dd3080679779cbfe7620a4810015..28bdcb14cb5b458d3c990fcf343ef97f this.rewardExp = true; this.xp = 1; this.baseCostA = firstBuyItem; -@@ -195,6 +214,7 @@ public class MerchantOffer { +@@ -210,6 +229,7 @@ public class MerchantOffer { nbttagcompound.putFloat("priceMultiplier", this.priceMultiplier); nbttagcompound.putInt("specialPrice", this.specialPriceDiff); nbttagcompound.putInt("demand", this.demand); diff --git a/patches/unapplied/server/0485-Toggle-for-removing-existing-dragon.patch b/patches/server/0477-Toggle-for-removing-existing-dragon.patch similarity index 91% rename from patches/unapplied/server/0485-Toggle-for-removing-existing-dragon.patch rename to patches/server/0477-Toggle-for-removing-existing-dragon.patch index 1feab0504f..0ec8e9d4ef 100644 --- a/patches/unapplied/server/0485-Toggle-for-removing-existing-dragon.patch +++ b/patches/server/0477-Toggle-for-removing-existing-dragon.patch @@ -5,7 +5,7 @@ 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 3c24c2c7dda04ba05f10c64c785f503dac9585f5..774f408b1520646dd32eb7d66e33946a7e1e72df 100644 +index 7be3405a93fbb9f43075983825d1ac9299cbe7b9..7741b27816636aaa48277b2fe14fd7b88cd3d78a 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 @@ -209,7 +209,7 @@ public class EndDragonFight { diff --git a/patches/unapplied/server/0486-Fix-client-lag-on-advancement-loading.patch b/patches/server/0478-Fix-client-lag-on-advancement-loading.patch similarity index 91% rename from patches/unapplied/server/0486-Fix-client-lag-on-advancement-loading.patch rename to patches/server/0478-Fix-client-lag-on-advancement-loading.patch index d32bf05036..d1fcc45325 100644 --- a/patches/unapplied/server/0486-Fix-client-lag-on-advancement-loading.patch +++ b/patches/server/0478-Fix-client-lag-on-advancement-loading.patch @@ -15,10 +15,10 @@ 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 6c6587c775162655581bd09e5eb7cc2d7fb8f782..c168dbfa5bc4aa49a1d743fe4b53d8169f01e1a0 100644 +index 336717e397d6d6572fd72da16f8585b349a80209..0fb0c8238be1e199220ef62576547ea6c9484a9c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -345,7 +345,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -346,7 +346,13 @@ public final class CraftMagicNumbers implements UnsafeValues { Bukkit.getLogger().log(Level.SEVERE, "Error saving advancement " + key, ex); } diff --git a/patches/unapplied/server/0487-Item-no-age-no-player-pickup.patch b/patches/server/0479-Item-no-age-no-player-pickup.patch similarity index 100% rename from patches/unapplied/server/0487-Item-no-age-no-player-pickup.patch rename to patches/server/0479-Item-no-age-no-player-pickup.patch diff --git a/patches/unapplied/server/0488-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/0480-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch similarity index 98% rename from patches/unapplied/server/0488-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch rename to patches/server/0480-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch index 91c966567f..9a80ce81b8 100644 --- a/patches/unapplied/server/0488-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch +++ b/patches/server/0480-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch @@ -17,7 +17,7 @@ This lets us get faster foreach iteration, as well as avoids map lookups on the values when needed. diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java -index 300c812d513e0b948a7e79c0ed241f514c7a09fc..d23481453717f715124156b5d83f6448f720d049 100644 +index 8519383a9abd45434c1e9888e77548941a80c79c..d23481453717f715124156b5d83f6448f720d049 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java @@ -38,9 +38,12 @@ public class PathFinder { @@ -102,7 +102,7 @@ index 300c812d513e0b948a7e79c0ed241f514c7a09fc..d23481453717f715124156b5d83f6448 - return this.reconstructPath(target.getBestNode(), positions.get(target), false); - }).min(Comparator.comparingDouble(Path::getDistToTarget).thenComparingInt(Path::getNodeCount)); - profiler.pop(); -- return !optional.isPresent() ? null : optional.get(); +- return optional.isEmpty() ? null : optional.get(); + // Paper start - remove streams - and optimize collection + Path best = null; + boolean entryListIsEmpty = entryList.isEmpty(); diff --git a/patches/unapplied/server/0489-Beacon-API-custom-effect-ranges.patch b/patches/server/0481-Beacon-API-custom-effect-ranges.patch similarity index 87% rename from patches/unapplied/server/0489-Beacon-API-custom-effect-ranges.patch rename to patches/server/0481-Beacon-API-custom-effect-ranges.patch index acea4bac73..cb9f27cca3 100644 --- a/patches/unapplied/server/0489-Beacon-API-custom-effect-ranges.patch +++ b/patches/server/0481-Beacon-API-custom-effect-ranges.patch @@ -5,10 +5,10 @@ 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 154e4652a93b50e9b26c93531a4e854601ed75e1..f3fb7e07ca65cb1c948b110b7f7edc8b0bd83b21 100644 +index cd28ee0cbc69713a641a21c9a626c694a4bcbfc9..3a50fe20294048a1c818ae717a918bb1aed74dea 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 -@@ -78,6 +78,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -82,6 +82,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name return (BeaconBlockEntity.hasSecondaryEffect(this.levels, this.primaryPower, this.secondaryPower)) ? CraftPotionUtil.toBukkit(new MobEffectInstance(this.secondaryPower, BeaconBlockEntity.getLevel(this.levels), BeaconBlockEntity.getAmplification(this.levels, this.primaryPower, this.secondaryPower), true, true)) : null; } // CraftBukkit end @@ -33,9 +33,9 @@ index 154e4652a93b50e9b26c93531a4e854601ed75e1..f3fb7e07ca65cb1c948b110b7f7edc8b + } + // Paper end - public BeaconBlockEntity(BlockPos pos, BlockState state) { - super(BlockEntityType.BEACON, pos, state); -@@ -188,7 +208,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name + @Nullable + static MobEffect filterEffect(@Nullable MobEffect effect) { +@@ -197,7 +217,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } if (blockEntity.levels > 0 && !blockEntity.beamSections.isEmpty()) { @@ -44,7 +44,7 @@ index 154e4652a93b50e9b26c93531a4e854601ed75e1..f3fb7e07ca65cb1c948b110b7f7edc8b BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT); } } -@@ -274,8 +294,13 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -283,8 +303,13 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } public static List getHumansInRange(Level world, BlockPos blockposition, int i) { @@ -59,7 +59,7 @@ index 154e4652a93b50e9b26c93531a4e854601ed75e1..f3fb7e07ca65cb1c948b110b7f7edc8b AABB axisalignedbb = (new AABB(blockposition)).inflate(d0).expandTowards(0.0D, (double) world.getHeight(), 0.0D); List list = world.getEntitiesOfClass(Player.class, axisalignedbb); -@@ -316,12 +341,17 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -325,12 +350,17 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable MobEffect primaryEffect, @Nullable MobEffect secondaryEffect) { @@ -78,7 +78,7 @@ index 154e4652a93b50e9b26c93531a4e854601ed75e1..f3fb7e07ca65cb1c948b110b7f7edc8b BeaconBlockEntity.applyEffect(list, primaryEffect, j, b0, true, pos); // Paper - BeaconEffectEvent -@@ -371,6 +401,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -393,6 +423,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } this.lockKey = LockCode.fromTag(nbt); @@ -86,7 +86,7 @@ index 154e4652a93b50e9b26c93531a4e854601ed75e1..f3fb7e07ca65cb1c948b110b7f7edc8b } @Override -@@ -384,6 +415,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name +@@ -406,6 +437,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name } this.lockKey.addToTag(nbt); @@ -95,10 +95,10 @@ index 154e4652a93b50e9b26c93531a4e854601ed75e1..f3fb7e07ca65cb1c948b110b7f7edc8b 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 c186a44b927188ed222f8b2f8f76aaef35d9c654..c47e613cae3d9252a8364ccc4d717e410bb0fc0c 100644 +index da3437eb0ce3374a44a09c55834f341e1a55c162..453fd72f6bab51acd4af25173f95873cf71cc318 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java -@@ -29,7 +29,7 @@ public class CraftBeacon extends CraftBlockEntityState implem +@@ -28,7 +28,7 @@ public class CraftBeacon extends CraftBlockEntityState implem if (tileEntity instanceof BeaconBlockEntity) { BeaconBlockEntity beacon = (BeaconBlockEntity) tileEntity; @@ -107,7 +107,7 @@ index c186a44b927188ed222f8b2f8f76aaef35d9c654..c47e613cae3d9252a8364ccc4d717e41 Collection bukkit = new ArrayList(nms.size()); for (Player human : nms) { -@@ -106,4 +106,21 @@ public class CraftBeacon extends CraftBlockEntityState implem +@@ -105,4 +105,21 @@ public class CraftBeacon extends CraftBlockEntityState implem public void setLock(String key) { this.getSnapshot().lockKey = (key == null) ? LockCode.NO_LOCK : new LockCode(key); } diff --git a/patches/unapplied/server/0490-Add-API-for-quit-reason.patch b/patches/server/0482-Add-API-for-quit-reason.patch similarity index 65% rename from patches/unapplied/server/0490-Add-API-for-quit-reason.patch rename to patches/server/0482-Add-API-for-quit-reason.patch index c5933dd497..12b7d58849 100644 --- a/patches/unapplied/server/0490-Add-API-for-quit-reason.patch +++ b/patches/server/0482-Add-API-for-quit-reason.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add API for quit reason diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 959d39e81cdde6fda90fcc95f842146448b4c6e4..a1467e8edd3ca66c306d01e0688a9fece69652f3 100644 +index a147c5e1929e8034b28af56f561f86478684fd08..7a98ea71fead97d3e18fa9774eb970359c18d931 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -182,12 +182,15 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -167,12 +167,15 @@ public class Connection extends SimpleChannelInboundHandler> { this.handlingFault = true; if (this.channel.isOpen()) { @@ -23,25 +23,25 @@ index 959d39e81cdde6fda90fcc95f842146448b4c6e4..a1467e8edd3ca66c306d01e0688a9fec + if (player != null) player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.ERRONEOUS_STATE; // Paper if (flag) { Connection.LOGGER.debug("Failed to sent packet", throwable); - ConnectionProtocol enumprotocol = this.getCurrentProtocol(); + 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 e087b62f88157d57eb037feb0d39c076b286f755..0b81878a951643af1ce785b3adcca9b3eec7f1c3 100644 +index 0661ed6cac8da2a1cc94abe7e1017fcd04a9e9c2..33f04964a2a56d36853d5ef53b79535bc56e7290 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -275,6 +275,7 @@ public class ServerPlayer extends Player { +@@ -272,6 +272,7 @@ public class ServerPlayer extends Player { public boolean isRealPlayer; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper + public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event - private final java.util.concurrent.atomic.AtomicReference viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1)); - public io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader; -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 06ccc5d528fe5411de306d787b705f7863777dc6..c115d103cbc28a511aedcdcd40ce6a50a777b102 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -509,6 +509,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure + 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 cce6febce229abdad859f183716cdefbec4a8f2e..a38ad79aaf4ef5a928370152bdc5c0cc4c59d93e 100644 +--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +@@ -305,6 +305,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + final Component ichatbasecomponent = io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()); // Paper - Adventure // CraftBukkit end + this.player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.KICKED; // Paper @@ -49,15 +49,15 @@ index 06ccc5d528fe5411de306d787b705f7863777dc6..c115d103cbc28a511aedcdcd40ce6a50 this.connection.disconnect(ichatbasecomponent); })); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 31e6da864b0ddf2f65ecc43ce8ef74d6c4e9d0aa..4d04cb528044d1e09687b80f9c6c7280bd2624ae 100644 +index 426594705780125607b9cd88f30f59bec949f882..75cf90dc8d061578b960b5f6f918b69d14e488ac 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -573,7 +573,7 @@ public abstract class PlayerList { +@@ -560,7 +560,7 @@ public abstract class PlayerList { entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper } -- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : PaperAdventure.asAdventure(entityplayer.getDisplayName()))); // Paper - Adventure -+ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : PaperAdventure.asAdventure(entityplayer.getDisplayName())), entityplayer.quitReason); // Paper - Adventure & quit reason +- PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName()))); // Paper - Adventure ++ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())), entityplayer.quitReason); // Paper - Adventure & quit reason this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); diff --git a/patches/unapplied/server/0491-Add-Wandering-Trader-spawn-rate-config-options.patch b/patches/server/0483-Add-Wandering-Trader-spawn-rate-config-options.patch similarity index 100% rename from patches/unapplied/server/0491-Add-Wandering-Trader-spawn-rate-config-options.patch rename to patches/server/0483-Add-Wandering-Trader-spawn-rate-config-options.patch diff --git a/patches/unapplied/server/0492-Expose-world-spawn-angle.patch b/patches/server/0484-Expose-world-spawn-angle.patch similarity index 87% rename from patches/unapplied/server/0492-Expose-world-spawn-angle.patch rename to patches/server/0484-Expose-world-spawn-angle.patch index b2ae742217..4b0fcd58ec 100644 --- a/patches/unapplied/server/0492-Expose-world-spawn-angle.patch +++ b/patches/server/0484-Expose-world-spawn-angle.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose world spawn angle diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 4d04cb528044d1e09687b80f9c6c7280bd2624ae..a474db28f74b698621342510d01bf38775794a8e 100644 +index 75cf90dc8d061578b960b5f6f918b69d14e488ac..ceb8e91ba1f14a6d6ab516753f87bbd5b681a18a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -837,7 +837,7 @@ public abstract class PlayerList { +@@ -832,7 +832,7 @@ public abstract class PlayerList { if (location == null) { worldserver1 = this.server.getLevel(Level.OVERWORLD); blockposition = entityplayer1.getSpawnPoint(worldserver1); diff --git a/patches/unapplied/server/0493-Add-Destroy-Speed-API.patch b/patches/server/0485-Add-Destroy-Speed-API.patch similarity index 100% rename from patches/unapplied/server/0493-Add-Destroy-Speed-API.patch rename to patches/server/0485-Add-Destroy-Speed-API.patch diff --git a/patches/unapplied/server/0494-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0486-Fix-Player-spawnParticle-x-y-z-precision-loss.patch similarity index 89% rename from patches/unapplied/server/0494-Fix-Player-spawnParticle-x-y-z-precision-loss.patch rename to patches/server/0486-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index b4986fc3eb..25591bbee8 100644 --- a/patches/unapplied/server/0494-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0486-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 63160efd1f5b555d024264edec479aa99e2b519b..309b489c11387a0a3555813a848b7be978ba2529 100644 +index f842cbe25832b17d7225132eea0bd7704c8c6f08..f4572fdcb6cfbfed75436cdd3a9a829b7f47fe3f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2520,7 +2520,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2494,7 +2494,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (data != null) { Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType()); } diff --git a/patches/unapplied/server/0495-Add-LivingEntity-clearActiveItem.patch b/patches/server/0487-Add-LivingEntity-clearActiveItem.patch similarity index 90% rename from patches/unapplied/server/0495-Add-LivingEntity-clearActiveItem.patch rename to patches/server/0487-Add-LivingEntity-clearActiveItem.patch index 7f1162da57..d761380070 100644 --- a/patches/unapplied/server/0495-Add-LivingEntity-clearActiveItem.patch +++ b/patches/server/0487-Add-LivingEntity-clearActiveItem.patch @@ -5,7 +5,7 @@ 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 4bb7c18bcf5c551fa5121745938a9fa76d2a7173..fa6b00e3055224a53eb6ec93431d70df27b6c6d1 100644 +index a0da8d022b9ab9c7b6ac6a32022739e863c2c9a0..833c1d37fde5e726933da6ac0076c6ea072389ca 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -887,6 +887,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/patches/unapplied/server/0496-Add-PlayerItemCooldownEvent.patch b/patches/server/0488-Add-PlayerItemCooldownEvent.patch similarity index 100% rename from patches/unapplied/server/0496-Add-PlayerItemCooldownEvent.patch rename to patches/server/0488-Add-PlayerItemCooldownEvent.patch diff --git a/patches/unapplied/server/0497-Significantly-improve-performance-of-the-end-generat.patch b/patches/server/0489-Significantly-improve-performance-of-the-end-generat.patch similarity index 100% rename from patches/unapplied/server/0497-Significantly-improve-performance-of-the-end-generat.patch rename to patches/server/0489-Significantly-improve-performance-of-the-end-generat.patch diff --git a/patches/unapplied/server/0498-More-lightning-API.patch b/patches/server/0490-More-lightning-API.patch similarity index 100% rename from patches/unapplied/server/0498-More-lightning-API.patch rename to patches/server/0490-More-lightning-API.patch diff --git a/patches/unapplied/server/0499-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0491-Climbing-should-not-bypass-cramming-gamerule.patch similarity index 86% rename from patches/unapplied/server/0499-Climbing-should-not-bypass-cramming-gamerule.patch rename to patches/server/0491-Climbing-should-not-bypass-cramming-gamerule.patch index 4e311cc370..2edeae6de1 100644 --- a/patches/unapplied/server/0499-Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/0491-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 73a2ddf2806ea1e1826d553b7d13cf4d58be43fc..01c5a986d7d5c87cb7bf574a2f59e57dd5b347e2 100644 +index a1f704600b8b4a43e05584cefdbeedacde6f2ed2..b8c41d759858fcb7b5db48351f352deac7796634 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2049,6 +2049,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1972,6 +1972,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public boolean isPushable() { @@ -45,10 +45,10 @@ index d15e62da0307728a7c2be191a27f87da1bb29f49..de06ae3e8757c923a6f3f475a34885d2 } else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) { 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 7b0e6f975ee00be6fc36c22ef586d4f0d4ce06ee..e4fd0bc35064e7962c7e43f9d0ee502463a6085f 100644 +index 4d9149d3a1d5711b88ce86fb34dbdc926cbe8c31..6b877e084caf931f8f0908c657ed0c8b6124a165 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3398,7 +3398,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3427,7 +3427,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 @@ -57,7 +57,7 @@ index 7b0e6f975ee00be6fc36c22ef586d4f0d4ce06ee..e4fd0bc35064e7962c7e43f9d0ee5024 if (!list.isEmpty()) { // Paper - moved up -@@ -3558,9 +3558,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3617,9 +3617,16 @@ public abstract class LivingEntity extends Entity implements Attackable { return !this.isRemoved() && this.collides; // CraftBukkit } @@ -89,10 +89,10 @@ index 867717f130b6fcd48f39d40b10b3f514dbb8798c..5beaa849a250ea005733250ad3edfa83 } 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 2f5056b00e4475906ffb1f1938cacb191169809d..e1874aaa0065a6e8e6ae043713c22f08b58b5e21 100644 +index e110931ee13ac3e64e455eaa7a30b96d9464df58..397264d31992fd43bd57736c25693ae001330b6d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -@@ -381,8 +381,8 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder { +@@ -163,7 +163,7 @@ public class Boat extends Entity implements VariantHolder { } @Override diff --git a/patches/unapplied/server/0500-Added-missing-default-perms-for-commands.patch b/patches/server/0492-Added-missing-default-perms-for-commands.patch similarity index 100% rename from patches/unapplied/server/0500-Added-missing-default-perms-for-commands.patch rename to patches/server/0492-Added-missing-default-perms-for-commands.patch diff --git a/patches/unapplied/server/0501-Add-PlayerShearBlockEvent.patch b/patches/server/0493-Add-PlayerShearBlockEvent.patch similarity index 95% rename from patches/unapplied/server/0501-Add-PlayerShearBlockEvent.patch rename to patches/server/0493-Add-PlayerShearBlockEvent.patch index 9a31074c99..56a84bee18 100644 --- a/patches/unapplied/server/0501-Add-PlayerShearBlockEvent.patch +++ b/patches/server/0493-Add-PlayerShearBlockEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerShearBlockEvent diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java -index 97ae550e388a8fa139fa36b830351f233db5da86..26f928ad94aed7f1078a31d8a0af2dc377a48d0f 100644 +index 9d61c9ada132af89292a5da7d3cce7777a961c13..61539bd963acf46f5f05865b235f9dbc05c771c3 100644 --- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java -@@ -113,7 +113,7 @@ public class BeehiveBlock extends BaseEntityBlock { +@@ -120,7 +120,7 @@ public class BeehiveBlock extends BaseEntityBlock { } public static void dropHoneycomb(Level world, BlockPos pos) { @@ -17,7 +17,7 @@ index 97ae550e388a8fa139fa36b830351f233db5da86..26f928ad94aed7f1078a31d8a0af2dc3 } @Override -@@ -126,8 +126,19 @@ public class BeehiveBlock extends BaseEntityBlock { +@@ -133,8 +133,19 @@ public class BeehiveBlock extends BaseEntityBlock { Item item = itemstack.getItem(); if (itemstack.is(Items.SHEARS)) { diff --git a/patches/unapplied/server/0502-Fix-curing-zombie-villager-discount-exploit.patch b/patches/server/0494-Fix-curing-zombie-villager-discount-exploit.patch similarity index 91% rename from patches/unapplied/server/0502-Fix-curing-zombie-villager-discount-exploit.patch rename to patches/server/0494-Fix-curing-zombie-villager-discount-exploit.patch index dd95f1314d..e659267ea0 100644 --- a/patches/unapplied/server/0502-Fix-curing-zombie-villager-discount-exploit.patch +++ b/patches/server/0494-Fix-curing-zombie-villager-discount-exploit.patch @@ -8,10 +8,10 @@ and curing a villager on repeat by simply resetting the relevant part of the reputation when it is cured. 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 24434b66d158b10d21579b2db6efb0bdcc788a5c..4bef7abbed6b64c2f126c81af5484eff200e620f 100644 +index f58be4e2529759cc64df2c70a69ef56eabbb762d..84cee8fb09f90424438de336f60d9388da1b39de 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -1000,6 +1000,15 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -1009,6 +1009,15 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override public void onReputationEventFrom(ReputationEventType interaction, Entity entity) { if (interaction == ReputationEventType.ZOMBIE_VILLAGER_CURED) { diff --git a/patches/unapplied/server/0503-Limit-recipe-packets.patch b/patches/server/0495-Limit-recipe-packets.patch similarity index 86% rename from patches/unapplied/server/0503-Limit-recipe-packets.patch rename to patches/server/0495-Limit-recipe-packets.patch index 402bbade0f..51678f9f15 100644 --- a/patches/unapplied/server/0503-Limit-recipe-packets.patch +++ b/patches/server/0495-Limit-recipe-packets.patch @@ -5,10 +5,10 @@ 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 c115d103cbc28a511aedcdcd40ce6a50a777b102..cb0cfd2d6b5e45771c99bd0b8dd5debd29064c7b 100644 +index a4345db5d89b1a2384f4cab421946f05bf846687..38310db2a998dbac413eb73f128a9a945bcff100 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -268,6 +268,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -254,6 +254,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 @@ -16,7 +16,7 @@ index c115d103cbc28a511aedcdcd40ce6a50a777b102..cb0cfd2d6b5e45771c99bd0b8dd5debd // CraftBukkit end private int dropSpamTickCount; private double firstGoodX; -@@ -420,6 +421,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -375,6 +376,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 - split to seperate variable @@ -24,7 +24,7 @@ index c115d103cbc28a511aedcdcd40ce6a50a777b102..cb0cfd2d6b5e45771c99bd0b8dd5debd /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -3115,6 +3117,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2967,6 +2969,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { diff --git a/patches/unapplied/server/0504-Fix-CraftSound-backwards-compatibility.patch b/patches/server/0496-Fix-CraftSound-backwards-compatibility.patch similarity index 100% rename from patches/unapplied/server/0504-Fix-CraftSound-backwards-compatibility.patch rename to patches/server/0496-Fix-CraftSound-backwards-compatibility.patch diff --git a/patches/server/0497-Player-Chunk-Load-Unload-Events.patch b/patches/server/0497-Player-Chunk-Load-Unload-Events.patch new file mode 100644 index 0000000000..acdb2ea099 --- /dev/null +++ b/patches/server/0497-Player-Chunk-Load-Unload-Events.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: ysl3000 +Date: Mon, 5 Oct 2020 21:25:16 +0200 +Subject: [PATCH] Player Chunk Load/Unload Events + + +diff --git a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java +index c509a1318bcef38fd4927e38b6ee9846853e2d15..c442be2119fcf5b4540b0b873519c64a1367c1f4 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java ++++ b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java +@@ -45,6 +45,11 @@ public class PlayerChunkSender { + public void dropChunk(ServerPlayer player, ChunkPos pos) { + if (!this.pendingChunks.remove(pos.toLong()) && player.isAlive()) { + player.connection.send(new ClientboundForgetLevelChunkPacket(pos)); ++ // Paper start ++ if(io.papermc.paper.event.packet.PlayerChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0){ ++ new io.papermc.paper.event.packet.PlayerChunkUnloadEvent(player.getBukkitEntity().getWorld().getChunkAt(pos.longKey), player.getBukkitEntity()).callEvent(); ++ } ++ // Paper end + } + + } +@@ -77,6 +82,11 @@ public class PlayerChunkSender { + + private static void sendChunk(ServerGamePacketListenerImpl handler, ServerLevel world, LevelChunk chunk) { + handler.send(new ClientboundLevelChunkWithLightPacket(chunk, world.getLightEngine(), (BitSet)null, (BitSet)null)); ++ // Paper start ++ if(io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0){ ++ new io.papermc.paper.event.packet.PlayerChunkLoadEvent(new org.bukkit.craftbukkit.CraftChunk(chunk), handler.getPlayer().getBukkitEntity()).callEvent(); ++ } ++ // Paper end + ChunkPos chunkPos = chunk.getPos(); + DebugPackets.sendPoiPacketsForChunk(world, chunkPos); + } diff --git a/patches/unapplied/server/0506-Optimize-Dynamic-get-Missing-Keys.patch b/patches/server/0498-Optimize-Dynamic-get-Missing-Keys.patch similarity index 100% rename from patches/unapplied/server/0506-Optimize-Dynamic-get-Missing-Keys.patch rename to patches/server/0498-Optimize-Dynamic-get-Missing-Keys.patch diff --git a/patches/unapplied/server/0507-Expose-LivingEntity-hurt-direction.patch b/patches/server/0499-Expose-LivingEntity-hurt-direction.patch similarity index 86% rename from patches/unapplied/server/0507-Expose-LivingEntity-hurt-direction.patch rename to patches/server/0499-Expose-LivingEntity-hurt-direction.patch index c7e1090f6c..12b46ea681 100644 --- a/patches/unapplied/server/0507-Expose-LivingEntity-hurt-direction.patch +++ b/patches/server/0499-Expose-LivingEntity-hurt-direction.patch @@ -5,10 +5,10 @@ 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 a8731cf957da9aad7ed6f5d372500bc34afd32ca..b36492efc3d6338e0099988c1ff31e7211b7d010 100644 +index 00d9dd5affd62ceb35bb783d6bcc9e1e600c0fb4..c44f8ed810b0c9a510d7e1c07987323a8a620ca4 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -182,7 +182,7 @@ public abstract class Player extends LivingEntity { +@@ -183,7 +183,7 @@ public abstract class Player extends LivingEntity { private Optional lastDeathLocation; @Nullable public FishingHook fishing; @@ -18,7 +18,7 @@ index a8731cf957da9aad7ed6f5d372500bc34afd32ca..b36492efc3d6338e0099988c1ff31e72 public boolean affectsSpawning = true; // Paper end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index f4cda5fbf12c59dc1ecec4aac6719837444382e2..8d1bbc1ac3dbc10e940a0715ebfa1d5a2674b303 100644 +index 05d9a9968588381aaa3aeb06ef4d18fed4085229..c9f4f496a92ff8465a21f22f326dc025aa8bd169 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -126,6 +126,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -36,7 +36,7 @@ index f4cda5fbf12c59dc1ecec4aac6719837444382e2..8d1bbc1ac3dbc10e940a0715ebfa1d5a 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 fa6b00e3055224a53eb6ec93431d70df27b6c6d1..eae5d75cd93416235690196cf2c88e7a17e1b97a 100644 +index 833c1d37fde5e726933da6ac0076c6ea072389ca..4d41a73281c851c1ff9506074f7590c06105efbb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -932,5 +932,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/patches/unapplied/server/0508-Add-OBSTRUCTED-reason-to-BedEnterResult.patch b/patches/server/0500-Add-OBSTRUCTED-reason-to-BedEnterResult.patch similarity index 86% rename from patches/unapplied/server/0508-Add-OBSTRUCTED-reason-to-BedEnterResult.patch rename to patches/server/0500-Add-OBSTRUCTED-reason-to-BedEnterResult.patch index 2615ae803b..b5cb8b8973 100644 --- a/patches/unapplied/server/0508-Add-OBSTRUCTED-reason-to-BedEnterResult.patch +++ b/patches/server/0500-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 ab6f24426031d47d25fcf94421569a3276cdca9a..a82a5fd54a962fdcf86f2bc139085ed526cade5e 100644 +index 9bdfb16720c9e5ca3254f8ea8463ca10077992ea..84941643036e4dc1cf135a24360e6a1c011969d5 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -300,6 +300,10 @@ public class CraftEventFactory { +@@ -302,6 +302,10 @@ public class CraftEventFactory { return BedEnterResult.TOO_FAR_AWAY; case NOT_SAFE: return BedEnterResult.NOT_SAFE; diff --git a/patches/unapplied/server/0509-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch b/patches/server/0501-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch similarity index 86% rename from patches/unapplied/server/0509-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch rename to patches/server/0501-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch index 94e14e3d19..d84f8bed22 100644 --- a/patches/unapplied/server/0509-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch +++ b/patches/server/0501-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Do not 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 0a62cf36a95d7bf1287acdd17464fc677c7a4b7d..fe003c42f002e229111c46a79ac6a961c60db912 100644 +index 629b79c6e59944994295768904c449733764cf99..3dfe2c483f76d0ba11674b3c4e05e33daebeedb5 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -@@ -275,7 +275,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa +@@ -261,7 +261,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa Bukkit.getPluginManager().callEvent(event); } if (!event.isCancelled()) { @@ -21,4 +21,4 @@ index 0a62cf36a95d7bf1287acdd17464fc677c7a4b7d..fe003c42f002e229111c46a79ac6a961 + // Paper end } // CraftBukkit end - } + ++j; diff --git a/patches/unapplied/server/0510-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch b/patches/server/0502-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch similarity index 97% rename from patches/unapplied/server/0510-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch rename to patches/server/0502-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch index fae98b6a21..456c819cfa 100644 --- a/patches/unapplied/server/0510-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch +++ b/patches/server/0502-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add PlayerTradeEvent and PlayerPurchaseEvent Co-authored-by: Alexander 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 fe003c42f002e229111c46a79ac6a961c60db912..564908ce0a560c2190fb624e77d227d3b7031024 100644 +index 3dfe2c483f76d0ba11674b3c4e05e33daebeedb5..5119d070dbb04f5a4f9c2def526e33e15ca8573f 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -@@ -138,11 +138,24 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa +@@ -137,11 +137,24 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa @Override public void overrideXp(int experience) {} @@ -37,7 +37,7 @@ index fe003c42f002e229111c46a79ac6a961c60db912..564908ce0a560c2190fb624e77d227d3 CriteriaTriggers.TRADE.trigger((ServerPlayer) this.tradingPlayer, this, offer.getResult()); } diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 85a6bc46817c7272855a7f3aa8c206d7b3f8512e..4ac91ba7dc754b120189fd32d24076d51b17d7c6 100644 +index 35b2e4853c2791a39ebfd75c4c0208c998a43160..877b80ef3028acd9a783adf933286be0a86227bf 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -756,6 +756,14 @@ public abstract class AbstractContainerMenu { @@ -207,7 +207,7 @@ index e49bbb803399ef696665c5844a18b55a551654f6..1f2b9a9a3fa167e2ba021c823dd142b0 this.slots.setItem(0, itemStack); this.slots.setItem(1, itemStack2); diff --git a/src/main/java/net/minecraft/world/item/trading/Merchant.java b/src/main/java/net/minecraft/world/item/trading/Merchant.java -index d41f44ed2e497ba3373d170c08488b49e88334c4..d3a99ba6f3085ad12b67ddc94cc4ab393ec7ecbe 100644 +index 5a350948a4735902f5c612592bc9d100445a0c8a..716b30dcd7e63c66736c448dd136c9f74dc7fe43 100644 --- a/src/main/java/net/minecraft/world/item/trading/Merchant.java +++ b/src/main/java/net/minecraft/world/item/trading/Merchant.java @@ -20,6 +20,7 @@ public interface Merchant { diff --git a/patches/unapplied/server/0511-Implement-TargetHitEvent.patch b/patches/server/0503-Implement-TargetHitEvent.patch similarity index 100% rename from patches/unapplied/server/0511-Implement-TargetHitEvent.patch rename to patches/server/0503-Implement-TargetHitEvent.patch diff --git a/patches/unapplied/server/0512-MC-4-Fix-item-position-desync.patch b/patches/server/0504-MC-4-Fix-item-position-desync.patch similarity index 84% rename from patches/unapplied/server/0512-MC-4-Fix-item-position-desync.patch rename to patches/server/0504-MC-4-Fix-item-position-desync.patch index 8d6bf2c087..5559b6862a 100644 --- a/patches/unapplied/server/0512-MC-4-Fix-item-position-desync.patch +++ b/patches/server/0504-MC-4-Fix-item-position-desync.patch @@ -9,7 +9,7 @@ loss, which forces the server to lose the same precision as the client keeping them in sync. diff --git a/src/main/java/net/minecraft/network/protocol/game/VecDeltaCodec.java b/src/main/java/net/minecraft/network/protocol/game/VecDeltaCodec.java -index 5ca3ad7b3d7606accd0a58b3c708fadb349608f7..4b6e0fe2fabcc55007fd8979e81f66df9c0278b7 100644 +index 05ac41e136da43284fb24a6b698ebd36318278fb..33d9131e9c75ef23cd637f5d6c39a2704a0c92a5 100644 --- a/src/main/java/net/minecraft/network/protocol/game/VecDeltaCodec.java +++ b/src/main/java/net/minecraft/network/protocol/game/VecDeltaCodec.java @@ -9,12 +9,12 @@ public class VecDeltaCodec { @@ -28,13 +28,13 @@ index 5ca3ad7b3d7606accd0a58b3c708fadb349608f7..4b6e0fe2fabcc55007fd8979e81f66df public Vec3 decode(long x, long y, long z) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 01c5a986d7d5c87cb7bf574a2f59e57dd5b347e2..1bca9f5d58c5adfff3610ab1e7296de3647adaec 100644 +index b8c41d759858fcb7b5db48351f352deac7796634..37906167da097b6a6308e8c358d6a344c605d550 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4221,6 +4221,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - return; - } - // Paper end - rewrite chunk system +@@ -4147,6 +4147,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + } + public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) { + // Paper end + // Paper start - fix MC-4 + if (this instanceof ItemEntity) { + if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.fixEntityPositionDesync) { diff --git a/patches/unapplied/server/0513-Additional-Block-Material-API-s.patch b/patches/server/0505-Additional-Block-Material-API-s.patch similarity index 100% rename from patches/unapplied/server/0513-Additional-Block-Material-API-s.patch rename to patches/server/0505-Additional-Block-Material-API-s.patch diff --git a/patches/unapplied/server/0514-Fix-harming-potion-dupe.patch b/patches/server/0506-Fix-harming-potion-dupe.patch similarity index 100% rename from patches/unapplied/server/0514-Fix-harming-potion-dupe.patch rename to patches/server/0506-Fix-harming-potion-dupe.patch diff --git a/patches/unapplied/server/0515-Implement-API-to-get-Material-from-Boats-and-Minecar.patch b/patches/server/0507-Implement-API-to-get-Material-from-Boats-and-Minecar.patch similarity index 100% rename from patches/unapplied/server/0515-Implement-API-to-get-Material-from-Boats-and-Minecar.patch rename to patches/server/0507-Implement-API-to-get-Material-from-Boats-and-Minecar.patch diff --git a/patches/unapplied/server/0516-Cache-burn-durations.patch b/patches/server/0508-Cache-burn-durations.patch similarity index 94% rename from patches/unapplied/server/0516-Cache-burn-durations.patch rename to patches/server/0508-Cache-burn-durations.patch index 0b0a8c2b0e..c4372f6401 100644 --- a/patches/unapplied/server/0516-Cache-burn-durations.patch +++ b/patches/server/0508-Cache-burn-durations.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Cache burn durations diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 40dc29288a13ae9c1f8b0434922fdb5c7d02daa9..5ea9a6e9fa197fd00952c5ade426d7de50497a5e 100644 +index d7a89c2b70de20f632ee210780ede0bc36369710..b6e31bede16f7dbc9abb6609f1c39b82883512b2 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java @@ -133,7 +133,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit diff --git a/patches/unapplied/server/0517-Allow-disabling-mob-spawner-spawn-egg-transformation.patch b/patches/server/0509-Allow-disabling-mob-spawner-spawn-egg-transformation.patch similarity index 100% rename from patches/unapplied/server/0517-Allow-disabling-mob-spawner-spawn-egg-transformation.patch rename to patches/server/0509-Allow-disabling-mob-spawner-spawn-egg-transformation.patch diff --git a/patches/unapplied/server/0518-Fix-Not-a-string-Map-Conversion-spam.patch b/patches/server/0510-Fix-Not-a-string-Map-Conversion-spam.patch similarity index 94% rename from patches/unapplied/server/0518-Fix-Not-a-string-Map-Conversion-spam.patch rename to patches/server/0510-Fix-Not-a-string-Map-Conversion-spam.patch index 087de88608..38593b84f5 100644 --- a/patches/unapplied/server/0518-Fix-Not-a-string-Map-Conversion-spam.patch +++ b/patches/server/0510-Fix-Not-a-string-Map-Conversion-spam.patch @@ -12,7 +12,7 @@ requesting the world. Track spigot issue to see when fixed: https://hub.spigotmc.org/jira/browse/SPIGOT-6181 diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -index d6ed799716f13cb3f72e66f9d57c6ec90c1eb272..7a6fbd4be33e93c7f09b1ed146ae25fe6c6b503c 100644 +index e1623ade449fe56ec51955ee9594a93f85660c51..5992f450f01349ce49286c34b8af56737de01a45 100644 --- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java @@ -15,6 +15,8 @@ import net.minecraft.core.BlockPos; @@ -24,7 +24,7 @@ index d6ed799716f13cb3f72e66f9d57c6ec90c1eb272..7a6fbd4be33e93c7f09b1ed146ae25fe import net.minecraft.nbt.Tag; import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.Packet; -@@ -103,7 +105,26 @@ public class MapItemSavedData extends SavedData { +@@ -110,7 +112,26 @@ public class MapItemSavedData extends SavedData { } public static MapItemSavedData load(CompoundTag nbt) { diff --git a/patches/unapplied/server/0519-Implement-PlayerFlowerPotManipulateEvent.patch b/patches/server/0511-Implement-PlayerFlowerPotManipulateEvent.patch similarity index 100% rename from patches/unapplied/server/0519-Implement-PlayerFlowerPotManipulateEvent.patch rename to patches/server/0511-Implement-PlayerFlowerPotManipulateEvent.patch diff --git a/patches/unapplied/server/0520-Fix-interact-event-not-being-called-sometimes.patch b/patches/server/0512-Fix-interact-event-not-being-called-sometimes.patch similarity index 92% rename from patches/unapplied/server/0520-Fix-interact-event-not-being-called-sometimes.patch rename to patches/server/0512-Fix-interact-event-not-being-called-sometimes.patch index e719b0d48b..4e8f00d979 100644 --- a/patches/unapplied/server/0520-Fix-interact-event-not-being-called-sometimes.patch +++ b/patches/server/0512-Fix-interact-event-not-being-called-sometimes.patch @@ -11,10 +11,10 @@ Subject: [PATCH] Fix interact event not being called sometimes Co-authored-by: Moulberry diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cb0cfd2d6b5e45771c99bd0b8dd5debd29064c7b..240b1f8efa672fb6d1967ef2b895c6710596e2cd 100644 +index 38310db2a998dbac413eb73f128a9a945bcff100..2921754736ce51b76337e1ef9d052e680af01db5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1839,7 +1839,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1726,7 +1726,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl MutableComponent ichatmutablecomponent = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED); this.player.sendSystemMessage(ichatmutablecomponent, true); @@ -23,7 +23,7 @@ index cb0cfd2d6b5e45771c99bd0b8dd5debd29064c7b..240b1f8efa672fb6d1967ef2b895c671 this.player.swing(enumhand, true); } } -@@ -2447,13 +2447,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2288,13 +2288,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl double d3 = player.gameMode.getGameModeForPlayer() == GameType.CREATIVE ? 5.0D : 4.5D; // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time // SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities diff --git a/patches/unapplied/server/0521-Zombie-API-breaking-doors.patch b/patches/server/0513-Zombie-API-breaking-doors.patch similarity index 100% rename from patches/unapplied/server/0521-Zombie-API-breaking-doors.patch rename to patches/server/0513-Zombie-API-breaking-doors.patch diff --git a/patches/unapplied/server/0522-Fix-nerfed-slime-when-splitting.patch b/patches/server/0514-Fix-nerfed-slime-when-splitting.patch similarity index 83% rename from patches/unapplied/server/0522-Fix-nerfed-slime-when-splitting.patch rename to patches/server/0514-Fix-nerfed-slime-when-splitting.patch index ca1a39e53c..d2beca8665 100644 --- a/patches/unapplied/server/0522-Fix-nerfed-slime-when-splitting.patch +++ b/patches/server/0514-Fix-nerfed-slime-when-splitting.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix nerfed slime when splitting diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java -index 30779b817db6f8e392036b4ec66e1c5cf50cd0f5..b0c5324dadc0a66786ec5edb7b4796ceeaa8e0d2 100644 +index 4677e47e4a84d09025cfb9327c1ed3bead1a3feb..21311d67565443b4ef59f8676f616237d28a8084 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java -@@ -241,6 +241,7 @@ public class Slime extends Mob implements Enemy { +@@ -243,6 +243,7 @@ public class Slime extends Mob implements Enemy { entityslime.setPersistenceRequired(); } diff --git a/patches/unapplied/server/0523-Add-EntityLoadCrossbowEvent.patch b/patches/server/0515-Add-EntityLoadCrossbowEvent.patch similarity index 100% rename from patches/unapplied/server/0523-Add-EntityLoadCrossbowEvent.patch rename to patches/server/0515-Add-EntityLoadCrossbowEvent.patch diff --git a/patches/unapplied/server/0524-Added-WorldGameRuleChangeEvent.patch b/patches/server/0516-Added-WorldGameRuleChangeEvent.patch similarity index 92% rename from patches/unapplied/server/0524-Added-WorldGameRuleChangeEvent.patch rename to patches/server/0516-Added-WorldGameRuleChangeEvent.patch index c0cc1dd4f6..5cadd41d0c 100644 --- a/patches/unapplied/server/0524-Added-WorldGameRuleChangeEvent.patch +++ b/patches/server/0516-Added-WorldGameRuleChangeEvent.patch @@ -18,10 +18,10 @@ index c8c358531dbc167e249bac2af246c5e34fbdd4df..307854468ac985560b4c63b6e9897c44 return Component.translatable("commands.gamerule.set", key.getId(), t0.toString()); }, true); diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java -index 4a0321f56ef80aa4991e61f586ddd3f6b45e499b..de713f1ca1d61a6b1fca2b66de9162556d102449 100644 +index 6a1001cb708a7f779a801428d2b00fbcde888bc1..2e240ad721928a9a68370114ba61c21884ef1472 100644 --- a/src/main/java/net/minecraft/world/level/GameRules.java +++ b/src/main/java/net/minecraft/world/level/GameRules.java -@@ -271,10 +271,10 @@ public class GameRules { +@@ -281,10 +281,10 @@ public class GameRules { this.type = type; } @@ -35,7 +35,7 @@ index 4a0321f56ef80aa4991e61f586ddd3f6b45e499b..de713f1ca1d61a6b1fca2b66de916255 this.onChanged(((CommandSourceStack) context.getSource()).getServer()); } -@@ -332,8 +332,11 @@ public class GameRules { +@@ -342,8 +342,11 @@ public class GameRules { } @Override @@ -49,7 +49,7 @@ index 4a0321f56ef80aa4991e61f586ddd3f6b45e499b..de713f1ca1d61a6b1fca2b66de916255 } public boolean get() { -@@ -397,8 +400,11 @@ public class GameRules { +@@ -407,8 +410,11 @@ public class GameRules { } @Override @@ -64,10 +64,10 @@ index 4a0321f56ef80aa4991e61f586ddd3f6b45e499b..de713f1ca1d61a6b1fca2b66de916255 public int get() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e754bb3ce28c3bd253698e2065121aafdfe94230..3e5ba6392c25e2bf9503a5429e96ffb04147ac99 100644 +index b9a5d94c31b20a87ed96d8e85a28e63400353353..c4df1d66ecdecef0aa03d4995d9e951421dae6dd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1845,8 +1845,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1850,8 +1850,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!this.isGameRule(rule)) return false; @@ -82,7 +82,7 @@ index e754bb3ce28c3bd253698e2065121aafdfe94230..3e5ba6392c25e2bf9503a5429e96ffb0 handle.onChanged(this.getHandle().getServer()); return true; } -@@ -1882,8 +1887,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1887,8 +1892,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!this.isGameRule(rule.getName())) return false; diff --git a/patches/unapplied/server/0525-Added-ServerResourcesReloadedEvent.patch b/patches/server/0517-Added-ServerResourcesReloadedEvent.patch similarity index 93% rename from patches/unapplied/server/0525-Added-ServerResourcesReloadedEvent.patch rename to patches/server/0517-Added-ServerResourcesReloadedEvent.patch index 15bb8da191..7ee6c2bb39 100644 --- a/patches/unapplied/server/0525-Added-ServerResourcesReloadedEvent.patch +++ b/patches/server/0517-Added-ServerResourcesReloadedEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Added ServerResourcesReloadedEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8c9ebc501282e929503c39607048e032f05fbb9c..892830b2d9a15a832040fbeac5fca3d011082c27 100644 +index 22b1efc8927d6f168694b2bde957d960661bb1c4..2d2e7fe673962cdf21a7623b51e2731132cd3c01 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2008,7 +2008,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -2049,6 +2055,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop -Date: Sat, 11 Apr 2020 13:10:58 +0200 -Subject: [PATCH] Brand support - - -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 3ddf29100807d5882e20395466d420fb169c2f87..37e5b479a093184e7d8d05c13e69b2682b5dac92 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -304,6 +304,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit - private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper - -+ private String clientBrandName = null; // Paper - Brand name -+ - public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { - this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH); - this.lastSeenMessages = new LastSeenMessagesValidator(20); -@@ -3316,6 +3318,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register"); - private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister"); - -+ private static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support -+ - @Override - public void handleCustomPayload(ServerboundCustomPayloadPacket packet) { - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); -@@ -3343,6 +3347,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - try { - byte[] data = new byte[packet.data.readableBytes()]; - packet.data.readBytes(data); -+ // Paper start - Brand support -+ if (packet.identifier.equals(MINECRAFT_BRAND)) { -+ try { -+ this.clientBrandName = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.copiedBuffer(data)).readUtf(256); -+ } catch (StringIndexOutOfBoundsException ex) { -+ this.clientBrandName = "illegal"; -+ } -+ } -+ // Paper end - this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data); - } catch (Exception ex) { - ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); -@@ -3352,6 +3365,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - - } - -+ // Paper start - brand support -+ public String getClientBrandName() { -+ return clientBrandName; -+ } -+ // Paper end -+ - public final boolean isDisconnected() { - return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper - } -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index cb9482240de0d5d56be4ec591b4fbb23006767c1..c96efc055e44dcc7880abb3a6e7b4c441aa9a112 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2991,6 +2991,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - // Paper end - }; - -+ // Paper start - brand support -+ @Override -+ public String getClientBrandName() { -+ return getHandle().connection != null ? getHandle().connection.getClientBrandName() : null; -+ } -+ // Paper end -+ - public Player.Spigot spigot() - { - return this.spigot; diff --git a/patches/unapplied/server/0505-Player-Chunk-Load-Unload-Events.patch b/patches/unapplied/server/0505-Player-Chunk-Load-Unload-Events.patch deleted file mode 100644 index 0706058aa6..0000000000 --- a/patches/unapplied/server/0505-Player-Chunk-Load-Unload-Events.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: ysl3000 -Date: Mon, 5 Oct 2020 21:25:16 +0200 -Subject: [PATCH] Player Chunk Load/Unload Events - - -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 0b81878a951643af1ce785b3adcca9b3eec7f1c3..4581bdf4525c05df235e47ab772fbf5c5f2d6b50 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayer.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2232,11 +2232,21 @@ public class ServerPlayer extends Player { - - public void trackChunk(ChunkPos chunkPos, Packet chunkDataPacket) { - this.connection.send(chunkDataPacket); -+ // Paper start -+ if(io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0){ -+ new io.papermc.paper.event.packet.PlayerChunkLoadEvent(this.getBukkitEntity().getWorld().getChunkAt(chunkPos.longKey), this.getBukkitEntity()).callEvent(); -+ } -+ // Paper end - } - - public void untrackChunk(ChunkPos chunkPos) { - if (this.isAlive()) { - this.connection.send(new ClientboundForgetLevelChunkPacket(chunkPos.x, chunkPos.z)); -+ // Paper start -+ if(io.papermc.paper.event.packet.PlayerChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0){ -+ new io.papermc.paper.event.packet.PlayerChunkUnloadEvent(this.getBukkitEntity().getWorld().getChunkAt(chunkPos.longKey), this.getBukkitEntity()).callEvent(); -+ } -+ // Paper end - } - - } diff --git a/patches/unapplied/server/0438-Optimize-NetworkManager-Exception-Handling.patch b/patches/unapplied/skipped/0438-Optimize-NetworkManager-Exception-Handling.patch similarity index 100% rename from patches/unapplied/server/0438-Optimize-NetworkManager-Exception-Handling.patch rename to patches/unapplied/skipped/0438-Optimize-NetworkManager-Exception-Handling.patch diff --git a/patches/unapplied/server/0447-Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/unapplied/skipped/0447-Do-not-let-the-server-load-chunks-from-newer-version.patch similarity index 100% rename from patches/unapplied/server/0447-Do-not-let-the-server-load-chunks-from-newer-version.patch rename to patches/unapplied/skipped/0447-Do-not-let-the-server-load-chunks-from-newer-version.patch