From 7a133678da0a20507456bf3b2cbe943b989f5c42 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 27 Jul 2022 22:46:05 +0200 Subject: [PATCH] More more more work --- patches/server/0353-Anti-Xray.patch | 28 +++++++++----- ...implement-PlayerRecipeBookClickEvent.patch | 29 ++++++++++++++ ...9-Hide-sync-chunk-writes-behind-flag.patch | 2 +- ...40-Add-permission-for-command-blocks.patch | 6 +-- ...sure-Entity-AABB-s-are-never-invalid.patch | 6 +-- ...ld-Difficulty-Remembering-Difficulty.patch | 14 +++---- .../server/0443-Paper-dumpitem-command.patch | 0 ...444-Don-t-allow-null-UUID-s-for-chat.patch | 17 +++++---- ...-Legacy-Component-serialization-size.patch | 0 ...-Optimize-Bit-Operations-by-inlining.patch | 0 ...-Plugin-Tickets-to-API-Chunk-Methods.patch | 0 ...-incremental-chunk-and-player-saving.patch | 34 ++++++++--------- ...te-operations-for-updating-light-dat.patch | 0 ...0450-Support-old-UUID-format-for-NBT.patch | 4 +- ...up-duplicated-GameProfile-Properties.patch | 4 +- ...nvert-legacy-attributes-in-Item-Meta.patch | 0 ...-Remove-some-streams-from-structures.patch | 20 +++++----- ...from-classes-related-villager-gossip.patch | 0 .../0455-Support-components-in-ItemMeta.patch | 0 ...argetLivingEntityEvent-for-1.16-mobs.patch | 0 .../server/0457-Add-entity-liquid-API.patch | 0 ...pdate-itemstack-legacy-name-and-lore.patch | 2 +- ...awn-player-in-correct-world-on-login.patch | 4 +- .../server/0460-Add-PrepareResultEvent.patch | 4 +- ...k-for-portal-on-world-gen-entity-add.patch | 4 +- ...k-Priority-Urgency-System-for-Chunks.patch | 38 +++++++++---------- ...ze-NetworkManager-Exception-Handling.patch | 4 +- ...ancement-data-player-iteration-to-be.patch | 6 +-- ...ix-arrows-never-despawning-MC-125757.patch | 0 ...-Vanilla-Command-permission-checking.patch | 8 ++-- .../server/0467-Fix-SPIGOT-5989.patch | 10 ++--- ...4-Bukkit-world-container-is-not-used.patch | 0 ...-5885-Unable-to-disable-advancements.patch | 0 ...ataPlayer-leak-due-from-quitting-ear.patch | 14 ++----- ...keLighting-call-to-World-spigot-stri.patch | 0 ...Fix-some-rails-connecting-improperly.patch | 0 ...istake-in-CB-NBT-int-deserialization.patch | 0 ...erver-load-chunks-from-newer-version.patch | 0 .../server/0475-Brand-support.patch | 16 ++++---- .../server/0476-Add-setMaxPlayers-API.patch | 4 +- ...yPickupItemAnimation-to-LivingEntity.patch | 0 .../0478-Don-t-require-FACING-data.patch | 0 ...geEvent-not-firing-for-all-use-cases.patch | 4 +- .../server/0480-Add-moon-phase-API.patch | 0 ...mprove-Chunk-Status-Transition-Speed.patch | 6 +-- ...-headless-pistons-from-being-created.patch | 0 .../server/0483-Add-BellRingEvent.patch | 0 ...Add-zombie-targets-turtle-egg-config.patch | 0 .../server/0485-Buffer-joins-to-world.patch | 15 ++++---- ...6-Eigencraft-redstone-implementation.patch | 0 ...rs-not-working-in-some-kick-messages.patch | 4 +- ...CreateEvent-needs-to-know-its-entity.patch | 8 ++-- .../0489-Fix-CraftTeam-null-check.patch | 0 .../server/0490-Add-more-Evoker-API.patch | 0 ...-Add-methods-to-get-translation-keys.patch | 2 +- ...ate-HoverEvent-from-ItemStack-Entity.patch | 0 .../0493-Cache-block-data-strings.patch | 2 +- ...ortation-and-cancel-velocity-if-tele.patch | 10 ++--- ...al-open-container-api-to-HumanEntity.patch | 0 ...taFixerUpper-Rewrite-Rules-on-demand.patch | 0 ...p-capture-to-capture-all-items-added.patch | 4 +- ...rty-in-invalid-locations-SPIGOT-6086.patch | 0 ...y-Counter-to-allow-plugins-to-use-va.patch | 6 +-- ...-track-plugin-scoreboards-by-default.patch | 0 .../server/0501-Entity-isTicking.patch | 4 +- ...-non-whitelisted-player-when-white-l.patch | 2 +- ...x-Concurrency-issue-in-ShufflingList.patch | 0 ...Reset-Ender-Crystals-on-Dragon-Spawn.patch | 0 ...r-large-move-vectors-crashing-server.patch | 12 +++--- .../server/0506-Optimise-getType-calls.patch | 0 .../server/0507-Villager-resetOffers.patch | 0 ...inig-for-some-hot-IBlockData-methods.patch | 10 ++--- ...ace-order-when-capturing-blockstates.patch | 0 ...blockpos-allocation-from-pathfinding.patch | 0 ...tem-locations-dropped-from-campfires.patch | 0 .../server/0512-Player-elytra-boost-API.patch | 2 +- ...513-Fixed-TileEntityBell-memory-leak.patch | 0 ...ling-up-when-item-stack-is-empty-in-.patch | 0 ...-Add-getOfflinePlayerIfCached-String.patch | 0 .../0516-Add-ignore-discounts-API.patch | 0 ...-Toggle-for-removing-existing-dragon.patch | 0 ...ix-client-lag-on-advancement-loading.patch | 2 +- .../0519-Item-no-age-no-player-pickup.patch | 0 ...der-Remove-Streams-Optimized-collect.patch | 0 ...0521-Beacon-API-custom-effect-ranges.patch | 0 .../server/0522-Add-API-for-quit-reason.patch | 20 +++++----- ...ing-Trader-spawn-rate-config-options.patch | 0 .../0524-Expose-world-spawn-angle.patch | 4 +- .../server/0525-Add-Destroy-Speed-API.patch | 0 ...r-spawnParticle-x-y-z-precision-loss.patch | 2 +- ...527-Add-LivingEntity-clearActiveItem.patch | 0 .../0528-Add-PlayerItemCooldownEvent.patch | 0 ...prove-performance-of-the-end-generat.patch | 30 +++++++-------- .../server/0530-More-lightning-API.patch | 0 ...-should-not-bypass-cramming-gamerule.patch | 10 ++--- ...d-missing-default-perms-for-commands.patch | 0 .../0533-Add-PlayerShearBlockEvent.patch | 0 ...ing-zombie-villager-discount-exploit.patch | 0 .../server/0535-Limit-recipe-packets.patch | 8 ++-- ...implement-PlayerRecipeBookClickEvent.patch | 28 -------------- 100 files changed, 239 insertions(+), 234 deletions(-) create mode 100644 patches/server/0438-Add-and-implement-PlayerRecipeBookClickEvent.patch rename patches/{unapplied => }/server/0439-Hide-sync-chunk-writes-behind-flag.patch (93%) rename patches/{unapplied => }/server/0440-Add-permission-for-command-blocks.patch (95%) rename patches/{unapplied => }/server/0441-Ensure-Entity-AABB-s-are-never-invalid.patch (89%) rename patches/{unapplied => }/server/0442-Fix-Per-World-Difficulty-Remembering-Difficulty.patch (92%) rename patches/{unapplied => }/server/0443-Paper-dumpitem-command.patch (100%) rename patches/{unapplied => }/server/0444-Don-t-allow-null-UUID-s-for-chat.patch (57%) rename patches/{unapplied => }/server/0445-Improve-Legacy-Component-serialization-size.patch (100%) rename patches/{unapplied => }/server/0446-Optimize-Bit-Operations-by-inlining.patch (100%) rename patches/{unapplied => }/server/0447-Add-Plugin-Tickets-to-API-Chunk-Methods.patch (100%) rename patches/{unapplied => }/server/0448-incremental-chunk-and-player-saving.patch (93%) rename patches/{unapplied => }/server/0449-Stop-copy-on-write-operations-for-updating-light-dat.patch (100%) rename patches/{unapplied => }/server/0450-Support-old-UUID-format-for-NBT.patch (94%) rename patches/{unapplied => }/server/0451-Clean-up-duplicated-GameProfile-Properties.patch (95%) rename patches/{unapplied => }/server/0452-Convert-legacy-attributes-in-Item-Meta.patch (100%) rename patches/{unapplied => }/server/0453-Remove-some-streams-from-structures.patch (62%) rename patches/{unapplied => }/server/0454-Remove-streams-from-classes-related-villager-gossip.patch (100%) rename patches/{unapplied => }/server/0455-Support-components-in-ItemMeta.patch (100%) rename patches/{unapplied => }/server/0456-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch (100%) rename patches/{unapplied => }/server/0457-Add-entity-liquid-API.patch (100%) rename patches/{unapplied => }/server/0458-Update-itemstack-legacy-name-and-lore.patch (97%) rename patches/{unapplied => }/server/0459-Spawn-player-in-correct-world-on-login.patch (91%) rename patches/{unapplied => }/server/0460-Add-PrepareResultEvent.patch (98%) rename patches/{unapplied => }/server/0461-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch (84%) rename patches/{unapplied => }/server/0462-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch (97%) rename patches/{unapplied => }/server/0463-Optimize-NetworkManager-Exception-Handling.patch (96%) rename patches/{unapplied => }/server/0464-Optimize-the-advancement-data-player-iteration-to-be.patch (91%) rename patches/{unapplied => }/server/0465-Fix-arrows-never-despawning-MC-125757.patch (100%) rename patches/{unapplied => }/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch (91%) rename patches/{unapplied => }/server/0467-Fix-SPIGOT-5989.patch (90%) rename patches/{unapplied => }/server/0468-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch (100%) rename patches/{unapplied => }/server/0469-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch (100%) rename patches/{unapplied => }/server/0470-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch (83%) rename patches/{unapplied => }/server/0471-Add-missing-strikeLighting-call-to-World-spigot-stri.patch (100%) rename patches/{unapplied => }/server/0472-Fix-some-rails-connecting-improperly.patch (100%) rename patches/{unapplied => }/server/0473-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch (100%) rename patches/{unapplied => }/server/0474-Do-not-let-the-server-load-chunks-from-newer-version.patch (100%) rename patches/{unapplied => }/server/0475-Brand-support.patch (81%) rename patches/{unapplied => }/server/0476-Add-setMaxPlayers-API.patch (91%) rename patches/{unapplied => }/server/0477-Add-playPickupItemAnimation-to-LivingEntity.patch (100%) rename patches/{unapplied => }/server/0478-Don-t-require-FACING-data.patch (100%) rename patches/{unapplied => }/server/0479-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch (93%) rename patches/{unapplied => }/server/0480-Add-moon-phase-API.patch (100%) rename patches/{unapplied => }/server/0481-Improve-Chunk-Status-Transition-Speed.patch (95%) rename patches/{unapplied => }/server/0482-Prevent-headless-pistons-from-being-created.patch (100%) rename patches/{unapplied => }/server/0483-Add-BellRingEvent.patch (100%) rename patches/{unapplied => }/server/0484-Add-zombie-targets-turtle-egg-config.patch (100%) rename patches/{unapplied => }/server/0485-Buffer-joins-to-world.patch (68%) rename patches/{unapplied => }/server/0486-Eigencraft-redstone-implementation.patch (100%) rename patches/{unapplied => }/server/0487-Fix-hex-colors-not-working-in-some-kick-messages.patch (94%) rename patches/{unapplied => }/server/0488-PortalCreateEvent-needs-to-know-its-entity.patch (96%) rename patches/{unapplied => }/server/0489-Fix-CraftTeam-null-check.patch (100%) rename patches/{unapplied => }/server/0490-Add-more-Evoker-API.patch (100%) rename patches/{unapplied => }/server/0491-Add-methods-to-get-translation-keys.patch (98%) rename patches/{unapplied => }/server/0492-Create-HoverEvent-from-ItemStack-Entity.patch (100%) rename patches/{unapplied => }/server/0493-Cache-block-data-strings.patch (97%) rename patches/{unapplied => }/server/0494-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch (91%) rename patches/{unapplied => }/server/0495-Add-additional-open-container-api-to-HumanEntity.patch (100%) rename patches/{unapplied => }/server/0496-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch (100%) rename patches/{unapplied => }/server/0497-Extend-block-drop-capture-to-capture-all-items-added.patch (94%) rename patches/{unapplied => }/server/0498-Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch (100%) rename patches/{unapplied => }/server/0499-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch (84%) rename patches/{unapplied => }/server/0500-Lazily-track-plugin-scoreboards-by-default.patch (100%) rename patches/{unapplied => }/server/0501-Entity-isTicking.patch (91%) rename patches/{unapplied => }/server/0502-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch (94%) rename patches/{unapplied => }/server/0503-Fix-Concurrency-issue-in-ShufflingList.patch (100%) rename patches/{unapplied => }/server/0504-Reset-Ender-Crystals-on-Dragon-Spawn.patch (100%) rename patches/{unapplied => }/server/0505-Fix-for-large-move-vectors-crashing-server.patch (90%) rename patches/{unapplied => }/server/0506-Optimise-getType-calls.patch (100%) rename patches/{unapplied => }/server/0507-Villager-resetOffers.patch (100%) rename patches/{unapplied => }/server/0508-Improve-inlinig-for-some-hot-IBlockData-methods.patch (91%) rename patches/{unapplied => }/server/0509-Retain-block-place-order-when-capturing-blockstates.patch (100%) rename patches/{unapplied => }/server/0510-Reduce-blockpos-allocation-from-pathfinding.patch (100%) rename patches/{unapplied => }/server/0511-Fix-item-locations-dropped-from-campfires.patch (100%) rename patches/{unapplied => }/server/0512-Player-elytra-boost-API.patch (94%) rename patches/{unapplied => }/server/0513-Fixed-TileEntityBell-memory-leak.patch (100%) rename patches/{unapplied => }/server/0514-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch (100%) rename patches/{unapplied => }/server/0515-Add-getOfflinePlayerIfCached-String.patch (100%) rename patches/{unapplied => }/server/0516-Add-ignore-discounts-API.patch (100%) rename patches/{unapplied => }/server/0517-Toggle-for-removing-existing-dragon.patch (100%) rename patches/{unapplied => }/server/0518-Fix-client-lag-on-advancement-loading.patch (95%) rename patches/{unapplied => }/server/0519-Item-no-age-no-player-pickup.patch (100%) rename patches/{unapplied => }/server/0520-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch (100%) rename patches/{unapplied => }/server/0521-Beacon-API-custom-effect-ranges.patch (100%) rename patches/{unapplied => }/server/0522-Add-API-for-quit-reason.patch (86%) rename patches/{unapplied => }/server/0523-Add-Wandering-Trader-spawn-rate-config-options.patch (100%) rename patches/{unapplied => }/server/0524-Expose-world-spawn-angle.patch (89%) rename patches/{unapplied => }/server/0525-Add-Destroy-Speed-API.patch (100%) rename patches/{unapplied => }/server/0526-Fix-Player-spawnParticle-x-y-z-precision-loss.patch (93%) rename patches/{unapplied => }/server/0527-Add-LivingEntity-clearActiveItem.patch (100%) rename patches/{unapplied => }/server/0528-Add-PlayerItemCooldownEvent.patch (100%) rename patches/{unapplied => }/server/0529-Significantly-improve-performance-of-the-end-generat.patch (71%) rename patches/{unapplied => }/server/0530-More-lightning-API.patch (100%) rename patches/{unapplied => }/server/0531-Climbing-should-not-bypass-cramming-gamerule.patch (95%) rename patches/{unapplied => }/server/0532-Added-missing-default-perms-for-commands.patch (100%) rename patches/{unapplied => }/server/0533-Add-PlayerShearBlockEvent.patch (100%) rename patches/{unapplied => }/server/0534-Fix-curing-zombie-villager-discount-exploit.patch (100%) rename patches/{unapplied => }/server/0535-Limit-recipe-packets.patch (86%) delete mode 100644 patches/unapplied/server/0438-Add-and-implement-PlayerRecipeBookClickEvent.patch diff --git a/patches/server/0353-Anti-Xray.patch b/patches/server/0353-Anti-Xray.patch index ed8587ea53..f8859ea793 100644 --- a/patches/server/0353-Anti-Xray.patch +++ b/patches/server/0353-Anti-Xray.patch @@ -1247,7 +1247,7 @@ index ae37e97e52557b48f129cc02eeea395378a48444..785fbcf9bafcdec1c5be213de3d85126 public int getSerializedSize() { diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 78e20871e4bd8d92c4475f797a55733c68f6aeb4..34d8fbb441def2e89415729a2f39b9a32eec95c7 100644 +index 78e20871e4bd8d92c4475f797a55733c68f6aeb4..723608946947fa2792c7284fa5faa85ab9507897 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -29,6 +29,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer @@ -1258,22 +1258,30 @@ index 78e20871e4bd8d92c4475f797a55733c68f6aeb4..34d8fbb441def2e89415729a2f39b9a3 private volatile PalettedContainer.Data data; private final PalettedContainer.Strategy strategy; private final ThreadingDetector threadingDetector = new ThreadingDetector("PalettedContainer"); -@@ -41,7 +42,13 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -41,14 +42,19 @@ public class PalettedContainer implements PaletteResize, PalettedContainer this.threadingDetector.checkAndUnlock(); } - public static Codec> codecRW(IdMap idList, Codec entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue) { +- PalettedContainerRO.Unpacker> unpacker = PalettedContainer::unpack; + // Paper start - Anti-Xray - Add preset values + @Deprecated @io.papermc.paper.annotation.DoNotUse public static Codec> codecRW(IdMap idList, Codec entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue) {return codecRW(idList, entryCodec, paletteProvider, defaultValue, null);} + public static Codec> codecRW(IdMap idList, Codec entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) { + PalettedContainerRO.Unpacker> unpacker = (idMapx, strategyx, packedData) -> { -+ return unpack(idMapx, strategyx, packedData, object, presetValues); ++ return unpack(idMapx, strategyx, packedData, defaultValue, presetValues); + }; + // Paper end - PalettedContainerRO.Unpacker> unpacker = PalettedContainer::unpack; return codec(idList, entryCodec, paletteProvider, defaultValue, unpacker); } -@@ -65,19 +72,52 @@ public class PalettedContainer implements PaletteResize, PalettedContainer + + public static Codec> codecRO(IdMap idList, Codec entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue) { + PalettedContainerRO.Unpacker> unpacker = (idListx, paletteProviderx, serialized) -> { +- return unpack(idListx, paletteProviderx, serialized).map((result) -> { ++ return unpack(idListx, paletteProviderx, serialized, defaultValue, null).map((result) -> { // Paper - Anti-Xray - Add preset values + return result; + }); + }; +@@ -65,19 +71,52 @@ public class PalettedContainer implements PaletteResize, PalettedContainer }); } @@ -1329,7 +1337,7 @@ index 78e20871e4bd8d92c4475f797a55733c68f6aeb4..34d8fbb441def2e89415729a2f39b9a3 this.strategy = paletteProvider; this.registry = idList; this.data = this.createOrReuseData((PalettedContainer.Data)null, 0); -@@ -92,11 +132,33 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -92,11 +131,33 @@ public class PalettedContainer implements PaletteResize, PalettedContainer @Override public int onResize(int newBits, T object) { PalettedContainer.Data data = this.data; @@ -1364,7 +1372,7 @@ index 78e20871e4bd8d92c4475f797a55733c68f6aeb4..34d8fbb441def2e89415729a2f39b9a3 public T getAndSet(int x, int y, int z, T value) { this.acquire(); -@@ -166,25 +228,36 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -166,25 +227,36 @@ public class PalettedContainer implements PaletteResize, PalettedContainer data.palette.read(buf); buf.readLongArray(data.storage.getRaw()); this.data = data; @@ -1404,7 +1412,7 @@ index 78e20871e4bd8d92c4475f797a55733c68f6aeb4..34d8fbb441def2e89415729a2f39b9a3 List list = serialized.paletteEntries(); int i = paletteProvider.size(); int j = paletteProvider.calculateBitsForSerialization(idList, list.size()); -@@ -220,7 +293,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -220,7 +292,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer } } @@ -1413,7 +1421,7 @@ index 78e20871e4bd8d92c4475f797a55733c68f6aeb4..34d8fbb441def2e89415729a2f39b9a3 } @Override -@@ -280,12 +353,12 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -280,12 +352,12 @@ public class PalettedContainer implements PaletteResize, PalettedContainer } public PalettedContainer copy() { @@ -1428,7 +1436,7 @@ index 78e20871e4bd8d92c4475f797a55733c68f6aeb4..34d8fbb441def2e89415729a2f39b9a3 } @Override -@@ -329,9 +402,20 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -329,9 +401,20 @@ public class PalettedContainer implements PaletteResize, PalettedContainer return 1 + this.palette.getSerializedSize() + FriendlyByteBuf.getVarIntSize(this.storage.getSize()) + this.storage.getRaw().length * 8; } diff --git a/patches/server/0438-Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/server/0438-Add-and-implement-PlayerRecipeBookClickEvent.patch new file mode 100644 index 0000000000..e849cb4382 --- /dev/null +++ b/patches/server/0438-Add-and-implement-PlayerRecipeBookClickEvent.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: JRoy +Date: Fri, 5 Jun 2020 18:24:06 -0400 +Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index a0f492b0c7783fc8c5ce2e1a60707ae2db74ab9f..640a9e56477e827f25acb962cbbda37a33401139 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -3205,9 +3205,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + if (!this.player.containerMenu.stillValid(this.player)) { + ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu); + } else { +- this.server.getRecipeManager().byKey(packet.getRecipe()).ifPresent((irecipe) -> { +- ((RecipeBookMenu) this.player.containerMenu).handlePlacement(packet.isShiftDown(), irecipe, this.player); +- }); ++ // Paper start - fire event for clicking recipes in the recipe book ++ com.destroystokyo.paper.event.player.PlayerRecipeBookClickEvent event = new com.destroystokyo.paper.event.player.PlayerRecipeBookClickEvent( ++ player.getBukkitEntity(), org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(packet.getRecipe()), packet.isShiftDown()); ++ if (event.callEvent() && this.player.containerMenu instanceof RecipeBookMenu recipeBookMenu) { // check if inventory changed during event handling ++ this.server.getRecipeManager().byKey(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getRecipe())).ifPresent((irecipe) -> { ++ recipeBookMenu.handlePlacement(event.isMakeAll(), irecipe, this.player); ++ }); ++ } ++ // Paper end + } + } + } diff --git a/patches/unapplied/server/0439-Hide-sync-chunk-writes-behind-flag.patch b/patches/server/0439-Hide-sync-chunk-writes-behind-flag.patch similarity index 93% rename from patches/unapplied/server/0439-Hide-sync-chunk-writes-behind-flag.patch rename to patches/server/0439-Hide-sync-chunk-writes-behind-flag.patch index 299fc6e59a..1d9e0f2b56 100644 --- a/patches/unapplied/server/0439-Hide-sync-chunk-writes-behind-flag.patch +++ b/patches/server/0439-Hide-sync-chunk-writes-behind-flag.patch @@ -9,7 +9,7 @@ on harddrives. -DPaper.enable-sync-chunk-writes=true to enable diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java -index cc92e2c5e6b62c6a67d0a6534b078e3a6029daf5..26345494ce190b5cd2ab58dd7d4b046796767b20 100644 +index 1e01277448a3cf2b2045b54b182166a66c822e20..a32cfa75a9bea896f558bab646d0868391b069a9 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java @@ -136,7 +136,7 @@ public class DedicatedServerProperties extends Settings> completablefuture = (CompletableFuture) this.futures.get(i); diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 86cdc8951544c16f8dc5148bc2c7bf9bbf920c60..c468b012197b2c3444ad8bb0d8a9f41c7ab17b10 100644 +index 6188f35e2b5300b6ff4a16e4d6e0e4a846261f8a..4d74eb7883c72fb42275fc5358917244bb36181d 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -106,6 +106,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp +@@ -103,6 +103,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp import net.minecraft.world.level.storage.DimensionDataStorage; import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.phys.Vec3; @@ -131,7 +131,7 @@ index 86cdc8951544c16f8dc5148bc2c7bf9bbf920c60..c468b012197b2c3444ad8bb0d8a9f41c import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.commons.lang3.mutable.MutableObject; import org.slf4j.Logger; -@@ -715,6 +716,64 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -712,6 +713,64 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } @@ -196,7 +196,7 @@ index 86cdc8951544c16f8dc5148bc2c7bf9bbf920c60..c468b012197b2c3444ad8bb0d8a9f41c protected void saveAllChunks(boolean flush) { if (flush) { List list = (List) this.visibleChunkMap.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList()); -@@ -799,13 +858,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -796,13 +855,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } int l = 0; @@ -211,7 +211,7 @@ index 86cdc8951544c16f8dc5148bc2c7bf9bbf920c60..c468b012197b2c3444ad8bb0d8a9f41c } -@@ -843,6 +896,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -840,6 +893,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.level.unload(chunk); } @@ -219,7 +219,7 @@ index 86cdc8951544c16f8dc5148bc2c7bf9bbf920c60..c468b012197b2c3444ad8bb0d8a9f41c this.lightEngine.updateChunkStatus(ichunkaccess.getPos()); this.lightEngine.tryScheduleUpdate(); -@@ -1263,6 +1317,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1260,6 +1314,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider asyncSaveData, chunk); chunk.setUnsaved(false); @@ -227,7 +227,7 @@ index 86cdc8951544c16f8dc5148bc2c7bf9bbf920c60..c468b012197b2c3444ad8bb0d8a9f41c } // Paper end -@@ -1272,6 +1327,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1269,6 +1324,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (!chunk.isUnsaved()) { return false; } else { @@ -256,10 +256,10 @@ index 1d9a0f6effa1654609f4d0752ec69eed6ab7134b..585892f19bc0aea89889a358c0407f29 public void close() throws IOException { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 443044aa09b80bdbbcd202b53d265c635b50015f..848690e6dfaec00ec9b8a8397d2a6d37f24c8d12 100644 +index c3db29bc1b24a976617068a4ddae062857d61097..c7221d169badfae6653d64cb39e1435372ea179a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1082,6 +1082,37 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1083,6 +1083,37 @@ public class ServerLevel extends Level implements WorldGenLevel { return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos); } @@ -298,10 +298,10 @@ index 443044aa09b80bdbbcd202b53d265c635b50015f..848690e6dfaec00ec9b8a8397d2a6d37 ServerChunkCache chunkproviderserver = this.getChunkSource(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 7c014f288184328384a811ecbeef83406a780289..fd46ec45d7f6b43cc02069ff3f2dbbdcf1e66d3c 100644 +index b0dffb7c7c8fece2528ac218acef428731145b92..8faa5ccd643158c59d55a6bf8e0e07a44881e6e9 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -178,6 +178,7 @@ import org.bukkit.inventory.MainHand; +@@ -179,6 +179,7 @@ import org.bukkit.inventory.MainHand; public class ServerPlayer extends Player { private static final Logger LOGGER = LogUtils.getLogger(); @@ -310,10 +310,10 @@ index 7c014f288184328384a811ecbeef83406a780289..fd46ec45d7f6b43cc02069ff3f2dbbdc private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; public ServerGamePacketListenerImpl connection; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 4b9e030016bef762c01ace5181ade7d1480b8702..c1e62a0d1655993430da7e4cbd8075cd4239adb4 100644 +index c9f0aa145b3f05b42b134654a841e88d6c39c3d1..74f7a49930b6fb1313c96a0d3f8802d1758e039c 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -561,6 +561,7 @@ public abstract class PlayerList { +@@ -565,6 +565,7 @@ public abstract class PlayerList { protected void save(ServerPlayer player) { if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit if (!player.didPlayerJoinEvent) return; // Paper - If we never fired PJE, we disconnected during login. Data has not changed, and additionally, our saved vehicle is not loaded! If we save now, we will lose our vehicle (CraftBukkit bug) @@ -321,7 +321,7 @@ index 4b9e030016bef762c01ace5181ade7d1480b8702..c1e62a0d1655993430da7e4cbd8075cd this.playerIo.save(player); ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit -@@ -1163,10 +1164,22 @@ public abstract class PlayerList { +@@ -1167,10 +1168,22 @@ public abstract class PlayerList { } public void saveAll() { @@ -346,7 +346,7 @@ index 4b9e030016bef762c01ace5181ade7d1480b8702..c1e62a0d1655993430da7e4cbd8075cd MinecraftTimings.savePlayers.stopTiming(); // Paper return null; }); // Paper - ensure main diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java -index 8dd9879d52ba9bd816fcfa5413ef3bfc25d562c7..44e1fdbf6798034b9092fe151568ff392da8af08 100644 +index dc164608bfb2fb18a1adf83fa10bac4028dcac0a..a97909e77b9b28aede8c8716831c3f9a90618f09 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java @@ -457,6 +457,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom diff --git a/patches/unapplied/server/0449-Stop-copy-on-write-operations-for-updating-light-dat.patch b/patches/server/0449-Stop-copy-on-write-operations-for-updating-light-dat.patch similarity index 100% rename from patches/unapplied/server/0449-Stop-copy-on-write-operations-for-updating-light-dat.patch rename to patches/server/0449-Stop-copy-on-write-operations-for-updating-light-dat.patch diff --git a/patches/unapplied/server/0450-Support-old-UUID-format-for-NBT.patch b/patches/server/0450-Support-old-UUID-format-for-NBT.patch similarity index 94% rename from patches/unapplied/server/0450-Support-old-UUID-format-for-NBT.patch rename to patches/server/0450-Support-old-UUID-format-for-NBT.patch index abd9b26387..04f6394d7a 100644 --- a/patches/unapplied/server/0450-Support-old-UUID-format-for-NBT.patch +++ b/patches/server/0450-Support-old-UUID-format-for-NBT.patch @@ -46,10 +46,10 @@ index 0778fdd4f47015787f7ffbfb39c31ec0e1c039bd..912fd5135e89348bdd3c0a8b6c07860e return tag != null && tag.getType() == IntArrayTag.TYPE && ((IntArrayTag)tag).getAsIntArray().length == 4; } diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java -index 2df77845b78b9d5fae0a36103d42c8202ee2af9e..73ee50e05a1c8d432d9967d4e879b5bb373740ad 100644 +index d6d8adf1e49cdb74dc5d8e2e60bcaca7c5e1c16d..b31741a9c3363e4288636ceff9b38c598a84aa43 100644 --- a/src/main/java/net/minecraft/nbt/NbtUtils.java +++ b/src/main/java/net/minecraft/nbt/NbtUtils.java -@@ -74,6 +74,11 @@ public final class NbtUtils { +@@ -75,6 +75,11 @@ public final class NbtUtils { if (nbt.contains("Name", 8)) { string = nbt.getString("Name"); } diff --git a/patches/unapplied/server/0451-Clean-up-duplicated-GameProfile-Properties.patch b/patches/server/0451-Clean-up-duplicated-GameProfile-Properties.patch similarity index 95% rename from patches/unapplied/server/0451-Clean-up-duplicated-GameProfile-Properties.patch rename to patches/server/0451-Clean-up-duplicated-GameProfile-Properties.patch index c742d4af9a..25554ddf57 100644 --- a/patches/unapplied/server/0451-Clean-up-duplicated-GameProfile-Properties.patch +++ b/patches/server/0451-Clean-up-duplicated-GameProfile-Properties.patch @@ -9,10 +9,10 @@ growing to large sizes and preventing login. This now automatically cleans up the extra properties. diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java -index 73ee50e05a1c8d432d9967d4e879b5bb373740ad..5dda064813a0eb00438a7df909d51a4b2d48942e 100644 +index b31741a9c3363e4288636ceff9b38c598a84aa43..46681f3fa63516aa750de11cf1dee17cb3734fcd 100644 --- a/src/main/java/net/minecraft/nbt/NbtUtils.java +++ b/src/main/java/net/minecraft/nbt/NbtUtils.java -@@ -92,7 +92,8 @@ public final class NbtUtils { +@@ -93,7 +93,8 @@ public final class NbtUtils { for(String string2 : compoundTag.getAllKeys()) { ListTag listTag = compoundTag.getList(string2, 10); diff --git a/patches/unapplied/server/0452-Convert-legacy-attributes-in-Item-Meta.patch b/patches/server/0452-Convert-legacy-attributes-in-Item-Meta.patch similarity index 100% rename from patches/unapplied/server/0452-Convert-legacy-attributes-in-Item-Meta.patch rename to patches/server/0452-Convert-legacy-attributes-in-Item-Meta.patch diff --git a/patches/unapplied/server/0453-Remove-some-streams-from-structures.patch b/patches/server/0453-Remove-some-streams-from-structures.patch similarity index 62% rename from patches/unapplied/server/0453-Remove-some-streams-from-structures.patch rename to patches/server/0453-Remove-some-streams-from-structures.patch index f695d56529..bb278ab7d3 100644 --- a/patches/unapplied/server/0453-Remove-some-streams-from-structures.patch +++ b/patches/server/0453-Remove-some-streams-from-structures.patch @@ -6,22 +6,24 @@ Subject: [PATCH] Remove some streams from structures This showed up a lot in the spark profiler, should have a low-medium performance improvement. diff --git a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java -index 89ec6902abaed56e57d3aa7e355a3db70baa02a0..0548be182bc342cc3855dcf7cc11519fc2805121 100644 +index 24f58441ae7b43a62d74aa55e9808c1c65f466e4..8ec886a10fc901a964f626a350b39c3fda0e59d9 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java +++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java -@@ -36,9 +36,10 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker { - int j = chunkPos.getMinBlockZ(); +@@ -36,10 +36,11 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker { + int j = pos.getMinBlockZ(); ObjectList objectList = new ObjectArrayList<>(10); ObjectList objectList2 = new ObjectArrayList<>(32); -- structureManager.startsForStructure(chunkPos, (structure) -> { +- world.startsForStructure(pos, (structure) -> { + // Paper start - replace for each -+ for (net.minecraft.world.level.levelgen.structure.StructureStart structureStart : structureManager.startsForStructure(chunkPos, (structure) -> { ++ for (net.minecraft.world.level.levelgen.structure.StructureStart structureStart : structureManager.startsForStructure(pos, (structure) -> { return structure.terrainAdaptation() != TerrainAdjustment.NONE; -- }).forEach((structureStart) -> { -+ })) { - TerrainAdjustment terrainAdjustment = structureStart.getStructure().terrainAdaptation(); +- }).forEach((start) -> { +- TerrainAdjustment terrainAdjustment = start.getStructure().terrainAdaptation(); ++ })) { // Paper end ++ TerrainAdjustment terrainAdjustment = structureStart.getStructure().terrainAdaptation(); - for(StructurePiece structurePiece : structureStart.getPieces()) { + for(StructurePiece structurePiece : start.getPieces()) { + if (structurePiece.isCloseToChunk(pos, 12)) { @@ -63,7 +64,7 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker { } } diff --git a/patches/unapplied/server/0454-Remove-streams-from-classes-related-villager-gossip.patch b/patches/server/0454-Remove-streams-from-classes-related-villager-gossip.patch similarity index 100% rename from patches/unapplied/server/0454-Remove-streams-from-classes-related-villager-gossip.patch rename to patches/server/0454-Remove-streams-from-classes-related-villager-gossip.patch diff --git a/patches/unapplied/server/0455-Support-components-in-ItemMeta.patch b/patches/server/0455-Support-components-in-ItemMeta.patch similarity index 100% rename from patches/unapplied/server/0455-Support-components-in-ItemMeta.patch rename to patches/server/0455-Support-components-in-ItemMeta.patch diff --git a/patches/unapplied/server/0456-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch b/patches/server/0456-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch similarity index 100% rename from patches/unapplied/server/0456-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch rename to patches/server/0456-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch diff --git a/patches/unapplied/server/0457-Add-entity-liquid-API.patch b/patches/server/0457-Add-entity-liquid-API.patch similarity index 100% rename from patches/unapplied/server/0457-Add-entity-liquid-API.patch rename to patches/server/0457-Add-entity-liquid-API.patch diff --git a/patches/unapplied/server/0458-Update-itemstack-legacy-name-and-lore.patch b/patches/server/0458-Update-itemstack-legacy-name-and-lore.patch similarity index 97% rename from patches/unapplied/server/0458-Update-itemstack-legacy-name-and-lore.patch rename to patches/server/0458-Update-itemstack-legacy-name-and-lore.patch index 7512e6019e..b354241c07 100644 --- a/patches/unapplied/server/0458-Update-itemstack-legacy-name-and-lore.patch +++ b/patches/server/0458-Update-itemstack-legacy-name-and-lore.patch @@ -5,7 +5,7 @@ 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 5d7e07a9612dc8e62b5843b3c805f6423d5304f2..8400f6fc96efecf0ea77f2e163b589ec375272cd 100644 +index 5e0852c4656813272a7ee6cb9c2331410c1b7739..cbcc90cffe38ea249cd0de4b0a90adc2a3ddeb0b 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -166,6 +166,44 @@ public final class ItemStack { diff --git a/patches/unapplied/server/0459-Spawn-player-in-correct-world-on-login.patch b/patches/server/0459-Spawn-player-in-correct-world-on-login.patch similarity index 91% rename from patches/unapplied/server/0459-Spawn-player-in-correct-world-on-login.patch rename to patches/server/0459-Spawn-player-in-correct-world-on-login.patch index ed8eedfdde..84b6dff1e0 100644 --- a/patches/unapplied/server/0459-Spawn-player-in-correct-world-on-login.patch +++ b/patches/server/0459-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 c1e62a0d1655993430da7e4cbd8075cd4239adb4..0b301b1f164853bfd23300993288a2958824e287 100644 +index 74f7a49930b6fb1313c96a0d3f8802d1758e039c..04a4f87920f8e8ab56f864d58424153b54686e3f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -199,7 +199,18 @@ public abstract class PlayerList { +@@ -200,7 +200,18 @@ public abstract class PlayerList { }String lastKnownName = s; // Paper // CraftBukkit end diff --git a/patches/unapplied/server/0460-Add-PrepareResultEvent.patch b/patches/server/0460-Add-PrepareResultEvent.patch similarity index 98% rename from patches/unapplied/server/0460-Add-PrepareResultEvent.patch rename to patches/server/0460-Add-PrepareResultEvent.patch index 8217e01b4b..415d9409c8 100644 --- a/patches/unapplied/server/0460-Add-PrepareResultEvent.patch +++ b/patches/server/0460-Add-PrepareResultEvent.patch @@ -56,10 +56,10 @@ index f5e52220abc5c678c090b32d83eb9644fa91ce9d..35575434f3c90f1bd23df6584ee8a5a9 } diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java -index 3b3e7a89ce1fc719d241c7a3dc8c746191d91f85..9cbdcb87d76fa36887413754ef625a16624aadd7 100644 +index d028ad0ab0e800b0fd93362d21942dff392f24af..942b4cc710bede4c942d269dcfc14ae105ab848d 100644 --- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java +++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java -@@ -243,7 +243,8 @@ public class LoomMenu extends AbstractContainerMenu { +@@ -248,7 +248,8 @@ public class LoomMenu extends AbstractContainerMenu { this.resultSlot.set(ItemStack.EMPTY); } diff --git a/patches/unapplied/server/0461-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/0461-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch similarity index 84% rename from patches/unapplied/server/0461-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch rename to patches/server/0461-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch index 3c25c05af4..110614ac67 100644 --- a/patches/unapplied/server/0461-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch +++ b/patches/server/0461-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 cf691b94b478dc058af706e1f2d13b51df231779..289073daacc2d477e965e668c6fb4041d27e3f8c 100644 +index 4a2a8566c9d68f21a98774fcecac0f4fa43d88c4..09513bc7a5b78580da415d486369b9403e99c773 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3410,7 +3410,7 @@ public abstract class LivingEntity extends Entity { +@@ -3413,7 +3413,7 @@ public abstract class LivingEntity extends Entity { Entity entity = this.getVehicle(); super.stopRiding(suppressCancellation); // Paper - suppress diff --git a/patches/unapplied/server/0462-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/patches/server/0462-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch similarity index 97% rename from patches/unapplied/server/0462-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch rename to patches/server/0462-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index a46253fa87..f1c4468cea 100644 --- a/patches/unapplied/server/0462-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/patches/server/0462-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -360,10 +360,10 @@ index 36a9d52d9af3bc398010c52dc16ab23e53f2702a..ece4cd0de061969d4d2f07560e6cf38e return this.isEntityTickingReady; } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index c468b012197b2c3444ad8bb0d8a9f41c7ab17b10..b486b800399b53cb6d4912e16f2a14f1a3062759 100644 +index 4d74eb7883c72fb42275fc5358917244bb36181d..7b1781faed02a5b5fa37ca6f079d1fb620315c80 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -134,6 +134,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -131,6 +131,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public final ServerLevel level; private final ThreadedLevelLightEngine lightEngine; private final BlockableEventLoop mainThreadExecutor; @@ -371,7 +371,7 @@ index c468b012197b2c3444ad8bb0d8a9f41c7ab17b10..b486b800399b53cb6d4912e16f2a14f1 public ChunkGenerator generator; private RandomState randomState; public final Supplier overworldDataStorage; -@@ -337,6 +338,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -334,6 +335,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } this.mainThreadExecutor = mainThreadExecutor; @@ -387,7 +387,7 @@ index c468b012197b2c3444ad8bb0d8a9f41c7ab17b10..b486b800399b53cb6d4912e16f2a14f1 ProcessorMailbox threadedmailbox = ProcessorMailbox.create(executor, "worldgen"); Objects.requireNonNull(mainThreadExecutor); -@@ -452,6 +462,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -449,6 +459,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }); } @@ -425,7 +425,7 @@ index c468b012197b2c3444ad8bb0d8a9f41c7ab17b10..b486b800399b53cb6d4912e16f2a14f1 // Paper start public void updatePlayerMobTypeMap(Entity entity) { if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { -@@ -562,6 +603,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -559,6 +600,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider List list1 = new ArrayList(); int j = centerChunk.x; int k = centerChunk.z; @@ -433,7 +433,7 @@ index c468b012197b2c3444ad8bb0d8a9f41c7ab17b10..b486b800399b53cb6d4912e16f2a14f1 for (int l = -margin; l <= margin; ++l) { for (int i1 = -margin; i1 <= margin; ++i1) { -@@ -580,6 +622,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -577,6 +619,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkStatus chunkstatus = (ChunkStatus) distanceToStatus.apply(j1); CompletableFuture> completablefuture = playerchunk.getOrScheduleFuture(chunkstatus, this); @@ -448,7 +448,7 @@ index c468b012197b2c3444ad8bb0d8a9f41c7ab17b10..b486b800399b53cb6d4912e16f2a14f1 list1.add(playerchunk); list.add(completablefuture); -@@ -937,11 +987,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -934,11 +984,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (requiredStatus == ChunkStatus.EMPTY) { return this.scheduleChunkLoad(chunkcoordintpair); } else { @@ -469,7 +469,7 @@ index c468b012197b2c3444ad8bb0d8a9f41c7ab17b10..b486b800399b53cb6d4912e16f2a14f1 if (optional.isPresent() && ((ChunkAccess) optional.get()).getStatus().isOrAfter(requiredStatus)) { CompletableFuture> completablefuture = requiredStatus.load(this.level, this.structureTemplateManager, this.lightEngine, (ichunkaccess) -> { -@@ -953,6 +1011,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -950,6 +1008,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } else { return this.scheduleChunkGeneration(holder, requiredStatus); } @@ -477,7 +477,7 @@ index c468b012197b2c3444ad8bb0d8a9f41c7ab17b10..b486b800399b53cb6d4912e16f2a14f1 } } -@@ -992,14 +1051,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -989,14 +1048,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }; CompletableFuture chunkSaveFuture = this.level.asyncChunkTaskManager.getChunkSaveFuture(pos.x, pos.z); @@ -507,7 +507,7 @@ index c468b012197b2c3444ad8bb0d8a9f41c7ab17b10..b486b800399b53cb6d4912e16f2a14f1 return ret; // Paper end - Async chunk io } -@@ -1078,7 +1147,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1075,7 +1144,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.releaseLightTicket(chunkcoordintpair); return CompletableFuture.completedFuture(Either.right(playerchunk_failure)); }); @@ -519,7 +519,7 @@ index c468b012197b2c3444ad8bb0d8a9f41c7ab17b10..b486b800399b53cb6d4912e16f2a14f1 } protected void releaseLightTicket(ChunkPos pos) { -@@ -1162,7 +1234,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1159,7 +1231,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider long i = chunkHolder.getPos().toLong(); Objects.requireNonNull(chunkHolder); @@ -796,10 +796,10 @@ index 585892f19bc0aea89889a358c0407f2975b9efe5..918fda0fbbafa39ce0f421dcaf10f8dc boolean flag1 = this.chunkMap.promoteChunkMap(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index fd46ec45d7f6b43cc02069ff3f2dbbdcf1e66d3c..059e4f221f4e509bbdf2b5034890af49f5415d5b 100644 +index 8faa5ccd643158c59d55a6bf8e0e07a44881e6e9..514d2d69980f843b5bc9339e63c48ba0e1176df5 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -193,6 +193,7 @@ public class ServerPlayer extends Player { +@@ -194,6 +194,7 @@ public class ServerPlayer extends Player { private int lastRecordedArmor = Integer.MIN_VALUE; private int lastRecordedLevel = Integer.MIN_VALUE; private int lastRecordedExperience = Integer.MIN_VALUE; @@ -807,7 +807,7 @@ index fd46ec45d7f6b43cc02069ff3f2dbbdcf1e66d3c..059e4f221f4e509bbdf2b5034890af49 private float lastSentHealth = -1.0E8F; private int lastSentFood = -99999999; private boolean lastFoodSaturationZero = true; -@@ -337,6 +338,21 @@ public class ServerPlayer extends Player { +@@ -338,6 +339,21 @@ public class ServerPlayer extends Player { this.maxHealthCache = this.getMaxHealth(); this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper } @@ -1112,10 +1112,10 @@ index 8770fe0db46b01e8b608637df4f1a669a3f4cdde..3c1698ba0d3bc412ab957777d9b5211d private final String name; private final Comparator comparator; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 0b301b1f164853bfd23300993288a2958824e287..ec48afe87b5d159b5bdbe035e214ea7c9024fadb 100644 +index 04a4f87920f8e8ab56f864d58424153b54686e3f..9d54f0cffd201d3ee7f2ba39740e08be4823c691 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -178,6 +178,7 @@ public abstract class PlayerList { +@@ -179,6 +179,7 @@ public abstract class PlayerList { } public void placeNewPlayer(Connection connection, ServerPlayer player) { @@ -1123,7 +1123,7 @@ index 0b301b1f164853bfd23300993288a2958824e287..ec48afe87b5d159b5bdbe035e214ea7c ServerPlayer prev = pendingPlayers.put(player.getUUID(), player);// Paper if (prev != null) { disconnectPendingPlayer(prev); -@@ -292,8 +293,8 @@ public abstract class PlayerList { +@@ -293,8 +294,8 @@ public abstract class PlayerList { net.minecraft.server.level.ChunkMap playerChunkMap = worldserver1.getChunkSource().chunkMap; net.minecraft.server.level.DistanceManager distanceManager = playerChunkMap.distanceManager; distanceManager.addTicket(net.minecraft.server.level.TicketType.LOGIN, pos, 31, pos.toLong()); @@ -1135,7 +1135,7 @@ index 0b301b1f164853bfd23300993288a2958824e287..ec48afe87b5d159b5bdbe035e214ea7c if (updatingChunk != null) { return updatingChunk.getEntityTickingChunkFuture(); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 520b991a0a8adb91c933288faeba64c1798d8577..bc3b174ceda5fb6dc6873429b8523ff85a1258a0 100644 +index 258aa2ee24742d48be08940f147e1d998e667fb8..7e36e53d44b5efbd6498caecb717bec1dcbec96d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -293,7 +293,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1194,7 +1194,7 @@ index b234ba968e82ddf1e8f7c84d3a17659e3beda2b3..af22fa8aa8ddef4d592564b14d0114cc net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk) either.left().orElse(null); if (chunk != null) addTicket(x, z); // Paper diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index daea1ca1d3288b6c3b0cf2e58fe35cb5e4069698..1699ad9a3e0d03866a6a80a74a1a831f6d54d311 100644 +index 14dc5a18bffc4d8a7d3e786142a3fd853aaeeac4..bd1611e9e83d0e579d38ad295d9f241570696cb3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1035,6 +1035,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/unapplied/server/0463-Optimize-NetworkManager-Exception-Handling.patch b/patches/server/0463-Optimize-NetworkManager-Exception-Handling.patch similarity index 96% rename from patches/unapplied/server/0463-Optimize-NetworkManager-Exception-Handling.patch rename to patches/server/0463-Optimize-NetworkManager-Exception-Handling.patch index 1cc708621a..cda717d9d2 100644 --- a/patches/unapplied/server/0463-Optimize-NetworkManager-Exception-Handling.patch +++ b/patches/server/0463-Optimize-NetworkManager-Exception-Handling.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optimize NetworkManager Exception Handling diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java -index d15ef330db69e0c948824d9bf112a26680c90b1b..25c98fa91260c5fe3bd42c0861e3834b4ec5dc5c 100644 +index 672e296cec289abd3bf797d84e16983ca50907be..aec921477e035095d569eab3335175b93a65e672 100644 --- a/src/main/java/net/minecraft/network/ConnectionProtocol.java +++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java -@@ -299,6 +299,7 @@ public enum ConnectionProtocol { +@@ -302,6 +302,7 @@ public enum ConnectionProtocol { @Nullable public Packet createPacket(int id, FriendlyByteBuf buf) { diff --git a/patches/unapplied/server/0464-Optimize-the-advancement-data-player-iteration-to-be.patch b/patches/server/0464-Optimize-the-advancement-data-player-iteration-to-be.patch similarity index 91% rename from patches/unapplied/server/0464-Optimize-the-advancement-data-player-iteration-to-be.patch rename to patches/server/0464-Optimize-the-advancement-data-player-iteration-to-be.patch index 449f7a5007..0763953dd5 100644 --- a/patches/unapplied/server/0464-Optimize-the-advancement-data-player-iteration-to-be.patch +++ b/patches/server/0464-Optimize-the-advancement-data-player-iteration-to-be.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize the advancement data player iteration to be O(N) diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java -index 4591364057110b8abe6cc669b76918096cb6b776..736e604205c0dcbe2cf1f1e0d507f53a9c0d941b 100644 +index 3f7f6a43ac0bf2efb0e66dc96438febbd92113e9..0c2f12e7930646a3da53a50f38be62e0cb1ed2b7 100644 --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java -@@ -436,6 +436,16 @@ public class PlayerAdvancements { +@@ -435,6 +435,16 @@ public class PlayerAdvancements { } private void ensureVisibility(Advancement advancement) { @@ -26,7 +26,7 @@ index 4591364057110b8abe6cc669b76918096cb6b776..736e604205c0dcbe2cf1f1e0d507f53a boolean flag = this.shouldBeVisible(advancement); boolean flag1 = this.visible.contains(advancement); -@@ -451,15 +461,23 @@ public class PlayerAdvancements { +@@ -450,15 +460,23 @@ public class PlayerAdvancements { } if (flag != flag1 && advancement.getParent() != null) { diff --git a/patches/unapplied/server/0465-Fix-arrows-never-despawning-MC-125757.patch b/patches/server/0465-Fix-arrows-never-despawning-MC-125757.patch similarity index 100% rename from patches/unapplied/server/0465-Fix-arrows-never-despawning-MC-125757.patch rename to patches/server/0465-Fix-arrows-never-despawning-MC-125757.patch diff --git a/patches/unapplied/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch b/patches/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch similarity index 91% rename from patches/unapplied/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch rename to patches/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch index 1017b5f0fa..8d25b8b504 100644 --- a/patches/unapplied/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch +++ b/patches/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch @@ -26,19 +26,19 @@ index a4f97c1df86c574af9b9824a38034a3d76d6e357..d65defd5fc54086a969c568b93dfb05f } // CraftBukkit end diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index 08cdd5807237c709accc989718178bc25428eb74..c948b9387e14d7f8bb2cd6236f513d57286d9301 100644 +index 981f08a537253516a6ce8b78f6cd04d7e5e1b546..b14773074fc4b10ef427eb0ad9e21601a7287901 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java -@@ -55,7 +55,7 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy - private final EntityAnchorArgument.Anchor anchor; +@@ -59,7 +59,7 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy private final Vec2 rotation; private final CommandSigningContext signingContext; + private final TaskChainer chatMessageChainer; - public volatile CommandNode currentCommand; // CraftBukkit + public java.util.Map currentCommand = new java.util.concurrent.ConcurrentHashMap<>(); // CraftBukkit // Paper public CommandSourceStack(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String name, Component displayName, MinecraftServer server, @Nullable Entity entity) { this(output, pos, rot, world, level, name, displayName, server, entity, false, (commandcontext, flag, j) -> { -@@ -186,9 +186,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy +@@ -195,9 +195,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy @Override public boolean hasPermission(int level) { // CraftBukkit start diff --git a/patches/unapplied/server/0467-Fix-SPIGOT-5989.patch b/patches/server/0467-Fix-SPIGOT-5989.patch similarity index 90% rename from patches/unapplied/server/0467-Fix-SPIGOT-5989.patch rename to patches/server/0467-Fix-SPIGOT-5989.patch index 8af3e2590b..a8ff807157 100644 --- a/patches/unapplied/server/0467-Fix-SPIGOT-5989.patch +++ b/patches/server/0467-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 ec48afe87b5d159b5bdbe035e214ea7c9024fadb..be7a25560cd5521ddfe4793c7e51b1036fc8a19c 100644 +index 9d54f0cffd201d3ee7f2ba39740e08be4823c691..ec0ceaac85b5868849b6399cdf8eb2b4447508e3 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -835,6 +835,7 @@ public abstract class PlayerList { +@@ -839,6 +839,7 @@ public abstract class PlayerList { // Paper start boolean isBedSpawn = false; boolean isRespawn = false; @@ -21,7 +21,7 @@ index ec48afe87b5d159b5bdbe035e214ea7c9024fadb..be7a25560cd5521ddfe4793c7e51b103 // Paper end // CraftBukkit start - fire PlayerRespawnEvent -@@ -845,7 +846,7 @@ public abstract class PlayerList { +@@ -849,7 +850,7 @@ public abstract class PlayerList { Optional optional; if (blockposition != null) { @@ -30,7 +30,7 @@ index ec48afe87b5d159b5bdbe035e214ea7c9024fadb..be7a25560cd5521ddfe4793c7e51b103 } else { optional = Optional.empty(); } -@@ -889,7 +890,12 @@ public abstract class PlayerList { +@@ -893,7 +894,12 @@ public abstract class PlayerList { } // Spigot End @@ -44,7 +44,7 @@ index ec48afe87b5d159b5bdbe035e214ea7c9024fadb..be7a25560cd5521ddfe4793c7e51b103 if (!flag) entityplayer.reset(); // SPIGOT-4785 isRespawn = true; // Paper } else { -@@ -927,8 +933,12 @@ public abstract class PlayerList { +@@ -931,8 +937,12 @@ public abstract class PlayerList { } // entityplayer1.initInventoryMenu(); entityplayer1.setHealth(entityplayer1.getHealth()); diff --git a/patches/unapplied/server/0468-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/patches/server/0468-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch similarity index 100% rename from patches/unapplied/server/0468-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch rename to patches/server/0468-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch diff --git a/patches/unapplied/server/0469-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/0469-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch similarity index 100% rename from patches/unapplied/server/0469-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch rename to patches/server/0469-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch diff --git a/patches/unapplied/server/0470-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/patches/server/0470-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch similarity index 83% rename from patches/unapplied/server/0470-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch rename to patches/server/0470-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch index c03f4b1f88..484c50da0a 100644 --- a/patches/unapplied/server/0470-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch +++ b/patches/server/0470-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch @@ -60,22 +60,14 @@ index 06fc39b19385d36fd0c5bb9a7042a238eb6e8a57..bb1f0e9dbcb792d015d1cb65664a96fd 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 736e604205c0dcbe2cf1f1e0d507f53a9c0d941b..a4f2eb219cc57303cc6642e6782700591e423cf4 100644 +index 0c2f12e7930646a3da53a50f38be62e0cb1ed2b7..e7ec5e1144c1596b035f97fb1fb86d18e61be3c9 100644 --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java -@@ -39,6 +39,7 @@ import net.minecraft.advancements.Criterion; - import net.minecraft.advancements.CriterionProgress; - import net.minecraft.advancements.CriterionTrigger; - import net.minecraft.advancements.CriterionTriggerInstance; -+import net.minecraft.advancements.critereon.SimpleCriterionTrigger; - import net.minecraft.network.chat.ChatType; - import net.minecraft.network.chat.Component; - import net.minecraft.network.protocol.game.ClientboundSelectAdvancementsTabPacket; -@@ -69,6 +70,8 @@ public class PlayerAdvancements { +@@ -68,6 +68,8 @@ public class PlayerAdvancements { private Advancement lastSelectedTab; private boolean isFirstPacket = true; -+ public final Map> criterionData = Maps.newIdentityHashMap(); // Paper - fix advancement data player leakage ++ public final Map> criterionData = Maps.newIdentityHashMap(); // Paper - fix advancement data player leakage + public PlayerAdvancements(DataFixer dataFixer, PlayerList playerManager, ServerAdvancementManager advancementLoader, File advancementFile, ServerPlayer owner) { this.dataFixer = dataFixer; diff --git a/patches/unapplied/server/0471-Add-missing-strikeLighting-call-to-World-spigot-stri.patch b/patches/server/0471-Add-missing-strikeLighting-call-to-World-spigot-stri.patch similarity index 100% rename from patches/unapplied/server/0471-Add-missing-strikeLighting-call-to-World-spigot-stri.patch rename to patches/server/0471-Add-missing-strikeLighting-call-to-World-spigot-stri.patch diff --git a/patches/unapplied/server/0472-Fix-some-rails-connecting-improperly.patch b/patches/server/0472-Fix-some-rails-connecting-improperly.patch similarity index 100% rename from patches/unapplied/server/0472-Fix-some-rails-connecting-improperly.patch rename to patches/server/0472-Fix-some-rails-connecting-improperly.patch diff --git a/patches/unapplied/server/0473-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch b/patches/server/0473-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch similarity index 100% rename from patches/unapplied/server/0473-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch rename to patches/server/0473-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch diff --git a/patches/unapplied/server/0474-Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/server/0474-Do-not-let-the-server-load-chunks-from-newer-version.patch similarity index 100% rename from patches/unapplied/server/0474-Do-not-let-the-server-load-chunks-from-newer-version.patch rename to patches/server/0474-Do-not-let-the-server-load-chunks-from-newer-version.patch diff --git a/patches/unapplied/server/0475-Brand-support.patch b/patches/server/0475-Brand-support.patch similarity index 81% rename from patches/unapplied/server/0475-Brand-support.patch rename to patches/server/0475-Brand-support.patch index 40a041a7c5..e0dad47eb7 100644 --- a/patches/unapplied/server/0475-Brand-support.patch +++ b/patches/server/0475-Brand-support.patch @@ -5,10 +5,10 @@ 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 50226c6672ffb933fe7e22bf43641983eb6caa54..b924bf36e5a13d9fb7078e091e50c7e468bdd5b5 100644 +index b72924b80021a4b9748723af7b6b71544d7bede1..322c9d39cd63e1651e5bb1b9ba5b070a18bf5340 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -279,6 +279,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -296,6 +296,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 @@ -16,8 +16,8 @@ index 50226c6672ffb933fe7e22bf43641983eb6caa54..b924bf36e5a13d9fb7078e091e50c7e4 + public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH); - this.server = server; -@@ -3213,6 +3215,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser + this.lastSeenMessagesValidator = new LastSeenMessagesValidator(); +@@ -3430,6 +3432,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"); @@ -26,7 +26,7 @@ index 50226c6672ffb933fe7e22bf43641983eb6caa54..b924bf36e5a13d9fb7078e091e50c7e4 @Override public void handleCustomPayload(ServerboundCustomPayloadPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); -@@ -3240,6 +3244,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3457,6 +3461,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic try { byte[] data = new byte[packet.data.readableBytes()]; packet.data.readBytes(data); @@ -42,7 +42,7 @@ index 50226c6672ffb933fe7e22bf43641983eb6caa54..b924bf36e5a13d9fb7078e091e50c7e4 this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data); } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); -@@ -3249,6 +3262,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3466,6 +3479,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } @@ -56,10 +56,10 @@ index 50226c6672ffb933fe7e22bf43641983eb6caa54..b924bf36e5a13d9fb7078e091e50c7e4 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 1699ad9a3e0d03866a6a80a74a1a831f6d54d311..d06f6c9a7bfa7585d5dfb7da8654837605866a3e 100644 +index bd1611e9e83d0e579d38ad295d9f241570696cb3..d70be6515dbf00ab6fe5b3c05d208a5686ce0209 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2685,6 +2685,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2679,6 +2679,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/patches/unapplied/server/0476-Add-setMaxPlayers-API.patch b/patches/server/0476-Add-setMaxPlayers-API.patch similarity index 91% rename from patches/unapplied/server/0476-Add-setMaxPlayers-API.patch rename to patches/server/0476-Add-setMaxPlayers-API.patch index 1ca3cb5512..dc1fa81eb8 100644 --- a/patches/unapplied/server/0476-Add-setMaxPlayers-API.patch +++ b/patches/server/0476-Add-setMaxPlayers-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add #setMaxPlayers API diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index be7a25560cd5521ddfe4793c7e51b1036fc8a19c..869fa7c3913185c3537185426e75c076fbbdb7fe 100644 +index ec0ceaac85b5868849b6399cdf8eb2b4447508e3..32f8a030abb81aa29cab9432b72f9b522f1f6aa6 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -146,7 +146,7 @@ public abstract class PlayerList { +@@ -147,7 +147,7 @@ public abstract class PlayerList { public final PlayerDataStorage playerIo; private boolean doWhiteList; private final RegistryAccess.Frozen registryHolder; diff --git a/patches/unapplied/server/0477-Add-playPickupItemAnimation-to-LivingEntity.patch b/patches/server/0477-Add-playPickupItemAnimation-to-LivingEntity.patch similarity index 100% rename from patches/unapplied/server/0477-Add-playPickupItemAnimation-to-LivingEntity.patch rename to patches/server/0477-Add-playPickupItemAnimation-to-LivingEntity.patch diff --git a/patches/unapplied/server/0478-Don-t-require-FACING-data.patch b/patches/server/0478-Don-t-require-FACING-data.patch similarity index 100% rename from patches/unapplied/server/0478-Don-t-require-FACING-data.patch rename to patches/server/0478-Don-t-require-FACING-data.patch diff --git a/patches/unapplied/server/0479-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0479-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch similarity index 93% rename from patches/unapplied/server/0479-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch rename to patches/server/0479-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch index 8368326183..5767a3c53e 100644 --- a/patches/unapplied/server/0479-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch +++ b/patches/server/0479-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 848690e6dfaec00ec9b8a8397d2a6d37f24c8d12..bb8d5868275407fe3c5eb29174bf1970cae498f9 100644 +index c7221d169badfae6653d64cb39e1435372ea179a..f4ec0487051b0d61a79bef3067cb4fc19d64a544 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1850,6 +1850,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1851,6 +1851,7 @@ public class ServerLevel extends Level implements WorldGenLevel { //ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c())); this.levelData.setSpawn(pos, angle); diff --git a/patches/unapplied/server/0480-Add-moon-phase-API.patch b/patches/server/0480-Add-moon-phase-API.patch similarity index 100% rename from patches/unapplied/server/0480-Add-moon-phase-API.patch rename to patches/server/0480-Add-moon-phase-API.patch diff --git a/patches/unapplied/server/0481-Improve-Chunk-Status-Transition-Speed.patch b/patches/server/0481-Improve-Chunk-Status-Transition-Speed.patch similarity index 95% rename from patches/unapplied/server/0481-Improve-Chunk-Status-Transition-Speed.patch rename to patches/server/0481-Improve-Chunk-Status-Transition-Speed.patch index 0485c6fc55..a4f7a9420d 100644 --- a/patches/unapplied/server/0481-Improve-Chunk-Status-Transition-Speed.patch +++ b/patches/server/0481-Improve-Chunk-Status-Transition-Speed.patch @@ -54,10 +54,10 @@ index ece4cd0de061969d4d2f07560e6cf38e631098b3..90f65fdcc4acf6762c67a5cb3023d249 public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) { this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size()); diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index b486b800399b53cb6d4912e16f2a14f1a3062759..13c4bfa296c854b5dbbffc495a029c6822131529 100644 +index 7b1781faed02a5b5fa37ca6f079d1fb620315c80..b659a058a0b6eb6b1827aacbd703e15fcbb1609c 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -712,7 +712,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -709,7 +709,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return either.mapLeft((list) -> { return (LevelChunk) list.get(list.size() / 2); }); @@ -66,7 +66,7 @@ index b486b800399b53cb6d4912e16f2a14f1a3062759..13c4bfa296c854b5dbbffc495a029c68 } @Nullable -@@ -1118,6 +1118,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1115,6 +1115,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return "chunkGenerate " + requiredStatus.getName(); }); Executor executor = (runnable) -> { diff --git a/patches/unapplied/server/0482-Prevent-headless-pistons-from-being-created.patch b/patches/server/0482-Prevent-headless-pistons-from-being-created.patch similarity index 100% rename from patches/unapplied/server/0482-Prevent-headless-pistons-from-being-created.patch rename to patches/server/0482-Prevent-headless-pistons-from-being-created.patch diff --git a/patches/unapplied/server/0483-Add-BellRingEvent.patch b/patches/server/0483-Add-BellRingEvent.patch similarity index 100% rename from patches/unapplied/server/0483-Add-BellRingEvent.patch rename to patches/server/0483-Add-BellRingEvent.patch diff --git a/patches/unapplied/server/0484-Add-zombie-targets-turtle-egg-config.patch b/patches/server/0484-Add-zombie-targets-turtle-egg-config.patch similarity index 100% rename from patches/unapplied/server/0484-Add-zombie-targets-turtle-egg-config.patch rename to patches/server/0484-Add-zombie-targets-turtle-egg-config.patch diff --git a/patches/unapplied/server/0485-Buffer-joins-to-world.patch b/patches/server/0485-Buffer-joins-to-world.patch similarity index 68% rename from patches/unapplied/server/0485-Buffer-joins-to-world.patch rename to patches/server/0485-Buffer-joins-to-world.patch index bf33110d9e..b1dad652b0 100644 --- a/patches/unapplied/server/0485-Buffer-joins-to-world.patch +++ b/patches/server/0485-Buffer-joins-to-world.patch @@ -8,10 +8,10 @@ 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 ed4587248fada36c4c206be1fa36fef42fc969e2..ddde8f9f53f352c806166354e6a445543ecc2fbf 100644 +index c06cb0f0e300c4d00b3aeed12772c38e8379cb0c..eb18253d4ae0618884c9061f8dda689119e10ef0 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -387,10 +387,22 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -396,8 +396,23 @@ public class Connection extends SimpleChannelInboundHandler> { } // Paper end @@ -26,11 +26,12 @@ index ed4587248fada36c4c206be1fa36fef42fc969e2..ddde8f9f53f352c806166354e6a44554 + joinAttemptsThisTick = 0; + } + // Paper end - if (this.packetListener instanceof ServerLoginPacketListenerImpl) { ++ if (this.packetListener instanceof ServerLoginPacketListenerImpl) { + if ( ((ServerLoginPacketListenerImpl) this.packetListener).state != ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT // Paper -+ || (joinAttemptsThisTick++ < MAX_PER_TICK)) { // Paper - limit the number of joins which can be processed each tick - ((ServerLoginPacketListenerImpl) this.packetListener).tick(); ++ || (joinAttemptsThisTick++ < MAX_PER_TICK)) { // Paper - limit the number of joins which can be processed each tick ++ ((ServerLoginPacketListenerImpl) this.packetListener).tick(); + } // Paper - } ++ } + PacketListener packetlistener = this.packetListener; - if (this.packetListener instanceof ServerGamePacketListenerImpl) { + if (packetlistener instanceof TickablePacketListener) { diff --git a/patches/unapplied/server/0486-Eigencraft-redstone-implementation.patch b/patches/server/0486-Eigencraft-redstone-implementation.patch similarity index 100% rename from patches/unapplied/server/0486-Eigencraft-redstone-implementation.patch rename to patches/server/0486-Eigencraft-redstone-implementation.patch diff --git a/patches/unapplied/server/0487-Fix-hex-colors-not-working-in-some-kick-messages.patch b/patches/server/0487-Fix-hex-colors-not-working-in-some-kick-messages.patch similarity index 94% rename from patches/unapplied/server/0487-Fix-hex-colors-not-working-in-some-kick-messages.patch rename to patches/server/0487-Fix-hex-colors-not-working-in-some-kick-messages.patch index 3c9abb3a48..f4a48df6f5 100644 --- a/patches/unapplied/server/0487-Fix-hex-colors-not-working-in-some-kick-messages.patch +++ b/patches/server/0487-Fix-hex-colors-not-working-in-some-kick-messages.patch @@ -25,10 +25,10 @@ index 43759cdf3da0796d7969c6504ac9a6986c0f0518..750fef0f5b908b776a7306e54653eba4 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 e51c03e05c4407ad3a51e573a5e79b003f86d9f1..000ee7e12a1c756e065e99ebdbcf4a51047ec4d3 100644 +index 40b27dbdc15e07a6a9d63d41babe5ed0245c0e0b..0ad129adf726049c62f8d5c816cc32b3b6b9b2eb 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -111,7 +111,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener +@@ -113,7 +113,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se // CraftBukkit start @Deprecated public void disconnect(String s) { diff --git a/patches/unapplied/server/0488-PortalCreateEvent-needs-to-know-its-entity.patch b/patches/server/0488-PortalCreateEvent-needs-to-know-its-entity.patch similarity index 96% rename from patches/unapplied/server/0488-PortalCreateEvent-needs-to-know-its-entity.patch rename to patches/server/0488-PortalCreateEvent-needs-to-know-its-entity.patch index 431d375f7b..3c2cb7d994 100644 --- a/patches/unapplied/server/0488-PortalCreateEvent-needs-to-know-its-entity.patch +++ b/patches/server/0488-PortalCreateEvent-needs-to-know-its-entity.patch @@ -5,7 +5,7 @@ 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 8400f6fc96efecf0ea77f2e163b589ec375272cd..494a39cfafa5a632ccb61b196b0ec4e5772aa180 100644 +index cbcc90cffe38ea249cd0de4b0a90adc2a3ddeb0b..b4ad1610d30396be344a04f5f3a565ae2b8f2265 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -431,7 +431,7 @@ public final class ItemStack { @@ -79,10 +79,10 @@ index 5ce5902b13ebb9438433d189f2c03677e4cb54b3..e34b8cff424ad58eee65a65fa510fa99 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 0ff34d2c569fbeae95509abed343b1e2f593378a..d75eb5eef83c9b0d247c7d8cb5021e931fe3ef4c 100644 +index ad38a7ced7f3dc05fb3d133e9da39f0a5eb0915b..7117dd220c393163fd5be77e332e56a34c667670 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 -@@ -34,6 +34,7 @@ import net.minecraft.world.item.DyeColor; +@@ -35,6 +35,7 @@ import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; @@ -90,7 +90,7 @@ index 0ff34d2c569fbeae95509abed343b1e2f593378a..d75eb5eef83c9b0d247c7d8cb5021e93 import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.EmptyBlockGetter; import net.minecraft.world.level.Level; -@@ -135,6 +136,12 @@ public abstract class BlockBehaviour { +@@ -136,6 +137,12 @@ public abstract class BlockBehaviour { DebugPackets.sendNeighborsUpdatePacket(world, pos); } diff --git a/patches/unapplied/server/0489-Fix-CraftTeam-null-check.patch b/patches/server/0489-Fix-CraftTeam-null-check.patch similarity index 100% rename from patches/unapplied/server/0489-Fix-CraftTeam-null-check.patch rename to patches/server/0489-Fix-CraftTeam-null-check.patch diff --git a/patches/unapplied/server/0490-Add-more-Evoker-API.patch b/patches/server/0490-Add-more-Evoker-API.patch similarity index 100% rename from patches/unapplied/server/0490-Add-more-Evoker-API.patch rename to patches/server/0490-Add-more-Evoker-API.patch diff --git a/patches/unapplied/server/0491-Add-methods-to-get-translation-keys.patch b/patches/server/0491-Add-methods-to-get-translation-keys.patch similarity index 98% rename from patches/unapplied/server/0491-Add-methods-to-get-translation-keys.patch rename to patches/server/0491-Add-methods-to-get-translation-keys.patch index c099427caf..3085ca118e 100644 --- a/patches/unapplied/server/0491-Add-methods-to-get-translation-keys.patch +++ b/patches/server/0491-Add-methods-to-get-translation-keys.patch @@ -42,7 +42,7 @@ index a859a675b4bc543e139358223cc92ad5eee3ddb5..31a22f26070059e5379730c1940ff1c5 public net.minecraft.world.item.enchantment.Enchantment getHandle() { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7d9a91b2afb6890a160c2cd1e1cf3f0fb6a10d92..c5d570131cd3c9b43ab7889454923c29078e0915 100644 +index 61668447c4314562109e31bd5ca48da181e98529..79bd1a6d4003f990e667e9d66605e6cc74e05eee 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -478,6 +478,30 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0492-Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/0492-Create-HoverEvent-from-ItemStack-Entity.patch similarity index 100% rename from patches/unapplied/server/0492-Create-HoverEvent-from-ItemStack-Entity.patch rename to patches/server/0492-Create-HoverEvent-from-ItemStack-Entity.patch diff --git a/patches/unapplied/server/0493-Cache-block-data-strings.patch b/patches/server/0493-Cache-block-data-strings.patch similarity index 97% rename from patches/unapplied/server/0493-Cache-block-data-strings.patch rename to patches/server/0493-Cache-block-data-strings.patch index b059d4b2a9..7453cf6b1e 100644 --- a/patches/unapplied/server/0493-Cache-block-data-strings.patch +++ b/patches/server/0493-Cache-block-data-strings.patch @@ -5,7 +5,7 @@ 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 2257a93b9f28a3b30f03ecb08e21346e0deeb8bf..ac65ff966b5ecd0960340c5a4063843e7c5582f3 100644 +index b8b82e9fe3273e3b53c4877e47b74f0db4dd8630..ff2d51aa788d8605f901fa592491b5d2d0da27d1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -2015,6 +2015,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= level; } -@@ -1656,6 +1657,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1651,6 +1652,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public void moveTo(double x, double y, double z, float yaw, float pitch) { diff --git a/patches/unapplied/server/0495-Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/0495-Add-additional-open-container-api-to-HumanEntity.patch similarity index 100% rename from patches/unapplied/server/0495-Add-additional-open-container-api-to-HumanEntity.patch rename to patches/server/0495-Add-additional-open-container-api-to-HumanEntity.patch diff --git a/patches/unapplied/server/0496-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch b/patches/server/0496-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch similarity index 100% rename from patches/unapplied/server/0496-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch rename to patches/server/0496-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch diff --git a/patches/unapplied/server/0497-Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/0497-Extend-block-drop-capture-to-capture-all-items-added.patch similarity index 94% rename from patches/unapplied/server/0497-Extend-block-drop-capture-to-capture-all-items-added.patch rename to patches/server/0497-Extend-block-drop-capture-to-capture-all-items-added.patch index 41752c6cf5..fc9c540f9e 100644 --- a/patches/unapplied/server/0497-Extend-block-drop-capture-to-capture-all-items-added.patch +++ b/patches/server/0497-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 bb8d5868275407fe3c5eb29174bf1970cae498f9..2ac0db36942ecb6dd073bc08f42fb3d1a6c12f6d 100644 +index f4ec0487051b0d61a79bef3067cb4fc19d64a544..f1506529687e47150a3134b3d5acac8021abe956 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1287,6 +1287,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1288,6 +1288,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 { diff --git a/patches/unapplied/server/0498-Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch b/patches/server/0498-Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch similarity index 100% rename from patches/unapplied/server/0498-Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch rename to patches/server/0498-Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch diff --git a/patches/unapplied/server/0499-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0499-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch similarity index 84% rename from patches/unapplied/server/0499-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch rename to patches/server/0499-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index 324320a425..2f66970d3e 100644 --- a/patches/unapplied/server/0499-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/0499-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 602525fdfe46fbe6e480a60f3382d04c344c7117..c2a17211cc216b9cf83ff393bf69ef49a3e778e8 100644 +index 1ed2670ab0687793b9298c2c1deb92da93e7bfd2..511255467688d4c9397037753d2d4821af29bb79 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -4077,4 +4077,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4074,4 +4074,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { void accept(Entity entity, double x, double y, double z); } @@ -21,7 +21,7 @@ index 602525fdfe46fbe6e480a60f3382d04c344c7117..c2a17211cc216b9cf83ff393bf69ef49 + // 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 c5d570131cd3c9b43ab7889454923c29078e0915..7de4cf40d96caba35b43b6b4ac4daa1bf28ef27f 100644 +index 79bd1a6d4003f990e667e9d66605e6cc74e05eee..04b3608424e482daaae7b399e61cf0d5f8e03729 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -502,6 +502,10 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0500-Lazily-track-plugin-scoreboards-by-default.patch b/patches/server/0500-Lazily-track-plugin-scoreboards-by-default.patch similarity index 100% rename from patches/unapplied/server/0500-Lazily-track-plugin-scoreboards-by-default.patch rename to patches/server/0500-Lazily-track-plugin-scoreboards-by-default.patch diff --git a/patches/unapplied/server/0501-Entity-isTicking.patch b/patches/server/0501-Entity-isTicking.patch similarity index 91% rename from patches/unapplied/server/0501-Entity-isTicking.patch rename to patches/server/0501-Entity-isTicking.patch index bf0a469853..c2e18c0dd7 100644 --- a/patches/unapplied/server/0501-Entity-isTicking.patch +++ b/patches/server/0501-Entity-isTicking.patch @@ -5,7 +5,7 @@ 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 c2a17211cc216b9cf83ff393bf69ef49a3e778e8..c5cd18b02e5956fef6779b0b89d33b515bc9d13a 100644 +index 511255467688d4c9397037753d2d4821af29bb79..532678194c2724e31a19f0e4d73d79d84ef6699c 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -59,6 +59,7 @@ import net.minecraft.resources.ResourceKey; @@ -16,7 +16,7 @@ index c2a17211cc216b9cf83ff393bf69ef49a3e778e8..c5cd18b02e5956fef6779b0b89d33b51 import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.TicketType; -@@ -4082,5 +4083,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4079,5 +4080,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { public static int nextEntityId() { return ENTITY_COUNTER.incrementAndGet(); } diff --git a/patches/unapplied/server/0502-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/0502-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch similarity index 94% rename from patches/unapplied/server/0502-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch rename to patches/server/0502-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch index 52b55a6ae3..40da5f4bae 100644 --- a/patches/unapplied/server/0502-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch +++ b/patches/server/0502-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch @@ -6,7 +6,7 @@ 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 ac65ff966b5ecd0960340c5a4063843e7c5582f3..115e598dcb075a8019b588b878e9d22994f0ce9f 100644 +index ff2d51aa788d8605f901fa592491b5d2d0da27d1..6fd6d2a4faf8e72511170fb3c3aa80733ed0e8d9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -2081,13 +2081,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 1.0D) { -@@ -1335,9 +1357,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1401,9 +1423,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic AABB axisalignedbb = this.player.getBoundingBox(); diff --git a/patches/unapplied/server/0506-Optimise-getType-calls.patch b/patches/server/0506-Optimise-getType-calls.patch similarity index 100% rename from patches/unapplied/server/0506-Optimise-getType-calls.patch rename to patches/server/0506-Optimise-getType-calls.patch diff --git a/patches/unapplied/server/0507-Villager-resetOffers.patch b/patches/server/0507-Villager-resetOffers.patch similarity index 100% rename from patches/unapplied/server/0507-Villager-resetOffers.patch rename to patches/server/0507-Villager-resetOffers.patch diff --git a/patches/unapplied/server/0508-Improve-inlinig-for-some-hot-IBlockData-methods.patch b/patches/server/0508-Improve-inlinig-for-some-hot-IBlockData-methods.patch similarity index 91% rename from patches/unapplied/server/0508-Improve-inlinig-for-some-hot-IBlockData-methods.patch rename to patches/server/0508-Improve-inlinig-for-some-hot-IBlockData-methods.patch index 91ae1561af..3639390300 100644 --- a/patches/unapplied/server/0508-Improve-inlinig-for-some-hot-IBlockData-methods.patch +++ b/patches/server/0508-Improve-inlinig-for-some-hot-IBlockData-methods.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Improve inlinig for some hot IBlockData methods 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 d75eb5eef83c9b0d247c7d8cb5021e931fe3ef4c..254ac28e692cf06c3286c8f4c6edb9de412851a2 100644 +index 7117dd220c393163fd5be77e332e56a34c667670..178d9ad7525b6743038ed45c6f85686a860ffd26 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 -@@ -716,8 +716,14 @@ public abstract class BlockBehaviour { +@@ -717,8 +717,14 @@ public abstract class BlockBehaviour { return this.shapeExceedsCube; } // Paper end @@ -23,7 +23,7 @@ index d75eb5eef83c9b0d247c7d8cb5021e931fe3ef4c..254ac28e692cf06c3286c8f4c6edb9de if (!this.getBlock().hasDynamicShape()) { this.cache = new BlockBehaviour.BlockStateBase.Cache(this.asState()); } -@@ -767,15 +773,15 @@ public abstract class BlockBehaviour { +@@ -768,15 +774,15 @@ public abstract class BlockBehaviour { return this.shapeExceedsCube; // Paper - moved into shape cache init } @@ -42,7 +42,7 @@ index d75eb5eef83c9b0d247c7d8cb5021e931fe3ef4c..254ac28e692cf06c3286c8f4c6edb9de return this.isAir; } -@@ -849,7 +855,7 @@ public abstract class BlockBehaviour { +@@ -850,7 +856,7 @@ public abstract class BlockBehaviour { } } @@ -51,7 +51,7 @@ index d75eb5eef83c9b0d247c7d8cb5021e931fe3ef4c..254ac28e692cf06c3286c8f4c6edb9de return this.canOcclude; } -@@ -1047,12 +1053,12 @@ public abstract class BlockBehaviour { +@@ -1048,12 +1054,12 @@ public abstract class BlockBehaviour { return this.getBlock() == block; } diff --git a/patches/unapplied/server/0509-Retain-block-place-order-when-capturing-blockstates.patch b/patches/server/0509-Retain-block-place-order-when-capturing-blockstates.patch similarity index 100% rename from patches/unapplied/server/0509-Retain-block-place-order-when-capturing-blockstates.patch rename to patches/server/0509-Retain-block-place-order-when-capturing-blockstates.patch diff --git a/patches/unapplied/server/0510-Reduce-blockpos-allocation-from-pathfinding.patch b/patches/server/0510-Reduce-blockpos-allocation-from-pathfinding.patch similarity index 100% rename from patches/unapplied/server/0510-Reduce-blockpos-allocation-from-pathfinding.patch rename to patches/server/0510-Reduce-blockpos-allocation-from-pathfinding.patch diff --git a/patches/unapplied/server/0511-Fix-item-locations-dropped-from-campfires.patch b/patches/server/0511-Fix-item-locations-dropped-from-campfires.patch similarity index 100% rename from patches/unapplied/server/0511-Fix-item-locations-dropped-from-campfires.patch rename to patches/server/0511-Fix-item-locations-dropped-from-campfires.patch diff --git a/patches/unapplied/server/0512-Player-elytra-boost-API.patch b/patches/server/0512-Player-elytra-boost-API.patch similarity index 94% rename from patches/unapplied/server/0512-Player-elytra-boost-API.patch rename to patches/server/0512-Player-elytra-boost-API.patch index 5c4eddda62..050ed8a8a7 100644 --- a/patches/unapplied/server/0512-Player-elytra-boost-API.patch +++ b/patches/server/0512-Player-elytra-boost-API.patch @@ -5,7 +5,7 @@ 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 d06f6c9a7bfa7585d5dfb7da8654837605866a3e..c94a7ccb3d5420dc0c8493d5cb0381a47ea8f9a0 100644 +index d70be6515dbf00ab6fe5b3c05d208a5686ce0209..a2a227f24855c89a1a8c45507f8ab0bd750638c4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -592,6 +592,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/unapplied/server/0513-Fixed-TileEntityBell-memory-leak.patch b/patches/server/0513-Fixed-TileEntityBell-memory-leak.patch similarity index 100% rename from patches/unapplied/server/0513-Fixed-TileEntityBell-memory-leak.patch rename to patches/server/0513-Fixed-TileEntityBell-memory-leak.patch diff --git a/patches/unapplied/server/0514-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch b/patches/server/0514-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch similarity index 100% rename from patches/unapplied/server/0514-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch rename to patches/server/0514-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch diff --git a/patches/unapplied/server/0515-Add-getOfflinePlayerIfCached-String.patch b/patches/server/0515-Add-getOfflinePlayerIfCached-String.patch similarity index 100% rename from patches/unapplied/server/0515-Add-getOfflinePlayerIfCached-String.patch rename to patches/server/0515-Add-getOfflinePlayerIfCached-String.patch diff --git a/patches/unapplied/server/0516-Add-ignore-discounts-API.patch b/patches/server/0516-Add-ignore-discounts-API.patch similarity index 100% rename from patches/unapplied/server/0516-Add-ignore-discounts-API.patch rename to patches/server/0516-Add-ignore-discounts-API.patch diff --git a/patches/unapplied/server/0517-Toggle-for-removing-existing-dragon.patch b/patches/server/0517-Toggle-for-removing-existing-dragon.patch similarity index 100% rename from patches/unapplied/server/0517-Toggle-for-removing-existing-dragon.patch rename to patches/server/0517-Toggle-for-removing-existing-dragon.patch diff --git a/patches/unapplied/server/0518-Fix-client-lag-on-advancement-loading.patch b/patches/server/0518-Fix-client-lag-on-advancement-loading.patch similarity index 95% rename from patches/unapplied/server/0518-Fix-client-lag-on-advancement-loading.patch rename to patches/server/0518-Fix-client-lag-on-advancement-loading.patch index e48d21e361..b4148f901c 100644 --- a/patches/unapplied/server/0518-Fix-client-lag-on-advancement-loading.patch +++ b/patches/server/0518-Fix-client-lag-on-advancement-loading.patch @@ -15,7 +15,7 @@ manually reload the advancement data for all players, which normally takes place as a part of the datapack reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7de4cf40d96caba35b43b6b4ac4daa1bf28ef27f..4192a6eff940bfe7823f100d4156f5c4d82d994c 100644 +index 04b3608424e482daaae7b399e61cf0d5f8e03729..9f08928bdfc1644b7f902c1685c3324d6ee896c1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -340,7 +340,13 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0519-Item-no-age-no-player-pickup.patch b/patches/server/0519-Item-no-age-no-player-pickup.patch similarity index 100% rename from patches/unapplied/server/0519-Item-no-age-no-player-pickup.patch rename to patches/server/0519-Item-no-age-no-player-pickup.patch diff --git a/patches/unapplied/server/0520-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/0520-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch similarity index 100% rename from patches/unapplied/server/0520-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch rename to patches/server/0520-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch diff --git a/patches/unapplied/server/0521-Beacon-API-custom-effect-ranges.patch b/patches/server/0521-Beacon-API-custom-effect-ranges.patch similarity index 100% rename from patches/unapplied/server/0521-Beacon-API-custom-effect-ranges.patch rename to patches/server/0521-Beacon-API-custom-effect-ranges.patch diff --git a/patches/unapplied/server/0522-Add-API-for-quit-reason.patch b/patches/server/0522-Add-API-for-quit-reason.patch similarity index 86% rename from patches/unapplied/server/0522-Add-API-for-quit-reason.patch rename to patches/server/0522-Add-API-for-quit-reason.patch index 33b22a2441..d8bbec4b7c 100644 --- a/patches/unapplied/server/0522-Add-API-for-quit-reason.patch +++ b/patches/server/0522-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 ddde8f9f53f352c806166354e6a445543ecc2fbf..91556b52edaa1d5c4dc73a825c77b9a66b002c61 100644 +index eb18253d4ae0618884c9061f8dda689119e10ef0..cc1aa02fdf214b63aa105f3b0b12723dc359d287 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -151,12 +151,15 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -147,12 +147,15 @@ public class Connection extends SimpleChannelInboundHandler> { this.handlingFault = true; if (this.channel.isOpen()) { @@ -25,10 +25,10 @@ index ddde8f9f53f352c806166354e6a445543ecc2fbf..91556b52edaa1d5c4dc73a825c77b9a6 Connection.LOGGER.debug("Failed to sent packet", throwable); ConnectionProtocol enumprotocol = this.getCurrentProtocol(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 059e4f221f4e509bbdf2b5034890af49f5415d5b..c9bb90854af9881f044c1968d116368957cc1d7d 100644 +index 514d2d69980f843b5bc9339e63c48ba0e1176df5..8c6f55efb555c9ca7253ccc1cd9ba615cfb1171c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -265,6 +265,7 @@ public class ServerPlayer extends Player { +@@ -266,6 +266,7 @@ public class ServerPlayer extends Player { public double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper @@ -37,22 +37,22 @@ index 059e4f221f4e509bbdf2b5034890af49f5415d5b..c9bb90854af9881f044c1968d1163689 public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, @Nullable ProfilePublicKey publicKey) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile, publicKey); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f1a41a931b22f88f0dd530fb559b1c2ed839527a..2687823d07df2c4b57cb684000621c69c1cfd10d 100644 +index 09edf5f6bbff8ae4af093d03e9a9f06337e87caa..31295e991b4269bc36293a70ba10738b9668244e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -469,6 +469,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -518,6 +518,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure // CraftBukkit end + this.player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.KICKED; // Paper - this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> { + this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> { 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 869fa7c3913185c3537185426e75c076fbbdb7fe..0dad9a0c98cc128d990d9bd2357895d9a07a0ac7 100644 +index 32f8a030abb81aa29cab9432b72f9b522f1f6aa6..596750b47b8e780c0387b634a48282fa9383dc01 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -600,7 +600,7 @@ public abstract class PlayerList { +@@ -604,7 +604,7 @@ public abstract class PlayerList { entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper } diff --git a/patches/unapplied/server/0523-Add-Wandering-Trader-spawn-rate-config-options.patch b/patches/server/0523-Add-Wandering-Trader-spawn-rate-config-options.patch similarity index 100% rename from patches/unapplied/server/0523-Add-Wandering-Trader-spawn-rate-config-options.patch rename to patches/server/0523-Add-Wandering-Trader-spawn-rate-config-options.patch diff --git a/patches/unapplied/server/0524-Expose-world-spawn-angle.patch b/patches/server/0524-Expose-world-spawn-angle.patch similarity index 89% rename from patches/unapplied/server/0524-Expose-world-spawn-angle.patch rename to patches/server/0524-Expose-world-spawn-angle.patch index 769d8e8343..2d90e9601a 100644 --- a/patches/unapplied/server/0524-Expose-world-spawn-angle.patch +++ b/patches/server/0524-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 0dad9a0c98cc128d990d9bd2357895d9a07a0ac7..75c713f7afd8c4fd5fffada7397b102751eb6423 100644 +index 596750b47b8e780c0387b634a48282fa9383dc01..e18c38132536e9d671376f7bf1a75941063a5136 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -878,7 +878,7 @@ public abstract class PlayerList { +@@ -882,7 +882,7 @@ public abstract class PlayerList { if (location == null) { worldserver1 = this.server.getLevel(Level.OVERWORLD); blockposition = entityplayer1.getSpawnPoint(worldserver1); diff --git a/patches/unapplied/server/0525-Add-Destroy-Speed-API.patch b/patches/server/0525-Add-Destroy-Speed-API.patch similarity index 100% rename from patches/unapplied/server/0525-Add-Destroy-Speed-API.patch rename to patches/server/0525-Add-Destroy-Speed-API.patch diff --git a/patches/unapplied/server/0526-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0526-Fix-Player-spawnParticle-x-y-z-precision-loss.patch similarity index 93% rename from patches/unapplied/server/0526-Fix-Player-spawnParticle-x-y-z-precision-loss.patch rename to patches/server/0526-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index 8a7c0c0a6f..1450765bc3 100644 --- a/patches/unapplied/server/0526-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0526-Fix-Player-spawnParticle-x-y-z-precision-loss.patch @@ -5,7 +5,7 @@ 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 c94a7ccb3d5420dc0c8493d5cb0381a47ea8f9a0..39e0f1398e6f09ce7b0a4f1c9b677dca10a32c3f 100644 +index a2a227f24855c89a1a8c45507f8ab0bd750638c4..ced1fd7ac0cbc80d5d65c95163ee271b26281773 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2261,7 +2261,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/unapplied/server/0527-Add-LivingEntity-clearActiveItem.patch b/patches/server/0527-Add-LivingEntity-clearActiveItem.patch similarity index 100% rename from patches/unapplied/server/0527-Add-LivingEntity-clearActiveItem.patch rename to patches/server/0527-Add-LivingEntity-clearActiveItem.patch diff --git a/patches/unapplied/server/0528-Add-PlayerItemCooldownEvent.patch b/patches/server/0528-Add-PlayerItemCooldownEvent.patch similarity index 100% rename from patches/unapplied/server/0528-Add-PlayerItemCooldownEvent.patch rename to patches/server/0528-Add-PlayerItemCooldownEvent.patch diff --git a/patches/unapplied/server/0529-Significantly-improve-performance-of-the-end-generat.patch b/patches/server/0529-Significantly-improve-performance-of-the-end-generat.patch similarity index 71% rename from patches/unapplied/server/0529-Significantly-improve-performance-of-the-end-generat.patch rename to patches/server/0529-Significantly-improve-performance-of-the-end-generat.patch index 8986e82f72..c223e5c115 100644 --- a/patches/unapplied/server/0529-Significantly-improve-performance-of-the-end-generat.patch +++ b/patches/server/0529-Significantly-improve-performance-of-the-end-generat.patch @@ -12,7 +12,7 @@ Co-authored-by: Dylan Xaldin Co-authored-by: pop4959 diff --git a/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java b/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java -index 6825feea42667a0f14c4c730e5f1ac970c654c56..1d00c019eb976de22be6e5e1f3632ca0c00d77ea 100644 +index 683474cd96d3a0cdfb3b22d0111c8d3231f01d92..f09fd5027535d2fc4d4afae010f08e7accff45b3 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java +++ b/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java @@ -489,6 +489,16 @@ public final class DensityFunctions { @@ -33,31 +33,31 @@ index 6825feea42667a0f14c4c730e5f1ac970c654c56..1d00c019eb976de22be6e5e1f3632ca0 public EndIslandDensityFunction(long seed) { RandomSource randomSource = new LegacyRandomSource(seed); @@ -504,12 +514,26 @@ public final class DensityFunctions { - float f = 100.0F - Mth.sqrt((long) i * (long) i + (long) j * (long) j) * 8.0F; // Paper - cast ints to long to avoid integer overflow + float f = 100.0F - Mth.sqrt((long) x * (long) x + (long) z * (long) z) * 8.0F; // Paper - cast ints to long to avoid integer overflow f = Mth.clamp(f, -100.0F, 80.0F); -+ NoiseCache cache = noiseCache.get().computeIfAbsent(simplexNoise, noiseKey -> new NoiseCache()); // Paper - for(int o = -12; o <= 12; ++o) { - for(int p = -12; p <= 12; ++p) { - long q = (long)(k + o); - long r = (long)(l + p); -- if (q * q + r * r > 4096L && simplexNoise.getValue((double)q, (double)r) < (double)-0.9F) { -- float g = (Mth.abs((float)q) * 3439.0F + Mth.abs((float)r) * 147.0F) % 13.0F + 9.0F; ++ NoiseCache cache = noiseCache.get().computeIfAbsent(sampler, noiseKey -> new NoiseCache()); // Paper + for(int m = -12; m <= 12; ++m) { + for(int n = -12; n <= 12; ++n) { + long o = (long)(i + m); + long p = (long)(j + n); +- if (o * o + p * p > 4096L && sampler.getValue((double)o, (double)p) < (double)-0.9F) { +- float g = (Mth.abs((float)o) * 3439.0F + Mth.abs((float)p) * 147.0F) % 13.0F + 9.0F; + // Paper start - Significantly improve end generation performance by using a noise cache -+ long key = net.minecraft.world.level.ChunkPos.asLong((int) q, (int) r); ++ long key = net.minecraft.world.level.ChunkPos.asLong((int) o, (int) p); + int index = (int) it.unimi.dsi.fastutil.HashCommon.mix(key) & 8191; + float g = Float.MIN_VALUE; + if (cache.keys[index] == key) { + g = cache.values[index]; + } else { -+ if (q * q + r * r > 4096L && simplexNoise.getValue((double)q, (double)r) < (double)-0.9F) { -+ g = (Mth.abs((float) q) * 3439.0F + Mth.abs((float) r) * 147.0F) % 13.0F + 9.0F; ++ if (o * o + p * p > 4096L && sampler.getValue((double)o, (double)p) < (double)-0.9F) { ++ g = (Mth.abs((float) o) * 3439.0F + Mth.abs((float) p) * 147.0F) % 13.0F + 9.0F; + } + cache.keys[index] = key; + cache.values[index] = g; + } + if (g != Float.MIN_VALUE) { + // Paper end - float h = (float)(m - o * 2); - float s = (float)(n - p * 2); - float t = 100.0F - Mth.sqrt(h * h + s * s) * g; + float h = (float)(k - m * 2); + float q = (float)(l - n * 2); + float r = 100.0F - Mth.sqrt(h * h + q * q) * g; diff --git a/patches/unapplied/server/0530-More-lightning-API.patch b/patches/server/0530-More-lightning-API.patch similarity index 100% rename from patches/unapplied/server/0530-More-lightning-API.patch rename to patches/server/0530-More-lightning-API.patch diff --git a/patches/unapplied/server/0531-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0531-Climbing-should-not-bypass-cramming-gamerule.patch similarity index 95% rename from patches/unapplied/server/0531-Climbing-should-not-bypass-cramming-gamerule.patch rename to patches/server/0531-Climbing-should-not-bypass-cramming-gamerule.patch index b97441d14d..50b7fcd2d3 100644 --- a/patches/unapplied/server/0531-Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/0531-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 c5cd18b02e5956fef6779b0b89d33b515bc9d13a..933b49da673c07e45f6cb5727598df492cf1a958 100644 +index 532678194c2724e31a19f0e4d73d79d84ef6699c..11a5a0b3002300b882511b4ebafe96af5e230cb8 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1837,6 +1837,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1832,6 +1832,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public boolean isPushable() { @@ -45,10 +45,10 @@ index 22f36cd3df49160f1b6668befdd05c2268edaa49..e39965c2e50bc8ee424ea07819346e06 } 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 289073daacc2d477e965e668c6fb4041d27e3f8c..9310770edd38107211dafb94529d0edc73889e85 100644 +index 09513bc7a5b78580da415d486369b9403e99c773..502d54845e1bcf538149a51be995320c6df10acb 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3332,7 +3332,7 @@ public abstract class LivingEntity extends Entity { +@@ -3335,7 +3335,7 @@ public abstract class LivingEntity extends Entity { return; } // Paper end - don't run getEntities if we're not going to use its result @@ -57,7 +57,7 @@ index 289073daacc2d477e965e668c6fb4041d27e3f8c..9310770edd38107211dafb94529d0edc if (!list.isEmpty()) { // Paper - move up -@@ -3495,9 +3495,16 @@ public abstract class LivingEntity extends Entity { +@@ -3498,9 +3498,16 @@ public abstract class LivingEntity extends Entity { return !this.isRemoved() && this.collides; // CraftBukkit } diff --git a/patches/unapplied/server/0532-Added-missing-default-perms-for-commands.patch b/patches/server/0532-Added-missing-default-perms-for-commands.patch similarity index 100% rename from patches/unapplied/server/0532-Added-missing-default-perms-for-commands.patch rename to patches/server/0532-Added-missing-default-perms-for-commands.patch diff --git a/patches/unapplied/server/0533-Add-PlayerShearBlockEvent.patch b/patches/server/0533-Add-PlayerShearBlockEvent.patch similarity index 100% rename from patches/unapplied/server/0533-Add-PlayerShearBlockEvent.patch rename to patches/server/0533-Add-PlayerShearBlockEvent.patch diff --git a/patches/unapplied/server/0534-Fix-curing-zombie-villager-discount-exploit.patch b/patches/server/0534-Fix-curing-zombie-villager-discount-exploit.patch similarity index 100% rename from patches/unapplied/server/0534-Fix-curing-zombie-villager-discount-exploit.patch rename to patches/server/0534-Fix-curing-zombie-villager-discount-exploit.patch diff --git a/patches/unapplied/server/0535-Limit-recipe-packets.patch b/patches/server/0535-Limit-recipe-packets.patch similarity index 86% rename from patches/unapplied/server/0535-Limit-recipe-packets.patch rename to patches/server/0535-Limit-recipe-packets.patch index 4fab8524f0..c5942ad0b9 100644 --- a/patches/unapplied/server/0535-Limit-recipe-packets.patch +++ b/patches/server/0535-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 2687823d07df2c4b57cb684000621c69c1cfd10d..8254c6d3bcff79c9a718c89f8c04c2c2db035a8f 100644 +index 31295e991b4269bc36293a70ba10738b9668244e..04bd217574e4395f3a42511d7e8b1938f5106cec 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -248,6 +248,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -261,6 +261,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // 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 2687823d07df2c4b57cb684000621c69c1cfd10d..8254c6d3bcff79c9a718c89f8c04c2c2 // CraftBukkit end private int dropSpamTickCount; private double firstGoodX; -@@ -400,6 +401,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -428,6 +429,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // 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 2687823d07df2c4b57cb684000621c69c1cfd10d..8254c6d3bcff79c9a718c89f8c04c2c2 /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -3019,6 +3021,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -3224,6 +3226,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { diff --git a/patches/unapplied/server/0438-Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/unapplied/server/0438-Add-and-implement-PlayerRecipeBookClickEvent.patch deleted file mode 100644 index e38911a158..0000000000 --- a/patches/unapplied/server/0438-Add-and-implement-PlayerRecipeBookClickEvent.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: JRoy -Date: Fri, 5 Jun 2020 18:24:06 -0400 -Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent - - -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index c03867ed9a66a408900cadf81b09704e415dfca6..00a8b49b4e3b443fed22761b57ebcfa64c8d46aa 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2997,9 +2997,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); - this.player.resetLastActionTime(); - if (!this.player.isSpectator() && this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu instanceof RecipeBookMenu) { -- this.server.getRecipeManager().byKey(packet.getRecipe()).ifPresent((irecipe) -> { -- ((RecipeBookMenu) this.player.containerMenu).handlePlacement(packet.isShiftDown(), irecipe, this.player); -- }); -+ // Paper start - fire event for clicking recipes in the recipe book -+ com.destroystokyo.paper.event.player.PlayerRecipeBookClickEvent event = new com.destroystokyo.paper.event.player.PlayerRecipeBookClickEvent( -+ player.getBukkitEntity(), org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(packet.getRecipe()), packet.isShiftDown()); -+ if (event.callEvent() && this.player.containerMenu instanceof RecipeBookMenu recipeBookMenu) { // check if inventory changed during event handling -+ this.server.getRecipeManager().byKey(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getRecipe())).ifPresent((irecipe) -> { -+ recipeBookMenu.handlePlacement(event.isMakeAll(), irecipe, this.player); -+ }); -+ } // Paper end - } - } -