aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-01-24 22:13:08 +0100
committerNassim Jahnke <[email protected]>2024-01-25 00:41:51 +0100
commit1831240d1c48086fc0199584787cd2013d4d4b5f (patch)
treed61d8d63ec61e8394df0b9c7db9219e1518741c2
parentb7004609991dab287b582a1546a1b59c5d90c916 (diff)
downloadPaper-1831240d1c48086fc0199584787cd2013d4d4b5f.tar.gz
Paper-1831240d1c48086fc0199584787cd2013d4d4b5f.zip
[ci skip] Move chunk system patch back
-rw-r--r--patches/api/0018-Add-view-distance-API.patch24
-rw-r--r--patches/api/0092-Player.setPlayerProfile-API.patch4
-rw-r--r--patches/api/0095-Add-openSign-method-to-HumanEntity.patch4
-rw-r--r--patches/api/0145-Expose-attack-cooldown-methods-for-Player.patch4
-rw-r--r--patches/api/0173-Fix-Spigot-annotation-mistakes.patch12
-rw-r--r--patches/api/0190-Add-Player-Client-Options-API.patch4
-rw-r--r--patches/api/0208-Brand-support.patch4
-rw-r--r--patches/api/0218-Player-elytra-boost-API.patch4
-rw-r--r--patches/api/0245-Add-sendOpLevel-API.patch4
-rw-r--r--patches/api/0366-More-Teleport-API.patch6
-rw-r--r--patches/api/0368-Custom-Chat-Completion-Suggestions-API.patch4
-rw-r--r--patches/api/0378-Elder-Guardian-appearance-API.patch4
-rw-r--r--patches/api/0386-Add-Player-Warden-Warning-API.patch4
-rw-r--r--patches/api/0438-Add-player-idle-duration-API.patch4
-rw-r--r--patches/server/0005-Paper-config-files.patch4
-rw-r--r--patches/server/0009-MC-Utils.patch396
-rw-r--r--patches/server/0010-Adventure.patch20
-rw-r--r--patches/server/0011-Paper-command.patch4
-rw-r--r--patches/server/0013-Paper-Plugins.patch4
-rw-r--r--patches/server/0014-Timings-v2.patch38
-rw-r--r--patches/server/0016-Starlight.patch8
-rw-r--r--patches/server/0017-Add-TickThread.patch14
-rw-r--r--patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch2
-rw-r--r--patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch2
-rw-r--r--patches/server/0052-Improve-Player-chat-API-handling.patch4
-rw-r--r--patches/server/0054-Expose-server-CommandMap.patch2
-rw-r--r--patches/server/0058-Add-velocity-warnings.patch2
-rw-r--r--patches/server/0065-Default-loading-permissions.yml-before-plugins.patch2
-rw-r--r--patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch4
-rw-r--r--patches/server/0067-Remove-Metadata-on-reload.patch2
-rw-r--r--patches/server/0079-Sanitise-RegionFileCache-and-make-configurable.patch2
-rw-r--r--patches/server/0102-Add-setting-for-proxy-online-mode-status.patch2
-rw-r--r--patches/server/0109-Allow-Reloading-of-Command-Aliases.patch4
-rw-r--r--patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch4
-rw-r--r--patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch2
-rw-r--r--patches/server/0135-Basic-PlayerProfile-API.patch4
-rw-r--r--patches/server/0136-Add-UnknownCommandEvent.patch2
-rw-r--r--patches/server/0162-AsyncTabCompleteEvent.patch2
-rw-r--r--patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch10
-rw-r--r--patches/server/0178-getPlayerUniqueId-API.patch2
-rw-r--r--patches/server/0229-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch10
-rw-r--r--patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch2
-rw-r--r--patches/server/0273-Make-the-default-permission-message-configurable.patch4
-rw-r--r--patches/server/0301-Expose-the-internal-current-tick.patch4
-rw-r--r--patches/server/0311-Duplicate-UUID-Resolve-Option.patch6
-rw-r--r--patches/server/0321-Tracking-Range-Improvements.patch8
-rw-r--r--patches/server/0325-Optimise-getChunkAt-calls-for-loaded-chunks.patch6
-rw-r--r--patches/server/0326-Add-debug-for-sync-chunk-loads.patch12
-rw-r--r--patches/server/0338-Add-tick-times-API-and-mspt-command.patch2
-rw-r--r--patches/server/0339-Expose-MinecraftServer-isRunning.patch4
-rw-r--r--patches/server/0344-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch6
-rw-r--r--patches/server/0355-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch4
-rw-r--r--patches/server/0363-Expose-game-version.patch2
-rw-r--r--patches/server/0365-misc-debugging-dumps.patch2
-rw-r--r--patches/server/0368-Implement-Mob-Goal-API.patch4
-rw-r--r--patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch2
-rw-r--r--patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch4
-rw-r--r--patches/server/0395-Add-Plugin-Tickets-to-API-Chunk-Methods.patch4
-rw-r--r--patches/server/0396-Add-BlockStateMeta-clearBlockState.patch (renamed from patches/server/1041-Add-BlockStateMeta-clearBlockState.patch)0
-rw-r--r--patches/server/0407-Fix-SPIGOT-5989.patch10
-rw-r--r--patches/server/0414-Brand-support.patch6
-rw-r--r--patches/server/0417-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch6
-rw-r--r--patches/server/0429-Cache-block-data-strings.patch4
-rw-r--r--patches/server/0433-Extend-block-drop-capture-to-capture-all-items-added.patch4
-rw-r--r--patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch4
-rw-r--r--patches/server/0448-Add-getOfflinePlayerIfCached-String.patch2
-rw-r--r--patches/server/0454-Add-API-for-quit-reason.patch8
-rw-r--r--patches/server/0456-Expose-world-spawn-angle.patch4
-rw-r--r--patches/server/0487-Add-ServerResourcesReloadedEvent.patch6
-rw-r--r--patches/server/0494-Remove-stale-POIs.patch4
-rw-r--r--patches/server/0495-Fix-villager-boat-exploit.patch4
-rw-r--r--patches/server/0496-Add-sendOpLevel-API.patch8
-rw-r--r--patches/server/0509-Reset-shield-blocking-on-dimension-change.patch4
-rw-r--r--patches/server/0511-Add-EntityMoveEvent.patch6
-rw-r--r--patches/server/0512-added-option-to-disable-pathfinding-updates-on-block.patch6
-rw-r--r--patches/server/0520-Improve-ServerGUI.patch4
-rw-r--r--patches/server/0528-Expand-world-key-API.patch2
-rw-r--r--patches/server/0531-Drop-carried-item-when-player-has-disconnected.patch4
-rw-r--r--patches/server/0532-forced-whitelist-use-configurable-kick-message.patch4
-rw-r--r--patches/server/0548-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch10
-rw-r--r--patches/server/0558-Add-basic-Datapack-API.patch4
-rw-r--r--patches/server/0560-Expand-PlayerGameModeChangeEvent.patch10
-rw-r--r--patches/server/0572-Add-PlayerKickEvent-causes.patch12
-rw-r--r--patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch4
-rw-r--r--patches/server/0594-Fix-kick-event-leave-message-not-being-sent.patch8
-rw-r--r--patches/server/0596-Don-t-apply-cramming-damage-to-players.patch4
-rw-r--r--patches/server/0601-Add-System.out-err-catcher.patch2
-rw-r--r--patches/server/0605-Add-PlayerSetSpawnEvent.patch14
-rw-r--r--patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch8
-rw-r--r--patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch4
-rw-r--r--patches/server/0642-Oprimise-map-impl-for-tracked-players.patch (renamed from patches/server/0643-Oprimise-map-impl-for-tracked-players.patch)4
-rw-r--r--patches/server/0643-Add-missing-InventoryType.patch (renamed from patches/server/0985-Add-missing-InventoryType.patch)0
-rw-r--r--patches/server/0645-Fix-merchant-inventory-not-closing-on-entity-removal.patch4
-rw-r--r--patches/server/0651-Ensure-valid-vehicle-status.patch4
-rw-r--r--patches/server/0661-Configurable-feature-seeds.patch4
-rw-r--r--patches/server/0674-Allow-delegation-to-vanilla-chunk-gen.patch2
-rw-r--r--patches/server/0688-Validate-usernames.patch4
-rw-r--r--patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch6
-rw-r--r--patches/server/0702-API-for-creating-command-sender-which-forwards-feedb.patch2
-rw-r--r--patches/server/0706-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch2
-rw-r--r--patches/server/0707-Add-GameEvent-tags.patch2
-rw-r--r--patches/server/0713-Put-world-into-worldlist-before-initing-the-world.patch4
-rw-r--r--patches/server/0715-Custom-Potion-Mixes.patch8
-rw-r--r--patches/server/0726-Fix-saving-in-unloadWorld.patch2
-rw-r--r--patches/server/0730-fix-player-loottables-running-when-mob-loot-gamerule.patch4
-rw-r--r--patches/server/0737-Use-username-instead-of-display-name-in-PlayerList-g.patch4
-rw-r--r--patches/server/0740-WorldCreator-keepSpawnLoaded.patch2
-rw-r--r--patches/server/0747-Don-t-tick-markers.patch4
-rw-r--r--patches/server/0751-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch (renamed from patches/server/0752-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch)0
-rw-r--r--patches/server/0752-properly-read-and-store-sus-effect-duration.patch (renamed from patches/server/0980-properly-read-and-store-sus-effect-duration.patch)2
-rw-r--r--patches/server/0755-Prevent-entity-loading-causing-async-lookups.patch4
-rw-r--r--patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch12
-rw-r--r--patches/server/0759-Add-option-for-strict-advancement-dimension-checks.patch4
-rw-r--r--patches/server/0760-Add-missing-important-BlockStateListPopulator-method.patch11
-rw-r--r--patches/server/0762-Don-t-broadcast-messages-to-command-blocks.patch4
-rw-r--r--patches/server/0763-Prevent-empty-items-from-being-added-to-world.patch4
-rw-r--r--patches/server/0767-Add-various-missing-EntityDropItemEvent-calls.patch4
-rw-r--r--patches/server/0769-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch4
-rw-r--r--patches/server/0770-More-Teleport-API.patch16
-rw-r--r--patches/server/0771-Add-EntityPortalReadyEvent.patch6
-rw-r--r--patches/server/0773-Send-block-entities-after-destroy-prediction.patch4
-rw-r--r--patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch14
-rw-r--r--patches/server/0775-Custom-Chat-Completion-Suggestions-API.patch4
-rw-r--r--patches/server/0780-Add-Velocity-IP-Forwarding-Support.patch4
-rw-r--r--patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch4
-rw-r--r--patches/server/0790-Configurable-chat-thread-limit.patch4
-rw-r--r--patches/server/0795-Fix-a-bunch-of-vanilla-bugs.patch16
-rw-r--r--patches/server/0796-Remove-unnecessary-onTrackingStart-during-navigation.patch6
-rw-r--r--patches/server/0800-Add-PlayerInventorySlotChangeEvent.patch4
-rw-r--r--patches/server/0801-Elder-Guardian-appearance-API.patch4
-rw-r--r--patches/server/0812-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch4
-rw-r--r--patches/server/0816-Add-Player-Warden-Warning-API.patch4
-rw-r--r--patches/server/0818-Add-paper-dumplisteners-command.patch6
-rw-r--r--patches/server/0819-check-global-player-list-where-appropriate.patch8
-rw-r--r--patches/server/0825-Sync-offhand-slot-in-menus.patch4
-rw-r--r--patches/server/0826-Player-Entity-Tracking-Events.patch8
-rw-r--r--patches/server/0829-fix-Instruments.patch4
-rw-r--r--patches/server/0834-Improve-logging-and-errors.patch4
-rw-r--r--patches/server/0835-Improve-PortalEvents.patch4
-rw-r--r--patches/server/0837-Add-missing-SpigotConfig-logCommands-check.patch4
-rw-r--r--patches/server/0839-Flying-Fall-Damage.patch4
-rw-r--r--patches/server/0841-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch6
-rw-r--r--patches/server/0843-Use-single-player-info-update-packet-on-join.patch6
-rw-r--r--patches/server/0845-Win-Screen-API.patch4
-rw-r--r--patches/server/0862-Treat-sequence-violations-like-they-should-be.patch4
-rw-r--r--patches/server/0864-Prevent-causing-expired-keys-from-impacting-new-join.patch4
-rw-r--r--patches/server/0865-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch4
-rw-r--r--patches/server/0868-Fix-demo-flag-not-enabling-demo-mode.patch4
-rw-r--r--patches/server/0875-Expand-PlayerItemMendEvent.patch4
-rw-r--r--patches/server/0878-Fix-block-place-logic.patch4
-rw-r--r--patches/server/0881-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch2
-rw-r--r--patches/server/0891-Don-t-load-chunks-for-supporting-block-checks.patch4
-rw-r--r--patches/server/0896-Fix-BanList-API.patch6
-rw-r--r--patches/server/0903-Implement-PlayerFailMoveEvent.patch12
-rw-r--r--patches/server/0904-Folia-scheduler-and-owned-region-API.patch28
-rw-r--r--patches/server/0906-API-for-updating-recipes-on-clients.patch14
-rw-r--r--patches/server/0908-Only-capture-actual-tree-growth.patch8
-rw-r--r--patches/server/0911-Use-correct-seed-on-api-world-load.patch2
-rw-r--r--patches/server/0915-Bandaid-fix-for-Effect.patch8
-rw-r--r--patches/server/0918-Deprecate-and-replace-methods-with-old-StructureType.patch6
-rw-r--r--patches/server/0919-Don-t-tab-complete-namespaced-commands-if-send-names.patch4
-rw-r--r--patches/server/0922-Configurable-entity-tracking-range-by-Y-coordinate.patch4
-rw-r--r--patches/server/0923-Add-Listing-API-for-Player.patch8
-rw-r--r--patches/server/0924-Configurable-Region-Compression-Format.patch6
-rw-r--r--patches/server/0926-Fix-NPE-on-Boat-getStatus.patch4
-rw-r--r--patches/server/0927-Expand-Pose-API.patch4
-rw-r--r--patches/server/0930-Add-PlayerPickItemEvent.patch4
-rw-r--r--patches/server/0934-Implement-OfflinePlayer-isConnected.patch4
-rw-r--r--patches/server/0936-Add-titleOverride-to-InventoryOpenEvent.patch6
-rw-r--r--patches/server/0940-Add-slot-sanity-checks-in-container-clicks.patch4
-rw-r--r--patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch6
-rw-r--r--patches/server/0953-Fix-missing-map-initialize-event-call.patch4
-rw-r--r--patches/server/0958-Add-player-idle-duration-API.patch4
-rw-r--r--patches/server/0959-Don-t-check-if-we-can-see-non-visible-entities.patch4
-rw-r--r--patches/server/0961-Allow-null-itemstack-for-Player-sendEquipmentChange.patch4
-rw-r--r--patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch8
-rw-r--r--patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch4
-rw-r--r--patches/server/0974-Don-t-fire-sync-events-during-worldgen.patch10
-rw-r--r--patches/server/0976-Add-Structure-check-API.patch (renamed from patches/server/0977-Add-Structure-check-API.patch)2
-rw-r--r--patches/server/0977-Restore-vanilla-entity-drops-behavior.patch (renamed from patches/server/0976-Restore-vanilla-entity-drops-behavior.patch)12
-rw-r--r--patches/server/0979-Keep-previous-behavior-for-setResourcePack.patch4
-rw-r--r--patches/server/0980-add-more-scoreboard-API.patch (renamed from patches/server/0981-add-more-scoreboard-API.patch)0
-rw-r--r--patches/server/0981-Improve-Registry.patch (renamed from patches/server/0982-Improve-Registry.patch)0
-rw-r--r--patches/server/0982-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch (renamed from patches/server/0983-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch)0
-rw-r--r--patches/server/0983-Add-experience-points-API.patch (renamed from patches/server/0984-Add-experience-points-API.patch)4
-rw-r--r--patches/server/0984-Add-drops-to-shear-events.patch (renamed from patches/server/0986-Add-drops-to-shear-events.patch)0
-rw-r--r--patches/server/0985-Add-PlayerShieldDisableEvent.patch (renamed from patches/server/0987-Add-PlayerShieldDisableEvent.patch)0
-rw-r--r--patches/server/0986-Validate-ResourceLocation-in-NBT-reading.patch (renamed from patches/server/0988-Validate-ResourceLocation-in-NBT-reading.patch)0
-rw-r--r--patches/server/0987-Properly-handle-experience-dropping-on-block-break.patch (renamed from patches/server/0989-Properly-handle-experience-dropping-on-block-break.patch)4
-rw-r--r--patches/server/0988-Fixup-NamespacedKey-handling.patch (renamed from patches/server/0990-Fixup-NamespacedKey-handling.patch)0
-rw-r--r--patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch (renamed from patches/server/0991-Reduce-allocation-of-Vec3D-by-entity-tracker.patch)6
-rw-r--r--patches/server/0990-Expose-LootTable-of-DecoratedPot.patch (renamed from patches/server/1042-Expose-LootTable-of-DecoratedPot.patch)0
-rw-r--r--patches/server/0991-Rewrite-chunk-system.patch (renamed from patches/server/0751-Rewrite-chunk-system.patch)666
-rw-r--r--patches/server/0992-incremental-chunk-and-player-saving.patch (renamed from patches/server/0396-incremental-chunk-and-player-saving.patch)28
-rw-r--r--patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch4
-rw-r--r--patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch (renamed from patches/server/0992-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch)2
-rw-r--r--patches/server/0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch (renamed from patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch)0
-rw-r--r--patches/server/0997-Allow-Saving-of-Oversized-Chunks.patch (renamed from patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch)0
-rw-r--r--patches/server/0998-Fix-World-isChunkGenerated-calls.patch (renamed from patches/server/0997-Fix-World-isChunkGenerated-calls.patch)8
-rw-r--r--patches/server/0999-Flat-bedrock-generator-settings.patch (renamed from patches/server/0998-Flat-bedrock-generator-settings.patch)0
-rw-r--r--patches/server/1000-Entity-Activation-Range-2.0.patch (renamed from patches/server/0999-Entity-Activation-Range-2.0.patch)2
-rw-r--r--patches/server/1001-Optional-per-player-mob-spawns.patch (renamed from patches/server/1000-Optional-per-player-mob-spawns.patch)6
-rw-r--r--patches/server/1002-Anti-Xray.patch (renamed from patches/server/1001-Anti-Xray.patch)4
-rw-r--r--patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch (renamed from patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch)6
-rw-r--r--patches/server/1004-Optimize-Collision-to-not-load-chunks.patch (renamed from patches/server/1003-Optimize-Collision-to-not-load-chunks.patch)2
-rw-r--r--patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch (renamed from patches/server/1004-Optimize-GoalSelector-Goal.Flag-Set-operations.patch)0
-rw-r--r--patches/server/1006-Entity-load-save-limit-per-chunk.patch (renamed from patches/server/1005-Entity-load-save-limit-per-chunk.patch)0
-rw-r--r--patches/server/1007-Fix-and-optimise-world-force-upgrading.patch (renamed from patches/server/1006-Fix-and-optimise-world-force-upgrading.patch)4
-rw-r--r--patches/server/1008-Improved-Watchdog-Support.patch (renamed from patches/server/1007-Improved-Watchdog-Support.patch)2
-rw-r--r--patches/server/1009-Optimize-Voxel-Shape-Merging.patch (renamed from patches/server/1008-Optimize-Voxel-Shape-Merging.patch)0
-rw-r--r--patches/server/1010-Write-SavedData-IO-async.patch (renamed from patches/server/1009-Write-SavedData-IO-async.patch)4
-rw-r--r--patches/server/1011-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch (renamed from patches/server/1010-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch)0
-rw-r--r--patches/server/1012-Use-distance-map-to-optimise-entity-tracker.patch (renamed from patches/server/1011-Use-distance-map-to-optimise-entity-tracker.patch)14
-rw-r--r--patches/server/1013-Optimize-Bit-Operations-by-inlining.patch (renamed from patches/server/1012-Optimize-Bit-Operations-by-inlining.patch)0
-rw-r--r--patches/server/1014-Remove-streams-from-hot-code.patch (renamed from patches/server/1013-Remove-streams-from-hot-code.patch)0
-rw-r--r--patches/server/1015-Eigencraft-redstone-implementation.patch (renamed from patches/server/1014-Eigencraft-redstone-implementation.patch)0
-rw-r--r--patches/server/1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch (renamed from patches/server/1015-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch)0
-rw-r--r--patches/server/1017-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch (renamed from patches/server/1016-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch)0
-rw-r--r--patches/server/1018-Improve-boat-collision-performance.patch (renamed from patches/server/1017-Improve-boat-collision-performance.patch)0
-rw-r--r--patches/server/1019-Optimise-general-POI-access.patch (renamed from patches/server/1018-Optimise-general-POI-access.patch)0
-rw-r--r--patches/server/1020-Custom-table-implementation-for-blockstate-state-loo.patch (renamed from patches/server/1019-Custom-table-implementation-for-blockstate-state-loo.patch)0
-rw-r--r--patches/server/1021-Execute-chunk-tasks-mid-tick.patch (renamed from patches/server/1020-Execute-chunk-tasks-mid-tick.patch)8
-rw-r--r--patches/server/1022-Optimise-random-block-ticking.patch (renamed from patches/server/1021-Optimise-random-block-ticking.patch)0
-rw-r--r--patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch (renamed from patches/server/1022-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch)2
-rw-r--r--patches/server/1024-Use-Velocity-compression-and-cipher-natives.patch (renamed from patches/server/1023-Use-Velocity-compression-and-cipher-natives.patch)0
-rw-r--r--patches/server/1025-Detail-more-information-in-watchdog-dumps.patch (renamed from patches/server/1024-Detail-more-information-in-watchdog-dumps.patch)2
-rw-r--r--patches/server/1026-Collision-optimisations.patch (renamed from patches/server/1025-Collision-optimisations.patch)2
-rw-r--r--patches/server/1027-Optimise-collision-checking-in-player-move-packet-ha.patch (renamed from patches/server/1026-Optimise-collision-checking-in-player-move-packet-ha.patch)0
-rw-r--r--patches/server/1028-Fix-tripwire-state-inconsistency.patch (renamed from patches/server/1027-Fix-tripwire-state-inconsistency.patch)0
-rw-r--r--patches/server/1029-Fix-entity-type-tags-suggestions-in-selectors.patch (renamed from patches/server/1028-Fix-entity-type-tags-suggestions-in-selectors.patch)0
-rw-r--r--patches/server/1030-Add-Alternate-Current-redstone-implementation.patch (renamed from patches/server/1029-Add-Alternate-Current-redstone-implementation.patch)0
-rw-r--r--patches/server/1031-optimize-dirt-and-snow-spreading.patch (renamed from patches/server/1030-optimize-dirt-and-snow-spreading.patch)0
-rw-r--r--patches/server/1032-Properly-resend-entities.patch (renamed from patches/server/1031-Properly-resend-entities.patch)0
-rw-r--r--patches/server/1033-Optimize-Hoppers.patch (renamed from patches/server/1032-Optimize-Hoppers.patch)2
-rw-r--r--patches/server/1034-Improve-performance-of-mass-crafts.patch (renamed from patches/server/1033-Improve-performance-of-mass-crafts.patch)0
-rw-r--r--patches/server/1035-Actually-optimise-explosions.patch (renamed from patches/server/1034-Actually-optimise-explosions.patch)0
-rw-r--r--patches/server/1036-Optimise-chunk-tick-iteration.patch (renamed from patches/server/1035-Optimise-chunk-tick-iteration.patch)10
-rw-r--r--patches/server/1037-Lag-compensation-ticks.patch (renamed from patches/server/1036-Lag-compensation-ticks.patch)2
-rw-r--r--patches/server/1038-Optimise-nearby-player-retrieval.patch (renamed from patches/server/1037-Optimise-nearby-player-retrieval.patch)0
-rw-r--r--patches/server/1039-Distance-manager-tick-timings.patch (renamed from patches/server/1038-Distance-manager-tick-timings.patch)0
-rw-r--r--patches/server/1040-Handle-Oversized-block-entities-in-chunks.patch (renamed from patches/server/1039-Handle-Oversized-block-entities-in-chunks.patch)0
-rw-r--r--patches/server/1041-Further-improve-server-tick-loop.patch (renamed from patches/server/1040-Further-improve-server-tick-loop.patch)27
-rw-r--r--patches/server/1042-Send-full-pos-packets-for-hard-colliding-entities.patch (renamed from patches/server/0642-Send-full-pos-packets-for-hard-colliding-entities.patch)4
-rw-r--r--scripts/moveback.py2
244 files changed, 989 insertions, 1223 deletions
diff --git a/patches/api/0018-Add-view-distance-API.patch b/patches/api/0018-Add-view-distance-API.patch
index 692c0e5716..7dbc38ba6b 100644
--- a/patches/api/0018-Add-view-distance-API.patch
+++ b/patches/api/0018-Add-view-distance-API.patch
@@ -8,10 +8,10 @@ Add per player no-tick, tick, and send view distances.
Also add send/no-tick view distance to World.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
-index 4c878531d9d8d0aee6832fd10b339a32f219fa9a..52977ba7aba446f74bf6befe065f722eaafee0c2 100644
+index 4c878531d9d8d0aee6832fd10b339a32f219fa9a..1ea851c658243aa3bfcdbffca3df5ded9386da98 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
-@@ -2875,6 +2875,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
+@@ -2875,6 +2875,66 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Set<FeatureFlag> getFeatureFlags();
@@ -38,7 +38,9 @@ index 4c878531d9d8d0aee6832fd10b339a32f219fa9a..52977ba7aba446f74bf6befe065f722e
+ * @deprecated Use {@link #getViewDistance()}
+ */
+ @Deprecated
-+ int getNoTickViewDistance();
++ default int getNoTickViewDistance() {
++ return this.getViewDistance();
++ }
+
+ /**
+ * Sets the no-tick view distance for this world.
@@ -50,7 +52,9 @@ index 4c878531d9d8d0aee6832fd10b339a32f219fa9a..52977ba7aba446f74bf6befe065f722e
+ * @deprecated Use {@link #setViewDistance(int)}
+ */
+ @Deprecated
-+ void setNoTickViewDistance(int viewDistance);
++ default void setNoTickViewDistance(int viewDistance) {
++ this.setViewDistance(viewDistance);
++ }
+
+ /**
+ * Gets the sending view distance for this world.
@@ -75,10 +79,10 @@ index 4c878531d9d8d0aee6832fd10b339a32f219fa9a..52977ba7aba446f74bf6befe065f722e
* Represents various map environment types that a world may be
*/
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index c03b5f24304d28a5ebabdf6301165cf04dd5176c..15d73986499cc190de925c1024cea6dfdf930065 100644
+index c03b5f24304d28a5ebabdf6301165cf04dd5176c..1f5402afd5e34c5da0d59d9c604f6da8c015950e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -2391,6 +2391,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -2391,6 +2391,82 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param affects Whether the player can affect mob spawning
*/
public void setAffectsSpawning(boolean affects);
@@ -123,7 +127,9 @@ index c03b5f24304d28a5ebabdf6301165cf04dd5176c..15d73986499cc190de925c1024cea6df
+ * @deprecated Use {@link #getViewDistance()}
+ */
+ @Deprecated
-+ public int getNoTickViewDistance();
++ default int getNoTickViewDistance() {
++ return this.getViewDistance();
++ }
+
+ /**
+ * Sets the no-ticking view distance for this player.
@@ -135,7 +141,9 @@ index c03b5f24304d28a5ebabdf6301165cf04dd5176c..15d73986499cc190de925c1024cea6df
+ * @deprecated Use {@link #setViewDistance(int)}
+ */
+ @Deprecated
-+ public void setNoTickViewDistance(int viewDistance);
++ default void setNoTickViewDistance(int viewDistance) {
++ this.setViewDistance(viewDistance);
++ }
+
+ /**
+ * Gets the sending view distance for this player.
diff --git a/patches/api/0092-Player.setPlayerProfile-API.patch b/patches/api/0092-Player.setPlayerProfile-API.patch
index 088929b790..0e9d8a293d 100644
--- a/patches/api/0092-Player.setPlayerProfile-API.patch
+++ b/patches/api/0092-Player.setPlayerProfile-API.patch
@@ -93,10 +93,10 @@ index 4016129ead172c5f5b550482f523921d39df046f..4d500904b28375f8517aa05075667da2
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index 4433ec84c717f9f922384836b45d636be76b3463..3e6f25bc92cd4711b9875f169b7d5071c1dbac12 100644
+index 36aeb88d10e0e30c8572d1eccaa2e97825e1a986..792fe65d970a5cd4bac20350c7177a5d16dff9ba 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -2904,6 +2904,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -2908,6 +2908,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
}
// Paper end
diff --git a/patches/api/0095-Add-openSign-method-to-HumanEntity.patch b/patches/api/0095-Add-openSign-method-to-HumanEntity.patch
index e7113c7907..5b92a3654f 100644
--- a/patches/api/0095-Add-openSign-method-to-HumanEntity.patch
+++ b/patches/api/0095-Add-openSign-method-to-HumanEntity.patch
@@ -36,10 +36,10 @@ index abdca9fe5acc90f167219eb769ece66c35682bb1..b3aa3dc6aa5afbc36cc86741b4cba56f
/**
* Make the entity drop the item in their hand.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index 3e6f25bc92cd4711b9875f169b7d5071c1dbac12..c8fa6733c6c8c08f653069d4630e35df4e29bd04 100644
+index 792fe65d970a5cd4bac20350c7177a5d16dff9ba..c67dd3cfd1d359b1f11c3f7c6fb1e58f2abe5610 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -2865,10 +2865,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -2869,10 +2869,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Open a Sign for editing by the Player.
*
diff --git a/patches/api/0145-Expose-attack-cooldown-methods-for-Player.patch b/patches/api/0145-Expose-attack-cooldown-methods-for-Player.patch
index 1547e14510..827a59da31 100644
--- a/patches/api/0145-Expose-attack-cooldown-methods-for-Player.patch
+++ b/patches/api/0145-Expose-attack-cooldown-methods-for-Player.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index e8497492713a97ef05dff838bdc2a8880111a0e1..f17fadd635f7f0bc1b55cca4947377942e50aceb 100644
+index 0b3f6fabdf8439fba748a3770fa202161bbeb26f..cb75b93f740b6d9a155a7c6073252412b5a9aac0 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -3082,6 +3082,28 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -3086,6 +3086,28 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void setPlayerProfile(com.destroystokyo.paper.profile.@NotNull PlayerProfile profile);
// Paper end - Player Profile API
diff --git a/patches/api/0173-Fix-Spigot-annotation-mistakes.patch b/patches/api/0173-Fix-Spigot-annotation-mistakes.patch
index 1ca860f01a..0a25233fac 100644
--- a/patches/api/0173-Fix-Spigot-annotation-mistakes.patch
+++ b/patches/api/0173-Fix-Spigot-annotation-mistakes.patch
@@ -254,7 +254,7 @@ index f9c9ae463aacd593e3aa9caf037ea1e23d56c780..f8ae143acbf586d5279b44f7311ca97f
/**
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
-index 0b202d378d50946f43434e70d9d511cac06749b0..cf42f6e57e96aa9cb4465e34a6e3f8709de4ca09 100644
+index 02b4ffa6b918269bd64f7c518fcceef1f6990737..f0878c7539696cc0676e6010e88914d3850acf20 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -46,7 +46,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
@@ -600,7 +600,7 @@ index e455eb21abf121dc6ff10ff8a13dd06f67096a8f..bbc01e7c192ae6689c301670047ff114
return origin;
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
-index b13f6d4ae42c981b051c6ef81b0f572039faded4..59a52583f433859b0a12a44c53970db87cde08aa 100644
+index 985dcea9ebed2fc5a3bfb8581cbd0ee4bf89ee8f..08eb8744104f1bbbd4f96972e0fb68f1aa4049f5 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -416,9 +416,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -634,7 +634,7 @@ index b13f6d4ae42c981b051c6ef81b0f572039faded4..59a52583f433859b0a12a44c53970db8
Spigot spigot();
// Spigot end
-@@ -3924,9 +3928,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
+@@ -3928,9 +3932,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* Gets the dimension ID of this environment
*
* @return dimension ID
@@ -646,7 +646,7 @@ index b13f6d4ae42c981b051c6ef81b0f572039faded4..59a52583f433859b0a12a44c53970db8
public int getId() {
return id;
}
-@@ -3936,9 +3940,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
+@@ -3940,9 +3944,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*
* @param id The ID of the environment
* @return The environment
@@ -659,7 +659,7 @@ index b13f6d4ae42c981b051c6ef81b0f572039faded4..59a52583f433859b0a12a44c53970db8
public static Environment getEnvironment(int id) {
return lookup.get(id);
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
-index 78f6cc1a8a8de05aec6f551f8a5f425944f0ffa3..653a83b7ceb5cec1d92aed5250ae50e714fe5f9f 100644
+index f3a18e337a579b602b1289bccdf454334a663fcf..c22f333174bd6b8860ee06a71f713e4be8fa64ec 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -517,7 +517,7 @@ public interface Block extends Metadatable, Translatable {
@@ -859,7 +859,7 @@ index 95c79c5fa0c4e30201f887da6467ce5f81c8a255..7f9c4d4b430a3f0276461346ff2621ba
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index e8d9b33f57b6eeb310662a63dde809ffaa49fcd2..b6ef3c47053747964289b99fc28be2e2452200b6 100644
+index cb75b93f740b6d9a155a7c6073252412b5a9aac0..23ed4d9bbd0e0ed44771c1663b707b025f242c60 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1498,11 +1498,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
diff --git a/patches/api/0190-Add-Player-Client-Options-API.patch b/patches/api/0190-Add-Player-Client-Options-API.patch
index 09aec55675..a2ccb609c1 100644
--- a/patches/api/0190-Add-Player-Client-Options-API.patch
+++ b/patches/api/0190-Add-Player-Client-Options-API.patch
@@ -229,10 +229,10 @@ index 0000000000000000000000000000000000000000..cf67dc7d465223710adbf2b798109f52
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index 604172b2362028a98599e463c18251ca12fabb49..dd9527b973239e20e62289ea8b4931623be6f7be 100644
+index 23ed4d9bbd0e0ed44771c1663b707b025f242c60..5da568d7760798e0f2df7d2e9bceadccf7162692 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -3101,6 +3101,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -3105,6 +3105,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void resetCooldown();
// Paper end - attack cooldown API
diff --git a/patches/api/0208-Brand-support.patch b/patches/api/0208-Brand-support.patch
index 53e8ec7076..87c4c95756 100644
--- a/patches/api/0208-Brand-support.patch
+++ b/patches/api/0208-Brand-support.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Brand support
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index dd9527b973239e20e62289ea8b4931623be6f7be..5311c533883e75bb8bf6017f6404dc3d02f1ea7a 100644
+index 5da568d7760798e0f2df7d2e9bceadccf7162692..1e2232ab9ac8e3dd169ad5a444fff529350ee2fd 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -3214,6 +3214,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -3218,6 +3218,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
// Paper end
}
diff --git a/patches/api/0218-Player-elytra-boost-API.patch b/patches/api/0218-Player-elytra-boost-API.patch
index 8c49585899..e7daecf153 100644
--- a/patches/api/0218-Player-elytra-boost-API.patch
+++ b/patches/api/0218-Player-elytra-boost-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Player elytra boost API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index 5311c533883e75bb8bf6017f6404dc3d02f1ea7a..7bd0cf4ce7d79a69bbb47129d6a3917a54dd9a5a 100644
+index 1e2232ab9ac8e3dd169ad5a444fff529350ee2fd..51e9a9f5843c97dd09e6f8e09f80221fe2b66ee6 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -3108,6 +3108,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -3112,6 +3112,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
<T> @NotNull T getClientOption(com.destroystokyo.paper.@NotNull ClientOption<T> option);
// Paper end - client option API
diff --git a/patches/api/0245-Add-sendOpLevel-API.patch b/patches/api/0245-Add-sendOpLevel-API.patch
index ed14a19310..5a279d7430 100644
--- a/patches/api/0245-Add-sendOpLevel-API.patch
+++ b/patches/api/0245-Add-sendOpLevel-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add sendOpLevel API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index 7bd0cf4ce7d79a69bbb47129d6a3917a54dd9a5a..a1bf0abc5a22f75e2cf3a981fc917915ae7ef00f 100644
+index 51e9a9f5843c97dd09e6f8e09f80221fe2b66ee6..202e6a5cf87fbbaa28081be2f34227bb0b414839 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -3127,6 +3127,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -3131,6 +3131,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
}
// Paper end - elytra boost API
diff --git a/patches/api/0366-More-Teleport-API.patch b/patches/api/0366-More-Teleport-API.patch
index 13d70bb0fd..80f1e75994 100644
--- a/patches/api/0366-More-Teleport-API.patch
+++ b/patches/api/0366-More-Teleport-API.patch
@@ -120,7 +120,7 @@ index 0000000000000000000000000000000000000000..c8b5b570d44da9524bfc59c7e11b2ae5
+
+}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
-index 953bb49b7079647450d3453356d1c8a91be94c01..2ea66188468cf32bcaedc5167d4b9b0c6ea9b0b3 100644
+index f090368dbb5acf352e1bee34d78b55eb92373c6d..8322d22f34968d579b92c581b36544d42b7732cd 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -126,10 +126,32 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -158,10 +158,10 @@ index 953bb49b7079647450d3453356d1c8a91be94c01..2ea66188468cf32bcaedc5167d4b9b0c
* Teleports this entity to the given location. If this entity is riding a
* vehicle, it will be dismounted prior to teleportation.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index e2333a5f8e357ada69ff8857d3b1c666f51ac909..da4d8d36fdf8006e308220cb7665c9e0302e5879 100644
+index 28d80415ef153e8e34faaae829a58556922c6024..d673de42d7d7eadc3101a70c297d89e406c3814e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -3287,6 +3287,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -3291,6 +3291,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
String getClientBrandName();
// Paper end
diff --git a/patches/api/0368-Custom-Chat-Completion-Suggestions-API.patch b/patches/api/0368-Custom-Chat-Completion-Suggestions-API.patch
index 2ee1dccaba..91de608669 100644
--- a/patches/api/0368-Custom-Chat-Completion-Suggestions-API.patch
+++ b/patches/api/0368-Custom-Chat-Completion-Suggestions-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Custom Chat Completion Suggestions API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index da4d8d36fdf8006e308220cb7665c9e0302e5879..541ac9cf8f4af2386a5c2930cbd8fa81a48d8445 100644
+index d673de42d7d7eadc3101a70c297d89e406c3814e..ae3a4f35a35df94496a73acd4127d0ab22fcf877 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -3171,6 +3171,31 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -3175,6 +3175,31 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void sendOpLevel(byte level);
// Paper end - sendOpLevel API
diff --git a/patches/api/0378-Elder-Guardian-appearance-API.patch b/patches/api/0378-Elder-Guardian-appearance-API.patch
index ca75252378..3830d3db09 100644
--- a/patches/api/0378-Elder-Guardian-appearance-API.patch
+++ b/patches/api/0378-Elder-Guardian-appearance-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index 541ac9cf8f4af2386a5c2930cbd8fa81a48d8445..c79a3583ccbd808df6ca0ef2912bfed4f417c387 100644
+index ae3a4f35a35df94496a73acd4127d0ab22fcf877..2abb6c19655bad636819097c72c5e210c1b7d98d 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -3351,6 +3351,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -3355,6 +3355,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void lookAt(@NotNull org.bukkit.entity.Entity entity, @NotNull io.papermc.paper.entity.LookAnchor playerAnchor, @NotNull io.papermc.paper.entity.LookAnchor entityAnchor);
// Paper end - Teleport API
diff --git a/patches/api/0386-Add-Player-Warden-Warning-API.patch b/patches/api/0386-Add-Player-Warden-Warning-API.patch
index 77e3620a98..a21a8bb413 100644
--- a/patches/api/0386-Add-Player-Warden-Warning-API.patch
+++ b/patches/api/0386-Add-Player-Warden-Warning-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Player Warden Warning API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index c79a3583ccbd808df6ca0ef2912bfed4f417c387..5b1233ff2a5cdda75263eae86f96052bc28e9f5c 100644
+index 2abb6c19655bad636819097c72c5e210c1b7d98d..6b998eccff579c8491786e6df3e88ce48fb14dd6 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -3367,6 +3367,59 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -3371,6 +3371,59 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param silent whether sound should be silenced
*/
void showElderGuardian(boolean silent);
diff --git a/patches/api/0438-Add-player-idle-duration-API.patch b/patches/api/0438-Add-player-idle-duration-API.patch
index dbe78e032c..1c86d23955 100644
--- a/patches/api/0438-Add-player-idle-duration-API.patch
+++ b/patches/api/0438-Add-player-idle-duration-API.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API
Implements API for getting and resetting a player's idle duration.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
-index 8ca61bca18c5520d20b0405d5add37759349560b..c09f423fe2a029c933bd2697c8ff104fc4230cf0 100644
+index 1ff74c6fb0dee02dad1d551d67a3c64bd9ebafa9..3fbad74bc9f0e95e19b0b17e73d130b4b257ee23 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
-@@ -3508,6 +3508,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+@@ -3512,6 +3512,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void increaseWardenWarningLevel();
// Paper end
diff --git a/patches/server/0005-Paper-config-files.patch b/patches/server/0005-Paper-config-files.patch
index 75d25f21d7..27deead1df 100644
--- a/patches/server/0005-Paper-config-files.patch
+++ b/patches/server/0005-Paper-config-files.patch
@@ -482,7 +482,7 @@ index 0000000000000000000000000000000000000000..c01b4393439838976965823298f12e47
+}
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
new file mode 100644
-index 0000000000000000000000000000000000000000..73a34b4e378e6012a01c8ac8b092248298be6648
+index 0000000000000000000000000000000000000000..57e6e857c84234bf0c137058ae35e6fb0e9b124f
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -0,0 +1,309 @@
@@ -686,7 +686,7 @@ index 0000000000000000000000000000000000000000..73a34b4e378e6012a01c8ac8b0922482
+
+ @PostProcess
+ private void postProcess() {
-+ io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.init(this);
++ //io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.init(this);
+ }
+ }
+
diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch
index c1fb4fcbe0..26b152ecfd 100644
--- a/patches/server/0009-MC-Utils.patch
+++ b/patches/server/0009-MC-Utils.patch
@@ -2662,10 +2662,10 @@ index 0000000000000000000000000000000000000000..a5f706d6f716b2a463ae58adcde69d9e
+}
diff --git a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
new file mode 100644
-index 0000000000000000000000000000000000000000..87ae7d64e67ebae5ab53cc239cdf6580dca31652
+index 0000000000000000000000000000000000000000..05bddc0697faa8d9d9955d89d76930c84ef7df0d
--- /dev/null
+++ b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
-@@ -0,0 +1,295 @@
+@@ -0,0 +1,296 @@
+package io.papermc.paper.chunk.system;
+
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
@@ -2762,7 +2762,7 @@ index 0000000000000000000000000000000000000000..87ae7d64e67ebae5ab53cc239cdf6580
+ }
+ };
+
-+ final ChunkHolder holder = level.chunkSource.chunkMap.getUpdatingChunkIfPresent(CoordinateUtils.getChunkKey(chunkX, chunkZ));
++ final ChunkHolder holder = level.chunkSource.chunkMap.updatingChunkMap.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
+
+ if (holder == null || holder.getTicketLevel() > minLevel) {
+ loadCallback.accept(null);
@@ -2790,7 +2790,8 @@ index 0000000000000000000000000000000000000000..87ae7d64e67ebae5ab53cc239cdf6580
+ public static void scheduleTickingState(final ServerLevel level, final int chunkX, final int chunkZ,
+ final FullChunkStatus toStatus, final boolean addTicket,
+ final PrioritisedExecutor.Priority priority, final Consumer<LevelChunk> onComplete) {
-+ if (toStatus == ChunkHolder.FullChunkStatus.INACCESSIBLE) {
++ // This method goes unused until the chunk system rewrite
++ if (toStatus == FullChunkStatus.INACCESSIBLE) {
+ throw new IllegalArgumentException("Cannot wait for INACCESSIBLE status");
+ }
+
@@ -2829,7 +2830,7 @@ index 0000000000000000000000000000000000000000..87ae7d64e67ebae5ab53cc239cdf6580
+ }
+ };
+
-+ final ChunkHolder holder = level.chunkSource.chunkMap.getUpdatingChunkIfPresent(CoordinateUtils.getChunkKey(chunkX, chunkZ));
++ final ChunkHolder holder = level.chunkSource.chunkMap.updatingChunkMap.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
+
+ if (holder == null || holder.getTicketLevel() > minLevel) {
+ loadCallback.accept(null);
@@ -2838,11 +2839,11 @@ index 0000000000000000000000000000000000000000..87ae7d64e67ebae5ab53cc239cdf6580
+
+ final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> tickingState;
+ switch (toStatus) {
-+ case BORDER: {
++ case FULL: {
+ tickingState = holder.getFullChunkFuture();
+ break;
+ }
-+ case TICKING: {
++ case BLOCK_TICKING: {
+ tickingState = holder.getTickingChunkFuture();
+ break;
+ }
@@ -2942,19 +2943,19 @@ index 0000000000000000000000000000000000000000..87ae7d64e67ebae5ab53cc239cdf6580
+ }
+
+ public static int getLoadViewDistance(final ServerPlayer player) {
-+ final ServerLevel level = player.getLevel();
++ final ServerLevel level = player.serverLevel();
+ if (level == null) {
-+ return Bukkit.getViewDistance() + 1;
++ return Bukkit.getViewDistance();
+ }
-+ return level.chunkSource.chunkMap.getEffectiveViewDistance() + 1;
++ return level.chunkSource.chunkMap.getPlayerViewDistance(player);
+ }
+
+ public static int getTickViewDistance(final ServerPlayer player) {
-+ final ServerLevel level = player.getLevel();
++ final ServerLevel level = player.serverLevel();
+ if (level == null) {
+ return Bukkit.getSimulationDistance();
+ }
-+ return level.chunkSource.chunkMap.distanceManager.getSimulationDistance();
++ return level.chunkSource.chunkMap.distanceManager.simulationDistance;
+ }
+
+ private ChunkSystem() {
@@ -6345,7 +6346,7 @@ index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba436
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b717d3b03 100644
+index f083356fe490ecebdc1486784f4833d778b816f4..59b608d9722898470010413bef0cb6a6b83500b2 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -168,6 +168,62 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -6411,7 +6412,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync);
this.visibleChunkMap = this.updatingChunkMap.clone();
-@@ -221,8 +277,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -221,7 +277,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.overworldDataStorage = persistentStateManagerFactory;
this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, iregistrycustom, world);
this.setServerViewDistance(viewDistance);
@@ -6420,18 +6421,17 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
+ this.regionManagers.add(this.dataRegionManager);
+ this.nearbyPlayers = new io.papermc.paper.util.player.NearbyPlayers(this.level);
+ // Paper end
- }
-
++ }
++
+ // Paper start
+ // always use accessor, so folia can override
+ public final io.papermc.paper.util.player.NearbyPlayers getNearbyPlayers() {
+ return this.nearbyPlayers;
-+ }
+ }
+ // Paper end
-+
+
protected ChunkGenerator generator() {
return this.generator;
- }
@@ -246,6 +314,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
});
}
@@ -6443,23 +6443,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
private static double euclideanDistanceSquared(ChunkPos pos, Entity entity) {
double d0 = (double) SectionPos.sectionToBlockCoord(pos.x, 8);
double d1 = (double) SectionPos.sectionToBlockCoord(pos.z, 8);
-@@ -322,6 +394,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- }
- }
-
-+ // Paper start
-+ public final int getEffectiveViewDistance() {
-+ // TODO this needs to be checked on update
-+ // Mojang currently sets it to +1 of the configured view distance. So subtract one to get the one we really want.
-+ //TODO check if +0 is correct now
-+ return this.viewDistance;
-+ }
-+ // Paper end
-+
- private CompletableFuture<Either<List<ChunkAccess>, ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkHolder centerChunk, int margin, IntFunction<ChunkStatus> distanceToStatus) {
- if (margin == 0) {
- ChunkStatus chunkstatus = (ChunkStatus) distanceToStatus.apply(0);
-@@ -418,9 +499,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -418,9 +490,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
};
stringbuilder.append("Updating:").append(System.lineSeparator());
@@ -6471,7 +6455,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
CrashReport crashreport = CrashReport.forThrowable(exception, "Chunk loading");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Chunk loading");
-@@ -462,8 +543,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -462,8 +534,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
holder.setTicketLevel(level);
} else {
holder = new ChunkHolder(new ChunkPos(pos), level, this.level, this.lightEngine, this.queueSorter, this);
@@ -6486,7 +6470,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
this.updatingChunkMap.put(pos, holder);
this.modified = true;
}
-@@ -485,7 +572,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -485,7 +563,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
protected void saveAllChunks(boolean flush) {
if (flush) {
@@ -6495,7 +6479,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
MutableBoolean mutableboolean = new MutableBoolean();
do {
-@@ -514,7 +601,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -514,7 +592,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
});
this.flushWorker();
} else {
@@ -6504,7 +6488,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
}
}
-@@ -533,7 +620,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -533,7 +611,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public boolean hasWork() {
@@ -6513,7 +6497,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
}
private void processUnloads(BooleanSupplier shouldKeepTicking) {
-@@ -544,6 +631,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -544,6 +622,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkHolder playerchunk = (ChunkHolder) this.updatingChunkMap.remove(j);
if (playerchunk != null) {
@@ -6521,7 +6505,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
this.pendingUnloads.put(j, playerchunk);
this.modified = true;
++i;
-@@ -561,7 +649,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -561,7 +640,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
int l = 0;
@@ -6530,7 +6514,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) {
if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) {
-@@ -579,7 +667,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -579,7 +658,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (completablefuture1 != completablefuture) {
this.scheduleUnload(pos, holder);
} else {
@@ -6543,7 +6527,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
if (ichunkaccess instanceof LevelChunk) {
((LevelChunk) ichunkaccess).setLoaded(false);
}
-@@ -595,7 +687,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -595,7 +678,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lightEngine.tryScheduleUpdate();
this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null);
this.chunkSaveCooldowns.remove(ichunkaccess.getPos().toLong());
@@ -6554,7 +6538,25 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
}
};
-@@ -1038,7 +1132,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -992,7 +1077,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ }
+ }
+
+- protected void setServerViewDistance(int watchDistance) {
++ public void setServerViewDistance(int watchDistance) { // Paper - public
+ int j = Mth.clamp(watchDistance, 2, 32);
+
+ if (j != this.serverViewDistance) {
+@@ -1009,7 +1094,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+
+ }
+
+- int getPlayerViewDistance(ServerPlayer player) {
++ public int getPlayerViewDistance(ServerPlayer player) { // Paper - public
+ return Mth.clamp(player.requestedViewDistance(), 2, this.serverViewDistance);
+ }
+
+@@ -1038,7 +1123,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public int size() {
@@ -6563,7 +6565,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
}
public DistanceManager getDistanceManager() {
-@@ -1046,19 +1140,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1046,19 +1131,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected Iterable<ChunkHolder> getChunks() {
@@ -6588,7 +6590,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
Optional<ChunkAccess> optional = Optional.ofNullable(playerchunk.getLastAvailable());
Optional<LevelChunk> optional1 = optional.flatMap((ichunkaccess) -> {
return ichunkaccess instanceof LevelChunk ? Optional.of((LevelChunk) ichunkaccess) : Optional.empty();
-@@ -1183,6 +1277,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1183,6 +1268,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
player.setChunkTrackingView(ChunkTrackingView.EMPTY);
this.updateChunkTracking(player);
@@ -6596,7 +6598,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
} else {
SectionPos sectionposition = player.getLastSectionPos();
-@@ -1191,6 +1286,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1191,6 +1277,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.distanceManager.removePlayer(sectionposition, player);
}
@@ -6604,7 +6606,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
this.applyChunkTrackingView(player, ChunkTrackingView.EMPTY);
}
-@@ -1242,6 +1338,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1242,6 +1329,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.updateChunkTracking(player);
}
@@ -6612,8 +6614,12 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
}
private void updateChunkTracking(ServerPlayer player) {
-@@ -1494,7 +1591,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- private class ChunkDistanceManager extends DistanceManager {
+@@ -1491,10 +1579,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ });
+ }
+
+- private class ChunkDistanceManager extends DistanceManager {
++ public class ChunkDistanceManager extends DistanceManager { // Paper - public
protected ChunkDistanceManager(Executor workerExecutor, Executor mainThreadExecutor) {
- super(workerExecutor, mainThreadExecutor);
@@ -6622,7 +6628,7 @@ index f083356fe490ecebdc1486784f4833d778b816f4..c721642337652ba4cf984ba3c263655b
@Override
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
-index 2a805b9e67b7a05dda5f9caa4b63b28c940828d0..42f9f28726bc6ef09ab877ecf663b4caa5003a3a 100644
+index 2a805b9e67b7a05dda5f9caa4b63b28c940828d0..76005b3c48bfa323a77781c20c63708eeaa66b2b 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
@@ -56,8 +56,9 @@ public abstract class DistanceManager {
@@ -6644,20 +6650,7 @@ index 2a805b9e67b7a05dda5f9caa4b63b28c940828d0..42f9f28726bc6ef09ab877ecf663b4ca
}
protected void purgeStaleTickets() {
-@@ -315,6 +317,12 @@ public abstract class DistanceManager {
- this.playerTicketManager.updateViewDistance(viewDistance);
- }
-
-+ // Paper start
-+ public int getSimulationDistance() {
-+ return this.simulationDistance;
-+ }
-+ // Paper end
-+
- public void updateSimulationDistance(int simulationDistance) {
- if (simulationDistance != this.simulationDistance) {
- this.simulationDistance = simulationDistance;
-@@ -378,7 +386,7 @@ public abstract class DistanceManager {
+@@ -378,7 +380,7 @@ public abstract class DistanceManager {
}
public void removeTicketsOnClosing() {
@@ -6667,7 +6660,7 @@ index 2a805b9e67b7a05dda5f9caa4b63b28c940828d0..42f9f28726bc6ef09ab877ecf663b4ca
while (objectiterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..7cacfceed5ef9276a19123a8a9079579423d03ac 100644
+index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..2c4727bf4571e1596bb0696b25104155f6302065 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -49,6 +49,7 @@ import net.minecraft.world.level.storage.LevelStorageSource;
@@ -6678,16 +6671,26 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..7cacfceed5ef9276a19123a8a9079579
private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
private final DistanceManager distanceManager;
final ServerLevel level;
-@@ -67,6 +68,231 @@ public class ServerChunkCache extends ChunkSource {
+@@ -67,6 +68,14 @@ public class ServerChunkCache extends ChunkSource {
@Nullable
@VisibleForDebug
private NaturalSpawner.SpawnState lastSpawnState;
+ // Paper start
++ public final io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<LevelChunk> tickingChunks = new io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
++ public final io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<LevelChunk> entityTickingChunks = new io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
+ final com.destroystokyo.paper.util.concurrent.WeakSeqLock loadedChunkMapSeqLock = new com.destroystokyo.paper.util.concurrent.WeakSeqLock();
+ final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<LevelChunk> loadedChunkMap = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(8192, 0.5f);
-+
++ long chunkFutureAwaitCounter;
+ private final LevelChunk[] lastLoadedChunks = new LevelChunk[4 * 4];
-+
++ // Paper end
+
+ public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory) {
+ this.level = world;
+@@ -92,6 +101,124 @@ public class ServerChunkCache extends ChunkSource {
+ return chunk.getFullChunkNow() != null;
+ }
+ // CraftBukkit end
++ // Paper start
+ private static int getChunkCacheKey(int x, int z) {
+ return x & 3 | ((z & 3) << 2);
+ }
@@ -6745,119 +6748,6 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..7cacfceed5ef9276a19123a8a9079579
+ return this.loadedChunkMap.get(ChunkPos.asLong(x, z));
+ }
+
-+ public final LevelChunk getChunkAtMainThread(int x, int z) {
-+ LevelChunk ret = this.getChunkAtIfLoadedMainThread(x, z);
-+ if (ret != null) {
-+ return ret;
-+ }
-+ return (LevelChunk)this.getChunk(x, z, ChunkStatus.FULL, true);
-+ }
-+
-+ long chunkFutureAwaitCounter; // Paper - private -> package private
-+
-+ public void getEntityTickingChunkAsync(int x, int z, java.util.function.Consumer<LevelChunk> onLoad) {
-+ io.papermc.paper.chunk.system.ChunkSystem.scheduleTickingState(
-+ this.level, x, z, FullChunkStatus.ENTITY_TICKING, true,
-+ ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.NORMAL, onLoad
-+ );
-+ }
-+
-+ public void getTickingChunkAsync(int x, int z, java.util.function.Consumer<LevelChunk> onLoad) {
-+ io.papermc.paper.chunk.system.ChunkSystem.scheduleTickingState(
-+ this.level, x, z, FullChunkStatus.BLOCK_TICKING, true,
-+ ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.NORMAL, onLoad
-+ );
-+ }
-+
-+ public void getFullChunkAsync(int x, int z, java.util.function.Consumer<LevelChunk> onLoad) {
-+ io.papermc.paper.chunk.system.ChunkSystem.scheduleTickingState(
-+ this.level, x, z, FullChunkStatus.FULL, true,
-+ ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.NORMAL, onLoad
-+ );
-+ }
-+
-+ void chunkLoadAccept(int chunkX, int chunkZ, ChunkAccess chunk, java.util.function.Consumer<ChunkAccess> consumer) {
-+ try {
-+ consumer.accept(chunk);
-+ } catch (Throwable throwable) {
-+ if (throwable instanceof ThreadDeath) {
-+ throw (ThreadDeath)throwable;
-+ }
-+ LOGGER.error("Load callback for chunk " + chunkX + "," + chunkZ + " in world '" + this.level.getWorld().getName() + "' threw an exception", throwable);
-+ }
-+ }
-+
-+ void getChunkAtAsynchronously(int chunkX, int chunkZ, int ticketLevel,
-+ java.util.function.Consumer<ChunkAccess> consumer) {
-+ if (ticketLevel <= 33) {
-+ this.getFullChunkAsync(chunkX, chunkZ, (java.util.function.Consumer)consumer);
-+ return;
-+ }
-+
-+ io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(
-+ this.level, chunkX, chunkZ, ChunkHolder.getStatus(ticketLevel), true,
-+ ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.NORMAL, consumer
-+ );
-+ }
-+
-+
-+ public final void getChunkAtAsynchronously(int chunkX, int chunkZ, ChunkStatus status, boolean gen, boolean allowSubTicketLevel, java.util.function.Consumer<ChunkAccess> onLoad) {
-+ // try to fire sync
-+ int chunkStatusTicketLevel = 33 + ChunkStatus.getDistance(status);
-+ ChunkHolder playerChunk = this.chunkMap.getUpdatingChunkIfPresent(io.papermc.paper.util.CoordinateUtils.getChunkKey(chunkX, chunkZ));
-+ if (playerChunk != null) {
-+ ChunkStatus holderStatus = playerChunk.getChunkHolderStatus();
-+ ChunkAccess immediate = playerChunk.getAvailableChunkNow();
-+ if (immediate != null) {
-+ if (allowSubTicketLevel ? immediate.getStatus().isOrAfter(status) : (playerChunk.getTicketLevel() <= chunkStatusTicketLevel && holderStatus != null && holderStatus.isOrAfter(status))) {
-+ this.chunkLoadAccept(chunkX, chunkZ, immediate, onLoad);
-+ return;
-+ } else {
-+ if (gen || (!allowSubTicketLevel && immediate.getStatus().isOrAfter(status))) {
-+ this.getChunkAtAsynchronously(chunkX, chunkZ, chunkStatusTicketLevel, onLoad);
-+ return;
-+ } else {
-+ this.chunkLoadAccept(chunkX, chunkZ, null, onLoad);
-+ return;
-+ }
-+ }
-+ }
-+ }
-+
-+ // need to fire async
-+
-+ if (gen && !allowSubTicketLevel) {
-+ this.getChunkAtAsynchronously(chunkX, chunkZ, chunkStatusTicketLevel, onLoad);
-+ return;
-+ }
-+
-+ this.getChunkAtAsynchronously(chunkX, chunkZ, io.papermc.paper.util.MCUtil.getTicketLevelFor(ChunkStatus.EMPTY), (ChunkAccess chunk) -> {
-+ if (chunk == null) {
-+ throw new IllegalStateException("Chunk cannot be null");
-+ }
-+
-+ if (!chunk.getStatus().isOrAfter(status)) {
-+ if (gen) {
-+ this.getChunkAtAsynchronously(chunkX, chunkZ, chunkStatusTicketLevel, onLoad);
-+ return;
-+ } else {
-+ ServerChunkCache.this.chunkLoadAccept(chunkX, chunkZ, null, onLoad);
-+ return;
-+ }
-+ } else {
-+ if (allowSubTicketLevel) {
-+ ServerChunkCache.this.chunkLoadAccept(chunkX, chunkZ, chunk, onLoad);
-+ return;
-+ } else {
-+ this.getChunkAtAsynchronously(chunkX, chunkZ, chunkStatusTicketLevel, onLoad);
-+ return;
-+ }
-+ }
-+ });
-+ }
-+ // Paper end
-+
-+ // Paper start
+ @Nullable
+ public ChunkAccess getChunkAtImmediately(int x, int z) {
+ ChunkHolder holder = this.chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
@@ -6868,34 +6758,6 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..7cacfceed5ef9276a19123a8a9079579
+ return holder.getLastAvailable();
+ }
+
-+ // this will try to avoid chunk neighbours for lighting
-+ public final ChunkAccess getFullStatusChunkAt(int chunkX, int chunkZ) {
-+ LevelChunk ifLoaded = this.getChunkAtIfLoadedImmediately(chunkX, chunkZ);
-+ if (ifLoaded != null) {
-+ return ifLoaded;
-+ }
-+
-+ ChunkAccess empty = this.getChunk(chunkX, chunkZ, ChunkStatus.EMPTY, true);
-+ if (empty != null && empty.getStatus().isOrAfter(ChunkStatus.FULL)) {
-+ return empty;
-+ }
-+ return this.getChunk(chunkX, chunkZ, ChunkStatus.FULL, true);
-+ }
-+
-+ public final ChunkAccess getFullStatusChunkAtIfLoaded(int chunkX, int chunkZ) {
-+ LevelChunk ifLoaded = this.getChunkAtIfLoadedImmediately(chunkX, chunkZ);
-+ if (ifLoaded != null) {
-+ return ifLoaded;
-+ }
-+
-+ ChunkAccess ret = this.getChunkAtImmediately(chunkX, chunkZ);
-+ if (ret != null && ret.getStatus().isOrAfter(ChunkStatus.FULL)) {
-+ return ret;
-+ } else {
-+ return null;
-+ }
-+ }
-+
+ public <T> void addTicketAtLevel(TicketType<T> ticketType, ChunkPos chunkPos, int ticketLevel, T identifier) {
+ this.distanceManager.addTicket(ticketType, chunkPos, ticketLevel, identifier);
+ }
@@ -6904,17 +6766,7 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..7cacfceed5ef9276a19123a8a9079579
+ this.distanceManager.removeTicket(ticketType, chunkPos, ticketLevel, identifier);
+ }
+
-+ public final io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<LevelChunk> tickingChunks = new io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
-+ public final io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<LevelChunk> entityTickingChunks = new io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
-+ // Paper end
-
- public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory) {
- this.level = world;
-@@ -119,6 +345,49 @@ public class ServerChunkCache extends ChunkSource {
- this.lastChunk[0] = chunk;
- }
-
-+ // Paper start - "real" get chunk if loaded
++ // "real" get chunk if loaded
+ // Note: Partially copied from the getChunkAt method below
+ @Nullable
+ public LevelChunk getChunkAtIfCachedImmediately(int x, int z) {
@@ -6956,11 +6808,19 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..7cacfceed5ef9276a19123a8a9079579
+ return ret;
+ }
+ // Paper end
-+
- @Nullable
+
@Override
- public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
-@@ -327,6 +596,12 @@ public class ServerChunkCache extends ChunkSource {
+ public ThreadedLevelLightEngine getLightEngine() {
+@@ -315,7 +442,7 @@ public class ServerChunkCache extends ChunkSource {
+ return this.mainThreadProcessor.pollTask();
+ }
+
+- boolean runDistanceManagerUpdates() {
++ public boolean runDistanceManagerUpdates() { // Paper - public
+ boolean flag = this.distanceManager.runAllUpdates(this.chunkMap);
+ boolean flag1 = this.chunkMap.promoteChunkMap();
+
+@@ -327,6 +454,12 @@ public class ServerChunkCache extends ChunkSource {
}
}
@@ -6974,7 +6834,7 @@ index 1d12a7934308aa48d7ea7fa10c7b6b5ccb27e707..7cacfceed5ef9276a19123a8a9079579
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 93867b8883c6f5d5086e8fdc153e6d7c1e5d9fec..aa2c9b13b86130a613ed171a3c16f3639e7c82c6 100644
+index 93867b8883c6f5d5086e8fdc153e6d7c1e5d9fec..68a0192f3b1c9491a6f64309ccc919274cdfe178 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -230,6 +230,98 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -7020,7 +6880,7 @@ index 93867b8883c6f5d5086e8fdc153e6d7c1e5d9fec..aa2c9b13b86130a613ed171a3c16f363
+ return;
+ }
+ List<net.minecraft.world.level.chunk.ChunkAccess> ret = new java.util.ArrayList<>();
-+ IntArrayList ticketLevels = new IntArrayList();
++ it.unimi.dsi.fastutil.ints.IntArrayList ticketLevels = new it.unimi.dsi.fastutil.ints.IntArrayList();
+
+ int minBlockX = Mth.floor(axisalignedbb.minX - 1.0E-7D) - 3;
+ int maxBlockX = Mth.floor(axisalignedbb.maxX + 1.0E-7D) + 3;
@@ -7876,8 +7736,22 @@ index 98836000cbca2a21649cb8f2a466986373405ea1..bbbf6dd8e566ecdca8794e3b03765fe7
if (!this.addEntityUuid(entity)) {
return false;
} else {
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+index 82d5c749a70f7a808c073263e861e09913c529d4..fdb24fe5504458ba2806df617464a1c41d8ba9e3 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+@@ -2533,4 +2533,9 @@ public final class CraftServer implements Server {
+ return this.spigot;
+ }
+ // Spigot end
++
++ @Override
++ public double[] getTPS() {
++ return new double[]{0, 0, 0}; // TODO
++ }
+ }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 16785a8dab5a2e786e17db049c027ed1c13f5ef6..9bd43d8859874c4d499f9b8d5ae6e08a23e0d4f2 100644
+index 16785a8dab5a2e786e17db049c027ed1c13f5ef6..2b0b9994751557e69ee7aa48fcb8319c128a5bbf 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -245,8 +245,8 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -7900,7 +7774,7 @@ index 16785a8dab5a2e786e17db049c027ed1c13f5ef6..9bd43d8859874c4d499f9b8d5ae6e08a
if (playerChunk == null) return false;
playerChunk.getTickingChunkFuture().thenAccept(either -> {
-@@ -2018,4 +2018,32 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -2018,4 +2018,55 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return this.spigot;
}
// Spigot end
@@ -7931,6 +7805,29 @@ index 16785a8dab5a2e786e17db049c027ed1c13f5ef6..9bd43d8859874c4d499f9b8d5ae6e08a
+
+ return ret;
+ }
++
++ @Override
++ public void setViewDistance(final int viewDistance) {
++ if (viewDistance < 2 || viewDistance > 32) {
++ throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]");
++ }
++ this.getHandle().chunkSource.chunkMap.setServerViewDistance(viewDistance);
++ }
++
++ @Override
++ public void setSimulationDistance(final int simulationDistance) {
++ throw new UnsupportedOperationException("Not implemented yet");
++ }
++
++ @Override
++ public int getSendViewDistance() {
++ return this.getViewDistance();
++ }
++
++ @Override
++ public void setSendViewDistance(final int viewDistance) {
++ throw new UnsupportedOperationException("Not implemented yet");
++ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -7975,6 +7872,45 @@ index 70165d287156f46b793eb23dd30b601289c0ffb1..758bf988432bb34aad9386e3f4e8bba6
+ }
+ // Paper end
}
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+index d5e56ed0a1bef50c0c715a7877f43fbc80dcaa44..633242f7cb25b8cdebd8c6ce579e4b60e471cdfa 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+@@ -2267,4 +2267,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+ return this.spigot;
+ }
+ // Spigot end
++
++ @Override
++ public int getViewDistance() {
++ return io.papermc.paper.chunk.system.ChunkSystem.getLoadViewDistance(this.getHandle());
++ }
++
++ @Override
++ public void setViewDistance(final int viewDistance) {
++ throw new UnsupportedOperationException("Not implemented yet");
++ }
++
++ @Override
++ public int getSimulationDistance() {
++ return io.papermc.paper.chunk.system.ChunkSystem.getTickViewDistance(this.getHandle());
++ }
++
++ @Override
++ public void setSimulationDistance(final int simulationDistance) {
++ throw new UnsupportedOperationException("Not implemented yet");
++ }
++
++ @Override
++ public int getSendViewDistance() {
++ return io.papermc.paper.chunk.system.ChunkSystem.getSendViewDistance(this.getHandle());
++ }
++
++ @Override
++ public void setSendViewDistance(final int viewDistance) {
++ throw new UnsupportedOperationException("Not implemented yet");
++ }
+ }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 97c8723d19233fb0a12e446594b18c50f34f11f1..cba729914a3adaee2507e2916a4cfb585869746d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch
index 93b956b36b..07bc481901 100644
--- a/patches/server/0010-Adventure.patch
+++ b/patches/server/0010-Adventure.patch
@@ -3354,7 +3354,7 @@ index 23bdb77690ba15bcbbfb0c70af23336d08ac7752..8f144a357174bbe096ac9b38a5e67a61
}
collection = icons;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 82d5c749a70f7a808c073263e861e09913c529d4..a3ef246b6765f93605bb3af6525adff01e71dd46 100644
+index fdb24fe5504458ba2806df617464a1c41d8ba9e3..1079476a3b327d668cf3d98f0a0659c81c120443 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -608,8 +608,10 @@ public final class CraftServer implements Server {
@@ -3484,10 +3484,10 @@ index 82d5c749a70f7a808c073263e861e09913c529d4..a3ef246b6765f93605bb3af6525adff0
@Override
public String getMotd() {
return this.console.getMotd();
-@@ -2533,4 +2590,57 @@ public final class CraftServer implements Server {
- return this.spigot;
+@@ -2538,4 +2595,57 @@ public final class CraftServer implements Server {
+ public double[] getTPS() {
+ return new double[]{0, 0, 0}; // TODO
}
- // Spigot end
+
+ // Paper start - adventure sounds
+ @Override
@@ -3543,7 +3543,7 @@ index 82d5c749a70f7a808c073263e861e09913c529d4..a3ef246b6765f93605bb3af6525adff0
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 9bd43d8859874c4d499f9b8d5ae6e08a23e0d4f2..68a7db9c840f101950435b386058f4cf409bfc05 100644
+index 2b0b9994751557e69ee7aa48fcb8319c128a5bbf..b2632cbc7903e23eb68e9901df039f5d8293bd77 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -155,6 +155,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -3597,9 +3597,9 @@ index 9bd43d8859874c4d499f9b8d5ae6e08a23e0d4f2..68a7db9c840f101950435b386058f4cf
private static Map<String, GameRules.Key<?>> gamerules;
public static synchronized Map<String, GameRules.Key<?>> getGameRulesNMS() {
-@@ -2045,5 +2082,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
-
- return ret;
+@@ -2068,5 +2105,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+ public void setSendViewDistance(final int viewDistance) {
+ throw new UnsupportedOperationException("Not implemented yet");
}
+
+ // Paper start - implement pointers
@@ -3617,7 +3617,7 @@ index 9bd43d8859874c4d499f9b8d5ae6e08a23e0d4f2..68a7db9c840f101950435b386058f4cf
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 5edad60f75a14b63ad704a68a3920f180ae82c40..ff503ab0ef9f3245d8ead4519507936f1c2288cf 100644
+index 02060584892d630d91f58e864ed34656ee738572..5158d536de16c93358d1b335b0fcfbe0d6ce848e 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -20,6 +20,12 @@ public class Main {
@@ -4137,7 +4137,7 @@ index 61759e8179d0f6342abf0c0294e5a024928db8d9..92e21126a9347f1ee2279ab09bb6abf2
public boolean isOp() {
return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index d5e56ed0a1bef50c0c715a7877f43fbc80dcaa44..af299f1e8a090758dea933647a4322f8f57d0aef 100644
+index 633242f7cb25b8cdebd8c6ce579e4b60e471cdfa..f609c4e67dd6feefb0c9366a515fd91256af3ff4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -300,14 +300,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0011-Paper-command.patch b/patches/server/0011-Paper-command.patch
index e9db4d01db..0e3a566133 100644
--- a/patches/server/0011-Paper-command.patch
+++ b/patches/server/0011-Paper-command.patch
@@ -617,7 +617,7 @@ index c56c7293261ec2601ab02d051b37e820f023f0ff..faab5e8c952a2af6a286043617cded4e
this.setPvpAllowed(dedicatedserverproperties.pvp);
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index a3ef246b6765f93605bb3af6525adff01e71dd46..606aa8bc3c1dbbe7c20e702042e7ff2335544398 100644
+index 1079476a3b327d668cf3d98f0a0659c81c120443..6c6a2a1eb9a02bf14b6b851f5d0aaba8528a8fec 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -939,6 +939,7 @@ public final class CraftServer implements Server {
@@ -628,7 +628,7 @@ index a3ef246b6765f93605bb3af6525adff01e71dd46..606aa8bc3c1dbbe7c20e702042e7ff23
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
-@@ -2634,6 +2635,34 @@ public final class CraftServer implements Server {
+@@ -2639,6 +2640,34 @@ public final class CraftServer implements Server {
// Paper end
// Paper start
diff --git a/patches/server/0013-Paper-Plugins.patch b/patches/server/0013-Paper-Plugins.patch
index 0fe1ef7114..a986d7d8e8 100644
--- a/patches/server/0013-Paper-Plugins.patch
+++ b/patches/server/0013-Paper-Plugins.patch
@@ -7085,7 +7085,7 @@ index 1eabd8b5a99850298838b11ba97e3d220f444378..8ff786c366332588a2df053438f23cc9
Bootstrap.wrapStreams();
Bootstrap.bootstrapDuration.set(Duration.between(instant, Instant.now()).toMillis());
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
-index f3130afbfd70e39a8000b0471854f8ef892bbbf5..884731fa4ebbbdc7c06ff670941f36ef3bf384ad 100644
+index 403c57fc683bb0497602e1a9ec7b81b2722ecc01..ba58580f4c60205d1c7a7b7dfcdc22c4fafc9bc6 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -128,6 +128,7 @@ public class Main {
@@ -7097,7 +7097,7 @@ index f3130afbfd70e39a8000b0471854f8ef892bbbf5..884731fa4ebbbdc7c06ff670941f36ef
Bootstrap.validate();
Util.startTimerHackThread();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 5f03d77a64e5ba2e86343599e0faafecbda316b1..04880123cde240f2d02936ecdefa9731db743b8f 100644
+index 6c6a2a1eb9a02bf14b6b851f5d0aaba8528a8fec..59872b2a9d88db63b76e07f7815246bbb095dbc1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -270,7 +270,8 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0014-Timings-v2.patch b/patches/server/0014-Timings-v2.patch
index ebb0a225cd..d4f79aa820 100644
--- a/patches/server/0014-Timings-v2.patch
+++ b/patches/server/0014-Timings-v2.patch
@@ -181,10 +181,10 @@ index 0000000000000000000000000000000000000000..4bd813161a5d76a83cdbd0a9209b9ea9
+}
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
new file mode 100644
-index 0000000000000000000000000000000000000000..38f01952153348d937e326da0ec102cd9b0f80af
+index 0000000000000000000000000000000000000000..49028463ba47e760281545c2f7597e3db8d6c453
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
-@@ -0,0 +1,386 @@
+@@ -0,0 +1,388 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -350,7 +350,9 @@ index 0000000000000000000000000000000000000000..38f01952153348d937e326da0ec102cd
+ pair("gamerules", toObjectMapper(world.getWorld().getGameRules(), rule -> {
+ return pair(rule, world.getWorld().getGameRuleValue(rule));
+ })),
-+ pair("ticking-distance", world.getChunkSource().chunkMap.getEffectiveViewDistance())
++ pair("ticking-distance", world.getWorld().getSimulationDistance()),
++ pair("no-ticking-distance", world.getWorld().getViewDistance()),
++ pair("sending-distance", world.getWorld().getSendViewDistance())
+ ));
+ }));
+
@@ -974,7 +976,7 @@ index 813fd87df0dfed8fe46389db8333d1d9f409fbe4..dfb37ddb89c2f43d9f9a34a6b2d38616
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index c721642337652ba4cf984ba3c263655b717d3b03..23e830d4cbe94a91c34ebb426311c8f861280b16 100644
+index 59b608d9722898470010413bef0cb6a6b83500b2..7245b93a4935aece23567fda0474104686485395 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,8 +1,10 @@
@@ -988,7 +990,7 @@ index c721642337652ba4cf984ba3c263655b717d3b03..23e830d4cbe94a91c34ebb426311c8f8
import com.google.common.collect.Lists;
import com.google.common.collect.Queues;
import com.google.common.collect.Sets;
-@@ -901,6 +903,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -892,6 +894,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkStatus chunkstatus = ChunkLevel.generationStatus(chunkHolder.getTicketLevel());
return !chunkstatus.isOrAfter(ChunkStatus.FULL) ? ChunkHolder.UNLOADED_CHUNK : either.mapLeft((ichunkaccess) -> {
@@ -996,7 +998,7 @@ index c721642337652ba4cf984ba3c263655b717d3b03..23e830d4cbe94a91c34ebb426311c8f8
ChunkPos chunkcoordintpair = chunkHolder.getPos();
ProtoChunk protochunk = (ProtoChunk) ichunkaccess;
LevelChunk chunk;
-@@ -925,6 +928,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -916,6 +919,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
return chunk;
@@ -1004,7 +1006,7 @@ index c721642337652ba4cf984ba3c263655b717d3b03..23e830d4cbe94a91c34ebb426311c8f8
});
}, (runnable) -> {
ProcessorHandle mailbox = this.mainThreadMailbox;
-@@ -1476,6 +1480,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1467,6 +1471,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
@@ -1012,7 +1014,7 @@ index c721642337652ba4cf984ba3c263655b717d3b03..23e830d4cbe94a91c34ebb426311c8f8
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
-@@ -1500,14 +1505,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1491,14 +1496,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker.serverEntity.sendChanges();
}
}
@@ -1031,10 +1033,10 @@ index c721642337652ba4cf984ba3c263655b717d3b03..23e830d4cbe94a91c34ebb426311c8f8
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 7cacfceed5ef9276a19123a8a9079579423d03ac..5cd680d2ed47aadb5e65a775d70bc662a92e3d7a 100644
+index 2c4727bf4571e1596bb0696b25104155f6302065..e0ae7274da59ff043cd423d282ed8db0382561d4 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -413,13 +413,15 @@ public class ServerChunkCache extends ChunkSource {
+@@ -271,13 +271,15 @@ public class ServerChunkCache extends ChunkSource {
}
gameprofilerfiller.incrementCounter("getChunkCacheMiss");
@@ -1052,7 +1054,7 @@ index 7cacfceed5ef9276a19123a8a9079579423d03ac..5cd680d2ed47aadb5e65a775d70bc662
ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
return ichunkaccess1;
}, (playerchunk_failure) -> {
-@@ -618,7 +620,9 @@ public class ServerChunkCache extends ChunkSource {
+@@ -476,7 +478,9 @@ public class ServerChunkCache extends ChunkSource {
public void save(boolean flush) {
this.runDistanceManagerUpdates();
@@ -1062,7 +1064,7 @@ index 7cacfceed5ef9276a19123a8a9079579423d03ac..5cd680d2ed47aadb5e65a775d70bc662
}
@Override
-@@ -657,10 +661,10 @@ public class ServerChunkCache extends ChunkSource {
+@@ -515,10 +519,10 @@ public class ServerChunkCache extends ChunkSource {
this.level.timings.doChunkMap.stopTiming(); // Spigot
this.level.getProfiler().popPush("chunks");
if (tickChunks) {
@@ -1075,7 +1077,7 @@ index 7cacfceed5ef9276a19123a8a9079579423d03ac..5cd680d2ed47aadb5e65a775d70bc662
}
this.level.timings.doChunkUnload.startTiming(); // Spigot
-@@ -683,6 +687,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -541,6 +545,7 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.push("filteringLoadedChunks");
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
Iterator iterator = this.chunkMap.getChunks().iterator();
@@ -1083,7 +1085,7 @@ index 7cacfceed5ef9276a19123a8a9079579423d03ac..5cd680d2ed47aadb5e65a775d70bc662
while (iterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
-@@ -695,8 +700,10 @@ public class ServerChunkCache extends ChunkSource {
+@@ -553,8 +558,10 @@ public class ServerChunkCache extends ChunkSource {
if (this.level.getServer().tickRateManager().runsNormally()) {
gameprofilerfiller.popPush("naturalSpawnCount");
@@ -1094,7 +1096,7 @@ index 7cacfceed5ef9276a19123a8a9079579423d03ac..5cd680d2ed47aadb5e65a775d70bc662
this.lastSpawnState = spawnercreature_d;
gameprofilerfiller.popPush("spawnAndTick");
-@@ -719,22 +726,25 @@ public class ServerChunkCache extends ChunkSource {
+@@ -577,22 +584,25 @@ public class ServerChunkCache extends ChunkSource {
}
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
@@ -1123,7 +1125,7 @@ index 7cacfceed5ef9276a19123a8a9079579423d03ac..5cd680d2ed47aadb5e65a775d70bc662
gameprofilerfiller.pop();
gameprofilerfiller.pop();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index aa2c9b13b86130a613ed171a3c16f3639e7c82c6..d00b789d8deb0163726acbcb10edb0965ac9f326 100644
+index 68a0192f3b1c9491a6f64309ccc919274cdfe178..73608abb5a39749c326ce6fe1bf014422941b2d1 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1,6 +1,8 @@
@@ -1603,7 +1605,7 @@ index 0eb09ce5c850d85ffd7229d27cf06b3e0edda11b..cc1d7626a82881c4410d65c6a33dadae
};
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 6a6923c1bc597831921cc3515e0e94f5172ef3e1..f7ff043c99268d5d8d139e2a4d8cd0817b7bb96b 100644
+index 59872b2a9d88db63b76e07f7815246bbb095dbc1..b1d0e9caed38b6a264b7ea8e508be103d3d0664e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -368,7 +368,7 @@ public final class CraftServer implements Server {
@@ -1817,7 +1819,7 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index af299f1e8a090758dea933647a4322f8f57d0aef..cf8a5b3ba642d4829725bc488c074b1b3b142867 100644
+index f609c4e67dd6feefb0c9366a515fd91256af3ff4..86802dee856ec0a5342c35ace716b6d66b093ccd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2631,6 +2631,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0016-Starlight.patch b/patches/server/0016-Starlight.patch
index 90fac0047e..39d3cff759 100644
--- a/patches/server/0016-Starlight.patch
+++ b/patches/server/0016-Starlight.patch
@@ -4480,7 +4480,7 @@ index 0000000000000000000000000000000000000000..463c6d8d5b114816ed90655582859458
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
-index facfdbb87e89f4db33ce13233c2ba4366d35c15b..807a6bb1026dac2c4cd0a50afe06fd62ce23558b 100644
+index 5250bf5029825524c239854db7999883459f1a8a..c5cd2c2c28795593712b0de2bbaa7e3860f1131a 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -53,7 +53,7 @@ public class ChunkHolder {
@@ -4493,7 +4493,7 @@ index facfdbb87e89f4db33ce13233c2ba4366d35c15b..807a6bb1026dac2c4cd0a50afe06fd62
private final DebugBuffer<ChunkHolder.ChunkSaveDebug> chunkToSaveHistory;
public int oldTicketLevel;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 23e830d4cbe94a91c34ebb426311c8f861280b16..ed095afdf8be843b9a608130040739c0b21dbe0a 100644
+index 7ee1b9fe8099091feaf09c4e7ffda99159b33c9b..c581ddf24f66a98798e8965adc848638edd889de 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -125,7 +125,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -4506,10 +4506,10 @@ index 23e830d4cbe94a91c34ebb426311c8f861280b16..ed095afdf8be843b9a608130040739c0
private final RandomState randomState;
private final ChunkGeneratorStructureState chunkGeneratorState;
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
-index 42f9f28726bc6ef09ab877ecf663b4caa5003a3a..0bd05d7a8f2a388c28ddcf3f07db5b0648dddeea 100644
+index 76005b3c48bfa323a77781c20c63708eeaa66b2b..222e72baa2fdb27c592e4c9ebef8303263b8d8ce 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
-@@ -386,7 +386,7 @@ public abstract class DistanceManager {
+@@ -380,7 +380,7 @@ public abstract class DistanceManager {
}
public void removeTicketsOnClosing() {
diff --git a/patches/server/0017-Add-TickThread.patch b/patches/server/0017-Add-TickThread.patch
index 462a214912..bf8c922243 100644
--- a/patches/server/0017-Add-TickThread.patch
+++ b/patches/server/0017-Add-TickThread.patch
@@ -7,10 +7,10 @@ Placeholder patch, to be used by chunksystem rewrite
diff --git a/src/main/java/io/papermc/paper/util/TickThread.java b/src/main/java/io/papermc/paper/util/TickThread.java
new file mode 100644
-index 0000000000000000000000000000000000000000..d59885ee9c8b29d5bac34dce0597e345e5358c77
+index 0000000000000000000000000000000000000000..73e83d56a340f0c7dcb8ff737d621003e72c6de4
--- /dev/null
+++ b/src/main/java/io/papermc/paper/util/TickThread.java
-@@ -0,0 +1,79 @@
+@@ -0,0 +1,83 @@
+package io.papermc.paper.util;
+
+import net.minecraft.server.MinecraftServer;
@@ -75,7 +75,7 @@ index 0000000000000000000000000000000000000000..d59885ee9c8b29d5bac34dce0597e345
+ }
+
+ public static TickThread getCurrentTickThread() {
-+ return (TickThread)Thread.currentThread();
++ return (TickThread) Thread.currentThread();
+ }
+
+ public static boolean isTickThread() {
@@ -83,11 +83,15 @@ index 0000000000000000000000000000000000000000..d59885ee9c8b29d5bac34dce0597e345
+ }
+
+ public static boolean isTickThreadFor(final ServerLevel world, final int chunkX, final int chunkZ) {
-+ return Bukkit.isPrimaryThread();
++ return isTickThread();
++ }
++
++ public static boolean isTickThreadFor(final ServerLevel world, final int chunkX, final int chunkZ, final int radius) {
++ return isTickThread();
+ }
+
+ public static boolean isTickThreadFor(final Entity entity) {
-+ return Bukkit.isPrimaryThread();
++ return isTickThread();
+ }
+}
diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java
diff --git a/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch
index 82fbad0ae7..7f6e9cc1b9 100644
--- a/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch
+++ b/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch
@@ -7,7 +7,7 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index f7ff043c99268d5d8d139e2a4d8cd0817b7bb96b..67129bf8c109486b65504536224666b1cb033b44 100644
+index b1d0e9caed38b6a264b7ea8e508be103d3d0664e..cfac91359e6084082fffd769fc8ce91f75717b1d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -422,6 +422,35 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
index 2a2bd44930..d395a0f02a 100644
--- a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
+++ b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
@@ -19,7 +19,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..de8b12b5014e653cb96d422c74307c7f
public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 67129bf8c109486b65504536224666b1cb033b44..58c0fc6c0d5df7cd8331d742dc93aad37d6139c9 100644
+index cfac91359e6084082fffd769fc8ce91f75717b1d..4fbc98bc2fe808a15f974b0abf614781fe66e1c4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -261,7 +261,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
diff --git a/patches/server/0052-Improve-Player-chat-API-handling.patch b/patches/server/0052-Improve-Player-chat-API-handling.patch
index fc2300f202..5de45ed559 100644
--- a/patches/server/0052-Improve-Player-chat-API-handling.patch
+++ b/patches/server/0052-Improve-Player-chat-API-handling.patch
@@ -40,7 +40,7 @@ index ce7caf08865df9ff032ba6c42308ea3ce4de6226..04e68886a5385234701962f250294805
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 58c0fc6c0d5df7cd8331d742dc93aad37d6139c9..c370a3be48d3582eb23e0831a3e21798ade9affd 100644
+index 4fbc98bc2fe808a15f974b0abf614781fe66e1c4..6568af2428be41c6d8baa8cf2a486ec4942d44d7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -885,7 +885,7 @@ public final class CraftServer implements Server {
@@ -53,7 +53,7 @@ index 58c0fc6c0d5df7cd8331d742dc93aad37d6139c9..c370a3be48d3582eb23e0831a3e21798
if (this.commandMap.dispatch(sender, commandLine)) {
return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 70a5ced9e39d6ce0e38f9ee04883584f40d49971..d37ff41c7266f6811988272e32e035469fe30f46 100644
+index ce54892f4a9b745779613af769783cb388336103..0017679b115de12f2e272db7ba3c11315086680f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -456,7 +456,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0054-Expose-server-CommandMap.patch b/patches/server/0054-Expose-server-CommandMap.patch
index 70890ea453..03a0a271b5 100644
--- a/patches/server/0054-Expose-server-CommandMap.patch
+++ b/patches/server/0054-Expose-server-CommandMap.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index c370a3be48d3582eb23e0831a3e21798ade9affd..fa77a985087acf3398f65b58be7c1d12ea8f7f66 100644
+index 6568af2428be41c6d8baa8cf2a486ec4942d44d7..669e75549d0cc1d9c506f362e27b2f1717ec8d5c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2112,6 +2112,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0058-Add-velocity-warnings.patch b/patches/server/0058-Add-velocity-warnings.patch
index 580c51848e..ad923e70d1 100644
--- a/patches/server/0058-Add-velocity-warnings.patch
+++ b/patches/server/0058-Add-velocity-warnings.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add velocity warnings
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index fa77a985087acf3398f65b58be7c1d12ea8f7f66..b7707cccbdc1b55f49cc70218949aacdceeb2651 100644
+index 669e75549d0cc1d9c506f362e27b2f1717ec8d5c..908808099d0b7c3320f447330a441a536ce07421 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -298,6 +298,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0065-Default-loading-permissions.yml-before-plugins.patch b/patches/server/0065-Default-loading-permissions.yml-before-plugins.patch
index 14939ea379..1168591066 100644
--- a/patches/server/0065-Default-loading-permissions.yml-before-plugins.patch
+++ b/patches/server/0065-Default-loading-permissions.yml-before-plugins.patch
@@ -16,7 +16,7 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe
A config option has been added for those who depend on the previous behavior, but I don't expect that.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index b7707cccbdc1b55f49cc70218949aacdceeb2651..64541619b92f58a9e2621f754c8494ab5c7014c8 100644
+index 908808099d0b7c3320f447330a441a536ce07421..9bec3b0d5c7eaccb334e2663bb1fdc42cd6eb367 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -456,6 +456,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch
index 34e3208f3e..cff5149940 100644
--- a/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch
+++ b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 64541619b92f58a9e2621f754c8494ab5c7014c8..73e29dc1cce2999e81d250a9cc8fae55df97698a 100644
+index 9bec3b0d5c7eaccb334e2663bb1fdc42cd6eb367..d2d2cc70eac66d503efe89ded205f1a904c95a26 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2709,5 +2709,23 @@ public final class CraftServer implements Server {
+@@ -2714,5 +2714,23 @@ public final class CraftServer implements Server {
}
return this.adventure$audiences;
}
diff --git a/patches/server/0067-Remove-Metadata-on-reload.patch b/patches/server/0067-Remove-Metadata-on-reload.patch
index b4e8ffba2f..d7f1fa2629 100644
--- a/patches/server/0067-Remove-Metadata-on-reload.patch
+++ b/patches/server/0067-Remove-Metadata-on-reload.patch
@@ -7,7 +7,7 @@ Metadata is not meant to persist reload as things break badly with non primitive
This will remove metadata on reload so it does not crash everything if a plugin uses it.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 73e29dc1cce2999e81d250a9cc8fae55df97698a..7555a74c90082d4164fbfda9d467514ccf7815bb 100644
+index d2d2cc70eac66d503efe89ded205f1a904c95a26..fb6c21a43e771317526972c183d95402d941924b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -952,8 +952,16 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0079-Sanitise-RegionFileCache-and-make-configurable.patch b/patches/server/0079-Sanitise-RegionFileCache-and-make-configurable.patch
index 39c74417d0..23c86e3bd0 100644
--- a/patches/server/0079-Sanitise-RegionFileCache-and-make-configurable.patch
+++ b/patches/server/0079-Sanitise-RegionFileCache-and-make-configurable.patch
@@ -11,7 +11,7 @@ The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap).
The maximum size of the RegionFileCache is also made configurable.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-index a7bf0ce6eefa60ba61975afb8885fc1857fb7959..50f8e12c964a7a0f388568e4df512ddffdda4a64 100644
+index 50a285127ee5a247680d4486ec9d5e01453b8a8e..b5b7b73048eaadfe58961631427da7574d42f5e8 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -37,7 +37,7 @@ public class RegionFileStorage implements AutoCloseable {
diff --git a/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch b/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch
index e93ba583d2..dffa348c1d 100644
--- a/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch
+++ b/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch
@@ -60,7 +60,7 @@ index b3c6e76105ee26a79a84a203935530f859460652..e697b8f7b165d2394d8155cbee7453e2
} else {
String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 7555a74c90082d4164fbfda9d467514ccf7815bb..b765da78ff380ffdf6472f850eab73d75fd6f469 100644
+index fb6c21a43e771317526972c183d95402d941924b..040d5fa985f746d90e144b668ebb2adb79c33daa 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1821,7 +1821,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch b/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch
index 855b74ef98..88538b7546 100644
--- a/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch
+++ b/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index b765da78ff380ffdf6472f850eab73d75fd6f469..b8eac20a5df37408321d3b05f4c55f091f808f50 100644
+index 040d5fa985f746d90e144b668ebb2adb79c33daa..d2fe67471259738a1008460d3364fb8650fe3811 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2735,5 +2735,24 @@ public final class CraftServer implements Server {
+@@ -2740,5 +2740,24 @@ public final class CraftServer implements Server {
DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions();
}
diff --git a/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch
index 60d7a14107..2a670523e4 100644
--- a/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch
+++ b/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index b8eac20a5df37408321d3b05f4c55f091f808f50..83eb0a8aec7b54f15af033a1018d6cd7901e6ce7 100644
+index d2fe67471259738a1008460d3364fb8650fe3811..e1403914e740f8fa9edc5381593926af99dfb5aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2754,5 +2754,10 @@ public final class CraftServer implements Server {
+@@ -2759,5 +2759,10 @@ public final class CraftServer implements Server {
commandMap.registerServerAliases();
return true;
}
diff --git a/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch
index ca065d6a9a..982c6a87c8 100644
--- a/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch
+++ b/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch
@@ -386,7 +386,7 @@ index 40af2325afea3e4831a9d8795ce1932a6a5663bf..db4480778e4b917a073c61f29cd45663
this.bans = new UserBanList(PlayerList.USERBANLIST_FILE);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 83eb0a8aec7b54f15af033a1018d6cd7901e6ce7..42b2ec78b8a4089c4d35e92a5450b95a97e057ed 100644
+index e1403914e740f8fa9edc5381593926af99dfb5aa..924dac8bc6b35c834e64512f036503b0ac365579 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -42,7 +42,7 @@ import java.util.logging.Level;
diff --git a/patches/server/0135-Basic-PlayerProfile-API.patch b/patches/server/0135-Basic-PlayerProfile-API.patch
index 71ae995dc6..f23495f9fb 100644
--- a/patches/server/0135-Basic-PlayerProfile-API.patch
+++ b/patches/server/0135-Basic-PlayerProfile-API.patch
@@ -612,7 +612,7 @@ index adb472c175cc6f6ced7075a37423d6c898fd5ccb..1ec0f3a7148c2f412421772f6e1dff0b
String s1 = name.toLowerCase(Locale.ROOT);
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 42b2ec78b8a4089c4d35e92a5450b95a97e057ed..0ba93b1fe563a76dae12cef93ae4a33ca92ff4e6 100644
+index 924dac8bc6b35c834e64512f036503b0ac365579..7678b7eb8561bca272bdb26de5a9f96bd18d005d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -260,6 +260,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
@@ -633,7 +633,7 @@ index 42b2ec78b8a4089c4d35e92a5450b95a97e057ed..0ba93b1fe563a76dae12cef93ae4a33c
CraftItemFactory.instance();
}
-@@ -2763,5 +2767,42 @@ public final class CraftServer implements Server {
+@@ -2768,5 +2772,42 @@ public final class CraftServer implements Server {
public boolean suggestPlayerNamesWhenNullTabCompletions() {
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
}
diff --git a/patches/server/0136-Add-UnknownCommandEvent.patch b/patches/server/0136-Add-UnknownCommandEvent.patch
index abf3e9736f..60d45f5e3e 100644
--- a/patches/server/0136-Add-UnknownCommandEvent.patch
+++ b/patches/server/0136-Add-UnknownCommandEvent.patch
@@ -100,7 +100,7 @@ index 495a7b713a7ab9c19aad34512b76523bad43b89d..15a5059994371da4850adcf726034a71
return null;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 0ba93b1fe563a76dae12cef93ae4a33ca92ff4e6..24fe763be314cd80b37f929a20a1af8da12ae9e8 100644
+index 7678b7eb8561bca272bdb26de5a9f96bd18d005d..59776663cee396f29f05988d8e22dd5c23b118b5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -527,6 +527,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0162-AsyncTabCompleteEvent.patch b/patches/server/0162-AsyncTabCompleteEvent.patch
index fd28484e3e..d6ddd62486 100644
--- a/patches/server/0162-AsyncTabCompleteEvent.patch
+++ b/patches/server/0162-AsyncTabCompleteEvent.patch
@@ -87,7 +87,7 @@ index ba2628f22907b386fe5638220e5f10e39bc1f80b..2d633b9921e04dac21d705ffdf0f5a92
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 24fe763be314cd80b37f929a20a1af8da12ae9e8..26a5e44fdb0078b2711228ac4f0eb827fe03f037 100644
+index 59776663cee396f29f05988d8e22dd5c23b118b5..fb26379f600cc3e7e286d246f25e2bf718611e9d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2227,7 +2227,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch
index 3106e55513..9caa2d8f5f 100644
--- a/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch
+++ b/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch
@@ -9,10 +9,10 @@ from triggering monster spawns on a server.
Also a highly more effecient way to blanket block spawns in a world
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index ed095afdf8be843b9a608130040739c0b21dbe0a..57b344459b670742edc81a5046f1dfc2dae52c9f 100644
+index c581ddf24f66a98798e8965adc848638edd889de..987f867def412552b0d7f6cb2cba50af520f1257 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1212,7 +1212,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1203,7 +1203,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
chunkRange = (chunkRange > this.level.spigotConfig.viewDistance) ? (byte) this.level.spigotConfig.viewDistance : chunkRange;
chunkRange = (chunkRange > 8) ? 8 : chunkRange;
@@ -23,7 +23,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..57b344459b670742edc81a5046f1dfc2
// Spigot end
if (!this.distanceManager.hasPlayersNearby(chunkcoordintpair.toLong())) {
return false;
-@@ -1227,6 +1229,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1218,6 +1220,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
entityplayer = (ServerPlayer) iterator.next();
@@ -40,10 +40,10 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..57b344459b670742edc81a5046f1dfc2
return true;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..5fc48485aa2045c19c5ec2ba9cb6fafabb1ae8f1 100644
+index e0ae7274da59ff043cd423d282ed8db0382561d4..369e4bf5ff52cb774f1acaf760b8bd276a0745f5 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -710,6 +710,15 @@ public class ServerChunkCache extends ChunkSource {
+@@ -568,6 +568,15 @@ public class ServerChunkCache extends ChunkSource {
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
Util.shuffle(list, this.level.random);
diff --git a/patches/server/0178-getPlayerUniqueId-API.patch b/patches/server/0178-getPlayerUniqueId-API.patch
index 25219f9e9d..d9dc0416d4 100644
--- a/patches/server/0178-getPlayerUniqueId-API.patch
+++ b/patches/server/0178-getPlayerUniqueId-API.patch
@@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 26a5e44fdb0078b2711228ac4f0eb827fe03f037..43406c5d7fdd3cd7c88aad5a86252eab28a88c0b 100644
+index fb26379f600cc3e7e286d246f25e2bf718611e9d..d4c3d9a45c01d462513e5dbfa514afdde32c9ad7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1826,6 +1826,25 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0229-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/0229-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
index 0b164f15bf..f9d49cc31b 100644
--- a/patches/server/0229-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
+++ b/patches/server/0229-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 57b344459b670742edc81a5046f1dfc2dae52c9f..fbac26f913476242c8dd1310426a1d66275f6567 100644
+index 987f867def412552b0d7f6cb2cba50af520f1257..1a80f48a425a81af6acd917f67d33a80746f46c3 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1434,6 +1434,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1425,6 +1425,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else {
ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas());
@@ -16,7 +16,7 @@ index 57b344459b670742edc81a5046f1dfc2dae52c9f..fbac26f913476242c8dd1310426a1d66
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
playerchunkmap_entitytracker.updatePlayers(this.level.players());
if (entity instanceof ServerPlayer) {
-@@ -1476,7 +1477,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1467,7 +1468,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.broadcastRemoved();
}
@@ -26,7 +26,7 @@ index 57b344459b670742edc81a5046f1dfc2dae52c9f..fbac26f913476242c8dd1310426a1d66
protected void tick() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 35ed4ba377eadb72d59a7984bc40f3834136174c..46b71a140ab8a1b997415184db09cb8a3ea39c52 100644
+index a6749080a192a591dd4e52f56b691df8d9cfcd98..e1518465e4ffc473a75a57e4d9b3ad399a022589 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1197,6 +1197,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -43,7 +43,7 @@ index 35ed4ba377eadb72d59a7984bc40f3834136174c..46b71a140ab8a1b997415184db09cb8a
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 7abb4ba10029ad8df5ed520d1d3deb9d2819ca8d..227df91e28d11cad778b5190432c6eb5fb0312e5 100644
+index 3ff8c6a4aa867e2ceed8c355550c9c20db6e812e..92284eff12eb28034e33563bb3644deeb0fa81ac 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -241,6 +241,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
diff --git a/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch
index f9e21ca8df..a13023571d 100644
--- a/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch
+++ b/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch
@@ -33,7 +33,7 @@ index 6aede562955799fae90a1234b6300ba3a91ba2f2..333647f4328c29afffdc2b0de5abeec7
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 43406c5d7fdd3cd7c88aad5a86252eab28a88c0b..0e18637f9ac0cf69f370d46081664456b4b30c4c 100644
+index d4c3d9a45c01d462513e5dbfa514afdde32c9ad7..4958a3715a3d09e6d956ca8cc8201f11e3ebc3a4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -915,6 +915,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0273-Make-the-default-permission-message-configurable.patch b/patches/server/0273-Make-the-default-permission-message-configurable.patch
index fbdf1ac3e7..d78a479f47 100644
--- a/patches/server/0273-Make-the-default-permission-message-configurable.patch
+++ b/patches/server/0273-Make-the-default-permission-message-configurable.patch
@@ -18,10 +18,10 @@ index de0e1ad2c78e5132651494f198703533847c84bd..830978f3409888302ab857161628cee5
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 0e18637f9ac0cf69f370d46081664456b4b30c4c..c682abdd2b144dcd6260db6d63b0474b547f2cc6 100644
+index 4958a3715a3d09e6d956ca8cc8201f11e3ebc3a4..3ff493a3a0f679d894d8f60712811e20f5d986a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2796,6 +2796,16 @@ public final class CraftServer implements Server {
+@@ -2801,6 +2801,16 @@ public final class CraftServer implements Server {
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
}
diff --git a/patches/server/0301-Expose-the-internal-current-tick.patch b/patches/server/0301-Expose-the-internal-current-tick.patch
index bc0180ff72..ec7cb5e019 100644
--- a/patches/server/0301-Expose-the-internal-current-tick.patch
+++ b/patches/server/0301-Expose-the-internal-current-tick.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index c682abdd2b144dcd6260db6d63b0474b547f2cc6..e406157dd677f4dde226a30a7faed92c1744afd7 100644
+index 3ff493a3a0f679d894d8f60712811e20f5d986a0..743e6d25ca5ef4745a723d3bbb2efd2d18741ded 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2842,5 +2842,10 @@ public final class CraftServer implements Server {
+@@ -2847,5 +2847,10 @@ public final class CraftServer implements Server {
profile.getProperties().putAll(((CraftPlayer) player).getHandle().getGameProfile().getProperties());
return new com.destroystokyo.paper.profile.CraftPlayerProfile(profile);
}
diff --git a/patches/server/0311-Duplicate-UUID-Resolve-Option.patch b/patches/server/0311-Duplicate-UUID-Resolve-Option.patch
index 68589f3b44..657d186095 100644
--- a/patches/server/0311-Duplicate-UUID-Resolve-Option.patch
+++ b/patches/server/0311-Duplicate-UUID-Resolve-Option.patch
@@ -33,10 +33,10 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA
It is recommended you regenerate the entities, as these were legit entities, and deserve your love.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index fbac26f913476242c8dd1310426a1d66275f6567..f9df43a6e6239fe8a7abec9f9fce4c9eb01b89ae 100644
+index 1a80f48a425a81af6acd917f67d33a80746f46c3..4357c2800aaceb2d6a9d3c5246faf796d7732f42 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -889,6 +889,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -880,6 +880,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.discard();
needsRemoval = true;
}
@@ -44,7 +44,7 @@ index fbac26f913476242c8dd1310426a1d66275f6567..f9df43a6e6239fe8a7abec9f9fce4c9e
return !needsRemoval;
}));
// CraftBukkit end
-@@ -939,6 +940,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -930,6 +931,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
});
}
diff --git a/patches/server/0321-Tracking-Range-Improvements.patch b/patches/server/0321-Tracking-Range-Improvements.patch
index ebb35fc4fa..63b16cfc50 100644
--- a/patches/server/0321-Tracking-Range-Improvements.patch
+++ b/patches/server/0321-Tracking-Range-Improvements.patch
@@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
Also ignores Enderdragon, defaulting it to Mojang's setting
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index f9df43a6e6239fe8a7abec9f9fce4c9eb01b89ae..064b008c3869346315f7a9fb2ce7a111f5adf729 100644
+index bc481cf547504140a921ec20d7c21d2931b1e7ab..51cbdaead57a527bac5eeb7bc130f31667fcf450 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1770,6 +1770,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1761,6 +1761,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
int j = entity.getType().clientTrackingRange() * 16;
@@ -20,7 +20,7 @@ index f9df43a6e6239fe8a7abec9f9fce4c9eb01b89ae..064b008c3869346315f7a9fb2ce7a111
if (j > i) {
i = j;
diff --git a/src/main/java/org/spigotmc/TrackingRange.java b/src/main/java/org/spigotmc/TrackingRange.java
-index 73f9563551632a5369ba55e8fe9211afc325e869..172d231adecf043f9f06b7f5e0365ae82327998d 100644
+index 73f9563551632a5369ba55e8fe9211afc325e869..bb06f89a29f30144e7e2113e088a503db006a83c 100644
--- a/src/main/java/org/spigotmc/TrackingRange.java
+++ b/src/main/java/org/spigotmc/TrackingRange.java
@@ -7,7 +7,6 @@ import net.minecraft.world.entity.ExperienceOrb;
@@ -72,7 +72,7 @@ index 73f9563551632a5369ba55e8fe9211afc325e869..172d231adecf043f9f06b7f5e0365ae8
return config.displayTrackingRange;
} else
{
-+ if (entity instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon) return ((net.minecraft.server.level.ServerLevel)(entity.getCommandSenderWorld())).getChunkSource().chunkMap.getEffectiveViewDistance(); // Paper - enderdragon is exempt
++ if (entity instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon) return ((net.minecraft.server.level.ServerLevel)(entity.getCommandSenderWorld())).getChunkSource().chunkMap.serverViewDistance; // Paper - enderdragon is exempt
return config.otherTrackingRange;
}
}
diff --git a/patches/server/0325-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/patches/server/0325-Optimise-getChunkAt-calls-for-loaded-chunks.patch
index 268dd7416f..bb08aebe5a 100644
--- a/patches/server/0325-Optimise-getChunkAt-calls-for-loaded-chunks.patch
+++ b/patches/server/0325-Optimise-getChunkAt-calls-for-loaded-chunks.patch
@@ -7,10 +7,10 @@ bypass the need to get a player chunk, then get the either,
then unwrap it...
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 5fc48485aa2045c19c5ec2ba9cb6fafabb1ae8f1..32a26eac53cfd4fb69ba117908acc82894deb1a0 100644
+index 369e4bf5ff52cb774f1acaf760b8bd276a0745f5..326b67c15ee3df162bf4468729c49dd98b582f02 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -396,6 +396,12 @@ public class ServerChunkCache extends ChunkSource {
+@@ -254,6 +254,12 @@ public class ServerChunkCache extends ChunkSource {
return this.getChunk(x, z, leastStatus, create);
}, this.mainThreadProcessor).join();
} else {
@@ -23,7 +23,7 @@ index 5fc48485aa2045c19c5ec2ba9cb6fafabb1ae8f1..32a26eac53cfd4fb69ba117908acc828
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
gameprofilerfiller.incrementCounter("getChunk");
-@@ -442,39 +448,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -300,39 +306,7 @@ public class ServerChunkCache extends ChunkSource {
if (Thread.currentThread() != this.mainThread) {
return null;
} else {
diff --git a/patches/server/0326-Add-debug-for-sync-chunk-loads.patch b/patches/server/0326-Add-debug-for-sync-chunk-loads.patch
index d7143dad9f..6862d9fe5b 100644
--- a/patches/server/0326-Add-debug-for-sync-chunk-loads.patch
+++ b/patches/server/0326-Add-debug-for-sync-chunk-loads.patch
@@ -14,7 +14,7 @@ chunks, however it must be enabled by setting the startup flag
diff --git a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
new file mode 100644
-index 0000000000000000000000000000000000000000..0bb4aaa546939b67a5d22865190f30478a9337c1
+index 0000000000000000000000000000000000000000..404a8fd128043527d23f22ee26f7c8c739f09089
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
@@ -0,0 +1,175 @@
@@ -69,7 +69,7 @@ index 0000000000000000000000000000000000000000..0bb4aaa546939b67a5d22865190f3047
+
+ ++valueInMap.times;
+
-+ valueInMap.coordinateTimes.compute(IOUtil.getCoordinateKey(chunkX, chunkZ), (Long keyInMap1, Integer valueInMap1) -> {
++ valueInMap.coordinateTimes.compute(io.papermc.paper.util.MCUtil.getCoordinateKey(chunkX, chunkZ), (Long keyInMap1, Integer valueInMap1) -> {
+ return valueInMap1 == null ? Integer.valueOf(1) : Integer.valueOf(valueInMap1.intValue() + 1);
+ });
+
@@ -122,7 +122,7 @@ index 0000000000000000000000000000000000000000..0bb4aaa546939b67a5d22865190f3047
+ for (Long2IntMap.Entry coordinate : pair.getSecond().coordinateTimes.long2IntEntrySet()) {
+ final long key = coordinate.getLongKey();
+ final int times = coordinate.getIntValue();
-+ coordinates.add("(" + IOUtil.getCoordinateX(key) + "," + IOUtil.getCoordinateZ(key) + "): " + times);
++ coordinates.add("(" + io.papermc.paper.util.MCUtil.getCoordinateX(key) + "," + io.papermc.paper.util.MCUtil.getCoordinateZ(key) + "): " + times);
+ }
+
+ stacktrace.add("coordinates", coordinates);
@@ -300,10 +300,10 @@ index 0000000000000000000000000000000000000000..95d6022c9cfb2e36ec5a71be6e343540
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 32a26eac53cfd4fb69ba117908acc82894deb1a0..6bb0b24e8bc5cd031d192dd0b61a3afd248c62e4 100644
+index 326b67c15ee3df162bf4468729c49dd98b582f02..8a118a7b2878d3c99dadfa97e2ae58fda2b3f93b 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -424,6 +424,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -282,6 +282,7 @@ public class ServerChunkCache extends ChunkSource {
Objects.requireNonNull(completablefuture);
if (!completablefuture.isDone()) { // Paper
@@ -312,7 +312,7 @@ index 32a26eac53cfd4fb69ba117908acc82894deb1a0..6bb0b24e8bc5cd031d192dd0b61a3afd
chunkproviderserver_b.managedBlock(completablefuture::isDone);
this.level.timings.syncChunkLoad.stopTiming(); // Paper
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 989cd53db579408f89c3425d808e0a611194e896..dd7071404555548c7f102737456f8773860b597b 100644
+index 3f70bab49d58ec36f6153a7dae577d22c90d2918..14958ce7c7cb1a55da6b6dd6c32a32c9346e866b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -415,6 +415,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0338-Add-tick-times-API-and-mspt-command.patch b/patches/server/0338-Add-tick-times-API-and-mspt-command.patch
index e5f094e4c0..f840d72f89 100644
--- a/patches/server/0338-Add-tick-times-API-and-mspt-command.patch
+++ b/patches/server/0338-Add-tick-times-API-and-mspt-command.patch
@@ -184,7 +184,7 @@ index e8b3755dec8149282a2fc55bf0a3fbb788df0b2b..fcb8708276a73ab61e004f0113650b0a
+ // Paper end - Add tick times API and /mspt command
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index e406157dd677f4dde226a30a7faed92c1744afd7..bc81109da3e03a34b0684a6a5a0e67b22fda569e 100644
+index 743e6d25ca5ef4745a723d3bbb2efd2d18741ded..7b30b180900d18074edf517c969f78bb1c10c241 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2619,6 +2619,16 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0339-Expose-MinecraftServer-isRunning.patch b/patches/server/0339-Expose-MinecraftServer-isRunning.patch
index 88dd15dd20..abe3bec443 100644
--- a/patches/server/0339-Expose-MinecraftServer-isRunning.patch
+++ b/patches/server/0339-Expose-MinecraftServer-isRunning.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index bc81109da3e03a34b0684a6a5a0e67b22fda569e..e7cc65bd56b8526ca4f5a935872bc158fae22bb0 100644
+index 7b30b180900d18074edf517c969f78bb1c10c241..69e25f23322704d054bef119f3581eee08cff55f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2857,5 +2857,10 @@ public final class CraftServer implements Server {
+@@ -2862,5 +2862,10 @@ public final class CraftServer implements Server {
public int getCurrentTick() {
return net.minecraft.server.MinecraftServer.currentTick;
}
diff --git a/patches/server/0344-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/patches/server/0344-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
index 97cd7fd97e..64a0e8c90d 100644
--- a/patches/server/0344-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
+++ b/patches/server/0344-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
@@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 064b008c3869346315f7a9fb2ce7a111f5adf729..b2bc8869c454eba5c55a45d5671e2e406a0d12a7 100644
+index 5be7788ad5c9fb8158c70b7e5eb11b82e0fbeafe..1543bdec9bfa48bba65d03b04a0986698aa00bba 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1461,6 +1461,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1452,6 +1452,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void addEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
@@ -25,7 +25,7 @@ index 064b008c3869346315f7a9fb2ce7a111f5adf729..b2bc8869c454eba5c55a45d5671e2e40
EntityType<?> entitytypes = entity.getType();
int i = entitytypes.clientTrackingRange() * 16;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index dd7071404555548c7f102737456f8773860b597b..ecc716ce94f40ab8f85e5f57fecad68c08d4e85e 100644
+index 14958ce7c7cb1a55da6b6dd6c32a32c9346e866b..d2da284aa7284c5205e656c48262061980893be6 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2224,7 +2224,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0355-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch b/patches/server/0355-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch
index 593623bc6d..05099c700e 100644
--- a/patches/server/0355-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch
+++ b/patches/server/0355-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch
@@ -31,10 +31,10 @@ delays anymore.
public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index b2bc8869c454eba5c55a45d5671e2e406a0d12a7..9706e08511fcfd72abd5e92d7df54dc199451499 100644
+index 1543bdec9bfa48bba65d03b04a0986698aa00bba..7f61b2945e5174f89936041c334d4cb2e5cdb130 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1468,6 +1468,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1459,6 +1459,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return;
}
// Paper end - ignore and warn about illegal addEntity calls instead of crashing server
diff --git a/patches/server/0363-Expose-game-version.patch b/patches/server/0363-Expose-game-version.patch
index 31b87107a7..1c3104600c 100644
--- a/patches/server/0363-Expose-game-version.patch
+++ b/patches/server/0363-Expose-game-version.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Expose game version
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index e7cc65bd56b8526ca4f5a935872bc158fae22bb0..46273f6d706ecf9a46c9c41bd93cffda9ff0687a 100644
+index 69e25f23322704d054bef119f3581eee08cff55f..32833942d0383671a03463d07ed6e40171db53c6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -577,6 +577,13 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0365-misc-debugging-dumps.patch b/patches/server/0365-misc-debugging-dumps.patch
index fad9dc8e9f..cbf65ca99a 100644
--- a/patches/server/0365-misc-debugging-dumps.patch
+++ b/patches/server/0365-misc-debugging-dumps.patch
@@ -87,7 +87,7 @@ index 04a728a16bb629adbae1cd8586764a6dbc22b5dc..d130f843975236018df4fa2ccc3ca6aa
this.connection.disconnect(ServerConfigurationPacketListenerImpl.DISCONNECT_REASON_INVALID_DATA);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 46273f6d706ecf9a46c9c41bd93cffda9ff0687a..0035e5c4e4394132a869dcadd15015fd33a2fefb 100644
+index 32833942d0383671a03463d07ed6e40171db53c6..51ae35b3edd651cc85aaab2cbf7d223c7563951a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1006,6 +1006,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0368-Implement-Mob-Goal-API.patch b/patches/server/0368-Implement-Mob-Goal-API.patch
index cc9532872f..7a767ac051 100644
--- a/patches/server/0368-Implement-Mob-Goal-API.patch
+++ b/patches/server/0368-Implement-Mob-Goal-API.patch
@@ -768,10 +768,10 @@ index 6667ecc4b7eded4e20a415cef1e1b1179e6710b8..16f9a98b8a939e5ca7e2dc04f87134a7
LOOK,
JUMP,
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 0035e5c4e4394132a869dcadd15015fd33a2fefb..0e7cfec27eb76382d4827b62c31e10f118a87dd4 100644
+index 51ae35b3edd651cc85aaab2cbf7d223c7563951a..bbd3ceb2db482f32e939ccd99970fd7101f5a5ce 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2870,5 +2870,11 @@ public final class CraftServer implements Server {
+@@ -2875,5 +2875,11 @@ public final class CraftServer implements Server {
public boolean isStopping() {
return net.minecraft.server.MinecraftServer.getServer().hasStopped();
}
diff --git a/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch b/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch
index 16c9f72f38..14c170d5c2 100644
--- a/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch
+++ b/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch
@@ -22,7 +22,7 @@ index 4339a2cd0b2020b673ebdb6902ad0d0a53373a27..d983aec418603a470f640ace139572fd
// CraftBukkit end
this.getConnection().stop();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 0e7cfec27eb76382d4827b62c31e10f118a87dd4..5b41a2c7e26fde4a5e34f2de567d6e1920e51a36 100644
+index bbd3ceb2db482f32e939ccd99970fd7101f5a5ce..b0e5dc6b3c9a7e820e001cfe311a7414cea4c245 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1016,6 +1016,31 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
index c767501ee5..aadb1f2698 100644
--- a/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
+++ b/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
@@ -102,7 +102,7 @@ index 6dbf7734b640dc9cd553dfd6afb4c9cd4e3d66da..48fca15cdc6b0bafc3d8ff13cc96b325
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 5b41a2c7e26fde4a5e34f2de567d6e1920e51a36..2b709a4e7b120497c48d0408874a29602ea5bd98 100644
+index b0e5dc6b3c9a7e820e001cfe311a7414cea4c245..7803075383cdde77444991e72f49ed67627f95ed 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -955,8 +955,8 @@ public final class CraftServer implements Server {
@@ -117,7 +117,7 @@ index 5b41a2c7e26fde4a5e34f2de567d6e1920e51a36..2b709a4e7b120497c48d0408874a2960
for (SpawnCategory spawnCategory : SpawnCategory.values()) {
if (CraftSpawnCategory.isValidForLimits(spawnCategory)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 92c19035e4e03530eb27d7dd96847f4546710d28..316ba3726f4bfe2e99edefa87bc0ff372a6389bc 100644
+index 6ab78bead1fd4e7c02c597b23824f5e4f80132c9..c44cfa0dd5794976c74211467ac0b7022cce17e9 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1121,7 +1121,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0395-Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/patches/server/0395-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
index ff602324a9..8a3e2169f4 100644
--- a/patches/server/0395-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
+++ b/patches/server/0395-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
@@ -22,7 +22,7 @@ wants it to collect even faster, they can restore that setting back to 1 instead
Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 2b709a4e7b120497c48d0408874a29602ea5bd98..3aa481599811af7cd9b0c523f66dac469105ee49 100644
+index 7803075383cdde77444991e72f49ed67627f95ed..936928dda8b09386ef936cec9da65eb76b1ccf1d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -377,7 +377,7 @@ public final class CraftServer implements Server {
@@ -44,7 +44,7 @@ index 2b709a4e7b120497c48d0408874a29602ea5bd98..3aa481599811af7cd9b0c523f66dac46
this.printSaveWarning = false;
this.console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 316ba3726f4bfe2e99edefa87bc0ff372a6389bc..fe0095601b41d85d8813af18e1c74b31f26f150d 100644
+index c44cfa0dd5794976c74211467ac0b7022cce17e9..6070409175b106ba6920adf4fa860215cd6f3087 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -282,7 +282,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/1041-Add-BlockStateMeta-clearBlockState.patch b/patches/server/0396-Add-BlockStateMeta-clearBlockState.patch
index 86efcbf634..86efcbf634 100644
--- a/patches/server/1041-Add-BlockStateMeta-clearBlockState.patch
+++ b/patches/server/0396-Add-BlockStateMeta-clearBlockState.patch
diff --git a/patches/server/0407-Fix-SPIGOT-5989.patch b/patches/server/0407-Fix-SPIGOT-5989.patch
index 1bacf423a4..f71f29884f 100644
--- a/patches/server/0407-Fix-SPIGOT-5989.patch
+++ b/patches/server/0407-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 a35dda4010c6db1a8e1efb7951ac8732d9a1e16e..98e66497f1a81e3df8d555ffdd36b9aae9f39447 100644
+index 54aba3118157f72491cb8c3d5fb5c63750ea6878..4959c1cc9f1ceead9da42e6d12903d13882a1c17 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -805,6 +805,7 @@ public abstract class PlayerList {
+@@ -804,6 +804,7 @@ public abstract class PlayerList {
// Paper start - Add PlayerPostRespawnEvent
boolean isBedSpawn = false;
boolean isRespawn = false;
@@ -21,7 +21,7 @@ index a35dda4010c6db1a8e1efb7951ac8732d9a1e16e..98e66497f1a81e3df8d555ffdd36b9aa
// Paper end - Add PlayerPostRespawnEvent
// CraftBukkit start - fire PlayerRespawnEvent
-@@ -815,7 +816,7 @@ public abstract class PlayerList {
+@@ -814,7 +815,7 @@ public abstract class PlayerList {
Optional optional;
if (blockposition != null) {
@@ -30,7 +30,7 @@ index a35dda4010c6db1a8e1efb7951ac8732d9a1e16e..98e66497f1a81e3df8d555ffdd36b9aa
} else {
optional = Optional.empty();
}
-@@ -859,7 +860,12 @@ public abstract class PlayerList {
+@@ -858,7 +859,12 @@ public abstract class PlayerList {
}
// Spigot End
@@ -44,7 +44,7 @@ index a35dda4010c6db1a8e1efb7951ac8732d9a1e16e..98e66497f1a81e3df8d555ffdd36b9aa
if (!flag) entityplayer.reset(); // SPIGOT-4785
isRespawn = true; // Paper - Add PlayerPostRespawnEvent
} else {
-@@ -897,8 +903,14 @@ public abstract class PlayerList {
+@@ -896,8 +902,14 @@ public abstract class PlayerList {
}
// entityplayer1.initInventoryMenu();
entityplayer1.setHealth(entityplayer1.getHealth());
diff --git a/patches/server/0414-Brand-support.patch b/patches/server/0414-Brand-support.patch
index 8526ffa1cf..a1db079b4f 100644
--- a/patches/server/0414-Brand-support.patch
+++ b/patches/server/0414-Brand-support.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Brand support
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index c4e0fa6c24f9df0d99508ea7d6a9ed974f14835e..468e4ccbe767a04a6903307f7285e882fab9e598 100644
+index ab92c2c0ff5ebb395670c23fe0e3a8122b215874..dc41eb243510fdb1de9ca3a0a8cb871af5272876 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -274,6 +274,7 @@ public class ServerPlayer extends Player {
+@@ -273,6 +273,7 @@ public class ServerPlayer extends Player {
public boolean isRealPlayer; // Paper
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
@@ -57,7 +57,7 @@ index e69043316372d98b122ed3788fda79cdd36849e8..6597e6e9987ddb5906909c22704fdfb6
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 549c14e2d861c0b4692ee56e1de5df13ef72f6f8..7a10bdaf6b837738afb73e27fa970f9eff9bb196 100644
+index bcdb1cbb6e59681163c9800bf6576965ab331721..e34a954247488f3ba96ef354ff676d07fd36cb06 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2988,6 +2988,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0417-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0417-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
index 3b842579c8..682fbc2465 100644
--- a/patches/server/0417-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
+++ b/patches/server/0417-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 baafe984f2e015e20e57841b5009861cb0a02525..d7bbe096b2bff241b95da17c2897c88565d521ae 100644
+index d2da284aa7284c5205e656c48262061980893be6..aa2f23c4f7d25d0f92ff025bb1840aff1b053fa3 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1757,9 +1757,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1726,9 +1726,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void setDefaultSpawnPos(BlockPos pos, float angle) {
// Paper start - Configurable Keep Spawn Loaded range per world
BlockPos prevSpawn = this.getSharedSpawnPos();
@@ -21,7 +21,7 @@ index baafe984f2e015e20e57841b5009861cb0a02525..d7bbe096b2bff241b95da17c2897c885
// if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add
this.removeTicketsForSpawn(this.paperConfig().spawn.keepSpawnLoadedRange * 16, prevSpawn);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index fe0095601b41d85d8813af18e1c74b31f26f150d..46a168a3e0db80c1584931c13eedeab420aa76c6 100644
+index 6070409175b106ba6920adf4fa860215cd6f3087..89119833db9660377d4d4cd7d69c7a16f23f8c12 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -262,12 +262,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0429-Cache-block-data-strings.patch b/patches/server/0429-Cache-block-data-strings.patch
index cdee87c883..4fe9c6d145 100644
--- a/patches/server/0429-Cache-block-data-strings.patch
+++ b/patches/server/0429-Cache-block-data-strings.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index f03a2995c2eb080ec4db0d6c3aa261a463c08579..3b50dc6f01a449ca3d5cfa02aadc8c63777a0094 100644
+index f3afc22e3c4fc792fa4ed5c3ee18d76cd1cd6e85..dedaf6f93cc81275e318d8eee3f4f140ddfa7655 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2017,6 +2017,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2005,6 +2005,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().reloadResources();
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
diff --git a/patches/server/0433-Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/0433-Extend-block-drop-capture-to-capture-all-items-added.patch
index de8db5031d..771fb682ab 100644
--- a/patches/server/0433-Extend-block-drop-capture-to-capture-all-items-added.patch
+++ b/patches/server/0433-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 d7bbe096b2bff241b95da17c2897c88565d521ae..e360048893f7719e6735724a2e0c2606879d6c9d 100644
+index aa2f23c4f7d25d0f92ff025bb1840aff1b053fa3..a668e204946943bcc963ad41ea3029111267eef9 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1255,6 +1255,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1224,6 +1224,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/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch
index 357b3ef705..016f59cab0 100644
--- a/patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch
+++ b/patches/server/0437-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 3b50dc6f01a449ca3d5cfa02aadc8c63777a0094..e7936fbc641769dfea77ae4add7b1b19e59addbb 100644
+index dedaf6f93cc81275e318d8eee3f4f140ddfa7655..546c8edcd53aab9ed38ef07291606d4765bcde25 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2100,13 +2100,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2088,13 +2088,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.isEnforceWhitelist()) {
PlayerList playerlist = source.getServer().getPlayerList();
UserWhiteList whitelist = playerlist.getWhiteList();
diff --git a/patches/server/0448-Add-getOfflinePlayerIfCached-String.patch b/patches/server/0448-Add-getOfflinePlayerIfCached-String.patch
index 8761b2840d..4818495f98 100644
--- a/patches/server/0448-Add-getOfflinePlayerIfCached-String.patch
+++ b/patches/server/0448-Add-getOfflinePlayerIfCached-String.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String)
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 3aa481599811af7cd9b0c523f66dac469105ee49..da0af328409aae94b3d537bf2db083fbc269d573 100644
+index 936928dda8b09386ef936cec9da65eb76b1ccf1d..811c0f36bc314ca79e062fa149c6d19fc2734087 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1909,6 +1909,28 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0454-Add-API-for-quit-reason.patch b/patches/server/0454-Add-API-for-quit-reason.patch
index d6bbd7a15f..8986435ffb 100644
--- a/patches/server/0454-Add-API-for-quit-reason.patch
+++ b/patches/server/0454-Add-API-for-quit-reason.patch
@@ -25,10 +25,10 @@ index 777681a58417684a35a875c869ab22e50bb27da5..1e495daf53a53260e1a3b1c86365edb9
Connection.LOGGER.debug("Failed to sent packet", throwable);
if (this.getSending() == PacketFlow.CLIENTBOUND) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 468e4ccbe767a04a6903307f7285e882fab9e598..58bbf3176f405c3c31007780368a3e16948382a7 100644
+index dc41eb243510fdb1de9ca3a0a8cb871af5272876..effafbcd8400cc40956d9cf36757e83f7f803038 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -275,6 +275,7 @@ public class ServerPlayer extends Player {
+@@ -274,6 +274,7 @@ public class ServerPlayer extends Player {
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
public @Nullable String clientBrandName = null; // Paper - Brand support
@@ -49,10 +49,10 @@ index 6597e6e9987ddb5906909c22704fdfb6557aee8e..6bb846d3ee2fb54ab3ffa116607f2a83
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 98e66497f1a81e3df8d555ffdd36b9aae9f39447..5e6aa40d7574b939746ac4724a24d85f9cf29d76 100644
+index 4959c1cc9f1ceead9da42e6d12903d13882a1c17..5777bb6bd01d01c0ff333d7a593744b6e62ddd58 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -578,7 +578,7 @@ public abstract class PlayerList {
+@@ -577,7 +577,7 @@ public abstract class PlayerList {
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason
}
diff --git a/patches/server/0456-Expose-world-spawn-angle.patch b/patches/server/0456-Expose-world-spawn-angle.patch
index d529beeb32..dcaa00771f 100644
--- a/patches/server/0456-Expose-world-spawn-angle.patch
+++ b/patches/server/0456-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 5e6aa40d7574b939746ac4724a24d85f9cf29d76..4771d0da97421443089499cc376bdf469dec8522 100644
+index 5777bb6bd01d01c0ff333d7a593744b6e62ddd58..08e4e8da49676f2fb20eb6fc42a399bee426a340 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -848,7 +848,7 @@ public abstract class PlayerList {
+@@ -847,7 +847,7 @@ public abstract class PlayerList {
if (location == null) {
worldserver1 = this.server.getLevel(Level.OVERWORLD);
blockposition = entityplayer1.getSpawnPoint(worldserver1);
diff --git a/patches/server/0487-Add-ServerResourcesReloadedEvent.patch b/patches/server/0487-Add-ServerResourcesReloadedEvent.patch
index 33cdb307c4..73aaa48ba6 100644
--- a/patches/server/0487-Add-ServerResourcesReloadedEvent.patch
+++ b/patches/server/0487-Add-ServerResourcesReloadedEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add ServerResourcesReloadedEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index e7936fbc641769dfea77ae4add7b1b19e59addbb..e679ee1cfae0787775c655690094d72732e1bbb4 100644
+index 546c8edcd53aab9ed38ef07291606d4765bcde25..1d109679f5f16e8a4fb32020bc5d781b817f1ac8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1985,7 +1985,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1973,7 +1973,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return this.functionManager;
}
@@ -22,7 +22,7 @@ index e7936fbc641769dfea77ae4add7b1b19e59addbb..e679ee1cfae0787775c655690094d727
RegistryAccess.Frozen iregistrycustom_dimension = this.registries.getAccessForLoading(RegistryLayer.RELOADABLE);
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error
-@@ -2018,6 +2024,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2006,6 +2012,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings; they can be defined by datapacks so refresh it here
diff --git a/patches/server/0494-Remove-stale-POIs.patch b/patches/server/0494-Remove-stale-POIs.patch
index d0b737b365..1579631de9 100644
--- a/patches/server/0494-Remove-stale-POIs.patch
+++ b/patches/server/0494-Remove-stale-POIs.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Remove stale POIs
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index e360048893f7719e6735724a2e0c2606879d6c9d..2f1d8a02f9fd85b4d577b67237de8400917c151f 100644
+index a668e204946943bcc963ad41ea3029111267eef9..b93976abbc98c1beffe4b464735c9b5a71cb45a4 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1826,6 +1826,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1795,6 +1795,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
});
optional1.ifPresent((holder) -> {
this.getServer().execute(() -> {
diff --git a/patches/server/0495-Fix-villager-boat-exploit.patch b/patches/server/0495-Fix-villager-boat-exploit.patch
index 59db870962..68b28966e8 100644
--- a/patches/server/0495-Fix-villager-boat-exploit.patch
+++ b/patches/server/0495-Fix-villager-boat-exploit.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix villager boat exploit
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 4771d0da97421443089499cc376bdf469dec8522..5cb195fc8d1431088253d496585f19e81f8082ef 100644
+index 08e4e8da49676f2fb20eb6fc42a399bee426a340..e629a560ae2163ea45ede727b97a301e8fa6f1e8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -603,6 +603,14 @@ public abstract class PlayerList {
+@@ -602,6 +602,14 @@ public abstract class PlayerList {
PlayerList.LOGGER.debug("Removing player mount");
entityplayer.stopRiding();
entity.getPassengersAndSelf().forEach((entity1) -> {
diff --git a/patches/server/0496-Add-sendOpLevel-API.patch b/patches/server/0496-Add-sendOpLevel-API.patch
index 616e836a5c..9c3630f10e 100644
--- a/patches/server/0496-Add-sendOpLevel-API.patch
+++ b/patches/server/0496-Add-sendOpLevel-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add sendOpLevel API
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 5cb195fc8d1431088253d496585f19e81f8082ef..065a189566d1eea08b1013ce64d1f2282d0c2dc3 100644
+index e629a560ae2163ea45ede727b97a301e8fa6f1e8..f336b52a529c3c0ddccb36ace8b441fba61b99dd 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -1101,6 +1101,11 @@ public abstract class PlayerList {
+@@ -1100,6 +1100,11 @@ public abstract class PlayerList {
}
private void sendPlayerPermissionLevel(ServerPlayer player, int permissionLevel) {
@@ -20,7 +20,7 @@ index 5cb195fc8d1431088253d496585f19e81f8082ef..065a189566d1eea08b1013ce64d1f228
if (player.connection != null) {
byte b0;
-@@ -1115,8 +1120,10 @@ public abstract class PlayerList {
+@@ -1114,8 +1119,10 @@ public abstract class PlayerList {
player.connection.send(new ClientboundEntityEventPacket(player, b0));
}
@@ -32,7 +32,7 @@ index 5cb195fc8d1431088253d496585f19e81f8082ef..065a189566d1eea08b1013ce64d1f228
public boolean isWhiteListed(GameProfile profile) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 1b9eeb31e2cea8a30640af4daa73f7a3b335a9c4..57839c42ca0f9925028eb4f8e3d39a252b9fcbf8 100644
+index eccc82f4c8eeb3a2b6ae2abbd1a38d447a2bfda8..537590236e9a0ac2946953ebbebe0044e17ccc72 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -591,6 +591,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0509-Reset-shield-blocking-on-dimension-change.patch b/patches/server/0509-Reset-shield-blocking-on-dimension-change.patch
index b7ac72f720..4d81ca2b6d 100644
--- a/patches/server/0509-Reset-shield-blocking-on-dimension-change.patch
+++ b/patches/server/0509-Reset-shield-blocking-on-dimension-change.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Reset shield blocking on dimension change
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 58bbf3176f405c3c31007780368a3e16948382a7..4b4f5fcb51b54981d81924e3d1b9ff091e2c5ae5 100644
+index effafbcd8400cc40956d9cf36757e83f7f803038..5a26a7d6e052c0533f73b1930da6c801f23cb521 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1199,6 +1199,11 @@ public class ServerPlayer extends Player {
+@@ -1198,6 +1198,11 @@ public class ServerPlayer extends Player {
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
// CraftBukkit end
}
diff --git a/patches/server/0511-Add-EntityMoveEvent.patch b/patches/server/0511-Add-EntityMoveEvent.patch
index fbeda05f6f..ca49b77885 100644
--- a/patches/server/0511-Add-EntityMoveEvent.patch
+++ b/patches/server/0511-Add-EntityMoveEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityMoveEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index e679ee1cfae0787775c655690094d72732e1bbb4..f8e74f8818002f7cc1be0bdb2317439b29a05ad5 100644
+index 1d109679f5f16e8a4fb32020bc5d781b817f1ac8..7ab3e35d4a6376f4c18c36ef1d6a29556d19f15f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1475,6 +1475,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1463,6 +1463,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
@@ -17,7 +17,7 @@ index e679ee1cfae0787775c655690094d72732e1bbb4..f8e74f8818002f7cc1be0bdb2317439b
this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 2f1d8a02f9fd85b4d577b67237de8400917c151f..909f9c0a53971a28844a59b1cb4b996afb902d80 100644
+index b93976abbc98c1beffe4b464735c9b5a71cb45a4..f75722633789155af38184982ce6459a6ff1178e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -222,6 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0512-added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/0512-added-option-to-disable-pathfinding-updates-on-block.patch
index 5a7c2a4fd7..c155d17a87 100644
--- a/patches/server/0512-added-option-to-disable-pathfinding-updates-on-block.patch
+++ b/patches/server/0512-added-option-to-disable-pathfinding-updates-on-block.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 909f9c0a53971a28844a59b1cb4b996afb902d80..379be7cd3ce1808cf0cf50e50ac7e8de8c8f652c 100644
+index f75722633789155af38184982ce6459a6ff1178e..bc7177bc0699e64933399a1ed0e66fee0663636d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1400,6 +1400,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1369,6 +1369,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
this.getChunkSource().blockChanged(pos);
@@ -16,7 +16,7 @@ index 909f9c0a53971a28844a59b1cb4b996afb902d80..379be7cd3ce1808cf0cf50e50ac7e8de
VoxelShape voxelshape = oldState.getCollisionShape(this, pos);
VoxelShape voxelshape1 = newState.getCollisionShape(this, pos);
-@@ -1441,6 +1442,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1410,6 +1411,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
diff --git a/patches/server/0520-Improve-ServerGUI.patch b/patches/server/0520-Improve-ServerGUI.patch
index 6387ce2d2d..ea0b4bbc77 100644
--- a/patches/server/0520-Improve-ServerGUI.patch
+++ b/patches/server/0520-Improve-ServerGUI.patch
@@ -7,7 +7,7 @@ Subject: [PATCH] Improve ServerGUI
- Show tps in the server stats
diff --git a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
-index f93373d28d741e1f8a53e07b4e328ce9c4e1657f..cac68122f2f816674173cd8057107ad6875c6d3b 100644
+index f93373d28d741e1f8a53e07b4e328ce9c4e1657f..039a86034928a5eb7aaa2d7ca76a7bddcca346bd 100644
--- a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
+++ b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
@@ -58,9 +58,17 @@ public class RAMDetails extends JList<String> {
@@ -15,7 +15,7 @@ index f93373d28d741e1f8a53e07b4e328ce9c4e1657f..cac68122f2f816674173cd8057107ad6
GraphData data = RAMGraph.DATA.peekLast();
Vector<String> vector = new Vector<>();
+
-+ double[] tps = new double[] {server.tps1.getAverage(), server.tps5.getAverage(), server.tps15.getAverage()};
++ double[] tps = org.bukkit.Bukkit.getTPS();
+ String[] tpsAvg = new String[tps.length];
+
+ for ( int g = 0; g < tps.length; g++) {
diff --git a/patches/server/0528-Expand-world-key-API.patch b/patches/server/0528-Expand-world-key-API.patch
index 87a8a262a6..87afb65e1c 100644
--- a/patches/server/0528-Expand-world-key-API.patch
+++ b/patches/server/0528-Expand-world-key-API.patch
@@ -20,7 +20,7 @@ index 0fb214ddd919b568da64541fd9b531c65caa5fad..9cd267f53505658d1c75187b662c4d9f
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index da0af328409aae94b3d537bf2db083fbc269d573..3ace5c08dfa2b156d79a00f06a2977c385fe5210 100644
+index 811c0f36bc314ca79e062fa149c6d19fc2734087..150013a0c62a057671cfad7f852c4439bd9051c6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1137,9 +1137,15 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0531-Drop-carried-item-when-player-has-disconnected.patch b/patches/server/0531-Drop-carried-item-when-player-has-disconnected.patch
index 4f9e0fd1d1..f8a056ade3 100644
--- a/patches/server/0531-Drop-carried-item-when-player-has-disconnected.patch
+++ b/patches/server/0531-Drop-carried-item-when-player-has-disconnected.patch
@@ -7,10 +7,10 @@ Fixes disappearance of held items, when a player gets disconnected and PlayerDro
Closes #5036
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index fde0b21f3e3349cf55ed6e9c200cf0b63dcb11a9..ad8d02821131eac8cb04532a57265fa450cd8e87 100644
+index 41c682c24b2f984e6cd0cc63eed5acc09f00d649..0ec9312fb2992aa2a7972734cd4be4b1621c594a 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -596,6 +596,14 @@ public abstract class PlayerList {
+@@ -595,6 +595,14 @@ public abstract class PlayerList {
}
// Paper end - Configurable player collision
diff --git a/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch
index 4e583539b1..843d16f8c9 100644
--- a/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch
+++ b/patches/server/0532-forced-whitelist-use-configurable-kick-message.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index f8e74f8818002f7cc1be0bdb2317439b29a05ad5..2615fbf23202c3218826d98835e327a71a5214e2 100644
+index 7ab3e35d4a6376f4c18c36ef1d6a29556d19f15f..82ed16af2384c73560b66cb5a60d53fb940371c0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2116,7 +2116,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2104,7 +2104,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
diff --git a/patches/server/0548-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch b/patches/server/0548-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch
index a69097796c..3c02ac2aef 100644
--- a/patches/server/0548-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch
+++ b/patches/server/0548-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch
@@ -19,10 +19,10 @@ index 923026fbc223d845ed8ea4028522b4c6d21673f2..6acec839ee6d7a8893016e79af76892d
} else {
if (this.player.getHealth() > 0.0F) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index ad8d02821131eac8cb04532a57265fa450cd8e87..37662f2b42d1cbaac62743ff9907434670bb93ed 100644
+index 0ec9312fb2992aa2a7972734cd4be4b1621c594a..27ae2ac95d4f53c1c16b35f737fa6c138ddcc644 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -780,6 +780,12 @@ public abstract class PlayerList {
+@@ -779,6 +779,12 @@ public abstract class PlayerList {
}
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason) {
@@ -35,7 +35,7 @@ index ad8d02821131eac8cb04532a57265fa450cd8e87..37662f2b42d1cbaac62743ff99074346
entityplayer.stopRiding(); // CraftBukkit
this.players.remove(entityplayer);
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
-@@ -821,6 +827,7 @@ public abstract class PlayerList {
+@@ -820,6 +826,7 @@ public abstract class PlayerList {
// Paper start - Add PlayerPostRespawnEvent
boolean isBedSpawn = false;
@@ -43,7 +43,7 @@ index ad8d02821131eac8cb04532a57265fa450cd8e87..37662f2b42d1cbaac62743ff99074346
boolean isRespawn = false;
boolean isLocAltered = false; // Paper - Fix SPIGOT-5989
// Paper end - Add PlayerPostRespawnEvent
-@@ -841,6 +848,7 @@ public abstract class PlayerList {
+@@ -840,6 +847,7 @@ public abstract class PlayerList {
if (optional.isPresent()) {
BlockState iblockdata = worldserver1.getBlockState(blockposition);
boolean flag3 = iblockdata.is(Blocks.RESPAWN_ANCHOR);
@@ -51,7 +51,7 @@ index ad8d02821131eac8cb04532a57265fa450cd8e87..37662f2b42d1cbaac62743ff99074346
Vec3 vec3d = (Vec3) optional.get();
float f1;
-@@ -869,7 +877,7 @@ public abstract class PlayerList {
+@@ -868,7 +876,7 @@ public abstract class PlayerList {
}
Player respawnPlayer = entityplayer1.getBukkitEntity();
diff --git a/patches/server/0558-Add-basic-Datapack-API.patch b/patches/server/0558-Add-basic-Datapack-API.patch
index 734f9585fb..c9445f7642 100644
--- a/patches/server/0558-Add-basic-Datapack-API.patch
+++ b/patches/server/0558-Add-basic-Datapack-API.patch
@@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..cf4374493c11057451a62a655514415c
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 3ace5c08dfa2b156d79a00f06a2977c385fe5210..b3e11cf65548bd79413620a4a6303b530e15297e 100644
+index 150013a0c62a057671cfad7f852c4439bd9051c6..5bf8d8de30f69e2eed92400bc75c36231a4631fe 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -301,6 +301,7 @@ public final class CraftServer implements Server {
@@ -111,7 +111,7 @@ index 3ace5c08dfa2b156d79a00f06a2977c385fe5210..b3e11cf65548bd79413620a4a6303b53
}
public boolean getCommandBlockOverride(String command) {
-@@ -2938,5 +2940,11 @@ public final class CraftServer implements Server {
+@@ -2943,5 +2945,11 @@ public final class CraftServer implements Server {
public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() {
return mobGoals;
}
diff --git a/patches/server/0560-Expand-PlayerGameModeChangeEvent.patch b/patches/server/0560-Expand-PlayerGameModeChangeEvent.patch
index 5428a748c8..a121393a09 100644
--- a/patches/server/0560-Expand-PlayerGameModeChangeEvent.patch
+++ b/patches/server/0560-Expand-PlayerGameModeChangeEvent.patch
@@ -45,10 +45,10 @@ index aee8618e27b893b72931e925724dd683d2e6d2aa..f7c9127346261d83413ca03a1cdaa849
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 4b4f5fcb51b54981d81924e3d1b9ff091e2c5ae5..364ecb81521a9490d561faddd86aa2ac6b225d12 100644
+index 5a26a7d6e052c0533f73b1930da6c801f23cb521..895c2cd385622fcc426e9e920ff35109f444b569 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1941,8 +1941,16 @@ public class ServerPlayer extends Player {
+@@ -1940,8 +1940,16 @@ public class ServerPlayer extends Player {
}
public boolean setGameMode(GameType gameMode) {
@@ -67,7 +67,7 @@ index 4b4f5fcb51b54981d81924e3d1b9ff091e2c5ae5..364ecb81521a9490d561faddd86aa2ac
} else {
this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, (float) gameMode.getId()));
if (gameMode == GameType.SPECTATOR) {
-@@ -1954,7 +1962,7 @@ public class ServerPlayer extends Player {
+@@ -1953,7 +1961,7 @@ public class ServerPlayer extends Player {
this.onUpdateAbilities();
this.updateEffectVisibility();
@@ -76,7 +76,7 @@ index 4b4f5fcb51b54981d81924e3d1b9ff091e2c5ae5..364ecb81521a9490d561faddd86aa2ac
}
}
-@@ -2366,6 +2374,16 @@ public class ServerPlayer extends Player {
+@@ -2365,6 +2373,16 @@ public class ServerPlayer extends Player {
}
public void loadGameTypes(@Nullable CompoundTag nbt) {
@@ -144,7 +144,7 @@ index 6acec839ee6d7a8893016e79af76892d63a7b601..4ee35e2f717a5a55c9f90a6528f5c935
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 57839c42ca0f9925028eb4f8e3d39a252b9fcbf8..41e4c05325bb5ef5ce37caabb1c8a76f80d7abe2 100644
+index 537590236e9a0ac2946953ebbebe0044e17ccc72..55fec85c4adb6e92e371547b5c3d58e5adc53ce8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1517,7 +1517,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0572-Add-PlayerKickEvent-causes.patch b/patches/server/0572-Add-PlayerKickEvent-causes.patch
index 8abd6de517..d2a09684a0 100644
--- a/patches/server/0572-Add-PlayerKickEvent-causes.patch
+++ b/patches/server/0572-Add-PlayerKickEvent-causes.patch
@@ -48,10 +48,10 @@ index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..ba12919c3f9aec34a9e64993b143ae92
public boolean shouldDisconnect() {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 2615fbf23202c3218826d98835e327a71a5214e2..9568e922fb69ff516539aca27a599a4b2e8c647b 100644
+index 82ed16af2384c73560b66cb5a60d53fb940371c0..19158fae4c8ebd9f5cd136795723771e23dba23c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2116,7 +2116,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2104,7 +2104,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
@@ -437,10 +437,10 @@ index 9c8188a5937206448479e9e29efcee7b938fb2cc..692c9235d4a6026e3598074a93697255
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 37662f2b42d1cbaac62743ff9907434670bb93ed..50318611b3fad9e7ad4a39c8746f77a7f9b19d69 100644
+index 27ae2ac95d4f53c1c16b35f737fa6c138ddcc644..14b0f78d78b9f5bdaf96b80baface0df04f8f8fc 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -683,7 +683,7 @@ public abstract class PlayerList {
+@@ -682,7 +682,7 @@ public abstract class PlayerList {
while (iterator.hasNext()) {
entityplayer = (ServerPlayer) iterator.next();
this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved
@@ -449,7 +449,7 @@ index 37662f2b42d1cbaac62743ff9907434670bb93ed..50318611b3fad9e7ad4a39c8746f77a7
}
// Instead of kicking then returning, we need to store the kick reason
-@@ -1331,8 +1331,8 @@ public abstract class PlayerList {
+@@ -1318,8 +1318,8 @@ public abstract class PlayerList {
// Paper end
// CraftBukkit start - disconnect safely
for (ServerPlayer player : this.players) {
@@ -491,7 +491,7 @@ index 6724d0a1af13e97bc1d3bd94fd43fef742a0deab..20ba0a0c9eae28658888a77dd2170f62
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 41e4c05325bb5ef5ce37caabb1c8a76f80d7abe2..aa145f29dfd60b19fedd4b39bc3103fb3c8fa242 100644
+index 55fec85c4adb6e92e371547b5c3d58e5adc53ce8..490e84e1b0bc72a5953ac540dc60640814ecc64a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -549,7 +549,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch
index 6f96cf927d..ec39d17cd7 100644
--- a/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch
+++ b/patches/server/0587-Fix-PlayerDropItemEvent-using-wrong-item.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix PlayerDropItemEvent using wrong item
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 364ecb81521a9490d561faddd86aa2ac6b225d12..f795699d5bb7295adee8f28ed7837f7586f83552 100644
+index 895c2cd385622fcc426e9e920ff35109f444b569..12d3809792384643e550b34e59c58d49869ec05d 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2343,7 +2343,7 @@ public class ServerPlayer extends Player {
+@@ -2342,7 +2342,7 @@ public class ServerPlayer extends Player {
if (retainOwnership) {
if (!itemstack1.isEmpty()) {
diff --git a/patches/server/0594-Fix-kick-event-leave-message-not-being-sent.patch b/patches/server/0594-Fix-kick-event-leave-message-not-being-sent.patch
index 5a6a489245..a78fa4bd48 100644
--- a/patches/server/0594-Fix-kick-event-leave-message-not-being-sent.patch
+++ b/patches/server/0594-Fix-kick-event-leave-message-not-being-sent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix kick event leave message not being sent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index f795699d5bb7295adee8f28ed7837f7586f83552..f0f1c5b4dd4dffa29715e3cfe7225f0753713d98 100644
+index 12d3809792384643e550b34e59c58d49869ec05d..33829587797f9bb6efccb0e5237b2aab020f837e 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -269,7 +269,6 @@ public class ServerPlayer extends Player {
+@@ -268,7 +268,6 @@ public class ServerPlayer extends Player {
public boolean joining = true;
public boolean sentListPacket = false;
public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready
@@ -96,10 +96,10 @@ index 297f9731f005c93c5d8d2d1913bd3bf74afdda47..ffe90271365138d6046b52cad2cf661d
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false);
// Paper end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 50318611b3fad9e7ad4a39c8746f77a7f9b19d69..e4cfdba803eea5092c5064ff5dcbc668976176d0 100644
+index 14b0f78d78b9f5bdaf96b80baface0df04f8f8fc..9e9d4b5cc32beef41aa6d3b0ad8dbbd158b1f148 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -569,6 +569,11 @@ public abstract class PlayerList {
+@@ -568,6 +568,11 @@ public abstract class PlayerList {
}
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // CraftBukkit - return string // Paper - return Component
diff --git a/patches/server/0596-Don-t-apply-cramming-damage-to-players.patch b/patches/server/0596-Don-t-apply-cramming-damage-to-players.patch
index 928b033417..b85c69d7d7 100644
--- a/patches/server/0596-Don-t-apply-cramming-damage-to-players.patch
+++ b/patches/server/0596-Don-t-apply-cramming-damage-to-players.patch
@@ -11,7 +11,7 @@ It does not make a lot of sense to damage players if they get crammed,
For those who really want it a config option is provided.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index f0f1c5b4dd4dffa29715e3cfe7225f0753713d98..481732b49b9492a7010d85932554b0d466e82765 100644
+index 33829587797f9bb6efccb0e5237b2aab020f837e..974874a6e72b65f956ebb5605547e5d1be74d2e8 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -95,6 +95,7 @@ import net.minecraft.util.Mth;
@@ -22,7 +22,7 @@ index f0f1c5b4dd4dffa29715e3cfe7225f0753713d98..481732b49b9492a7010d85932554b0d4
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity;
-@@ -1431,7 +1432,7 @@ public class ServerPlayer extends Player {
+@@ -1430,7 +1431,7 @@ public class ServerPlayer extends Player {
@Override
public boolean isInvulnerableTo(DamageSource damageSource) {
diff --git a/patches/server/0601-Add-System.out-err-catcher.patch b/patches/server/0601-Add-System.out-err-catcher.patch
index 470f68bfd8..56f9ba7be5 100644
--- a/patches/server/0601-Add-System.out-err-catcher.patch
+++ b/patches/server/0601-Add-System.out-err-catcher.patch
@@ -105,7 +105,7 @@ index 0000000000000000000000000000000000000000..a8e813ca89b033f061e695288b3383bd
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index b3e11cf65548bd79413620a4a6303b530e15297e..06f14b2adacdbcc4e9f24b8e1fb2224ae3925172 100644
+index 5bf8d8de30f69e2eed92400bc75c36231a4631fe..3c29d2a8ccac5ca50d3df41262e9e767daf7035b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -303,6 +303,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0605-Add-PlayerSetSpawnEvent.patch b/patches/server/0605-Add-PlayerSetSpawnEvent.patch
index 68ec8e90f4..782b2bcabc 100644
--- a/patches/server/0605-Add-PlayerSetSpawnEvent.patch
+++ b/patches/server/0605-Add-PlayerSetSpawnEvent.patch
@@ -49,10 +49,10 @@ index a2d0699e8427b2262a2396495111125eccafbb66..15db9368227dbc29d07d74e85bd126b3
}
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 481732b49b9492a7010d85932554b0d466e82765..ef957f0dcea13097e34bf8c9f223eb9790ee282c 100644
+index 974874a6e72b65f956ebb5605547e5d1be74d2e8..5fff2d791b924e402a1b861c3cff8989c19d5e3b 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1308,7 +1308,7 @@ public class ServerPlayer extends Player {
+@@ -1307,7 +1307,7 @@ public class ServerPlayer extends Player {
} else if (this.bedBlocked(blockposition, enumdirection)) {
return Either.left(Player.BedSleepingProblem.OBSTRUCTED);
} else {
@@ -61,7 +61,7 @@ index 481732b49b9492a7010d85932554b0d466e82765..ef957f0dcea13097e34bf8c9f223eb97
if (this.level().isDay()) {
return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW);
} else {
-@@ -2263,44 +2263,50 @@ public class ServerPlayer extends Player {
+@@ -2262,44 +2262,50 @@ public class ServerPlayer extends Player {
return this.respawnForced;
}
@@ -145,7 +145,7 @@ index 481732b49b9492a7010d85932554b0d466e82765..ef957f0dcea13097e34bf8c9f223eb97
} else {
this.respawnPosition = null;
this.respawnDimension = Level.OVERWORLD;
-@@ -2308,6 +2314,7 @@ public class ServerPlayer extends Player {
+@@ -2307,6 +2313,7 @@ public class ServerPlayer extends Player {
this.respawnForced = false;
}
@@ -154,10 +154,10 @@ index 481732b49b9492a7010d85932554b0d466e82765..ef957f0dcea13097e34bf8c9f223eb97
public SectionPos getLastSectionPos() {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index e4cfdba803eea5092c5064ff5dcbc668976176d0..edeec3dd7887fbde9456e39c023d4a2dd9b6ffc5 100644
+index 9e9d4b5cc32beef41aa6d3b0ad8dbbd158b1f148..3df033f99ccc5b803eca2fe6d4f1e60399c4bee1 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -871,7 +871,7 @@ public abstract class PlayerList {
+@@ -870,7 +870,7 @@ public abstract class PlayerList {
location = CraftLocation.toBukkit(vec3d, worldserver1.getWorld(), f1, 0.0F);
} else if (blockposition != null) {
entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F));
@@ -187,7 +187,7 @@ index ecaa7f0b2bf795f16187f11fa27f6d5d435ccbfe..acd5ec218b8d4c096f44ae2eec1379ee
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index aa145f29dfd60b19fedd4b39bc3103fb3c8fa242..85dd644ca86895e91ba639ba4974a05290e4e061 100644
+index 490e84e1b0bc72a5953ac540dc60640814ecc64a..c74f43450469b1158040372a59c4b49d6020a2aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1276,9 +1276,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch
index 5c9a4298ea..dbc5aaf800 100644
--- a/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch
+++ b/patches/server/0631-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch
@@ -9,10 +9,10 @@ chunk through it. This should also be OK from a leak prevention/
state desync POV because the TE is getting unloaded anyways.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index dd3e5ee62da7b37b51e07796f6a1188e207d49e2..46e14d8bcef8ba9ba2b17f6d2e59db7247b38977 100644
+index c83f2be16953b5cc009ddef81fd082295f3b2f71..f2015ffc83696b7ab6a552d4bb6fec1d8f6c6031 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1301,9 +1301,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1270,9 +1270,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) {
if (tileentity instanceof net.minecraft.world.Container) {
@@ -28,10 +28,10 @@ index dd3e5ee62da7b37b51e07796f6a1188e207d49e2..46e14d8bcef8ba9ba2b17f6d2e59db72
}
// Spigot End
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index ef957f0dcea13097e34bf8c9f223eb9790ee282c..e711bb835267e09183c2af1ac0df07b9fd5cefcd 100644
+index 5fff2d791b924e402a1b861c3cff8989c19d5e3b..b04b31e599c4954d4d4176f9d99f29bf0c1fadd7 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1582,6 +1582,18 @@ public class ServerPlayer extends Player {
+@@ -1581,6 +1581,18 @@ public class ServerPlayer extends Player {
this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId));
this.doCloseContainer();
}
diff --git a/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch
index 869272efd9..9ca6f8dd8e 100644
--- a/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch
+++ b/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch
@@ -278,7 +278,7 @@ index 4ad3a4403f497f4b437209a9e63445f0d29b09f1..28ec1cc4dec6d12627761a58d635fd51
BlockPos blockposition = NaturalSpawner.getRandomPosWithin(world, chunk);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 06f14b2adacdbcc4e9f24b8e1fb2224ae3925172..8bf110c0d9f4203559795d804cbee5b9a5f502e3 100644
+index 3c29d2a8ccac5ca50d3df41262e9e767daf7035b..20b2fd911c2d8bc530c533e883f334b5b329fa9b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2274,6 +2274,11 @@ public final class CraftServer implements Server {
@@ -294,7 +294,7 @@ index 06f14b2adacdbcc4e9f24b8e1fb2224ae3925172..8bf110c0d9f4203559795d804cbee5b9
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 605c04d10b47b71787b7f3369d4fdfbb98327c1d..b3a48f238e64f4de3074b1a9d7882cd5b6adfba3 100644
+index b58788161b758eee5fbaee3280c8551116e82566..b3e17c14152204e9ccbe70ee8dfab4b20583d2d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1682,9 +1682,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0643-Oprimise-map-impl-for-tracked-players.patch b/patches/server/0642-Oprimise-map-impl-for-tracked-players.patch
index f6826029b1..c74b649a5c 100644
--- a/patches/server/0643-Oprimise-map-impl-for-tracked-players.patch
+++ b/patches/server/0642-Oprimise-map-impl-for-tracked-players.patch
@@ -7,10 +7,10 @@ Reference2BooleanOpenHashMap is going to have
better lookups than HashMap.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 9706e08511fcfd72abd5e92d7df54dc199451499..3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5 100644
+index 7f61b2945e5174f89936041c334d4cb2e5cdb130..7c13ef020ac183253465d691adebb0e40f24ee8a 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1686,7 +1686,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1677,7 +1677,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity;
private final int range;
SectionPos lastSectionPos;
diff --git a/patches/server/0985-Add-missing-InventoryType.patch b/patches/server/0643-Add-missing-InventoryType.patch
index a49bdf073d..a49bdf073d 100644
--- a/patches/server/0985-Add-missing-InventoryType.patch
+++ b/patches/server/0643-Add-missing-InventoryType.patch
diff --git a/patches/server/0645-Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/0645-Fix-merchant-inventory-not-closing-on-entity-removal.patch
index 93adc35a5b..e4c9eb4f84 100644
--- a/patches/server/0645-Fix-merchant-inventory-not-closing-on-entity-removal.patch
+++ b/patches/server/0645-Fix-merchant-inventory-not-closing-on-entity-removal.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 46e14d8bcef8ba9ba2b17f6d2e59db7247b38977..2d0d1da27152654ab43aba0ffe51887137190a2e 100644
+index f2015ffc83696b7ab6a552d4bb6fec1d8f6c6031..5ed27de9be5300b22cd29b57385e93e6e97ef361 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2356,6 +2356,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2325,6 +2325,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot end
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
diff --git a/patches/server/0651-Ensure-valid-vehicle-status.patch b/patches/server/0651-Ensure-valid-vehicle-status.patch
index 285b094a33..ed5c4e0c78 100644
--- a/patches/server/0651-Ensure-valid-vehicle-status.patch
+++ b/patches/server/0651-Ensure-valid-vehicle-status.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Ensure valid vehicle status
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index e711bb835267e09183c2af1ac0df07b9fd5cefcd..1287a714b50723a8512428d62c4d39edcc396ed9 100644
+index b04b31e599c4954d4d4176f9d99f29bf0c1fadd7..e418778297b89edd3cdf4ce9917dcb4d4d130023 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -528,7 +528,7 @@ public class ServerPlayer extends Player {
+@@ -527,7 +527,7 @@ public class ServerPlayer extends Player {
}
}
diff --git a/patches/server/0661-Configurable-feature-seeds.patch b/patches/server/0661-Configurable-feature-seeds.patch
index 3eef86b255..0cfc074f8f 100644
--- a/patches/server/0661-Configurable-feature-seeds.patch
+++ b/patches/server/0661-Configurable-feature-seeds.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Configurable feature seeds
Co-authored-by: Thonk <[email protected]>
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
-index 38f01952153348d937e326da0ec102cd9b0f80af..2d4090b95193de431f56eaafd4d4561ecccdf99c 100644
+index 49028463ba47e760281545c2f7597e3db8d6c453..7620c72a4c243cbeea245203ce03a97cbfa7d922 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
-@@ -284,7 +284,7 @@ public class TimingsExport extends Thread {
+@@ -286,7 +286,7 @@ public class TimingsExport extends Thread {
JSONObject object = new JSONObject();
for (String key : config.getKeys(false)) {
String fullKey = (parentKey != null ? parentKey + "." + key : key);
diff --git a/patches/server/0674-Allow-delegation-to-vanilla-chunk-gen.patch b/patches/server/0674-Allow-delegation-to-vanilla-chunk-gen.patch
index f53f363b6a..59db41b993 100644
--- a/patches/server/0674-Allow-delegation-to-vanilla-chunk-gen.patch
+++ b/patches/server/0674-Allow-delegation-to-vanilla-chunk-gen.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 8bf110c0d9f4203559795d804cbee5b9a5f502e3..33a3a46e275a6583ca11dfd87bd9fb7e5b60914a 100644
+index 20b2fd911c2d8bc530c533e883f334b5b329fa9b..7a5fd6fb4ddcf1ba555725f1bb956333a0450d7c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2454,6 +2454,88 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0688-Validate-usernames.patch b/patches/server/0688-Validate-usernames.patch
index f06e92bc13..069a182bd7 100644
--- a/patches/server/0688-Validate-usernames.patch
+++ b/patches/server/0688-Validate-usernames.patch
@@ -26,10 +26,10 @@ index d4658328eeecb1c9e3e25eec14dea07e9e2a8b74..ebda34825bbd10145a81d54c345e31c2
GameProfile gameprofile = this.server.getSingleplayerProfile();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index edeec3dd7887fbde9456e39c023d4a2dd9b6ffc5..f66f7e8070cbe7628a6e4ae69418fb863f684fae 100644
+index 3df033f99ccc5b803eca2fe6d4f1e60399c4bee1..18014d03078be9081c1cbec9e8b9805f719a521d 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -678,7 +678,7 @@ public abstract class PlayerList {
+@@ -677,7 +677,7 @@ public abstract class PlayerList {
for (int i = 0; i < this.players.size(); ++i) {
entityplayer = (ServerPlayer) this.players.get(i);
diff --git a/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch
index 059408cd59..3d3d4f1d89 100644
--- a/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch
+++ b/patches/server/0690-Expose-vanilla-BiomeProvider-from-WorldInfo.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 9568e922fb69ff516539aca27a599a4b2e8c647b..d5436fd2037e510ccbcb195036c5056bbc1b374f 100644
+index 19158fae4c8ebd9f5cd136795723771e23dba23c..249c3e0724a0f85cd3bae9ae67cc787d3eedfbfc 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -596,7 +596,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -18,7 +18,7 @@ index 9568e922fb69ff516539aca27a599a4b2e8c647b..d5436fd2037e510ccbcb195036c5056b
biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 33a3a46e275a6583ca11dfd87bd9fb7e5b60914a..58d46f1a3f2b27d81fed6566e24ed0167d749751 100644
+index 7a5fd6fb4ddcf1ba555725f1bb956333a0450d7c..5161f6d2fdd7cbf30b52089ecfda56b3d480ecda 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1260,7 +1260,7 @@ public final class CraftServer implements Server {
@@ -31,7 +31,7 @@ index 33a3a46e275a6583ca11dfd87bd9fb7e5b60914a..58d46f1a3f2b27d81fed6566e24ed016
biomeProvider = generator.getDefaultBiomeProvider(worldInfo);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index b3a48f238e64f4de3074b1a9d7882cd5b6adfba3..146dce90630325437ea57b0c496f6ac5e9fefc7a 100644
+index b3e17c14152204e9ccbe70ee8dfab4b20583d2d6..391f546e44080293fd94ff240d7809e3f471bb14 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -205,6 +205,29 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0702-API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/0702-API-for-creating-command-sender-which-forwards-feedb.patch
index b241dc2eba..dddb5edd47 100644
--- a/patches/server/0702-API-for-creating-command-sender-which-forwards-feedb.patch
+++ b/patches/server/0702-API-for-creating-command-sender-which-forwards-feedb.patch
@@ -122,7 +122,7 @@ index 0000000000000000000000000000000000000000..e3a5f1ec376319bdfda87fa27ae217bf
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 58d46f1a3f2b27d81fed6566e24ed0167d749751..0c7bfed8174b19797eda7cfcaf097d85dedeebaa 100644
+index 5161f6d2fdd7cbf30b52089ecfda56b3d480ecda..e9d6f40de8ce89bc6541dcb3cd847b208ee67a85 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2105,6 +2105,13 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0706-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch b/patches/server/0706-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch
index 57275a5d74..d90b3e8034 100644
--- a/patches/server/0706-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch
+++ b/patches/server/0706-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit
Copies appropriate checks from CraftWorld#getSpawnLimit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 0c7bfed8174b19797eda7cfcaf097d85dedeebaa..4331b58d553f1b1c3ffc3a980ee41c0a5bf11555 100644
+index e9d6f40de8ce89bc6541dcb3cd847b208ee67a85..4e64f5b74a26c16325b9778a4646f87936c994a4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2282,6 +2282,8 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0707-Add-GameEvent-tags.patch b/patches/server/0707-Add-GameEvent-tags.patch
index 22118e627a..f32da43d70 100644
--- a/patches/server/0707-Add-GameEvent-tags.patch
+++ b/patches/server/0707-Add-GameEvent-tags.patch
@@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..e7d9fd2702a1ce96596580fff8f5ee4f
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 4331b58d553f1b1c3ffc3a980ee41c0a5bf11555..3e0fde65132d53413dcf2ea07c802de28322c6c3 100644
+index 4e64f5b74a26c16325b9778a4646f87936c994a4..9cfc4422aa772889db06a3bb450d18c7aa0b4dcb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2703,6 +2703,15 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0713-Put-world-into-worldlist-before-initing-the-world.patch b/patches/server/0713-Put-world-into-worldlist-before-initing-the-world.patch
index cde3b928d2..2255896043 100644
--- a/patches/server/0713-Put-world-into-worldlist-before-initing-the-world.patch
+++ b/patches/server/0713-Put-world-into-worldlist-before-initing-the-world.patch
@@ -7,7 +7,7 @@ Some parts of legacy conversion will need the overworld
to get the legacy structure data storage
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 28d8f777edcb83623ff07f2bdf1c29ac94effb90..21cc2bdf9b7274bbc7fc3b3584adfba180203f23 100644
+index 3e11543218196ee55387d86dafd2a381e64cddd5..c96e2cb5201b21142cf0ac18b5d78f28ef965b07 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -628,9 +628,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -23,7 +23,7 @@ index 28d8f777edcb83623ff07f2bdf1c29ac94effb90..21cc2bdf9b7274bbc7fc3b3584adfba1
if (worlddata.getCustomBossEvents() != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 3e0fde65132d53413dcf2ea07c802de28322c6c3..16c5f046a3518ba3b58f8ab96bb9780ad75bca2a 100644
+index 9cfc4422aa772889db06a3bb450d18c7aa0b4dcb..f0f87074fe9303dde499728e71b428ec4f16a336 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1283,10 +1283,11 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0715-Custom-Potion-Mixes.patch b/patches/server/0715-Custom-Potion-Mixes.patch
index a5db4ce458..bc6c0d24c6 100644
--- a/patches/server/0715-Custom-Potion-Mixes.patch
+++ b/patches/server/0715-Custom-Potion-Mixes.patch
@@ -32,10 +32,10 @@ index 0000000000000000000000000000000000000000..7ea357ac2f3a93db4ebdf24b5072be7d
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 21cc2bdf9b7274bbc7fc3b3584adfba180203f23..80235d7f046aec179694db0eedcd003d75b6b80d 100644
+index c96e2cb5201b21142cf0ac18b5d78f28ef965b07..7bb06b95c116eae425ab53f340f75c2e68da1081 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2030,6 +2030,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2018,6 +2018,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.worldData.setDataConfiguration(worlddataconfiguration);
this.resources.managers.updateRegistryTags(this.registryAccess());
@@ -172,7 +172,7 @@ index 424406d2692856cfd82b6f3b7b6228fa3bd20c2f..bc01481ac5990ad1cfd1def5a16dd0ed
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 16c5f046a3518ba3b58f8ab96bb9780ad75bca2a..a56e8233170de3f95e547ec375f5d839303869fb 100644
+index f0f87074fe9303dde499728e71b428ec4f16a336..a2eb5ca693d0239e9cf43f6bda78d9fd9e653e98 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -304,6 +304,7 @@ public final class CraftServer implements Server {
@@ -192,7 +192,7 @@ index 16c5f046a3518ba3b58f8ab96bb9780ad75bca2a..a56e8233170de3f95e547ec375f5d839
// Ugly hack :(
if (!Main.useConsole) {
-@@ -3060,5 +3061,10 @@ public final class CraftServer implements Server {
+@@ -3065,5 +3066,10 @@ public final class CraftServer implements Server {
return datapackManager;
}
diff --git a/patches/server/0726-Fix-saving-in-unloadWorld.patch b/patches/server/0726-Fix-saving-in-unloadWorld.patch
index b4b5d989db..5ab088fe94 100644
--- a/patches/server/0726-Fix-saving-in-unloadWorld.patch
+++ b/patches/server/0726-Fix-saving-in-unloadWorld.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Fix saving in unloadWorld
Change savingDisabled to false to ensure ServerLevel's saving logic gets called when unloadWorld is called with save = true
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index a56e8233170de3f95e547ec375f5d839303869fb..8f5fd0b973acde1ba0f49e6a6f3da7244d5cd296 100644
+index a2eb5ca693d0239e9cf43f6bda78d9fd9e653e98..001afa881d8c84bfdb7329037d877bd88430b11b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1331,7 +1331,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0730-fix-player-loottables-running-when-mob-loot-gamerule.patch b/patches/server/0730-fix-player-loottables-running-when-mob-loot-gamerule.patch
index aaec4fa7a4..0eb3cafa24 100644
--- a/patches/server/0730-fix-player-loottables-running-when-mob-loot-gamerule.patch
+++ b/patches/server/0730-fix-player-loottables-running-when-mob-loot-gamerule.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] fix player loottables running when mob loot gamerule is false
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 1287a714b50723a8512428d62c4d39edcc396ed9..f8cb091bb0424d05bfe71b2f56e1489b5f45b38c 100644
+index e418778297b89edd3cdf4ce9917dcb4d4d130023..6d1093972ffcee52c9f94c97c4f842b66726647c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -876,12 +876,14 @@ public class ServerPlayer extends Player {
+@@ -875,12 +875,14 @@ public class ServerPlayer extends Player {
}
}
}
diff --git a/patches/server/0737-Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/0737-Use-username-instead-of-display-name-in-PlayerList-g.patch
index 063b1192a8..149673f045 100644
--- a/patches/server/0737-Use-username-instead-of-display-name-in-PlayerList-g.patch
+++ b/patches/server/0737-Use-username-instead-of-display-name-in-PlayerList-g.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Use username instead of display name in
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index a75e343a03627f1155361c98a45ed8fb66b0c4ec..5d56f1a38b898d5532a995ef7e3146f565e165d7 100644
+index 4b8062c04df707de93046c19633048d674d809b6..b40ad88b42dd8fcbf6138cd4f1933360cce0ad28 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -1447,7 +1447,7 @@ public abstract class PlayerList {
+@@ -1434,7 +1434,7 @@ public abstract class PlayerList {
// CraftBukkit start
public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) {
ServerStatsCounter serverstatisticmanager = entityhuman.getStats();
diff --git a/patches/server/0740-WorldCreator-keepSpawnLoaded.patch b/patches/server/0740-WorldCreator-keepSpawnLoaded.patch
index 50ef36da4b..6ce0b724a1 100644
--- a/patches/server/0740-WorldCreator-keepSpawnLoaded.patch
+++ b/patches/server/0740-WorldCreator-keepSpawnLoaded.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] WorldCreator#keepSpawnLoaded
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 8f5fd0b973acde1ba0f49e6a6f3da7244d5cd296..1761fac48b832fc35cb916131587120e43ac0b08 100644
+index 001afa881d8c84bfdb7329037d877bd88430b11b..62cecfbc3bf8f52078e18273d7c1ca940cff4105 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1278,7 +1278,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0747-Don-t-tick-markers.patch b/patches/server/0747-Don-t-tick-markers.patch
index 6625ebb691..ae96fa4757 100644
--- a/patches/server/0747-Don-t-tick-markers.patch
+++ b/patches/server/0747-Don-t-tick-markers.patch
@@ -23,10 +23,10 @@ index ff99336e0b8131ae161cfa5c4fc83c6905e3dbc8..5e5a018433414af76eaa1e781f61612d
}
});
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 2d0d1da27152654ab43aba0ffe51887137190a2e..7118f5734c08020cc23555fe84a6afdd7f456190 100644
+index 5ed27de9be5300b22cd29b57385e93e6e97ef361..196c776fdb20aac5a9ad5692c47f61c979e4ace0 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2266,6 +2266,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2235,6 +2235,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void onTickingStart(Entity entity) {
diff --git a/patches/server/0752-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch b/patches/server/0751-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch
index ef7517367b..ef7517367b 100644
--- a/patches/server/0752-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch
+++ b/patches/server/0751-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch
diff --git a/patches/server/0980-properly-read-and-store-sus-effect-duration.patch b/patches/server/0752-properly-read-and-store-sus-effect-duration.patch
index c970d92c46..20754fe9a1 100644
--- a/patches/server/0980-properly-read-and-store-sus-effect-duration.patch
+++ b/patches/server/0752-properly-read-and-store-sus-effect-duration.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] properly read and store sus effect duration
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
-index bafc7215a3577c857fb7585f0d6dec54e1b95e90..5468b5dd74f81544b4716d46b7430082908b0d26 100644
+index df1df2ad759622b5b1355fae322cbc0333c932fb..adb804f6f81f35ceeb1dc36157c70267136a1e81 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
@@ -49,7 +49,14 @@ public class CraftMetaSuspiciousStew extends CraftMetaItem implements Suspicious
diff --git a/patches/server/0755-Prevent-entity-loading-causing-async-lookups.patch b/patches/server/0755-Prevent-entity-loading-causing-async-lookups.patch
index f0a0cf57b8..c3dc616854 100644
--- a/patches/server/0755-Prevent-entity-loading-causing-async-lookups.patch
+++ b/patches/server/0755-Prevent-entity-loading-causing-async-lookups.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Prevent entity loading causing async lookups
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index bae70a2385c75b372f96382c6976d18be612ac81..51aee56014ba843cd81667791022ac887aebc6d4 100644
+index b580bb939f3c128ed68e02f2c75764aed49427c6..467f269107f314ebc3af1c4a1852f239906c0ba4 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -766,6 +766,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -714,6 +714,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public void baseTick() {
this.level().getProfiler().push("entityBaseTick");
diff --git a/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch
index a2ee77aec4..954f93c541 100644
--- a/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch
+++ b/patches/server/0756-Throw-exception-on-world-create-while-being-ticked.patch
@@ -7,7 +7,7 @@ There are no plans to support creating worlds while worlds are
being ticked themselvess.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 5a9867265d1015e5bbdfd455a625ec82cff8a37b..affe94f919fb56e925d848849b29eb5a72875dfb 100644
+index 7bb06b95c116eae425ab53f340f75c2e68da1081..13c08973d692a23188d045e82d4f1c4c93008426 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -18,7 +18,7 @@ index 5a9867265d1015e5bbdfd455a625ec82cff8a37b..affe94f919fb56e925d848849b29eb5a
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
-@@ -1444,7 +1445,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1438,7 +1439,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getFunctions().tick();
MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
this.profiler.popPush("levels");
@@ -27,7 +27,7 @@ index 5a9867265d1015e5bbdfd455a625ec82cff8a37b..affe94f919fb56e925d848849b29eb5a
// CraftBukkit start
// Run tasks that are waiting on processing
-@@ -1476,6 +1477,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1470,6 +1471,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end - Perf: Optimize time updates
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
@@ -36,7 +36,7 @@ index 5a9867265d1015e5bbdfd455a625ec82cff8a37b..affe94f919fb56e925d848849b29eb5a
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
-@@ -1514,6 +1517,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1508,6 +1511,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop();
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
}
@@ -45,7 +45,7 @@ index 5a9867265d1015e5bbdfd455a625ec82cff8a37b..affe94f919fb56e925d848849b29eb5a
this.profiler.popPush("connection");
MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 1a92659da8a6064ab4f54d5e9861633b6b46a8bd..6bd2af869c905ff6709c4e1a7205691140e55499 100644
+index 62cecfbc3bf8f52078e18273d7c1ca940cff4105..3261c8715aee966d6e7234e60074ad59a841294f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -874,6 +874,11 @@ public final class CraftServer implements Server {
@@ -68,7 +68,7 @@ index 1a92659da8a6064ab4f54d5e9861633b6b46a8bd..6bd2af869c905ff6709c4e1a72056911
Preconditions.checkArgument(creator != null, "WorldCreator cannot be null");
String name = creator.name();
-@@ -1304,6 +1310,7 @@ public final class CraftServer implements Server {
+@@ -1305,6 +1311,7 @@ public final class CraftServer implements Server {
@Override
public boolean unloadWorld(World world, boolean save) {
diff --git a/patches/server/0759-Add-option-for-strict-advancement-dimension-checks.patch b/patches/server/0759-Add-option-for-strict-advancement-dimension-checks.patch
index ac68939212..c99f644dd8 100644
--- a/patches/server/0759-Add-option-for-strict-advancement-dimension-checks.patch
+++ b/patches/server/0759-Add-option-for-strict-advancement-dimension-checks.patch
@@ -24,10 +24,10 @@ index 5f9cb2c7a2874e423087d04d3360af0364692b5c..428e0afef2cac9f2a19d8cfe8f2504dd
} else {
BlockPos blockPos = BlockPos.containing(x, y, z);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 1ff1c03bad54dfd4aef681466b141b0a314a275c..d8323a21e81541bce6962d00c02c1af527b27541 100644
+index 6d1093972ffcee52c9f94c97c4f842b66726647c..efd95132301f50cd159339444e48cd4988accb1b 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1317,6 +1317,12 @@ public class ServerPlayer extends Player {
+@@ -1272,6 +1272,12 @@ public class ServerPlayer extends Player {
ResourceKey<Level> maindimensionkey = CraftDimensionUtil.getMainDimensionKey(origin);
ResourceKey<Level> maindimensionkey1 = CraftDimensionUtil.getMainDimensionKey(this.level());
diff --git a/patches/server/0760-Add-missing-important-BlockStateListPopulator-method.patch b/patches/server/0760-Add-missing-important-BlockStateListPopulator-method.patch
index 70241cc9b8..5db34c9fe3 100644
--- a/patches/server/0760-Add-missing-important-BlockStateListPopulator-method.patch
+++ b/patches/server/0760-Add-missing-important-BlockStateListPopulator-method.patch
@@ -53,13 +53,14 @@ index ffe6881d93153838cd23f125980b832e6fd1d0eb..f5cbe9ae5802fa48e57092b1e5ca8a5f
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
-index 187eda2dd40785eb09528c86718d6b4fd3ab252c..32594b4ebe8ab4c820e588573f5e01b08c57984f 100644
+index 440660dfa70d57e94ae4eef1dce783aee5034f7e..67c9009b735429e887e706baf50a6023d572a46c 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
-@@ -274,4 +274,13 @@ public class DummyGeneratorAccess implements WorldGenLevel {
- @Override
- public <T> void getEntitiesByClass(Class<? extends T> clazz, Entity except, AABB box, List<? super T> into, Predicate<? super T> predicate) {}
- // Paper end
+@@ -258,4 +258,14 @@ public class DummyGeneratorAccess implements WorldGenLevel {
+ public boolean destroyBlock(BlockPos pos, boolean drop, Entity breakingEntity, int maxUpdateDepth) {
+ return false; // SPIGOT-6515
+ }
++
+ // Paper start - add more methods
+ public void scheduleTick(BlockPos pos, Fluid fluid, int delay) {}
+
diff --git a/patches/server/0762-Don-t-broadcast-messages-to-command-blocks.patch b/patches/server/0762-Don-t-broadcast-messages-to-command-blocks.patch
index c58a89538d..2e33539ca8 100644
--- a/patches/server/0762-Don-t-broadcast-messages-to-command-blocks.patch
+++ b/patches/server/0762-Don-t-broadcast-messages-to-command-blocks.patch
@@ -20,10 +20,10 @@ index c56f5173fda6b38c2dcaea196217f2f5a7d7c641..524b0f1086c01888fe0b76e180c40915
Date date = new Date();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 6bd2af869c905ff6709c4e1a7205691140e55499..e38bf3312b8d5ac9d3e8dd0629c15afbf2189f3d 100644
+index 3261c8715aee966d6e7234e60074ad59a841294f..4c343b5b811b87b2c4f40efaaf376368ce73fcdb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -1867,7 +1867,7 @@ public final class CraftServer implements Server {
+@@ -1868,7 +1868,7 @@ public final class CraftServer implements Server {
// Paper end
Set<CommandSender> recipients = new HashSet<>();
for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {
diff --git a/patches/server/0763-Prevent-empty-items-from-being-added-to-world.patch b/patches/server/0763-Prevent-empty-items-from-being-added-to-world.patch
index a0fbc7a6c6..a3cccb274c 100644
--- a/patches/server/0763-Prevent-empty-items-from-being-added-to-world.patch
+++ b/patches/server/0763-Prevent-empty-items-from-being-added-to-world.patch
@@ -7,10 +7,10 @@ The previous solution caused a bunch of bandaid fixes inorder to resolve edge ca
Just simply prevent them from being added to the world instead.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 1c2c942c960326cea641936b0afc5df71c957ba5..0b9c14de016115f9d033e0750d8468ca5dfc183a 100644
+index 196c776fdb20aac5a9ad5692c47f61c979e4ace0..de822b99df2de08371f3a7a29bf8f3275650887c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1501,6 +1501,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1231,6 +1231,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false;
} else {
diff --git a/patches/server/0767-Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/0767-Add-various-missing-EntityDropItemEvent-calls.patch
index 1331e09ca4..68f6361dc9 100644
--- a/patches/server/0767-Add-various-missing-EntityDropItemEvent-calls.patch
+++ b/patches/server/0767-Add-various-missing-EntityDropItemEvent-calls.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add various missing EntityDropItemEvent calls
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 51aee56014ba843cd81667791022ac887aebc6d4..b6bb76cb369d7edbf1268de3552008e06001908a 100644
+index 467f269107f314ebc3af1c4a1852f239906c0ba4..efc7287ce869d8bb6833d075738d3bfab47d3909 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2523,6 +2523,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2471,6 +2471,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe
entityitem.setDefaultPickUpDelay();
diff --git a/patches/server/0769-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/0769-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch
index 55d6277f05..f75b5b93c7 100644
--- a/patches/server/0769-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch
+++ b/patches/server/0769-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix Spigot Config not using commands.spam-exclusions
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 2bca2ae3688a36ee0e7c951f3ced39606dc4e456..41da7f32b59aeeef229a97386fa195f63767cce8 100644
+index b84d748953e03f1852c4edf3d8d9466f2bce67c6..f1c712dce7d5d0b0aea81c9ec57812f2d256b92f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2299,7 +2299,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -2292,7 +2292,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Spigot end
// this.chatSpamTickCount += 20;
diff --git a/patches/server/0770-More-Teleport-API.patch b/patches/server/0770-More-Teleport-API.patch
index 8524587dcb..42c83a0611 100644
--- a/patches/server/0770-More-Teleport-API.patch
+++ b/patches/server/0770-More-Teleport-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] More Teleport API
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 41da7f32b59aeeef229a97386fa195f63767cce8..3a6ea61d65e24d6d1f89e626e8d6efd7e1943735 100644
+index f1c712dce7d5d0b0aea81c9ec57812f2d256b92f..4d1fcd2d1ec8080144ded7ceffd8fa0e4bea95bb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1558,11 +1558,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1551,11 +1551,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
return false; // CraftBukkit - Return event status
}
@@ -72,10 +72,10 @@ index b7df71633527dce2e4f954caee249e3b31b82226..ee1dc74b2f48bf8d684562de895ab631
// Let the server handle cross world teleports
if (location.getWorld() != null && !location.getWorld().equals(this.getWorld())) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index b6bf7cf5515400a1f241ebef6cc76073f0a93bfa..aad9e9d0a832df412d1835998c3537d7279c9421 100644
+index 1fe839581edc496826885937ab0e10ec0a056212..451ef858cfc4504efe52f30d449d632b92569bd9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1207,13 +1207,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1165,13 +1165,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setRotation(float yaw, float pitch) {
@@ -178,7 +178,7 @@ index b6bf7cf5515400a1f241ebef6cc76073f0a93bfa..aad9e9d0a832df412d1835998c3537d7
location.checkFinite();
ServerPlayer entity = this.getHandle();
-@@ -1226,7 +1314,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1184,7 +1272,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return false;
}
@@ -187,7 +187,7 @@ index b6bf7cf5515400a1f241ebef6cc76073f0a93bfa..aad9e9d0a832df412d1835998c3537d7
return false;
}
-@@ -1235,7 +1323,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1193,7 +1281,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// To = Players new Location if Teleport is Successful
Location to = location;
// Create & Call the Teleport Event.
@@ -196,7 +196,7 @@ index b6bf7cf5515400a1f241ebef6cc76073f0a93bfa..aad9e9d0a832df412d1835998c3537d7
this.server.getPluginManager().callEvent(event);
// Return False to inform the Plugin that the Teleport was unsuccessful/cancelled.
-@@ -1244,7 +1332,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1202,7 +1290,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// If this player is riding another entity, we must dismount before teleporting.
@@ -205,7 +205,7 @@ index b6bf7cf5515400a1f241ebef6cc76073f0a93bfa..aad9e9d0a832df412d1835998c3537d7
// SPIGOT-5509: Wakeup, similar to riding
if (this.isSleeping()) {
-@@ -1260,13 +1348,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1218,13 +1306,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
ServerLevel toWorld = ((CraftWorld) to.getWorld()).getHandle();
// Close any foreign inventory
diff --git a/patches/server/0771-Add-EntityPortalReadyEvent.patch b/patches/server/0771-Add-EntityPortalReadyEvent.patch
index 36b6e63125..3ce3a5c8bf 100644
--- a/patches/server/0771-Add-EntityPortalReadyEvent.patch
+++ b/patches/server/0771-Add-EntityPortalReadyEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityPortalReadyEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index b6bb76cb369d7edbf1268de3552008e06001908a..2c0f9433738f9de1cf9df73425bea9dfb873deb1 100644
+index efc7287ce869d8bb6833d075738d3bfab47d3909..e6739e436f709fd24315932ad6386ed6534721c2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2864,6 +2864,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2812,6 +2812,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit
this.level().getProfiler().push("portal");
this.portalTime = i;
@@ -22,7 +22,7 @@ index b6bb76cb369d7edbf1268de3552008e06001908a..2c0f9433738f9de1cf9df73425bea9df
this.setPortalCooldown();
// CraftBukkit start
if (this instanceof ServerPlayer) {
-@@ -2871,6 +2878,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2819,6 +2826,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} else {
this.changeDimension(worldserver1);
}
diff --git a/patches/server/0773-Send-block-entities-after-destroy-prediction.patch b/patches/server/0773-Send-block-entities-after-destroy-prediction.patch
index e70b56b1a3..0edd338e0b 100644
--- a/patches/server/0773-Send-block-entities-after-destroy-prediction.patch
+++ b/patches/server/0773-Send-block-entities-after-destroy-prediction.patch
@@ -57,10 +57,10 @@ index be25ea71cb3a3bd324935754604c9f7473a88d0a..75967b3526f3f946ffc6784b87b78739
}
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 3a6ea61d65e24d6d1f89e626e8d6efd7e1943735..8bf4ff57791e3800370d79ec1660d47177f9521c 100644
+index 4d1fcd2d1ec8080144ded7ceffd8fa0e4bea95bb..c9b0a0489386fde907adb35f0291416e39c350a5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1704,8 +1704,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1697,8 +1697,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
return;
}
// Paper end - Don't allow digging into unloaded chunks
diff --git a/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch
index 1cda4d0d48..dce7d457e6 100644
--- a/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch
+++ b/patches/server/0774-Warn-on-plugins-accessing-faraway-chunks.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Warn on plugins accessing faraway chunks
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 8c4d618a6641c38d6df1d320a1945cd006b40280..ff8e8a4f1002ca095df232336c4551b115383ef4 100644
+index e8b9050f9abe6f269aab775bb12993bcf18aff2a..2d4a471af69f3036fb2996aae3fd26960b73838f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -350,7 +350,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -18,7 +18,7 @@ index 8c4d618a6641c38d6df1d320a1945cd006b40280..ff8e8a4f1002ca095df232336c4551b1
private static boolean isOutsideSpawnableHeight(int y) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 561ed3b93ba09f17f0f263b90993a7b13ce3f468..4a6fe040e3eeaabaa84946c49482b03b63e6eccc 100644
+index c35f5a1a42b76b154bfbb161d23348e76f676090..551e13635a82df8f2a420a758d08d3ccb2128e8c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -312,9 +312,24 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -54,7 +54,7 @@ index 561ed3b93ba09f17f0f263b90993a7b13ce3f468..4a6fe040e3eeaabaa84946c49482b03b
// Paper start - implement regenerateChunk method
final ServerLevel serverLevel = this.world;
final net.minecraft.server.level.ServerChunkCache serverChunkCache = serverLevel.getChunkSource();
-@@ -505,6 +521,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -502,6 +518,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean loadChunk(int x, int z, boolean generate) {
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
@@ -62,7 +62,7 @@ index 561ed3b93ba09f17f0f263b90993a7b13ce3f468..4a6fe040e3eeaabaa84946c49482b03b
ChunkAccess chunk = this.world.getChunkSource().getChunk(x, z, generate || isChunkGenerated(x, z) ? ChunkStatus.FULL : ChunkStatus.EMPTY, true); // Paper
// If generate = false, but the chunk already exists, we will get this back.
-@@ -537,6 +554,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -534,6 +551,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean addPluginChunkTicket(int x, int z, Plugin plugin) {
@@ -70,7 +70,7 @@ index 561ed3b93ba09f17f0f263b90993a7b13ce3f468..4a6fe040e3eeaabaa84946c49482b03b
Preconditions.checkArgument(plugin != null, "null plugin");
Preconditions.checkArgument(plugin.isEnabled(), "plugin is not enabled");
-@@ -605,6 +623,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -615,6 +633,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setChunkForceLoaded(int x, int z, boolean forced) {
@@ -78,7 +78,7 @@ index 561ed3b93ba09f17f0f263b90993a7b13ce3f468..4a6fe040e3eeaabaa84946c49482b03b
this.getHandle().setChunkForced(x, z, forced);
}
-@@ -917,6 +936,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -927,6 +946,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) {
@@ -86,7 +86,7 @@ index 561ed3b93ba09f17f0f263b90993a7b13ce3f468..4a6fe040e3eeaabaa84946c49482b03b
// Transient load for this tick
return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z);
}
-@@ -2365,6 +2385,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -2336,6 +2356,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// Spigot end
// Paper start
public java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) {
diff --git a/patches/server/0775-Custom-Chat-Completion-Suggestions-API.patch b/patches/server/0775-Custom-Chat-Completion-Suggestions-API.patch
index 5e20e5e035..58069f3875 100644
--- a/patches/server/0775-Custom-Chat-Completion-Suggestions-API.patch
+++ b/patches/server/0775-Custom-Chat-Completion-Suggestions-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Custom Chat Completion Suggestions API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index aad9e9d0a832df412d1835998c3537d7279c9421..6366fc2ae7944f90bcc25780c4e11e25c13f77b7 100644
+index 451ef858cfc4504efe52f30d449d632b92569bd9..93fb3ec75009ccbeba796146ffb6236cba2d8bd5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -647,6 +647,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -605,6 +605,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end - Add sendOpLevel API
diff --git a/patches/server/0780-Add-Velocity-IP-Forwarding-Support.patch b/patches/server/0780-Add-Velocity-IP-Forwarding-Support.patch
index e9a700772d..844fc51f4e 100644
--- a/patches/server/0780-Add-Velocity-IP-Forwarding-Support.patch
+++ b/patches/server/0780-Add-Velocity-IP-Forwarding-Support.patch
@@ -106,7 +106,7 @@ index 0000000000000000000000000000000000000000..3c31ff3330c2e925e205c0c9ff4f0b83
+ }
+}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index 46708de7fac39928f52119343fc05cb877235b05..9e0c5bb92fb45cab7d78c5ad631c64170d48729f 100644
+index 8d7d5cadbd65833d46dce71609e938290c81f772..c666bcd29d39ee7bca05edac348b7fa0325e80ab 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -274,13 +274,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -228,7 +228,7 @@ index ebda34825bbd10145a81d54c345e31c2a4fb5de4..42ae62bdbe11fdfbacebf621d64e7c49
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index f9c03519dca0674478ae7c47947530242b1990c6..020c27007dc7b6071206a649fb9fb3611ebef8e7 100644
+index 4c343b5b811b87b2c4f40efaaf376368ce73fcdb..f5bd1a68502be87e03923934b25fb3e982762be7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -803,7 +803,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch
index 4439587b2e..eb539d450b 100644
--- a/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch
+++ b/patches/server/0782-Fix-plugin-loggers-on-server-shutdown.patch
@@ -37,10 +37,10 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index affe94f919fb56e925d848849b29eb5a72875dfb..c18ba90d3809ee1b2a1a1a7c3b7364cdb5ac6b3c 100644
+index 7819b889654cc6bac588532ffe7b32f36e9f8912..35eca4018d33d772f9a53f4d2a7830b8c38a8518 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1149,6 +1149,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1160,6 +1160,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} catch (Exception ignored) {
}
// CraftBukkit end
diff --git a/patches/server/0790-Configurable-chat-thread-limit.patch b/patches/server/0790-Configurable-chat-thread-limit.patch
index 5e312d3a14..8f0a8571fd 100644
--- a/patches/server/0790-Configurable-chat-thread-limit.patch
+++ b/patches/server/0790-Configurable-chat-thread-limit.patch
@@ -22,10 +22,10 @@ is actually processed, this is honestly really just exposed for the misnomers or
who just wanna ensure that this won't grow over a specific size if chat gets stupidly active
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
-index 276961a11fc2bd747d2dacdc581cecec498d7593..a6f58b3457b7477015c5c6d969e7d83017dd3fa1 100644
+index 73a34b4e378e6012a01c8ac8b092248298be6648..0f4d5e44d3f4fb2498b555bdafe5263810ed0c77 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
-@@ -307,7 +307,18 @@ public class GlobalConfiguration extends ConfigurationPart {
+@@ -283,7 +283,18 @@ public class GlobalConfiguration extends ConfigurationPart {
@PostProcess
private void postProcess() {
diff --git a/patches/server/0795-Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/0795-Fix-a-bunch-of-vanilla-bugs.patch
index 85846e7b56..286a6ebb61 100644
--- a/patches/server/0795-Fix-a-bunch-of-vanilla-bugs.patch
+++ b/patches/server/0795-Fix-a-bunch-of-vanilla-bugs.patch
@@ -113,10 +113,10 @@ index 6cd6d69a20e95e344fc18ab67dc300824537a59b..2e2a7c2cf3081187da817479a9da3eb1
}
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index f7ebb560a3f8aebb5e35397814eaa7af098897c3..ed6efb22465c4d610a5b12f6ef3ca1aa7a5907ea 100644
+index 7c13ef020ac183253465d691adebb0e40f24ee8a..d1ce32936f3b581a4e60582b4f5a433db49d380a 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -734,7 +734,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1233,7 +1233,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit end
}
@@ -126,10 +126,10 @@ index f7ebb560a3f8aebb5e35397814eaa7af098897c3..ed6efb22465c4d610a5b12f6ef3ca1aa
return this.anyPlayerCloseEnoughForSpawning(pos, false);
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 0b9c14de016115f9d033e0750d8468ca5dfc183a..0bfde139536d0ac5230bb4c690a2bd4e6fe306b5 100644
+index de822b99df2de08371f3a7a29bf8f3275650887c..62feb9e2f8e0072bb180c65b4946281494a7dc1d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1007,7 +1007,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -770,7 +770,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} else {
AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, new BlockPos(blockposition1.atY(this.getMaxBuildHeight()))).inflate(3.0D);
List<LivingEntity> list = this.getEntitiesOfClass(LivingEntity.class, axisalignedbb, (entityliving) -> {
@@ -139,10 +139,10 @@ index 0b9c14de016115f9d033e0750d8468ca5dfc183a..0bfde139536d0ac5230bb4c690a2bd4e
if (!list.isEmpty()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index d8323a21e81541bce6962d00c02c1af527b27541..2d9d94777916acf79908b7f6325a88fa62050867 100644
+index efd95132301f50cd159339444e48cd4988accb1b..2fd04f7d39c4d06aa85133a3f53caa6d741d35ae 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -464,14 +464,14 @@ public class ServerPlayer extends Player {
+@@ -419,14 +419,14 @@ public class ServerPlayer extends Player {
BlockPos blockposition1 = PlayerRespawnLogic.getOverworldRespawnPos(world, blockposition.getX() + j2 - i, blockposition.getZ() + k2 - i);
if (blockposition1 != null) {
@@ -173,10 +173,10 @@ index 75967b3526f3f946ffc6784b87b787396ab15368..da8a60fbbba3866780615e65d6e24277
this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit
this.level.updateSleepingPlayerList();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 4602f8a4f22eed417bf3c56f0147ed697e349f37..6f047b2116d2ee88c75f1f39f9fd6c813775b7b5 100644
+index b40ad88b42dd8fcbf6138cd4f1933360cce0ad28..6bdb0a9f82b7cb1d7045d2582533b22af9ee8f72 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -710,8 +710,10 @@ public abstract class PlayerList {
+@@ -709,8 +709,10 @@ public abstract class PlayerList {
Player player = entity.getBukkitEntity();
PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.channel.remoteAddress()).getAddress());
diff --git a/patches/server/0796-Remove-unnecessary-onTrackingStart-during-navigation.patch b/patches/server/0796-Remove-unnecessary-onTrackingStart-during-navigation.patch
index 876fb8ca9a..66236863d1 100644
--- a/patches/server/0796-Remove-unnecessary-onTrackingStart-during-navigation.patch
+++ b/patches/server/0796-Remove-unnecessary-onTrackingStart-during-navigation.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Remove unnecessary onTrackingStart during navigation warning
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 0bfde139536d0ac5230bb4c690a2bd4e6fe306b5..98771dd96a75098f218f9bfbc05c48f6a7baebf3 100644
+index 62feb9e2f8e0072bb180c65b4946281494a7dc1d..e7ed2d1160d412790b23550f9ae967179b7a61f4 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2548,7 +2548,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2263,7 +2263,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (entity instanceof Mob) {
Mob entityinsentient = (Mob) entity;
@@ -17,7 +17,7 @@ index 0bfde139536d0ac5230bb4c690a2bd4e6fe306b5..98771dd96a75098f218f9bfbc05c48f6
String s = "onTrackingStart called during navigation iteration";
Util.logAndPauseIfInIde("onTrackingStart called during navigation iteration", new IllegalStateException("onTrackingStart called during navigation iteration"));
-@@ -2633,7 +2633,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2348,7 +2348,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (entity instanceof Mob) {
Mob entityinsentient = (Mob) entity;
diff --git a/patches/server/0800-Add-PlayerInventorySlotChangeEvent.patch b/patches/server/0800-Add-PlayerInventorySlotChangeEvent.patch
index b53efb820a..41ff90bb29 100644
--- a/patches/server/0800-Add-PlayerInventorySlotChangeEvent.patch
+++ b/patches/server/0800-Add-PlayerInventorySlotChangeEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerInventorySlotChangeEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 2d9d94777916acf79908b7f6325a88fa62050867..3284928b9f85e1adacd64219141efe2ea7116e7b 100644
+index 2fd04f7d39c4d06aa85133a3f53caa6d741d35ae..89ee8c6f2c7201a7b55b3428a6225334fe316224 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -375,6 +375,25 @@ public class ServerPlayer extends Player {
+@@ -330,6 +330,25 @@ public class ServerPlayer extends Player {
}
}
diff --git a/patches/server/0801-Elder-Guardian-appearance-API.patch b/patches/server/0801-Elder-Guardian-appearance-API.patch
index ed1d0138cd..81483f0154 100644
--- a/patches/server/0801-Elder-Guardian-appearance-API.patch
+++ b/patches/server/0801-Elder-Guardian-appearance-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 6366fc2ae7944f90bcc25780c4e11e25c13f77b7..947612bb606fd24423857a42021ef89e73a083e5 100644
+index 93fb3ec75009ccbeba796146ffb6236cba2d8bd5..41a1f63b0772944b8dcc310510de8f6f372ae80d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -3189,6 +3189,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -3147,6 +3147,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end
diff --git a/patches/server/0812-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch b/patches/server/0812-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch
index edf29e0905..b576f955d9 100644
--- a/patches/server/0812-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch
+++ b/patches/server/0812-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix EntityCombustEvent cancellation cant fully prevent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 2c0f9433738f9de1cf9df73425bea9dfb873deb1..ee534368a317c0f6d2d8189588af9f7088809cae 100644
+index e6739e436f709fd24315932ad6386ed6534721c2..79ceab8d5328df63ec20eb68b30c98fc38bdf51c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -3143,6 +3143,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3091,6 +3091,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
pluginManager.callEvent(entityCombustEvent);
if (!entityCombustEvent.isCancelled()) {
this.setSecondsOnFire(entityCombustEvent.getDuration(), false);
diff --git a/patches/server/0816-Add-Player-Warden-Warning-API.patch b/patches/server/0816-Add-Player-Warden-Warning-API.patch
index 954f55dae8..9f3436ec3d 100644
--- a/patches/server/0816-Add-Player-Warden-Warning-API.patch
+++ b/patches/server/0816-Add-Player-Warden-Warning-API.patch
@@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 947612bb606fd24423857a42021ef89e73a083e5..b47c5c81ebc160a7a767b1d22436d39820ffb595 100644
+index 41a1f63b0772944b8dcc310510de8f6f372ae80d..5823c8d3e9c2fa15ad0f062b1a5fe0286b64c712 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -3194,6 +3194,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -3152,6 +3152,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void showElderGuardian(boolean silent) {
if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F));
}
diff --git a/patches/server/0818-Add-paper-dumplisteners-command.patch b/patches/server/0818-Add-paper-dumplisteners-command.patch
index 76d91477d5..1919006e5d 100644
--- a/patches/server/0818-Add-paper-dumplisteners-command.patch
+++ b/patches/server/0818-Add-paper-dumplisteners-command.patch
@@ -6,13 +6,13 @@ Subject: [PATCH] Add /paper dumplisteners command
Co-authored-by: TwoLeggedCat <[email protected]>
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
-index e2f433ddb7a34b721ba983db84f100aac953e3a4..bca1b25d12e9c987ba82f26a2a69862dfb3fca86 100644
+index 1fd0854fb4f8ab3b5da3cda5ddd2535a0faa6adf..a6793f227fa90a37260cf0b9d5e9b6f1f47ff920 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
-@@ -43,6 +43,7 @@ public final class PaperCommand extends Command {
+@@ -42,6 +42,7 @@ public final class PaperCommand extends Command {
+ commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
commands.put(Set.of("dumpitem"), new DumpItemCommand());
commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand());
- commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
+ commands.put(Set.of("dumplisteners"), new DumpListenersCommand());
return commands.entrySet().stream()
diff --git a/patches/server/0819-check-global-player-list-where-appropriate.patch b/patches/server/0819-check-global-player-list-where-appropriate.patch
index abfacbd48b..0045fbf607 100644
--- a/patches/server/0819-check-global-player-list-where-appropriate.patch
+++ b/patches/server/0819-check-global-player-list-where-appropriate.patch
@@ -7,10 +7,10 @@ Makes certain entities check all players when searching for a player
instead of just checking players in their world.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 98771dd96a75098f218f9bfbc05c48f6a7baebf3..ec49e11d151f32557b914ae7822f6e8f79a310ae 100644
+index e7ed2d1160d412790b23550f9ae967179b7a61f4..711712f144d7b0e26d1248f53bf7ac3963c5df4a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2670,4 +2670,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2385,4 +2385,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.updateDynamicGameEventListener(DynamicGameEventListener::move);
}
}
@@ -50,10 +50,10 @@ index d4ac3e566b47cfc8688bcc2ab08385b6de4693f8..7de9d012e7416eaa0189b513a0972c84
if (entityhuman instanceof ServerPlayer) {
CriteriaTriggers.CURED_ZOMBIE_VILLAGER.trigger((ServerPlayer) entityhuman, this, entityvillager);
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
-index dbdf124638c35510aa0040100c4d80d63ab14ada..cc888bbcd6a50124fa553bc4a8ffd1e8885d3856 100644
+index e7b6f97d8519a5797903664e5ba2a793e37a4bfc..57d4d2014f33a2f069d6c5aaa8e87e36b63a7177 100644
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
-@@ -243,4 +243,11 @@ public interface EntityGetter {
+@@ -231,4 +231,11 @@ public interface EntityGetter {
return null;
}
diff --git a/patches/server/0825-Sync-offhand-slot-in-menus.patch b/patches/server/0825-Sync-offhand-slot-in-menus.patch
index deda1b40ad..f2e498a992 100644
--- a/patches/server/0825-Sync-offhand-slot-in-menus.patch
+++ b/patches/server/0825-Sync-offhand-slot-in-menus.patch
@@ -8,10 +8,10 @@ offhand slot isn't sent. This is not correct because you *can* put stuff into th
by pressing the offhand swap item
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 3284928b9f85e1adacd64219141efe2ea7116e7b..dc99cf246bfca6543f4e53b0102770d0fd94250f 100644
+index 89ee8c6f2c7201a7b55b3428a6225334fe316224..c4d49ddee5f6585e0455cc364f895b00b10226bf 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -344,6 +344,13 @@ public class ServerPlayer extends Player {
+@@ -299,6 +299,13 @@ public class ServerPlayer extends Player {
}
diff --git a/patches/server/0826-Player-Entity-Tracking-Events.patch b/patches/server/0826-Player-Entity-Tracking-Events.patch
index 498d378422..8239b8c439 100644
--- a/patches/server/0826-Player-Entity-Tracking-Events.patch
+++ b/patches/server/0826-Player-Entity-Tracking-Events.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Player Entity Tracking Events
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index ed6efb22465c4d610a5b12f6ef3ca1aa7a5907ea..e8dfae9d5d899963d1750d0e60a5069bab12ea07 100644
+index d1ce32936f3b581a4e60582b4f5a433db49d380a..c56136c785e9239df5f8782fae67edb6e52917f4 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1191,7 +1191,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1749,7 +1749,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit end
if (flag) {
if (this.seenBy.add(player.connection)) {
@@ -21,10 +21,10 @@ index ed6efb22465c4d610a5b12f6ef3ca1aa7a5907ea..e8dfae9d5d899963d1750d0e60a5069b
} else if (this.seenBy.remove(player.connection)) {
this.serverEntity.removePairing(player);
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index ee534368a317c0f6d2d8189588af9f7088809cae..c2e827e2ff7eb8e4450324e1574fc748eb7a2972 100644
+index e3bea8fe8b04f47c5432f957f6364fedcead6e3f..b7263260ab1c0a17d05959bb0d30deeb8e645199 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -3870,7 +3870,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3818,7 +3818,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public void startSeenByPlayer(ServerPlayer player) {}
diff --git a/patches/server/0829-fix-Instruments.patch b/patches/server/0829-fix-Instruments.patch
index 312d90a306..a69fc68670 100644
--- a/patches/server/0829-fix-Instruments.patch
+++ b/patches/server/0829-fix-Instruments.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] fix Instruments
properly handle Player#playNote
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index b47c5c81ebc160a7a767b1d22436d39820ffb595..2affa1477ad2994b6083c294e78ded3ff8e4086b 100644
+index 5823c8d3e9c2fa15ad0f062b1a5fe0286b64c712..3f8f928b61ff48e403d7a391343e62fbedf5826d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -724,7 +724,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -682,7 +682,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Sound instrumentSound = instrument.getSound();
if (instrumentSound == null) return;
diff --git a/patches/server/0834-Improve-logging-and-errors.patch b/patches/server/0834-Improve-logging-and-errors.patch
index 7388835824..a543126452 100644
--- a/patches/server/0834-Improve-logging-and-errors.patch
+++ b/patches/server/0834-Improve-logging-and-errors.patch
@@ -40,10 +40,10 @@ index 536f0c496ce36ca3248fc6eeac9bbd77214a36f9..31718823250a1490b783f426fff65bf5
while (iterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 8bf4ff57791e3800370d79ec1660d47177f9521c..8b763089616823cfbf5a16e72f6a586e92379246 100644
+index c9b0a0489386fde907adb35f0291416e39c350a5..9edc0f95bf4487f1928cc151ed39bf4e0d05e653 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -3316,7 +3316,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -3309,7 +3309,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator));
} catch (ProfilePublicKey.ValidationException profilepublickey_b) {
diff --git a/patches/server/0835-Improve-PortalEvents.patch b/patches/server/0835-Improve-PortalEvents.patch
index 2981ab37aa..7c24354836 100644
--- a/patches/server/0835-Improve-PortalEvents.patch
+++ b/patches/server/0835-Improve-PortalEvents.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Improve PortalEvents
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index c2e827e2ff7eb8e4450324e1574fc748eb7a2972..c9e1718f6846d4ef9825ad7da45508f09486b458 100644
+index bbf4c314776df09659ba4504b2d0cb90ae4e34d9..57d08daa6ca215b604a3f80db17b78f4bd4f822b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -3528,7 +3528,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3476,7 +3476,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
Location enter = bukkitEntity.getLocation();
Location exit = CraftLocation.toBukkit(exitPosition, exitWorldServer.getWorld());
diff --git a/patches/server/0837-Add-missing-SpigotConfig-logCommands-check.patch b/patches/server/0837-Add-missing-SpigotConfig-logCommands-check.patch
index 01f7c70a9c..81f64dae5c 100644
--- a/patches/server/0837-Add-missing-SpigotConfig-logCommands-check.patch
+++ b/patches/server/0837-Add-missing-SpigotConfig-logCommands-check.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add missing SpigotConfig logCommands check
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 8b763089616823cfbf5a16e72f6a586e92379246..4b7bde944f62057841840a07295d528d7d1b17a2 100644
+index 9edc0f95bf4487f1928cc151ed39bf4e0d05e653..40db361e677865cbcf339e6159392cccc7dd97c5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2060,7 +2060,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -2053,7 +2053,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private void performChatCommand(ServerboundChatCommandPacket packet, LastSeenMessages lastSeenMessages) {
// CraftBukkit start
String command = "/" + packet.command();
diff --git a/patches/server/0839-Flying-Fall-Damage.patch b/patches/server/0839-Flying-Fall-Damage.patch
index 16f327c991..7d9c4d6035 100644
--- a/patches/server/0839-Flying-Fall-Damage.patch
+++ b/patches/server/0839-Flying-Fall-Damage.patch
@@ -26,10 +26,10 @@ index e0fd3c3a129216ad1272a6e038eb16cb44e45475..182180275be3bf90b9f8e66dcf19ad6c
} else {
if (fallDistance >= 2.0F) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 2affa1477ad2994b6083c294e78ded3ff8e4086b..285ac126baf0a9be36fad2ea114c167c357ef118 100644
+index 3f8f928b61ff48e403d7a391343e62fbedf5826d..c9616b31b074c82eb06d9254ae65a0a85260d480 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2472,6 +2472,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2430,6 +2430,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().onUpdateAbilities();
}
diff --git a/patches/server/0841-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/server/0841-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch
index 6741cbdd07..c2637e2f18 100644
--- a/patches/server/0841-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch
+++ b/patches/server/0841-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Expose pre-collision moving velocity to
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index c9e1718f6846d4ef9825ad7da45508f09486b458..287450e58076e63f9686a1ad2c1148c24a5c7252 100644
+index 57d08daa6ca215b604a3f80db17b78f4bd4f822b..ecef6daf948550a9bf9b30413466b5f3d70ba6b2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -997,6 +997,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -945,6 +945,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public void move(MoverType movementType, Vec3 movement) {
@@ -17,7 +17,7 @@ index c9e1718f6846d4ef9825ad7da45508f09486b458..287450e58076e63f9686a1ad2c1148c2
if (this.noPhysics) {
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
} else {
-@@ -1081,7 +1082,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -1029,7 +1030,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
if (!bl.getType().isAir()) {
diff --git a/patches/server/0843-Use-single-player-info-update-packet-on-join.patch b/patches/server/0843-Use-single-player-info-update-packet-on-join.patch
index 9b0401d7e0..67608daae0 100644
--- a/patches/server/0843-Use-single-player-info-update-packet-on-join.patch
+++ b/patches/server/0843-Use-single-player-info-update-packet-on-join.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Use single player info update packet on join
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 4b7bde944f62057841840a07295d528d7d1b17a2..7d03dd75932682ed22bf98f8052ab045468b9b30 100644
+index 40db361e677865cbcf339e6159392cccc7dd97c5..2153bcc91db2907a4a99771a01e2c7884e41460a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -3346,7 +3346,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -3339,7 +3339,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.signedMessageDecoder = session.createMessageDecoder(this.player.getUUID());
this.chatMessageChain.append(() -> {
this.player.setChatSession(session);
@@ -18,7 +18,7 @@ index 4b7bde944f62057841840a07295d528d7d1b17a2..7d03dd75932682ed22bf98f8052ab045
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 6f047b2116d2ee88c75f1f39f9fd6c813775b7b5..2192ed7df719c9b8d4c990d9fb38824284fe3f0c 100644
+index 82802c797bc60e92770595d166acc144f3f57006..cb19120aef8ff37a625c82635caeead02f228bcf 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -358,6 +358,7 @@ public abstract class PlayerList {
diff --git a/patches/server/0845-Win-Screen-API.patch b/patches/server/0845-Win-Screen-API.patch
index c6ffc4441c..1a5412d4c0 100644
--- a/patches/server/0845-Win-Screen-API.patch
+++ b/patches/server/0845-Win-Screen-API.patch
@@ -7,10 +7,10 @@ Subject: [PATCH] Win Screen API
public net.minecraft.server.level.ServerPlayer seenCredits
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 285ac126baf0a9be36fad2ea114c167c357ef118..4b85c6bfd9398da369fbe22f090c21fc1217eae3 100644
+index c9616b31b074c82eb06d9254ae65a0a85260d480..66176fc39f5e6a06b1a5e92627747fbbad87c6d0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1226,6 +1226,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1184,6 +1184,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(packet);
}
diff --git a/patches/server/0862-Treat-sequence-violations-like-they-should-be.patch b/patches/server/0862-Treat-sequence-violations-like-they-should-be.patch
index 512bad9e2d..b5e8a2c617 100644
--- a/patches/server/0862-Treat-sequence-violations-like-they-should-be.patch
+++ b/patches/server/0862-Treat-sequence-violations-like-they-should-be.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Treat sequence violations like they should be
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 7d03dd75932682ed22bf98f8052ab045468b9b30..63b340bdc21db8d068d0e8f0e7620fd7f1fb877a 100644
+index 2153bcc91db2907a4a99771a01e2c7884e41460a..204cf94df7b9520a0aed6e08f6d8843a3b706d3b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1964,6 +1964,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1957,6 +1957,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void ackBlockChangesUpTo(int sequence) {
if (sequence < 0) {
diff --git a/patches/server/0864-Prevent-causing-expired-keys-from-impacting-new-join.patch b/patches/server/0864-Prevent-causing-expired-keys-from-impacting-new-join.patch
index 5c1aff197b..25b6b9dd9c 100644
--- a/patches/server/0864-Prevent-causing-expired-keys-from-impacting-new-join.patch
+++ b/patches/server/0864-Prevent-causing-expired-keys-from-impacting-new-join.patch
@@ -24,7 +24,7 @@ index 0e54e8faa48751a651b953bec72543a94edf74bc..d43106eb89b14667e85cd6e8fa047d64
UPDATE_GAME_MODE((serialized, buf) -> {
serialized.gameMode = GameType.byId(buf.readVarInt());
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 63b340bdc21db8d068d0e8f0e7620fd7f1fb877a..6fb45dab9cb2bc0319ab185bcbea5386ff1ab252 100644
+index 204cf94df7b9520a0aed6e08f6d8843a3b706d3b..1e1c3fb7a5e078b870ea733b35b004737f3c1ced 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -287,6 +287,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -49,7 +49,7 @@ index 63b340bdc21db8d068d0e8f0e7620fd7f1fb877a..6fb45dab9cb2bc0319ab185bcbea5386
}
public void resetPosition() {
-@@ -3344,6 +3352,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -3337,6 +3345,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private void resetPlayerChatState(RemoteChatSession session) {
this.chatSession = session;
diff --git a/patches/server/0865-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch b/patches/server/0865-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch
index 2c8c63916c..88a92e8a06 100644
--- a/patches/server/0865-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch
+++ b/patches/server/0865-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Prevent GameEvents being fired from unloaded chunks
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index ec49e11d151f32557b914ae7822f6e8f79a310ae..c17c0fe2b67024513379304e1be79f88474aa4ff 100644
+index 711712f144d7b0e26d1248f53bf7ac3963c5df4a..09b0113df3b7c78b5cc62a1c32e71dc400385795 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1638,6 +1638,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1368,6 +1368,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public void gameEvent(GameEvent event, Vec3 emitterPos, GameEvent.Context emitter) {
diff --git a/patches/server/0868-Fix-demo-flag-not-enabling-demo-mode.patch b/patches/server/0868-Fix-demo-flag-not-enabling-demo-mode.patch
index a105febcd8..65ea83a2c1 100644
--- a/patches/server/0868-Fix-demo-flag-not-enabling-demo-mode.patch
+++ b/patches/server/0868-Fix-demo-flag-not-enabling-demo-mode.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix demo flag not enabling demo mode
https://github.com/PaperMC/Paper/issues/9046
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
-index 15464ef7779d62f1dba5edeabcb91c6e677e676f..72d013d06705b08ed696e3d3b6d631d65800c2c9 100644
+index aa19a24b10cc6f4f79bb9ad65f92f60735ac5387..deb2d8c22a1c5724d0ac8571f4ea54711988dc4b 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
-@@ -333,7 +333,9 @@ public class Main {
+@@ -332,7 +332,9 @@ public class Main {
/*
dedicatedserver1.setPort((Integer) optionset.valueOf(optionspec10));
diff --git a/patches/server/0875-Expand-PlayerItemMendEvent.patch b/patches/server/0875-Expand-PlayerItemMendEvent.patch
index a211bf3a3a..abd2aaf80d 100644
--- a/patches/server/0875-Expand-PlayerItemMendEvent.patch
+++ b/patches/server/0875-Expand-PlayerItemMendEvent.patch
@@ -33,10 +33,10 @@ index 36d5d1736bf826f3abc756277de431c94cabb744..e814b2ef2577f032d6760de2f798d4fe
return k > 0 ? this.repairPlayerItems(player, k) : 0;
} else {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 4b85c6bfd9398da369fbe22f090c21fc1217eae3..94878e0e44ade28e84c95f4ea1837679ed5bcd1f 100644
+index 66176fc39f5e6a06b1a5e92627747fbbad87c6d0..b02894b1adb53b37aaff33cf0af00f1a1f72d8df 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1754,11 +1754,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1712,11 +1712,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ());
int i = Math.min(orb.xpToDurability(amount), itemstack.getDamageValue());
diff --git a/patches/server/0878-Fix-block-place-logic.patch b/patches/server/0878-Fix-block-place-logic.patch
index ed85c474b6..90ebe26535 100644
--- a/patches/server/0878-Fix-block-place-logic.patch
+++ b/patches/server/0878-Fix-block-place-logic.patch
@@ -41,10 +41,10 @@ index 0e9d515381a673e683b63a12c1a9e79a5eedd80b..096eb30dcfdd62b1d946891f7480e9d9
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 0bf91f88a9385797c508d165501ab18658707d71..16a4a9e28d920e2a3dfdb303ba79caa915fd1646 100644
+index 58dd1f7738c2e36ef8e0b802b6a7c5685c34476d..e4810342370e05647d569f83f064d299de1de756 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -570,17 +570,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -565,17 +565,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
CraftWorld world = ((ServerLevel) this).getWorld();
diff --git a/patches/server/0881-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch b/patches/server/0881-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch
index cbd650b0fc..f487b964ca 100644
--- a/patches/server/0881-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch
+++ b/patches/server/0881-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Don't enforce icanhasbukkit default if alias block exists
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 020c27007dc7b6071206a649fb9fb3611ebef8e7..86eb586a443c6cd4ec87582972dafd82ed2e5940 100644
+index f5bd1a68502be87e03923934b25fb3e982762be7..b66b01a743353e3b829f65bc619b39cc62d5f4fe 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -352,7 +352,11 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0891-Don-t-load-chunks-for-supporting-block-checks.patch b/patches/server/0891-Don-t-load-chunks-for-supporting-block-checks.patch
index a007970ad4..a59e753d0b 100644
--- a/patches/server/0891-Don-t-load-chunks-for-supporting-block-checks.patch
+++ b/patches/server/0891-Don-t-load-chunks-for-supporting-block-checks.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't load chunks for supporting block checks
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 1ce9f436fee9722fc7367447333db8e13230c156..53ab3716ae22982a8d94663e3e2a1d7d250a816d 100644
+index 18a1229f3be364df56bb99cb6de61c80dfe99390..fb934b069312ce27c8ebaf3d3645b2c2475bd87f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -1240,7 +1240,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -1188,7 +1188,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
protected BlockPos getOnPos(float offset) {
diff --git a/patches/server/0896-Fix-BanList-API.patch b/patches/server/0896-Fix-BanList-API.patch
index a4ec581da1..e9297e4606 100644
--- a/patches/server/0896-Fix-BanList-API.patch
+++ b/patches/server/0896-Fix-BanList-API.patch
@@ -208,10 +208,10 @@ index 172202accf4448a933fcf1ff820316c7910dd7f7..50ee7656580d386db473c054f5c5ec57
return null;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 94878e0e44ade28e84c95f4ea1837679ed5bcd1f..5dbd2a22497b40d4accbe0909e4482d9bd229a1f 100644
+index b02894b1adb53b37aaff33cf0af00f1a1f72d8df..a003b72f5c0384712ffd39f6505a408e09cbbc25 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1652,23 +1652,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1610,23 +1610,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override
@@ -240,7 +240,7 @@ index 94878e0e44ade28e84c95f4ea1837679ed5bcd1f..5dbd2a22497b40d4accbe0909e4482d9
if (kickPlayer) {
this.kickPlayer(reason);
}
-@@ -1676,12 +1676,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1634,12 +1634,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override
diff --git a/patches/server/0903-Implement-PlayerFailMoveEvent.patch b/patches/server/0903-Implement-PlayerFailMoveEvent.patch
index 23a834dc70..a0c95abbf9 100644
--- a/patches/server/0903-Implement-PlayerFailMoveEvent.patch
+++ b/patches/server/0903-Implement-PlayerFailMoveEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerFailMoveEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 6fb45dab9cb2bc0319ab185bcbea5386ff1ab252..863662dddfe31cef1d9a446efc9a2f0326c23f80 100644
+index 1e1c3fb7a5e078b870ea733b35b004737f3c1ced..498f2990b2d4f033b8e792bcef5af31bd5b60532 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1279,8 +1279,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1272,8 +1272,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d0 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX(this.player.getX())); final double toX = d0; // Paper - OBFHELPER
double d1 = ServerGamePacketListenerImpl.clampVertical(packet.getY(this.player.getY())); final double toY = d1;
double d2 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ(this.player.getZ())); final double toZ = d2; // Paper - OBFHELPER
@@ -19,7 +19,7 @@ index 6fb45dab9cb2bc0319ab185bcbea5386ff1ab252..863662dddfe31cef1d9a446efc9a2f03
if (this.player.isPassenger()) {
this.player.absMoveTo(this.player.getX(), this.player.getY(), this.player.getZ(), f, f1);
-@@ -1345,8 +1345,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1338,8 +1338,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Paper start - Prevent moving into unloaded chunks
if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) {
@@ -36,7 +36,7 @@ index 6fb45dab9cb2bc0319ab185bcbea5386ff1ab252..863662dddfe31cef1d9a446efc9a2f03
}
// Paper end - Prevent moving into unloaded chunks
-@@ -1355,9 +1361,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1348,9 +1354,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
// CraftBukkit end
@@ -56,7 +56,7 @@ index 6fb45dab9cb2bc0319ab185bcbea5386ff1ab252..863662dddfe31cef1d9a446efc9a2f03
}
}
}
-@@ -1419,14 +1432,29 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1412,14 +1425,29 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d8 = d2 - this.player.getZ();
d10 = d6 * d6 + d7 * d7 + d8 * d8;
@@ -89,7 +89,7 @@ index 6fb45dab9cb2bc0319ab185bcbea5386ff1ab252..863662dddfe31cef1d9a446efc9a2f03
this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet()); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packet.isOnGround());
} else {
-@@ -3370,4 +3398,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -3363,4 +3391,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
InteractionResult run(ServerPlayer player, Entity entity, InteractionHand hand);
}
diff --git a/patches/server/0904-Folia-scheduler-and-owned-region-API.patch b/patches/server/0904-Folia-scheduler-and-owned-region-API.patch
index 9c2bf14cd6..5644b80eb8 100644
--- a/patches/server/0904-Folia-scheduler-and-owned-region-API.patch
+++ b/patches/server/0904-Folia-scheduler-and-owned-region-API.patch
@@ -1148,17 +1148,17 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index c18ba90d3809ee1b2a1a1a7c3b7364cdb5ac6b3c..9efd93bd086ea342527b2ff530b4eb4f7df1f777 100644
+index 016cebed19ca382a40e4fabee1b96aec816944bf..469e108c844880b1a95e5aa9f0f8f12375cc314a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1440,6 +1440,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1434,6 +1434,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper
+ // Paper start - Folia scheduler API
+ ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
+ getAllLevels().forEach(level -> {
-+ for (final Entity entity : level.getEntityLookup().getAllCopy()) {
++ for (final Entity entity : level.getEntities().getAll()) {
+ if (entity.isRemoved()) {
+ continue;
+ }
@@ -1173,10 +1173,10 @@ index c18ba90d3809ee1b2a1a1a7c3b7364cdb5ac6b3c..9efd93bd086ea342527b2ff530b4eb4f
this.profiler.push("commandFunctions");
MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 2192ed7df719c9b8d4c990d9fb38824284fe3f0c..bb5a51dec100fe7924fd00da9804a3040752a23f 100644
+index 980d03a5594bc6bf1d687230e13c2dead544c18d..56d8767a19b03b5e70c6a5a5cd747a59abf062ee 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -648,6 +648,7 @@ public abstract class PlayerList {
+@@ -647,6 +647,7 @@ public abstract class PlayerList {
entityplayer.unRide();
worldserver.removePlayerImmediately(entityplayer, Entity.RemovalReason.UNLOADED_WITH_PLAYER);
@@ -1185,7 +1185,7 @@ index 2192ed7df719c9b8d4c990d9fb38824284fe3f0c..bb5a51dec100fe7924fd00da9804a304
this.players.remove(entityplayer);
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index c5ae9333f0c1916c2d279c49d1d62fca6ffceeae..97c6988702eb13a36983a2cdca8bfae52d9a67f3 100644
+index fb934b069312ce27c8ebaf3d3645b2c2475bd87f..ecdf98872f2f9b9b067be80701f20775b45e4aad 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -246,11 +246,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -1213,17 +1213,17 @@ index c5ae9333f0c1916c2d279c49d1d62fca6ffceeae..97c6988702eb13a36983a2cdca8bfae5
@Override
public CommandSender getBukkitSender(CommandSourceStack wrapper) {
return this.getBukkitEntity();
-@@ -4493,6 +4505,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
- return;
- }
- // Paper end - rewrite chunk system
-+ final boolean alreadyRemoved = this.removalReason != null;
+@@ -4421,6 +4433,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+
+ @Override
+ public final void setRemoved(Entity.RemovalReason reason) {
++ final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers
if (this.removalReason == null) {
this.removalReason = reason;
}
-@@ -4503,12 +4516,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -4431,12 +4444,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
- if (reason != RemovalReason.UNLOADED_TO_CHUNK) this.getPassengers().forEach(Entity::stopRiding); // Paper - chunk system - don't adjust passenger state when unloading, it's just not safe (and messes with our logic in entity chunk unload)
+ this.getPassengers().forEach(Entity::stopRiding);
this.levelCallback.onRemove(reason);
+ // Paper start - Folia schedulers
+ if (!(this instanceof ServerPlayer) && reason != RemovalReason.CHANGED_DIMENSION && !alreadyRemoved) {
@@ -1251,7 +1251,7 @@ index c5ae9333f0c1916c2d279c49d1d62fca6ffceeae..97c6988702eb13a36983a2cdca8bfae5
public void setLevelCallback(EntityInLevelCallback changeListener) {
this.levelCallback = changeListener;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 86eb586a443c6cd4ec87582972dafd82ed2e5940..3cadb8f2b0208e38c47cb7bc30d0b4575266db8a 100644
+index b66b01a743353e3b829f65bc619b39cc62d5f4fe..cc8e826c72ca954030c5b42f6704a6e95cb88c31 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -306,6 +306,76 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0906-API-for-updating-recipes-on-clients.patch b/patches/server/0906-API-for-updating-recipes-on-clients.patch
index 264c62d7b6..d169b01846 100644
--- a/patches/server/0906-API-for-updating-recipes-on-clients.patch
+++ b/patches/server/0906-API-for-updating-recipes-on-clients.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] API for updating recipes on clients
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index bb5a51dec100fe7924fd00da9804a3040752a23f..9c392ac769ec8660cb70012744a64a522a5d23d4 100644
+index 56d8767a19b03b5e70c6a5a5cd747a59abf062ee..fd32811f00a2c82dcb6efb9d78ffee0240d5de0b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -1543,6 +1543,13 @@ public abstract class PlayerList {
+@@ -1530,6 +1530,13 @@ public abstract class PlayerList {
}
public void reloadResources() {
@@ -22,7 +22,7 @@ index bb5a51dec100fe7924fd00da9804a3040752a23f..9c392ac769ec8660cb70012744a64a52
// CraftBukkit start
/*Iterator iterator = this.advancements.values().iterator();
-@@ -1558,7 +1565,15 @@ public abstract class PlayerList {
+@@ -1545,7 +1552,15 @@ public abstract class PlayerList {
}
// CraftBukkit end
@@ -39,7 +39,7 @@ index bb5a51dec100fe7924fd00da9804a3040752a23f..9c392ac769ec8660cb70012744a64a52
Iterator iterator1 = this.players.iterator();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index fb542c304bb0ea3be61d92d3ee230c519b1994c7..5b7aed2c7ce8e1a1515ca0baf3596ffe2b506265 100644
+index cc8e826c72ca954030c5b42f6704a6e95cb88c31..5ca1878e7c64ff1c270a3b90c456662cc2361f26 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1129,6 +1129,18 @@ public final class CraftServer implements Server {
@@ -61,7 +61,7 @@ index fb542c304bb0ea3be61d92d3ee230c519b1994c7..5b7aed2c7ce8e1a1515ca0baf3596ffe
private void loadIcon() {
this.icon = new CraftIconCache(null);
try {
-@@ -1503,6 +1515,13 @@ public final class CraftServer implements Server {
+@@ -1504,6 +1516,13 @@ public final class CraftServer implements Server {
@Override
public boolean addRecipe(Recipe recipe) {
@@ -75,7 +75,7 @@ index fb542c304bb0ea3be61d92d3ee230c519b1994c7..5b7aed2c7ce8e1a1515ca0baf3596ffe
CraftRecipe toAdd;
if (recipe instanceof CraftRecipe) {
toAdd = (CraftRecipe) recipe;
-@@ -1532,6 +1551,11 @@ public final class CraftServer implements Server {
+@@ -1533,6 +1552,11 @@ public final class CraftServer implements Server {
}
}
toAdd.addToCraftingManager();
@@ -87,7 +87,7 @@ index fb542c304bb0ea3be61d92d3ee230c519b1994c7..5b7aed2c7ce8e1a1515ca0baf3596ffe
return true;
}
-@@ -1712,10 +1736,23 @@ public final class CraftServer implements Server {
+@@ -1713,10 +1737,23 @@ public final class CraftServer implements Server {
@Override
public boolean removeRecipe(NamespacedKey recipeKey) {
diff --git a/patches/server/0908-Only-capture-actual-tree-growth.patch b/patches/server/0908-Only-capture-actual-tree-growth.patch
index 7a37cfeaae..7a1ed6a1fd 100644
--- a/patches/server/0908-Only-capture-actual-tree-growth.patch
+++ b/patches/server/0908-Only-capture-actual-tree-growth.patch
@@ -29,10 +29,10 @@ index e14d928e8bf484c61f2687621623942a27f30db1..0fd5decb0790423aba80a7c1e55ce39a
}
entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 16a4a9e28d920e2a3dfdb303ba79caa915fd1646..035c9c78d848d1dc69ace27e2c139834864d55e5 100644
+index e4810342370e05647d569f83f064d299de1de756..5d675d4a5380c3a67e5a320cdb7bffe8a823d855 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -1352,6 +1352,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -1377,4 +1377,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
}
// Paper end - respect global sound events gamerule
@@ -46,9 +46,7 @@ index 16a4a9e28d920e2a3dfdb303ba79caa915fd1646..035c9c78d848d1dc69ace27e2c139834
+ }
+ }
+ // Paper end - notify observers even if grow failed
- // Paper start
- //protected final io.papermc.paper.world.EntitySliceManager entitySliceManager; // Paper - rewrite chunk system
-
+ }
diff --git a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java b/src/main/java/net/minecraft/world/level/block/SaplingBlock.java
index 7e6ee9c1ccef3eaa6b2edc39e414bd186426aee5..836c86104ed4f0d375330c9123af5d502efefa4d 100644
--- a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java
diff --git a/patches/server/0911-Use-correct-seed-on-api-world-load.patch b/patches/server/0911-Use-correct-seed-on-api-world-load.patch
index f7453c584e..0b5ac6f5b9 100644
--- a/patches/server/0911-Use-correct-seed-on-api-world-load.patch
+++ b/patches/server/0911-Use-correct-seed-on-api-world-load.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Use correct seed on api world load
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index b6bd8f678c4b160fd83686e604ef590edcc3efa7..965f843a4a0274ec7f012c5e74c4bdb7ca184e69 100644
+index 5ca1878e7c64ff1c270a3b90c456662cc2361f26..11be490bd3c92143cd608aafe94e4e18027ddaea 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1349,7 +1349,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0915-Bandaid-fix-for-Effect.patch b/patches/server/0915-Bandaid-fix-for-Effect.patch
index 835ace1a3a..7cc42138ae 100644
--- a/patches/server/0915-Bandaid-fix-for-Effect.patch
+++ b/patches/server/0915-Bandaid-fix-for-Effect.patch
@@ -60,10 +60,10 @@ index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f9
case COMPOSTER_FILL_ATTEMPT:
datavalue = ((Boolean) data) ? 1 : 0;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 4a6fe040e3eeaabaa84946c49482b03b63e6eccc..e148688bd49a0e8a63b2999dd22dc69db1f07856 100644
+index 551e13635a82df8f2a420a758d08d3ccb2128e8c..3cca22e7ef6a2558a539d67705fc64c0f8867fe8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -1380,7 +1380,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1351,7 +1351,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public <T> void playEffect(Location loc, Effect effect, T data, int radius) {
if (data != null) {
Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect);
@@ -73,10 +73,10 @@ index 4a6fe040e3eeaabaa84946c49482b03b63e6eccc..e148688bd49a0e8a63b2999dd22dc69d
// Special case: the axis is optional for ELECTRIC_SPARK
Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 5dbd2a22497b40d4accbe0909e4482d9bd229a1f..ef496fb67afe7aef56df06385ff39ee9c33b0dc6 100644
+index a003b72f5c0384712ffd39f6505a408e09cbbc25..6d6bbd1d40bbb6d8c0b9a03b6c69f98c0370e866 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -873,7 +873,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -831,7 +831,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Preconditions.checkArgument(effect != null, "Effect cannot be null");
if (data != null) {
Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect);
diff --git a/patches/server/0918-Deprecate-and-replace-methods-with-old-StructureType.patch b/patches/server/0918-Deprecate-and-replace-methods-with-old-StructureType.patch
index 2e2998ff90..25f7929557 100644
--- a/patches/server/0918-Deprecate-and-replace-methods-with-old-StructureType.patch
+++ b/patches/server/0918-Deprecate-and-replace-methods-with-old-StructureType.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Deprecate and replace methods with old StructureType
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 70631060e8890e6a22d0be8bbe8871e39666c4d0..be285f915e669a6b9e29ab80cec4a46546f2d09b 100644
+index 11be490bd3c92143cd608aafe94e4e18027ddaea..b23cc5371cb8fc2cfaba70c73cd9d4b0accb3283 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -1945,6 +1945,11 @@ public final class CraftServer implements Server {
+@@ -1946,6 +1946,11 @@ public final class CraftServer implements Server {
ServerLevel worldServer = ((CraftWorld) world).getHandle();
Location structureLocation = world.locateNearestStructure(location, structureType, radius, findUnexplored);
@@ -20,7 +20,7 @@ index 70631060e8890e6a22d0be8bbe8871e39666c4d0..be285f915e669a6b9e29ab80cec4a465
BlockPos structurePosition = CraftLocation.toBlockPosition(structureLocation);
// Create map with trackPlayer = true, unlimitedTracking = true
-@@ -1955,6 +1960,31 @@ public final class CraftServer implements Server {
+@@ -1956,6 +1961,31 @@ public final class CraftServer implements Server {
return CraftItemStack.asBukkitCopy(stack);
}
diff --git a/patches/server/0919-Don-t-tab-complete-namespaced-commands-if-send-names.patch b/patches/server/0919-Don-t-tab-complete-namespaced-commands-if-send-names.patch
index edb74b4913..5bebfc1b01 100644
--- a/patches/server/0919-Don-t-tab-complete-namespaced-commands-if-send-names.patch
+++ b/patches/server/0919-Don-t-tab-complete-namespaced-commands-if-send-names.patch
@@ -11,10 +11,10 @@ This patch prevents server from sending namespaced commands when player
requests tab-complete only commands.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 863662dddfe31cef1d9a446efc9a2f0326c23f80..9f30c8a271db87fff58e28dbec91dab7209c42a7 100644
+index 498f2990b2d4f033b8e792bcef5af31bd5b60532..c52d4f2db071b2aea276a96e8cbd550dd6f3880f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -770,6 +770,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -763,6 +763,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
diff --git a/patches/server/0922-Configurable-entity-tracking-range-by-Y-coordinate.patch b/patches/server/0922-Configurable-entity-tracking-range-by-Y-coordinate.patch
index 3e05295275..2279776ee8 100644
--- a/patches/server/0922-Configurable-entity-tracking-range-by-Y-coordinate.patch
+++ b/patches/server/0922-Configurable-entity-tracking-range-by-Y-coordinate.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Configurable entity tracking range by Y coordinate
Options to configure entity tracking by Y coordinate, also for each entity category.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index e8dfae9d5d899963d1750d0e60a5069bab12ea07..1236c92c52454207e031aeeb050db910ccda40c3 100644
+index c56136c785e9239df5f8782fae67edb6e52917f4..aaca1b2394641a74bbe1309f150507a49b8e1459 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1183,6 +1183,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1741,6 +1741,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z;
double d2 = d0 * d0;
boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z);
diff --git a/patches/server/0923-Add-Listing-API-for-Player.patch b/patches/server/0923-Add-Listing-API-for-Player.patch
index d1b5edaed1..1df473603d 100644
--- a/patches/server/0923-Add-Listing-API-for-Player.patch
+++ b/patches/server/0923-Add-Listing-API-for-Player.patch
@@ -74,7 +74,7 @@ index d43106eb89b14667e85cd6e8fa047d64f2e8ec87..56eddd28429cf42c02d88b8bf79f8b61
static class EntryBuilder {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 9c392ac769ec8660cb70012744a64a522a5d23d4..34bd7e81f9480c97afd69c11eca216b03e6a5a1f 100644
+index fecee3dc3d5ab8daac677530e8b0eeb6ef86e400..895b4f2d3007879e81a0f4da1dce8d083ad57e26 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -356,14 +356,22 @@ public abstract class PlayerList {
@@ -111,7 +111,7 @@ index 9c392ac769ec8660cb70012744a64a522a5d23d4..34bd7e81f9480c97afd69c11eca216b0
// Paper end - Use single player info update packet on join
player.sentListPacket = true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index ef496fb67afe7aef56df06385ff39ee9c33b0dc6..d46a7ed737a18a65f04b38bb1354cea6f3839974 100644
+index 6d6bbd1d40bbb6d8c0b9a03b6c69f98c0370e866..9afc24a451010298c59b588785626c5b7f5f4d31 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -182,6 +182,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -122,7 +122,7 @@ index ef496fb67afe7aef56df06385ff39ee9c33b0dc6..d46a7ed737a18a65f04b38bb1354cea6
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
private int hash = 0;
private double health = 20;
-@@ -1992,7 +1993,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1950,7 +1951,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
otherPlayer.setUUID(uuidOverride);
}
// Paper end
@@ -131,7 +131,7 @@ index ef496fb67afe7aef56df06385ff39ee9c33b0dc6..d46a7ed737a18a65f04b38bb1354cea6
if (original != null) otherPlayer.setUUID(original); // Paper - uuid override
}
-@@ -2099,6 +2100,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2057,6 +2058,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it
}
diff --git a/patches/server/0924-Configurable-Region-Compression-Format.patch b/patches/server/0924-Configurable-Region-Compression-Format.patch
index a6dfa66f09..25a1d4bb16 100644
--- a/patches/server/0924-Configurable-Region-Compression-Format.patch
+++ b/patches/server/0924-Configurable-Region-Compression-Format.patch
@@ -5,11 +5,11 @@ Subject: [PATCH] Configurable Region Compression Format
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
-index 4d5ab1771129114ef1e4745c43a4fd1813df2e30..bc8038da65f834249c61a262fc1a5abb7cc91a63 100644
+index 169e375c814ff814d15101d09dccc67783f50465..8d20e265872e1f8200de186a69a29f498ceb8588 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
-@@ -47,7 +47,7 @@ public class RegionFile implements AutoCloseable {
- public final java.util.concurrent.locks.ReentrantLock fileLock = new java.util.concurrent.locks.ReentrantLock(); // Paper
+@@ -46,7 +46,7 @@ public class RegionFile implements AutoCloseable {
+ protected final RegionBitmap usedSectors;
public RegionFile(Path file, Path directory, boolean dsync) throws IOException {
- this(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
diff --git a/patches/server/0926-Fix-NPE-on-Boat-getStatus.patch b/patches/server/0926-Fix-NPE-on-Boat-getStatus.patch
index 060e44340f..70323a4352 100644
--- a/patches/server/0926-Fix-NPE-on-Boat-getStatus.patch
+++ b/patches/server/0926-Fix-NPE-on-Boat-getStatus.patch
@@ -9,7 +9,7 @@ Boat status is null until the entity is added to the world and the tick() method
public net.minecraft.world.entity.vehicle.Boat getStatus()Lnet/minecraft/world/entity/vehicle/Boat$Status;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
-index d161cbf9c83cd78593864850b98f688da2c85aa5..8184a2adf889e02b048ceb015edfc04d1b5c21b9 100644
+index d161cbf9c83cd78593864850b98f688da2c85aa5..e33b1b6fd50a4eea57500cc00dba20d6edcab75d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
@@ -88,6 +88,17 @@ public class CraftBoat extends CraftVehicle implements Boat {
@@ -19,7 +19,7 @@ index d161cbf9c83cd78593864850b98f688da2c85aa5..8184a2adf889e02b048ceb015edfc04d
+ // Paper start - Fix NPE on Boat getStatus
+ final net.minecraft.world.entity.vehicle.Boat handle = this.getHandle();
+ if (handle.status == null) {
-+ if (handle.valid && !handle.updatingSectionStatus) {
++ if (handle.valid) {
+ // Don't actually set the status because it would skew the old status check in the next tick
+ return CraftBoat.boatStatusFromNms(handle.getStatus());
+ } else {
diff --git a/patches/server/0927-Expand-Pose-API.patch b/patches/server/0927-Expand-Pose-API.patch
index cd53e48bb1..cbabe03580 100644
--- a/patches/server/0927-Expand-Pose-API.patch
+++ b/patches/server/0927-Expand-Pose-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Expand Pose API
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 8fc2dd2c2389657d2de2c4036117eb949a883a97..c610bb83e49fcc97f3f69bbe03b854bcef9acb37 100644
+index ecdf98872f2f9b9b067be80701f20775b45e4aad..0e299073086cc06324794ca8b6e74674a70cc77a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -418,6 +418,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -16,7 +16,7 @@ index 8fc2dd2c2389657d2de2c4036117eb949a883a97..c610bb83e49fcc97f3f69bbe03b854bc
public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector();
-@@ -670,6 +671,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -618,6 +619,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public void onClientRemoval() {}
public void setPose(net.minecraft.world.entity.Pose pose) {
diff --git a/patches/server/0930-Add-PlayerPickItemEvent.patch b/patches/server/0930-Add-PlayerPickItemEvent.patch
index 60bdf01f72..edebe95f30 100644
--- a/patches/server/0930-Add-PlayerPickItemEvent.patch
+++ b/patches/server/0930-Add-PlayerPickItemEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerPickItemEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 9f30c8a271db87fff58e28dbec91dab7209c42a7..302ff57c7fb90f5ccddefa222f6b5fdd8fb3cf22 100644
+index c52d4f2db071b2aea276a96e8cbd550dd6f3880f..a3513ef6952ea1b446540505ab98d1cb865f7324 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -907,8 +907,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -900,8 +900,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.disconnect("Invalid hotbar selection (Hacking?)", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
return;
}
diff --git a/patches/server/0934-Implement-OfflinePlayer-isConnected.patch b/patches/server/0934-Implement-OfflinePlayer-isConnected.patch
index fd4a5c9e47..7037246d5f 100644
--- a/patches/server/0934-Implement-OfflinePlayer-isConnected.patch
+++ b/patches/server/0934-Implement-OfflinePlayer-isConnected.patch
@@ -23,10 +23,10 @@ index 9daec0782774ab51ea8091cb8ed9d0a106e34cfa..2bbc39c257965ad91ee360cdfcd3538a
public String getName() {
Player player = this.getPlayer();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index d46a7ed737a18a65f04b38bb1354cea6f3839974..798c1af5fb6768661f67ef87039a55ea3acb572a 100644
+index 9afc24a451010298c59b588785626c5b7f5f4d31..ea8eca5a7359d68095d073ea725f12a45e44dcaa 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -279,6 +279,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -237,6 +237,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.server.getPlayer(this.getUniqueId()) != null;
}
diff --git a/patches/server/0936-Add-titleOverride-to-InventoryOpenEvent.patch b/patches/server/0936-Add-titleOverride-to-InventoryOpenEvent.patch
index 9f28b90369..d7ec9ce9aa 100644
--- a/patches/server/0936-Add-titleOverride-to-InventoryOpenEvent.patch
+++ b/patches/server/0936-Add-titleOverride-to-InventoryOpenEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add titleOverride to InventoryOpenEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index dc99cf246bfca6543f4e53b0102770d0fd94250f..3450e5a31437ce17a5b4499b8d08ce0b2623704d 100644
+index c4d49ddee5f6585e0455cc364f895b00b10226bf..6147ffdcb83a9d013a05facd75453d6500064fe7 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1568,12 +1568,17 @@ public class ServerPlayer extends Player {
+@@ -1523,12 +1523,17 @@ public class ServerPlayer extends Player {
this.nextContainerCounter();
AbstractContainerMenu container = factory.createMenu(this.containerCounter, this.getInventory(), this);
@@ -27,7 +27,7 @@ index dc99cf246bfca6543f4e53b0102770d0fd94250f..3450e5a31437ce17a5b4499b8d08ce0b
if (container == null && !cancelled) { // Let pre-cancelled events fall through
// SPIGOT-5263 - close chest if cancelled
if (factory instanceof Container) {
-@@ -1595,7 +1600,7 @@ public class ServerPlayer extends Player {
+@@ -1550,7 +1555,7 @@ public class ServerPlayer extends Player {
} else {
// CraftBukkit start
this.containerMenu = container;
diff --git a/patches/server/0940-Add-slot-sanity-checks-in-container-clicks.patch b/patches/server/0940-Add-slot-sanity-checks-in-container-clicks.patch
index 47a29c00d3..a38808a525 100644
--- a/patches/server/0940-Add-slot-sanity-checks-in-container-clicks.patch
+++ b/patches/server/0940-Add-slot-sanity-checks-in-container-clicks.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add slot sanity checks in container clicks
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 302ff57c7fb90f5ccddefa222f6b5fdd8fb3cf22..fc540b879230b5a5f8d6e01fa435ce140849a712 100644
+index a3513ef6952ea1b446540505ab98d1cb865f7324..401658927b6bf4946709f0f2aeba01f944ec4dfb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2899,6 +2899,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -2892,6 +2892,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
break;
case SWAP:
if ((packet.getButtonNum() >= 0 && packet.getButtonNum() < 9) || packet.getButtonNum() == 40) {
diff --git a/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch b/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch
index 7561d0ddff..1b37f747b4 100644
--- a/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch
+++ b/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch
@@ -10,10 +10,10 @@ which would cause a crash on Folia but would appear to function
fine on Paper.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
-index 279da8d43f16b4c1372d0d427891389fb7b6c780..5aff6454b5b1c7834adca8f1234ec4848aa3709c 100644
+index 7ca4790d564846c1ab9560e349005eea8aef35b8..94e9919da2ba5a36afa5b7f97af888cb113bb14b 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
-@@ -363,6 +363,13 @@ public class ChunkSerializer {
+@@ -346,6 +346,13 @@ public class ChunkSerializer {
for (int k1 = 0; k1 < nbttaglist3.size(); ++k1) {
CompoundTag nbttagcompound4 = nbttaglist3.getCompound(k1);
@@ -27,7 +27,7 @@ index 279da8d43f16b4c1372d0d427891389fb7b6c780..5aff6454b5b1c7834adca8f1234ec484
((ChunkAccess) object1).setBlockEntityNbt(nbttagcompound4);
}
-@@ -661,10 +668,19 @@ public class ChunkSerializer {
+@@ -591,10 +598,19 @@ public class ChunkSerializer {
CompoundTag nbttagcompound1 = nbttaglist1.getCompound(i);
boolean flag = nbttagcompound1.getBoolean("keepPacked");
diff --git a/patches/server/0953-Fix-missing-map-initialize-event-call.patch b/patches/server/0953-Fix-missing-map-initialize-event-call.patch
index 92d235cc79..261c9631e8 100644
--- a/patches/server/0953-Fix-missing-map-initialize-event-call.patch
+++ b/patches/server/0953-Fix-missing-map-initialize-event-call.patch
@@ -7,10 +7,10 @@ Subject: [PATCH] Fix missing map initialize event call
public net.minecraft.world.level.storage.DimensionDataStorage readSavedData(Ljava/util/function/Function;Lnet/minecraft/util/datafix/DataFixTypes;Ljava/lang/String;)Lnet/minecraft/world/level/saveddata/SavedData;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index c17c0fe2b67024513379304e1be79f88474aa4ff..316f4ef261592b8c508f73d6b3a0e99bcfe5b106 100644
+index 09b0113df3b7c78b5cc62a1c32e71dc400385795..0e7811ae2a8731ae7475aabd2322e56ab364bc32 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1927,13 +1927,25 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1657,13 +1657,25 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Nullable
@Override
public MapItemSavedData getMapData(String id) {
diff --git a/patches/server/0958-Add-player-idle-duration-API.patch b/patches/server/0958-Add-player-idle-duration-API.patch
index f08742e8a8..6a84393957 100644
--- a/patches/server/0958-Add-player-idle-duration-API.patch
+++ b/patches/server/0958-Add-player-idle-duration-API.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API
Implements API for getting and resetting a player's idle duration.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 798c1af5fb6768661f67ef87039a55ea3acb572a..2b305a66e3f7d9ac6d144219dd943a01dbf6729c 100644
+index ea8eca5a7359d68095d073ea725f12a45e44dcaa..350d4e75401d2adda3f60e5637eac3d6c278c928 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -3311,6 +3311,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -3269,6 +3269,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end
diff --git a/patches/server/0959-Don-t-check-if-we-can-see-non-visible-entities.patch b/patches/server/0959-Don-t-check-if-we-can-see-non-visible-entities.patch
index 3433a5e527..5ff3f43f7e 100644
--- a/patches/server/0959-Don-t-check-if-we-can-see-non-visible-entities.patch
+++ b/patches/server/0959-Don-t-check-if-we-can-see-non-visible-entities.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't check if we can see non-visible entities
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 1236c92c52454207e031aeeb050db910ccda40c3..9e7e192493532a2ecab23b98eebc95a1bb75791c 100644
+index aaca1b2394641a74bbe1309f150507a49b8e1459..0801bbba0ea2a5d6e19d503ee31ad6717f1d5234 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1194,7 +1194,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1752,7 +1752,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end - Configurable entity tracking range by Y
// CraftBukkit start - respect vanish API
diff --git a/patches/server/0961-Allow-null-itemstack-for-Player-sendEquipmentChange.patch b/patches/server/0961-Allow-null-itemstack-for-Player-sendEquipmentChange.patch
index 3e45d7c093..1c7a3f812a 100644
--- a/patches/server/0961-Allow-null-itemstack-for-Player-sendEquipmentChange.patch
+++ b/patches/server/0961-Allow-null-itemstack-for-Player-sendEquipmentChange.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Allow null itemstack for Player#sendEquipmentChange
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 2b305a66e3f7d9ac6d144219dd943a01dbf6729c..9c4b46bb319c7f0b0831d37cff657d9563956ca5 100644
+index 350d4e75401d2adda3f60e5637eac3d6c278c928..838ea7a08df425adac7986d1bc6bf13ca8ce956b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1083,7 +1083,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1041,7 +1041,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void sendEquipmentChange(LivingEntity entity, EquipmentSlot slot, ItemStack item) {
diff --git a/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch b/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch
index 08e456cd0c..68e3bc845e 100644
--- a/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch
+++ b/patches/server/0964-Add-predicate-for-blocks-when-raytracing.patch
@@ -47,10 +47,10 @@ index c978f3b2d42f512e982f289e76c2422e41b7eec6..bb8e962e63c7a2d931f9bd7f7c002aa3
Vec3 vec3d = raytrace1.getFrom().subtract(raytrace1.getTo());
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index e148688bd49a0e8a63b2999dd22dc69db1f07856..bec84fe26e684f1c09ab6b1e143d3ced15b04914 100644
+index 3cca22e7ef6a2558a539d67705fc64c0f8867fe8..11ad72b87651b380ceb7083322d1a8993837da2d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -1075,9 +1075,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1085,9 +1085,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate<? super Entity> filter) {
@@ -68,7 +68,7 @@ index e148688bd49a0e8a63b2999dd22dc69db1f07856..bec84fe26e684f1c09ab6b1e143d3ced
Preconditions.checkArgument(direction != null, "Vector direction cannot be null");
direction.checkFinite();
-@@ -1127,9 +1133,16 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1137,9 +1143,16 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) {
@@ -87,7 +87,7 @@ index e148688bd49a0e8a63b2999dd22dc69db1f07856..bec84fe26e684f1c09ab6b1e143d3ced
Preconditions.checkArgument(direction != null, "Vector direction cannot be null");
direction.checkFinite();
-@@ -1142,16 +1155,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1152,16 +1165,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
}
Vector dir = direction.clone().normalize().multiply(maxDistance);
diff --git a/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch b/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch
index b821180899..ddd7a5783d 100644
--- a/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch
+++ b/patches/server/0968-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch
@@ -45,10 +45,10 @@ index 0db0d67f9ac15372becc1166c37f7f0aede4a4da..a9e70484b01fc082ea25d43d1d428334
BlockState iblockdata = BaseFireBlock.getState(this.level(), blockposition);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index bec84fe26e684f1c09ab6b1e143d3ced15b04914..1d17131b9b3dc57218e07d3045439634255a2260 100644
+index 11ad72b87651b380ceb7083322d1a8993837da2d..0617419975f843f3899b2cb013fd37ea631dd320 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -723,7 +723,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -733,7 +733,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
LightningBolt lightning = EntityType.LIGHTNING_BOLT.create(this.world);
lightning.moveTo(loc.getX(), loc.getY(), loc.getZ());
diff --git a/patches/server/0974-Don-t-fire-sync-events-during-worldgen.patch b/patches/server/0974-Don-t-fire-sync-events-during-worldgen.patch
index 9edbdda6d2..52b6454404 100644
--- a/patches/server/0974-Don-t-fire-sync-events-during-worldgen.patch
+++ b/patches/server/0974-Don-t-fire-sync-events-during-worldgen.patch
@@ -19,10 +19,10 @@ where generation happened directly to a ServerLevel and the
entity still has the flag set.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 316f4ef261592b8c508f73d6b3a0e99bcfe5b106..09a9452705cc8d4133940c081583d6d38d226f71 100644
+index 0e7811ae2a8731ae7475aabd2322e56ab364bc32..b5d6a7eaa24d9968e159d77a4295be00332a5457 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1490,6 +1490,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1220,6 +1220,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit start
private boolean addEntity(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
@@ -31,10 +31,10 @@ index 316f4ef261592b8c508f73d6b3a0e99bcfe5b106..09a9452705cc8d4133940c081583d6d3
if (entity.valid) {
MinecraftServer.LOGGER.error("Attempted Double World add on {}", entity, new Throwable());
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index c610bb83e49fcc97f3f69bbe03b854bcef9acb37..eef69be6cce94d89688f7d485627a8b665b863c7 100644
+index 55feebb8e75bdeab4d089a1d6f80be49996dfcb6..7fa7cb2a567c90a4bb7cf20c7182c45395b6ea32 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -676,7 +676,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -624,7 +624,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (pose == this.getPose()) {
return;
}
@@ -133,7 +133,7 @@ index ae8a42261337bf736d0cc1bbe18da2b773417ca4..471e8493622c89d44a82f42f135cb308
// return Optional.empty();
// }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
-index a650411e3fa7e2a045ac55502c77028be348acf1..86a20c91beff6b27e6ec886e49ba902b216106f2 100644
+index e37c2d82ed606cbfe00c152b08c3ab99ac751f69..7ed861cd67889e525ab4987c0afed245aca08833 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
@@ -93,15 +93,17 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
diff --git a/patches/server/0977-Add-Structure-check-API.patch b/patches/server/0976-Add-Structure-check-API.patch
index 6d493fd4a5..01a73c5287 100644
--- a/patches/server/0977-Add-Structure-check-API.patch
+++ b/patches/server/0976-Add-Structure-check-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add Structure check API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 1d17131b9b3dc57218e07d3045439634255a2260..031db5f0bcf4a7d0930a7d376e7f6806d34da4e2 100644
+index 0617419975f843f3899b2cb013fd37ea631dd320..d7fb40682d446b962d9e19ca88b297c4e9a28231 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -230,6 +230,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0976-Restore-vanilla-entity-drops-behavior.patch b/patches/server/0977-Restore-vanilla-entity-drops-behavior.patch
index 88bfbc47a1..74f1b6a5c6 100644
--- a/patches/server/0976-Restore-vanilla-entity-drops-behavior.patch
+++ b/patches/server/0977-Restore-vanilla-entity-drops-behavior.patch
@@ -9,10 +9,10 @@ on dropping the item instead of generalizing it for all dropped
items like CB does.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 3450e5a31437ce17a5b4499b8d08ce0b2623704d..e03d2d3d35470cb3971606c66da382672eef1f82 100644
+index 6147ffdcb83a9d013a05facd75453d6500064fe7..ecf463139bb6567103d81ae26cfff53d843cbd26 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -936,22 +936,20 @@ public class ServerPlayer extends Player {
+@@ -891,22 +891,20 @@ public class ServerPlayer extends Player {
if (this.isRemoved()) {
return;
}
@@ -38,7 +38,7 @@ index 3450e5a31437ce17a5b4499b8d08ce0b2623704d..e03d2d3d35470cb3971606c66da38267
this.drops.clear(); // SPIGOT-5188: make sure to clear
} // Paper - fix player loottables running when mob loot gamerule is false
-@@ -2434,8 +2432,8 @@ public class ServerPlayer extends Player {
+@@ -2389,8 +2387,8 @@ public class ServerPlayer extends Player {
}
@Override
@@ -50,10 +50,10 @@ index 3450e5a31437ce17a5b4499b8d08ce0b2623704d..e03d2d3d35470cb3971606c66da38267
if (entityitem == null) {
return null;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index eef69be6cce94d89688f7d485627a8b665b863c7..95ef55c232b605691d462aa532f93d338bb6600c 100644
+index 7fa7cb2a567c90a4bb7cf20c7182c45395b6ea32..2a1cbb548bfe65382483597c6350450033dffdb1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2528,6 +2528,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2476,6 +2476,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@Nullable
public ItemEntity spawnAtLocation(ItemStack stack, float yOffset) {
@@ -79,7 +79,7 @@ index eef69be6cce94d89688f7d485627a8b665b863c7..95ef55c232b605691d462aa532f93d33
if (stack.isEmpty()) {
return null;
} else if (this.level().isClientSide) {
-@@ -2535,14 +2554,21 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2483,14 +2502,21 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} else {
// CraftBukkit start - Capture drops for death event
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {
diff --git a/patches/server/0979-Keep-previous-behavior-for-setResourcePack.patch b/patches/server/0979-Keep-previous-behavior-for-setResourcePack.patch
index 68447429bd..75e35125d1 100644
--- a/patches/server/0979-Keep-previous-behavior-for-setResourcePack.patch
+++ b/patches/server/0979-Keep-previous-behavior-for-setResourcePack.patch
@@ -10,10 +10,10 @@ packs before sending the new pack. Other API exists
for adding a new pack to the existing packs on a client.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 9c4b46bb319c7f0b0831d37cff657d9563956ca5..2fb263502b61d6a66aa30ef42e1514447bf4f3fa 100644
+index 838ea7a08df425adac7986d1bc6bf13ca8ce956b..51a63de2e0bb43c35cd9b8e6c431ec81fc9aecd1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2351,8 +2351,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2309,8 +2309,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (hash != null) {
Preconditions.checkArgument(hash.length == 20, "Resource pack hash should be 20 bytes long but was %s", hash.length);
diff --git a/patches/server/0981-add-more-scoreboard-API.patch b/patches/server/0980-add-more-scoreboard-API.patch
index 3365b53a36..3365b53a36 100644
--- a/patches/server/0981-add-more-scoreboard-API.patch
+++ b/patches/server/0980-add-more-scoreboard-API.patch
diff --git a/patches/server/0982-Improve-Registry.patch b/patches/server/0981-Improve-Registry.patch
index 162949848b..162949848b 100644
--- a/patches/server/0982-Improve-Registry.patch
+++ b/patches/server/0981-Improve-Registry.patch
diff --git a/patches/server/0983-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch b/patches/server/0982-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch
index aa658a4835..aa658a4835 100644
--- a/patches/server/0983-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch
+++ b/patches/server/0982-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch
diff --git a/patches/server/0984-Add-experience-points-API.patch b/patches/server/0983-Add-experience-points-API.patch
index f0bc88e7e4..c7b16fc198 100644
--- a/patches/server/0984-Add-experience-points-API.patch
+++ b/patches/server/0983-Add-experience-points-API.patch
@@ -18,10 +18,10 @@ index 182180275be3bf90b9f8e66dcf19ad6ce02136bf..2759fa8768cfa7a38af7266a8e58af5f
// Paper start - send while respecting visibility
private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 2fb263502b61d6a66aa30ef42e1514447bf4f3fa..c11b974cf4dee385d0730ecc20715feac0f20352 100644
+index 51a63de2e0bb43c35cd9b8e6c431ec81fc9aecd1..89a248b392a4001e951415a3560c39259a83e8d0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1821,6 +1821,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1779,6 +1779,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Preconditions.checkArgument(exp >= 0, "Total experience points must not be negative (%s)", exp);
this.getHandle().totalExperience = exp;
}
diff --git a/patches/server/0986-Add-drops-to-shear-events.patch b/patches/server/0984-Add-drops-to-shear-events.patch
index 77b35dfe1f..77b35dfe1f 100644
--- a/patches/server/0986-Add-drops-to-shear-events.patch
+++ b/patches/server/0984-Add-drops-to-shear-events.patch
diff --git a/patches/server/0987-Add-PlayerShieldDisableEvent.patch b/patches/server/0985-Add-PlayerShieldDisableEvent.patch
index 0e89bafeb1..0e89bafeb1 100644
--- a/patches/server/0987-Add-PlayerShieldDisableEvent.patch
+++ b/patches/server/0985-Add-PlayerShieldDisableEvent.patch
diff --git a/patches/server/0988-Validate-ResourceLocation-in-NBT-reading.patch b/patches/server/0986-Validate-ResourceLocation-in-NBT-reading.patch
index a88ee23306..a88ee23306 100644
--- a/patches/server/0988-Validate-ResourceLocation-in-NBT-reading.patch
+++ b/patches/server/0986-Validate-ResourceLocation-in-NBT-reading.patch
diff --git a/patches/server/0989-Properly-handle-experience-dropping-on-block-break.patch b/patches/server/0987-Properly-handle-experience-dropping-on-block-break.patch
index a89e4dc3ae..3cebe8aa1c 100644
--- a/patches/server/0989-Properly-handle-experience-dropping-on-block-break.patch
+++ b/patches/server/0987-Properly-handle-experience-dropping-on-block-break.patch
@@ -7,10 +7,10 @@ This causes spawnAfterBreak to spawn xp by default, removing the need to manuall
For classes that use custom xp amounts, they can drop the resources with disabling
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 035c9c78d848d1dc69ace27e2c139834864d55e5..9a0d648f04063dd7701d1cbe548a6d45fc216928 100644
+index 5d675d4a5380c3a67e5a320cdb7bffe8a823d855..aa5437860c0471dcc0e6b01cb97e1cbadb752fab 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -635,7 +635,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -630,7 +630,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (drop) {
BlockEntity tileentity = iblockdata.hasBlockEntity() ? this.getBlockEntity(pos) : null;
diff --git a/patches/server/0990-Fixup-NamespacedKey-handling.patch b/patches/server/0988-Fixup-NamespacedKey-handling.patch
index 14ddcf111d..14ddcf111d 100644
--- a/patches/server/0990-Fixup-NamespacedKey-handling.patch
+++ b/patches/server/0988-Fixup-NamespacedKey-handling.patch
diff --git a/patches/server/0991-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
index 432ca3b272..364e247001 100644
--- a/patches/server/0991-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
+++ b/patches/server/0989-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
@@ -18,10 +18,10 @@ index 3c4ac79c094dc2fff7de94150a34b7bf814ac0de..38b56923a642afc1cb411480ba03cc78
@VisibleForTesting
static long encode(double value) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 9e7e192493532a2ecab23b98eebc95a1bb75791c..74c3bc1127b4d81cb8838d3ff4ba5211bdb24393 100644
+index 0801bbba0ea2a5d6e19d503ee31ad6717f1d5234..a1fd9d902bb6ebca7ca7edc584cbf72a138368eb 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1177,10 +1177,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1735,10 +1735,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void updatePlayer(ServerPlayer player) {
org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
if (player != this.entity) {
@@ -39,7 +39,7 @@ index 9e7e192493532a2ecab23b98eebc95a1bb75791c..74c3bc1127b4d81cb8838d3ff4ba5211
boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z);
// Paper start - Configurable entity tracking range by Y
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
-index 8cd52a6172fc7bdd5dc980329fed1d765e3750f2..529ab44baaf573b97cf7e89560c548642733188f 100644
+index c2a4fde17673a2bc3133aa0c68608c3da75d5cc5..9154af6523f4eaab1636e0bad30f743244e47471 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -164,7 +164,13 @@ public class ServerEntity {
diff --git a/patches/server/1042-Expose-LootTable-of-DecoratedPot.patch b/patches/server/0990-Expose-LootTable-of-DecoratedPot.patch
index 6d5e2738de..6d5e2738de 100644
--- a/patches/server/1042-Expose-LootTable-of-DecoratedPot.patch
+++ b/patches/server/0990-Expose-LootTable-of-DecoratedPot.patch
diff --git a/patches/server/0751-Rewrite-chunk-system.patch b/patches/server/0991-Rewrite-chunk-system.patch
index cf8d6ad719..e4f89841a2 100644
--- a/patches/server/0751-Rewrite-chunk-system.patch
+++ b/patches/server/0991-Rewrite-chunk-system.patch
@@ -923,23 +923,6 @@ index 499c069d64692872924963d3a7ac39664b20468d..ef8ea36b2acefb935afda01396d2699e
}
public static final class LightQueue {
-diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
-index 2d4090b95193de431f56eaafd4d4561ecccdf99c..a2f71a6d1a9e98133dff6cd0f625da9435a8af14 100644
---- a/src/main/java/co/aikar/timings/TimingsExport.java
-+++ b/src/main/java/co/aikar/timings/TimingsExport.java
-@@ -163,7 +163,11 @@ public class TimingsExport extends Thread {
- pair("gamerules", toObjectMapper(world.getWorld().getGameRules(), rule -> {
- return pair(rule, world.getWorld().getGameRuleValue(rule));
- })),
-- pair("ticking-distance", world.getChunkSource().chunkMap.getEffectiveViewDistance())
-+ // Paper start - replace chunk loader system
-+ pair("ticking-distance", world.getWorld().getSimulationDistance()),
-+ pair("no-ticking-distance", world.getWorld().getViewDistance()),
-+ pair("sending-distance", world.getWorld().getSendViewDistance())
-+ // Paper end - replace chunk loader system
- ));
- }));
-
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
index 2f0d9b953802dee821cfde82d22b0567cce8ee91..22687667ec69a954261e55e59261286ac1b8b8cd 100644
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -2094,10 +2077,10 @@ index 0000000000000000000000000000000000000000..99f49b5625cf51d6c97640553cf5c420
+ }
+}
diff --git a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
-index 87ae7d64e67ebae5ab53cc239cdf6580dca31652..cbeaadaecf816070b3a37938c8e683180939afc4 100644
+index 05bddc0697faa8d9d9955d89d76930c84ef7df0d..cbeaadaecf816070b3a37938c8e683180939afc4 100644
--- a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
+++ b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
-@@ -32,191 +32,41 @@ public final class ChunkSystem {
+@@ -32,192 +32,41 @@ public final class ChunkSystem {
}
public static void scheduleChunkTask(final ServerLevel level, final int chunkX, final int chunkZ, final Runnable run, final PrioritisedExecutor.Priority priority) {
@@ -2166,7 +2149,7 @@ index 87ae7d64e67ebae5ab53cc239cdf6580dca31652..cbeaadaecf816070b3a37938c8e68318
- }
- };
-
-- final ChunkHolder holder = level.chunkSource.chunkMap.getUpdatingChunkIfPresent(CoordinateUtils.getChunkKey(chunkX, chunkZ));
+- final ChunkHolder holder = level.chunkSource.chunkMap.updatingChunkMap.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
-
- if (holder == null || holder.getTicketLevel() > minLevel) {
- loadCallback.accept(null);
@@ -2195,7 +2178,8 @@ index 87ae7d64e67ebae5ab53cc239cdf6580dca31652..cbeaadaecf816070b3a37938c8e68318
public static void scheduleTickingState(final ServerLevel level, final int chunkX, final int chunkZ,
final FullChunkStatus toStatus, final boolean addTicket,
final PrioritisedExecutor.Priority priority, final Consumer<LevelChunk> onComplete) {
-- if (toStatus == ChunkHolder.FullChunkStatus.INACCESSIBLE) {
+- // This method goes unused until the chunk system rewrite
+- if (toStatus == FullChunkStatus.INACCESSIBLE) {
- throw new IllegalArgumentException("Cannot wait for INACCESSIBLE status");
- }
-
@@ -2234,7 +2218,7 @@ index 87ae7d64e67ebae5ab53cc239cdf6580dca31652..cbeaadaecf816070b3a37938c8e68318
- }
- };
-
-- final ChunkHolder holder = level.chunkSource.chunkMap.getUpdatingChunkIfPresent(CoordinateUtils.getChunkKey(chunkX, chunkZ));
+- final ChunkHolder holder = level.chunkSource.chunkMap.updatingChunkMap.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
-
- if (holder == null || holder.getTicketLevel() > minLevel) {
- loadCallback.accept(null);
@@ -2243,11 +2227,11 @@ index 87ae7d64e67ebae5ab53cc239cdf6580dca31652..cbeaadaecf816070b3a37938c8e68318
-
- final CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> tickingState;
- switch (toStatus) {
-- case BORDER: {
+- case FULL: {
- tickingState = holder.getFullChunkFuture();
- break;
- }
-- case TICKING: {
+- case BLOCK_TICKING: {
- tickingState = holder.getTickingChunkFuture();
- break;
- }
@@ -2298,7 +2282,7 @@ index 87ae7d64e67ebae5ab53cc239cdf6580dca31652..cbeaadaecf816070b3a37938c8e68318
}
public static boolean hasAnyChunkHolders(final ServerLevel level) {
-@@ -243,26 +93,31 @@ public final class ChunkSystem {
+@@ -244,26 +93,31 @@ public final class ChunkSystem {
public static void onChunkBorder(final LevelChunk chunk, final ChunkHolder holder) {
chunk.playerChunk = holder;
@@ -2331,7 +2315,7 @@ index 87ae7d64e67ebae5ab53cc239cdf6580dca31652..cbeaadaecf816070b3a37938c8e68318
}
public static ChunkHolder getUnloadingChunkHolder(final ServerLevel level, final int chunkX, final int chunkZ) {
-@@ -270,23 +125,15 @@ public final class ChunkSystem {
+@@ -271,23 +125,15 @@ public final class ChunkSystem {
}
public static int getSendViewDistance(final ServerPlayer player) {
@@ -2340,20 +2324,20 @@ index 87ae7d64e67ebae5ab53cc239cdf6580dca31652..cbeaadaecf816070b3a37938c8e68318
}
public static int getLoadViewDistance(final ServerPlayer player) {
-- final ServerLevel level = player.getLevel();
+- final ServerLevel level = player.serverLevel();
- if (level == null) {
-- return Bukkit.getViewDistance() + 1;
+- return Bukkit.getViewDistance();
- }
-- return level.chunkSource.chunkMap.getEffectiveViewDistance() + 1;
+- return level.chunkSource.chunkMap.getPlayerViewDistance(player);
+ return io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.getLoadViewDistance(player);
}
public static int getTickViewDistance(final ServerPlayer player) {
-- final ServerLevel level = player.getLevel();
+- final ServerLevel level = player.serverLevel();
- if (level == null) {
- return Bukkit.getSimulationDistance();
- }
-- return level.chunkSource.chunkMap.distanceManager.getSimulationDistance();
+- return level.chunkSource.chunkMap.distanceManager.simulationDistance;
+ return io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.getAPITickViewDistance(player);
}
@@ -15282,13 +15266,13 @@ index 0000000000000000000000000000000000000000..f7b0e2564ac4bd2db1d2b2bdc230c9f5
+ }
+}
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
-index 1fd0854fb4f8ab3b5da3cda5ddd2535a0faa6adf..e2f433ddb7a34b721ba983db84f100aac953e3a4 100644
+index a6793f227fa90a37260cf0b9d5e9b6f1f47ff920..596ef21a05a5c9311adcd8799239b1532d9bb747 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
-@@ -42,6 +42,7 @@ public final class PaperCommand extends Command {
- commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
+@@ -43,6 +43,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("dumpitem"), new DumpItemCommand());
commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand());
+ commands.put(Set.of("dumplisteners"), new DumpListenersCommand());
+ commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
return commands.entrySet().stream()
@@ -15565,7 +15549,7 @@ index 0000000000000000000000000000000000000000..962d3cae6340fc11607b59355e291629
+
+}
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
-index 73a34b4e378e6012a01c8ac8b092248298be6648..276961a11fc2bd747d2dacdc581cecec498d7593 100644
+index ffd52f6871161cd1f2d23040ed4493434a29b834..a6f58b3457b7477015c5c6d969e7d83017dd3fa1 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -28,6 +28,45 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -15636,6 +15620,15 @@ index 73a34b4e378e6012a01c8ac8b092248298be6648..276961a11fc2bd747d2dacdc581cecec
public UnsupportedSettings unsupportedSettings;
public class UnsupportedSettings extends ConfigurationPart {
+@@ -198,7 +222,7 @@ public class GlobalConfiguration extends ConfigurationPart {
+
+ @PostProcess
+ private void postProcess() {
+- //io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.init(this);
++ io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.init(this);
+ }
+ }
+
diff --git a/src/main/java/io/papermc/paper/threadedregions/TickRegions.java b/src/main/java/io/papermc/paper/threadedregions/TickRegions.java
new file mode 100644
index 0000000000000000000000000000000000000000..d5d39e9c1f326e91010237b0db80d527ac52f4d6
@@ -15875,7 +15868,7 @@ index ff8a983e23bcf73ec3f7dd98c48640183647ad4d..200ed770b57e1a9240abf0473968d4b8
return net.minecraft.server.level.ChunkMap.MAX_VIEW_DISTANCE + net.minecraft.world.level.chunk.ChunkStatus.getDistance(status);
}
diff --git a/src/main/java/io/papermc/paper/util/TickThread.java b/src/main/java/io/papermc/paper/util/TickThread.java
-index d59885ee9c8b29d5bac34dce0597e345e5358c77..f9063e2282f89e97a378f06822cde0a64ab03f9a 100644
+index 73e83d56a340f0c7dcb8ff737d621003e72c6de4..bdaf062f9b66ceab303a0807eca301342886a8ea 100644
--- a/src/main/java/io/papermc/paper/util/TickThread.java
+++ b/src/main/java/io/papermc/paper/util/TickThread.java
@@ -1,12 +1,20 @@
@@ -15964,7 +15957,7 @@ index d59885ee9c8b29d5bac34dce0597e345e5358c77..f9063e2282f89e97a378f06822cde0a6
public final int id; /* We don't override getId as the spec requires that it be unique (with respect to all other threads) */
private static final AtomicInteger ID_GENERATOR = new AtomicInteger();
-@@ -66,14 +110,50 @@ public final class TickThread extends Thread {
+@@ -66,13 +110,45 @@ public final class TickThread extends Thread {
}
public static boolean isTickThread() {
@@ -15989,10 +15982,9 @@ index d59885ee9c8b29d5bac34dce0597e345e5358c77..f9063e2282f89e97a378f06822cde0a6
}
public static boolean isTickThreadFor(final ServerLevel world, final int chunkX, final int chunkZ) {
-- return Bukkit.isPrimaryThread();
-+ return isTickThread();
-+ }
-+
+ return isTickThread();
+ }
+
+ public static boolean isTickThreadFor(final ServerLevel world, final AABB aabb) {
+ return isTickThread();
+ }
@@ -16009,15 +16001,9 @@ index d59885ee9c8b29d5bac34dce0597e345e5358c77..f9063e2282f89e97a378f06822cde0a6
+ return isTickThread();
+ }
+
-+ public static boolean isTickThreadFor(final ServerLevel world, final int chunkX, final int chunkZ, final int radius) {
-+ return isTickThread();
- }
-
- public static boolean isTickThreadFor(final Entity entity) {
-- return Bukkit.isPrimaryThread();
-+ return isTickThread();
+ public static boolean isTickThreadFor(final ServerLevel world, final int chunkX, final int chunkZ, final int radius) {
+ return isTickThread();
}
- }
diff --git a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
new file mode 100644
index 0000000000000000000000000000000000000000..7e8dc9e8f381abfdcce2746edc93122d623622d1
@@ -16644,10 +16630,10 @@ index a5e438a834826161c52ca9db57d234d9ff80a591..b8bc1b9b8e8a33df90a963f9f9769292
@Override
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
-index 7a5e70c99716273d04f4cd28d80a38f6f6b3868e..1cad3585ca122a465572b16d4ecbb7231e87c7de 100644
+index deb2d8c22a1c5724d0ac8571f4ea54711988dc4b..72d013d06705b08ed696e3d3b6d631d65800c2c9 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
-@@ -315,6 +315,7 @@ public class Main {
+@@ -327,6 +327,7 @@ public class Main {
convertable_conversionsession.saveDataTag(iregistrycustom_dimension, savedata);
*/
@@ -16656,10 +16642,10 @@ index 7a5e70c99716273d04f4cd28d80a38f6f6b3868e..1cad3585ca122a465572b16d4ecbb723
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82cff8a37b 100644
+index 469e108c844880b1a95e5aa9f0f8f12375cc314a..5e9b079b815b775a77bec2d70cf9ce800a94811d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -309,7 +309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -310,7 +310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
@@ -16668,7 +16654,7 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
((MinecraftServer) atomicreference.get()).runServer();
}, "Server thread");
-@@ -641,7 +641,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -642,7 +642,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.forceDifficulty();
for (ServerLevel worldserver : this.getAllLevels()) {
this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver);
@@ -16677,7 +16663,7 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
}
-@@ -854,6 +854,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -855,6 +855,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public abstract boolean shouldRconBroadcast();
public boolean saveAllChunks(boolean suppressLogs, boolean flush, boolean force) {
@@ -16690,7 +16676,7 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
boolean flag3 = false;
for (Iterator iterator = this.getAllLevels().iterator(); iterator.hasNext(); flag3 = true) {
-@@ -862,8 +868,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -863,8 +869,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (!suppressLogs) {
MinecraftServer.LOGGER.info("Saving chunks for level '{}'/{}", worldserver, worldserver.dimension().location());
}
@@ -16705,7 +16691,7 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
}
// CraftBukkit start - moved to WorldServer.save
-@@ -882,7 +892,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -883,7 +893,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator1.hasNext()) {
ServerLevel worldserver2 = (ServerLevel) iterator1.next();
@@ -16714,7 +16700,7 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
}
MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved");
-@@ -963,36 +973,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -964,36 +974,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
@@ -16752,7 +16738,7 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
this.isSaving = false;
this.resources.close();
-@@ -1011,7 +992,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1012,7 +993,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getProfileCache().save(false); // Paper - Perf: Async GameProfileCache saving
}
// Spigot end
@@ -16761,7 +16747,7 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
}
public String getLocalIp() {
-@@ -1053,6 +1034,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1054,6 +1035,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Spigot End
@@ -16770,7 +16756,7 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
protected void runServer() {
try {
if (!this.initServer()) {
-@@ -1068,6 +1051,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1069,6 +1052,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Arrays.fill( this.recentTps, 20 );
long tickSection = Util.getMillis(), tickCount = 1;
while (this.running) {
@@ -16783,7 +16769,7 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
long i;
if (!this.isPaused() && this.tickRateManager.isSprinting() && this.tickRateManager.checkShouldSprintThisTick()) {
-@@ -1192,6 +1181,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1194,6 +1183,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
private boolean haveTime() {
@@ -16795,7 +16781,16 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
// CraftBukkit start
if (isOversleep) return canOversleep(); // Paper - because of our changes, this logic is broken
return this.forceTicks || this.runningTask() || Util.getNanos() < (this.mayHaveDelayedTasks ? this.delayedTasksMaxNextTickTimeNanos : this.nextTickTimeNanos);
-@@ -2450,7 +2444,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1437,7 +1431,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+ // Paper start - Folia scheduler API
+ ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
+ getAllLevels().forEach(level -> {
+- for (final Entity entity : level.getEntities().getAll()) {
++ for (final Entity entity : level.getEntityLookup().getAllCopy()) { // Paper - rewrite chunk system
+ if (entity.isRemoved()) {
+ continue;
+ }
+@@ -2457,7 +2451,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start
@Override
public boolean isSameThread() {
@@ -16805,10 +16800,10 @@ index 80235d7f046aec179694db0eedcd003d75b6b80d..5a9867265d1015e5bbdfd455a625ec82
public boolean isDebugging() {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index 8d7d5cadbd65833d46dce71609e938290c81f772..46708de7fac39928f52119343fc05cb877235b05 100644
+index c666bcd29d39ee7bca05edac348b7fa0325e80ab..9e0c5bb92fb45cab7d78c5ad631c64170d48729f 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-@@ -444,7 +444,34 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+@@ -451,7 +451,34 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
return this.getProperties().allowNether;
}
@@ -17522,7 +17517,7 @@ index 807a6bb1026dac2c4cd0a50afe06fd62ce23558b..2b998bdbe49bf8211b755e0eb7c1bf13
// Paper end
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af098897c3 100644
+index 3ae47b86b80f9156e71d1da83e492153f360d1b5..5c1accb75655eadd4858ee24cdcdf9b200fbbcb2 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -119,10 +119,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -17714,17 +17709,8 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
public String getChunkDebugData(ChunkPos chunkPos) {
-@@ -398,92 +364,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
-
- // Paper start
- public final int getEffectiveViewDistance() {
-- // TODO this needs to be checked on update
-- // Mojang currently sets it to +1 of the configured view distance. So subtract one to get the one we really want.
-- //TODO check if +0 is correct now
-- return this.viewDistance;
-+ return this.serverViewDistance;
+@@ -397,84 +363,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
- // Paper end
private CompletableFuture<Either<List<ChunkAccess>, ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkHolder centerChunk, int margin, IntFunction<ChunkStatus> distanceToStatus) {
- if (margin == 0) {
@@ -17809,7 +17795,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
public ReportedException debugFuturesAndCreateReportedException(IllegalStateException exception, String details) {
-@@ -513,263 +399,72 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -504,263 +393,72 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> prepareEntityTickingChunk(ChunkHolder chunk) {
@@ -18093,7 +18079,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
return nbt.contains("Status", 8);
}
-@@ -805,54 +500,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -796,54 +494,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
private CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> scheduleChunkGeneration(ChunkHolder holder, ChunkStatus requiredStatus) {
@@ -18149,7 +18135,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
protected void releaseLightTicket(ChunkPos pos) {
-@@ -863,7 +511,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -854,7 +505,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}));
}
@@ -18158,7 +18144,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
ChunkStatus chunkstatus1;
if (distance == 0) {
-@@ -875,7 +523,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -866,7 +517,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return chunkstatus1;
}
@@ -18167,7 +18153,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
if (!nbt.isEmpty()) {
// CraftBukkit start - these are spawned serialized (DefinedStructure) and we don't call an add event below at the moment due to ordering complexities
world.addWorldGenChunkEntities(EntityType.loadEntitiesRecursive(nbt, world).filter((entity) -> {
-@@ -891,53 +539,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -882,53 +533,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
checkDupeUUID(world, entity); // Paper - duplicate uuid resolving
return !needsRemoval;
@@ -18223,7 +18209,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
// Paper start - duplicate uuid resolving
-@@ -980,61 +589,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -971,61 +583,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
// Paper end - duplicate uuid resolving
public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> prepareTickingChunk(ChunkHolder holder) {
@@ -18288,7 +18274,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
public int getTickingGenerated() {
-@@ -1042,130 +606,52 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1033,130 +600,52 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
private boolean saveChunkIfNeeded(ChunkHolder chunkHolder) {
@@ -18391,8 +18377,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
+ // Paper end - replace player loader system
-- protected void setServerViewDistance(int watchDistance) {
-+ public void setServerViewDistance(int watchDistance) { // Paper - replace player loader system
+ public void setServerViewDistance(int watchDistance) { // Paper - public
int j = Mth.clamp(watchDistance, 2, 32);
if (j != this.serverViewDistance) {
@@ -18410,7 +18395,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
- int getPlayerViewDistance(ServerPlayer player) {
+ public int getPlayerViewDistance(ServerPlayer player) { // Paper - public
- return Mth.clamp(player.requestedViewDistance(), 2, this.serverViewDistance);
+ return io.papermc.paper.chunk.system.ChunkSystem.getSendViewDistance(player); // Paper - per player view distance
}
@@ -18436,7 +18421,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
@Nullable
-@@ -1188,30 +674,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1179,30 +668,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
void dumpChunks(Writer writer) throws IOException {
@@ -18468,7 +18453,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
private static String printFuture(CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> future) {
-@@ -1230,6 +693,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1221,6 +687,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -18504,7 +18489,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
private CompletableFuture<Optional<CompoundTag>> readChunk(ChunkPos chunkPos) {
return this.read(chunkPos).thenApplyAsync((optional) -> {
return optional.map((nbttagcompound) -> this.upgradeChunkTag(nbttagcompound, chunkPos)); // CraftBukkit
-@@ -1330,8 +822,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1321,8 +816,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.distanceManager.addPlayer(SectionPos.of((EntityAccess) player), player);
}
@@ -18514,7 +18499,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
this.addPlayerToDistanceMaps(player); // Paper - distance maps
} else {
SectionPos sectionposition = player.getLastSectionPos();
-@@ -1342,7 +833,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1333,7 +827,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
this.removePlayerFromDistanceMaps(player); // Paper - distance maps
@@ -18523,7 +18508,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
}
-@@ -1390,73 +881,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1381,73 +875,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.playerMap.unIgnorePlayer(player);
}
@@ -18607,7 +18592,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
}
public void addEntity(Entity entity) {
-@@ -1529,13 +977,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1520,13 +971,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected void tick() {
@@ -18622,7 +18607,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
-@@ -1644,16 +1086,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1635,16 +1080,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public void waitForLightBeforeSending(ChunkPos centerPos, int radius) {
@@ -18639,8 +18624,8 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
+ // Paper - rewrite player chunk loader
}
- private class ChunkDistanceManager extends DistanceManager {
-@@ -1664,7 +1097,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ public class ChunkDistanceManager extends DistanceManager { // Paper - public
+@@ -1655,7 +1091,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@Override
protected boolean isChunkToRemove(long pos) {
@@ -18650,7 +18635,7 @@ index 3dc4ee8b39aabf1fdaa82d5a195691d59dd1ffa5..f7ebb560a3f8aebb5e35397814eaa7af
@Nullable
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
-index 1a9e6ed379c5fccfd82f4718c7fd2794978f63b4..c80a625f7289e3bb33c6851d2072957e153ca1fb 100644
+index 8e8e3896040241bba8fd15f4d6d046567847f741..c80a625f7289e3bb33c6851d2072957e153ca1fb 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
@@ -39,67 +39,29 @@ import org.slf4j.Logger;
@@ -18915,7 +18900,7 @@ index 1a9e6ed379c5fccfd82f4718c7fd2794978f63b4..c80a625f7289e3bb33c6851d2072957e
}
public void removePlayer(SectionPos pos, ServerPlayer player) {
-@@ -289,46 +150,44 @@ public abstract class DistanceManager {
+@@ -289,40 +150,44 @@ public abstract class DistanceManager {
if (objectset == null || objectset.isEmpty()) { // Paper
this.playersPerChunk.remove(i);
this.naturalSpawnChunkCounter.update(i, Integer.MAX_VALUE, false);
@@ -18960,24 +18945,23 @@ index 1a9e6ed379c5fccfd82f4718c7fd2794978f63b4..c80a625f7289e3bb33c6851d2072957e
+ this.chunkMap.setServerViewDistance(viewDistance); // Paper - route to player chunk manager
}
- // Paper start
- public int getSimulationDistance() {
-- return this.simulationDistance;
-+ return this.chunkMap.level.playerChunkLoader.getAPITickDistance();
- }
- // Paper end
-
- public void updateSimulationDistance(int simulationDistance) {
+- public void updateSimulationDistance(int simulationDistance) {
- if (simulationDistance != this.simulationDistance) {
- this.simulationDistance = simulationDistance;
- this.tickingTicketsTracker.replacePlayerTicketsLevel(this.getPlayerTicketLevel());
- }
--
++ // Paper start
++ public int getSimulationDistance() {
++ return this.chunkMap.level.playerChunkLoader.getAPITickDistance();
++ }
++ // Paper end
+
++ public void updateSimulationDistance(int simulationDistance) {
+ this.chunkMap.level.playerChunkLoader.setTickDistance(simulationDistance); // Paper - route to player chunk manager
}
public int getNaturalSpawnChunkCount() {
-@@ -342,103 +201,28 @@ public abstract class DistanceManager {
+@@ -336,103 +201,28 @@ public abstract class DistanceManager {
}
public String getDebugStatus() {
@@ -18988,7 +18972,8 @@ index 1a9e6ed379c5fccfd82f4718c7fd2794978f63b4..c80a625f7289e3bb33c6851d2072957e
- private void dumpTickets(String path) {
- try {
- FileOutputStream fileoutputstream = new FileOutputStream(new File(path));
--
++ // Paper - rewrite chunk system
+
- try {
- ObjectIterator objectiterator = this.tickets.long2ObjectEntrySet().iterator();
-
@@ -19019,8 +19004,7 @@ index 1a9e6ed379c5fccfd82f4718c7fd2794978f63b4..c80a625f7289e3bb33c6851d2072957e
- }
-
- }
-+ // Paper - rewrite chunk system
-
+-
- @VisibleForTesting
- TickingTracker tickingTracker() {
- return this.tickingTicketsTracker;
@@ -19088,7 +19072,7 @@ index 1a9e6ed379c5fccfd82f4718c7fd2794978f63b4..c80a625f7289e3bb33c6851d2072957e
private class ChunkTicketTracker extends ChunkTracker {
private static final int MAX_LEVEL = ChunkLevel.MAX_LEVEL + 1;
-@@ -485,6 +269,7 @@ public abstract class DistanceManager {
+@@ -479,6 +269,7 @@ public abstract class DistanceManager {
return this.runUpdates(distance);
}
}
@@ -19096,7 +19080,7 @@ index 1a9e6ed379c5fccfd82f4718c7fd2794978f63b4..c80a625f7289e3bb33c6851d2072957e
private class FixedPlayerDistanceChunkTracker extends ChunkTracker {
-@@ -564,6 +349,7 @@ public abstract class DistanceManager {
+@@ -558,6 +349,7 @@ public abstract class DistanceManager {
}
}
@@ -19104,162 +19088,26 @@ index 1a9e6ed379c5fccfd82f4718c7fd2794978f63b4..c80a625f7289e3bb33c6851d2072957e
private class PlayerTicketTracker extends DistanceManager.FixedPlayerDistanceChunkTracker {
private int viewDistance = 0;
-@@ -659,4 +445,5 @@ public abstract class DistanceManager {
+@@ -653,4 +445,5 @@ public abstract class DistanceManager {
return distance <= this.viewDistance;
}
}
+ */ // Paper - rewrite chunk system
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d324983154b12792c 100644
+index 8a118a7b2878d3c99dadfa97e2ae58fda2b3f93b..9bb4223fbb665211df11dc89fcd13cb7a92cd5dd 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -139,108 +139,7 @@ public class ServerChunkCache extends ChunkSource {
- return (LevelChunk)this.getChunk(x, z, ChunkStatus.FULL, true);
- }
-
-- long chunkFutureAwaitCounter; // Paper - private -> package private
--
-- public void getEntityTickingChunkAsync(int x, int z, java.util.function.Consumer<LevelChunk> onLoad) {
-- io.papermc.paper.chunk.system.ChunkSystem.scheduleTickingState(
-- this.level, x, z, FullChunkStatus.ENTITY_TICKING, true,
-- ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.NORMAL, onLoad
-- );
-- }
--
-- public void getTickingChunkAsync(int x, int z, java.util.function.Consumer<LevelChunk> onLoad) {
-- io.papermc.paper.chunk.system.ChunkSystem.scheduleTickingState(
-- this.level, x, z, FullChunkStatus.BLOCK_TICKING, true,
-- ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.NORMAL, onLoad
-- );
-- }
--
-- public void getFullChunkAsync(int x, int z, java.util.function.Consumer<LevelChunk> onLoad) {
-- io.papermc.paper.chunk.system.ChunkSystem.scheduleTickingState(
-- this.level, x, z, FullChunkStatus.FULL, true,
-- ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.NORMAL, onLoad
-- );
-- }
--
-- void chunkLoadAccept(int chunkX, int chunkZ, ChunkAccess chunk, java.util.function.Consumer<ChunkAccess> consumer) {
-- try {
-- consumer.accept(chunk);
-- } catch (Throwable throwable) {
-- if (throwable instanceof ThreadDeath) {
-- throw (ThreadDeath)throwable;
-- }
-- LOGGER.error("Load callback for chunk " + chunkX + "," + chunkZ + " in world '" + this.level.getWorld().getName() + "' threw an exception", throwable);
-- }
-- }
--
-- void getChunkAtAsynchronously(int chunkX, int chunkZ, int ticketLevel,
-- java.util.function.Consumer<ChunkAccess> consumer) {
-- if (ticketLevel <= 33) {
-- this.getFullChunkAsync(chunkX, chunkZ, (java.util.function.Consumer)consumer);
-- return;
-- }
--
-- io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(
-- this.level, chunkX, chunkZ, ChunkHolder.getStatus(ticketLevel), true,
-- ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.NORMAL, consumer
-- );
-- }
--
--
-- public final void getChunkAtAsynchronously(int chunkX, int chunkZ, ChunkStatus status, boolean gen, boolean allowSubTicketLevel, java.util.function.Consumer<ChunkAccess> onLoad) {
-- // try to fire sync
-- int chunkStatusTicketLevel = 33 + ChunkStatus.getDistance(status);
-- ChunkHolder playerChunk = this.chunkMap.getUpdatingChunkIfPresent(io.papermc.paper.util.CoordinateUtils.getChunkKey(chunkX, chunkZ));
-- if (playerChunk != null) {
-- ChunkStatus holderStatus = playerChunk.getChunkHolderStatus();
-- ChunkAccess immediate = playerChunk.getAvailableChunkNow();
-- if (immediate != null) {
-- if (allowSubTicketLevel ? immediate.getStatus().isOrAfter(status) : (playerChunk.getTicketLevel() <= chunkStatusTicketLevel && holderStatus != null && holderStatus.isOrAfter(status))) {
-- this.chunkLoadAccept(chunkX, chunkZ, immediate, onLoad);
-- return;
-- } else {
-- if (gen || (!allowSubTicketLevel && immediate.getStatus().isOrAfter(status))) {
-- this.getChunkAtAsynchronously(chunkX, chunkZ, chunkStatusTicketLevel, onLoad);
-- return;
-- } else {
-- this.chunkLoadAccept(chunkX, chunkZ, null, onLoad);
-- return;
-- }
-- }
-- }
-- }
--
-- // need to fire async
--
-- if (gen && !allowSubTicketLevel) {
-- this.getChunkAtAsynchronously(chunkX, chunkZ, chunkStatusTicketLevel, onLoad);
-- return;
-- }
--
-- this.getChunkAtAsynchronously(chunkX, chunkZ, io.papermc.paper.util.MCUtil.getTicketLevelFor(ChunkStatus.EMPTY), (ChunkAccess chunk) -> {
-- if (chunk == null) {
-- throw new IllegalStateException("Chunk cannot be null");
-- }
--
-- if (!chunk.getStatus().isOrAfter(status)) {
-- if (gen) {
-- this.getChunkAtAsynchronously(chunkX, chunkZ, chunkStatusTicketLevel, onLoad);
-- return;
-- } else {
-- ServerChunkCache.this.chunkLoadAccept(chunkX, chunkZ, null, onLoad);
-- return;
-- }
-- } else {
-- if (allowSubTicketLevel) {
-- ServerChunkCache.this.chunkLoadAccept(chunkX, chunkZ, chunk, onLoad);
-- return;
-- } else {
-- this.getChunkAtAsynchronously(chunkX, chunkZ, chunkStatusTicketLevel, onLoad);
-- return;
-- }
-- }
-- });
-- }
-+ final java.util.concurrent.atomic.AtomicLong chunkFutureAwaitCounter = new java.util.concurrent.atomic.AtomicLong(); // Paper - private -> package private
+@@ -73,7 +73,7 @@ public class ServerChunkCache extends ChunkSource {
+ public final io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<LevelChunk> entityTickingChunks = new io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet<>(4096, 0.75f, 4096, 0.15, true);
+ final com.destroystokyo.paper.util.concurrent.WeakSeqLock loadedChunkMapSeqLock = new com.destroystokyo.paper.util.concurrent.WeakSeqLock();
+ final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<LevelChunk> loadedChunkMap = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(8192, 0.5f);
+- long chunkFutureAwaitCounter;
++ final java.util.concurrent.atomic.AtomicLong chunkFutureAwaitCounter = new java.util.concurrent.atomic.AtomicLong(); // Paper - chunk system rewrite
+ private final LevelChunk[] lastLoadedChunks = new LevelChunk[4 * 4];
// Paper end
- // Paper start
-@@ -254,34 +153,6 @@ public class ServerChunkCache extends ChunkSource {
- return holder.getLastAvailable();
- }
-
-- // this will try to avoid chunk neighbours for lighting
-- public final ChunkAccess getFullStatusChunkAt(int chunkX, int chunkZ) {
-- LevelChunk ifLoaded = this.getChunkAtIfLoadedImmediately(chunkX, chunkZ);
-- if (ifLoaded != null) {
-- return ifLoaded;
-- }
--
-- ChunkAccess empty = this.getChunk(chunkX, chunkZ, ChunkStatus.EMPTY, true);
-- if (empty != null && empty.getStatus().isOrAfter(ChunkStatus.FULL)) {
-- return empty;
-- }
-- return this.getChunk(chunkX, chunkZ, ChunkStatus.FULL, true);
-- }
--
-- public final ChunkAccess getFullStatusChunkAtIfLoaded(int chunkX, int chunkZ) {
-- LevelChunk ifLoaded = this.getChunkAtIfLoadedImmediately(chunkX, chunkZ);
-- if (ifLoaded != null) {
-- return ifLoaded;
-- }
--
-- ChunkAccess ret = this.getChunkAtImmediately(chunkX, chunkZ);
-- if (ret != null && ret.getStatus().isOrAfter(ChunkStatus.FULL)) {
-- return ret;
-- } else {
-- return null;
-- }
-- }
--
- public <T> void addTicketAtLevel(TicketType<T> ticketType, ChunkPos chunkPos, int ticketLevel, T identifier) {
- this.distanceManager.addTicket(ticketType, chunkPos, ticketLevel, identifier);
- }
-@@ -365,7 +236,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -197,7 +197,7 @@ public class ServerChunkCache extends ChunkSource {
public LevelChunk getChunkAtIfLoadedImmediately(int x, int z) {
long k = ChunkPos.asLong(x, z);
@@ -19268,7 +19116,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
return this.getChunkAtIfLoadedMainThread(x, z);
}
-@@ -391,7 +262,8 @@ public class ServerChunkCache extends ChunkSource {
+@@ -249,7 +249,8 @@ public class ServerChunkCache extends ChunkSource {
@Nullable
@Override
public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
@@ -19278,7 +19126,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
return (ChunkAccess) CompletableFuture.supplyAsync(() -> {
return this.getChunk(x, z, leastStatus, create);
}, this.mainThreadProcessor).join();
-@@ -409,24 +281,19 @@ public class ServerChunkCache extends ChunkSource {
+@@ -267,24 +268,19 @@ public class ServerChunkCache extends ChunkSource {
ChunkAccess ichunkaccess;
@@ -19307,7 +19155,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
this.level.timings.syncChunkLoad.stopTiming(); // Paper
} // Paper
ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
-@@ -446,7 +313,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -304,7 +300,7 @@ public class ServerChunkCache extends ChunkSource {
@Nullable
@Override
public LevelChunk getChunkNow(int chunkX, int chunkZ) {
@@ -19316,7 +19164,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
return null;
} else {
return this.getChunkAtIfLoadedMainThread(chunkX, chunkZ); // Paper - Perf: Optimise getChunkAt calls for loaded chunks
-@@ -460,7 +327,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -318,7 +314,7 @@ public class ServerChunkCache extends ChunkSource {
}
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getChunkFuture(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
@@ -19325,7 +19173,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
CompletableFuture completablefuture;
if (flag1) {
-@@ -481,47 +348,52 @@ public class ServerChunkCache extends ChunkSource {
+@@ -339,47 +335,52 @@ public class ServerChunkCache extends ChunkSource {
}
private CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getChunkFutureMainThread(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
@@ -19410,7 +19258,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
}
@Nullable
-@@ -533,22 +405,13 @@ public class ServerChunkCache extends ChunkSource {
+@@ -391,22 +392,13 @@ public class ServerChunkCache extends ChunkSource {
if (playerchunk == null) {
return null;
} else {
@@ -19439,10 +19287,10 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
}
}
-@@ -562,15 +425,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -420,15 +412,7 @@ public class ServerChunkCache extends ChunkSource {
}
- boolean runDistanceManagerUpdates() {
+ public boolean runDistanceManagerUpdates() { // Paper - public
- boolean flag = this.distanceManager.runAllUpdates(this.chunkMap);
- boolean flag1 = this.chunkMap.promoteChunkMap();
-
@@ -19456,7 +19304,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
}
// Paper start
-@@ -580,17 +435,10 @@ public class ServerChunkCache extends ChunkSource {
+@@ -438,17 +422,10 @@ public class ServerChunkCache extends ChunkSource {
// Paper end
public boolean isPositionTicking(long pos) {
@@ -19478,7 +19326,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
}
public void save(boolean flush) {
-@@ -615,17 +463,13 @@ public class ServerChunkCache extends ChunkSource {
+@@ -464,17 +441,13 @@ public class ServerChunkCache extends ChunkSource {
this.close(true);
}
@@ -19499,7 +19347,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
this.level.getProfiler().push("purge");
this.distanceManager.purgeStaleTickets();
this.runDistanceManagerUpdates();
-@@ -646,6 +490,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -495,6 +468,7 @@ public class ServerChunkCache extends ChunkSource {
this.level.getProfiler().popPush("chunks");
if (tickChunks) {
this.level.timings.chunks.startTiming(); // Paper - timings
@@ -19507,7 +19355,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
this.tickChunks();
this.level.timings.chunks.stopTiming(); // Paper - timings
this.chunkMap.tick();
-@@ -748,7 +593,12 @@ public class ServerChunkCache extends ChunkSource {
+@@ -597,7 +571,12 @@ public class ServerChunkCache extends ChunkSource {
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
if (playerchunk != null) {
@@ -19521,7 +19369,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
}
}
-@@ -914,17 +764,10 @@ public class ServerChunkCache extends ChunkSource {
+@@ -763,17 +742,10 @@ public class ServerChunkCache extends ChunkSource {
@Override
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
public boolean pollTask() {
@@ -19541,7 +19389,7 @@ index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d32498315
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df71c957ba5 100644
+index b5d6a7eaa24d9968e159d77a4295be00332a5457..dff2dfbe9cc04894d42181c6691e27ad061beb40 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -195,7 +195,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -19601,7 +19449,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
+ ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority priority,
+ java.util.function.Consumer<List<net.minecraft.world.level.chunk.ChunkAccess>> onLoad) {
List<net.minecraft.world.level.chunk.ChunkAccess> ret = new java.util.ArrayList<>();
-- IntArrayList ticketLevels = new IntArrayList();
+- it.unimi.dsi.fastutil.ints.IntArrayList ticketLevels = new it.unimi.dsi.fastutil.ints.IntArrayList();
-
- int minBlockX = Mth.floor(axisalignedbb.minX - 1.0E-7D) - 3;
- int maxBlockX = Mth.floor(axisalignedbb.maxX + 1.0E-7D) + 3;
@@ -19937,8 +19785,8 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
}
protected void tickTime() {
-@@ -1085,6 +1322,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
- // Paper end - Incremental chunk and player saving
+@@ -1054,6 +1291,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+ }
public void save(@Nullable ProgressListener progressListener, boolean flush, boolean savingDisabled) {
+ // Paper start - rewrite chunk system - add close param
@@ -19949,7 +19797,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
ServerChunkCache chunkproviderserver = this.getChunkSource();
if (!savingDisabled) {
-@@ -1100,16 +1342,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1069,16 +1311,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
timings.worldSaveChunks.startTiming(); // Paper
@@ -19970,7 +19818,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
// CraftBukkit start - moved from MinecraftServer.saveChunks
ServerLevel worldserver1 = this;
-@@ -1245,7 +1484,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1214,7 +1453,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED);
}
@@ -19979,7 +19827,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
}
// CraftBukkit start
-@@ -1274,7 +1513,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1245,7 +1484,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
// CraftBukkit end
@@ -19988,7 +19836,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
}
}
-@@ -1286,10 +1525,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1257,10 +1496,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
public boolean tryAddFreshEntityWithPassengers(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
// CraftBukkit end
Stream<UUID> stream = entity.getSelfAndPassengers().map(Entity::getUUID); // CraftBukkit - decompile error
@@ -20002,7 +19850,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
return false;
} else {
this.addFreshEntityWithPassengers(entity, reason); // CraftBukkit
-@@ -1906,7 +2145,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1894,7 +2133,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
@@ -20011,7 +19859,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
bufferedwriter.write(String.format(Locale.ROOT, "block_entity_tickers: %d\n", this.blockEntityTickers.size()));
bufferedwriter.write(String.format(Locale.ROOT, "block_ticks: %d\n", this.getBlockTicks().count()));
bufferedwriter.write(String.format(Locale.ROOT, "fluid_ticks: %d\n", this.getFluidTicks().count()));
-@@ -1955,7 +2194,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1943,7 +2182,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
BufferedWriter bufferedwriter2 = Files.newBufferedWriter(path1);
try {
@@ -20020,7 +19868,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
} catch (Throwable throwable4) {
if (bufferedwriter2 != null) {
try {
-@@ -1976,7 +2215,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1964,7 +2203,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
BufferedWriter bufferedwriter3 = Files.newBufferedWriter(path2);
try {
@@ -20029,7 +19877,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
} catch (Throwable throwable6) {
if (bufferedwriter3 != null) {
try {
-@@ -2118,7 +2357,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2106,7 +2345,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@VisibleForTesting
public String getWatchdogStats() {
@@ -20038,7 +19886,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString();
}), this.blockEntityTickers.size(), ServerLevel.getTypeCount(this.blockEntityTickers, TickingBlockEntity::getType), this.getBlockTicks().count(), this.getFluidTicks().count(), this.gatherChunkSourceStats());
}
-@@ -2178,15 +2417,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2166,15 +2405,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public LevelEntityGetter<Entity> getEntities() {
org.spigotmc.AsyncCatcher.catchOp("Chunk getEntities call"); // Spigot
@@ -20059,7 +19907,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
}
public void startTickingChunk(LevelChunk chunk) {
-@@ -2202,34 +2441,49 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2190,34 +2429,49 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public void close() throws IOException {
super.close();
@@ -20116,7 +19964,7 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
}
@Override
-@@ -2250,7 +2504,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2238,7 +2492,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
CrashReportCategory crashreportsystemdetails = super.fillReportDetails(report);
crashreportsystemdetails.setDetail("Loaded entity count", () -> {
@@ -20126,10 +19974,10 @@ index 7118f5734c08020cc23555fe84a6afdd7f456190..1c2c942c960326cea641936b0afc5df7
return crashreportsystemdetails;
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index f8cb091bb0424d05bfe71b2f56e1489b5f45b38c..1ff1c03bad54dfd4aef681466b141b0a314a275c 100644
+index ecf463139bb6567103d81ae26cfff53d843cbd26..36aa6fa15e12da2caec671895d5e627da0e9ff95 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -277,6 +277,50 @@ public class ServerPlayer extends Player {
+@@ -276,6 +276,50 @@ public class ServerPlayer extends Player {
public @Nullable String clientBrandName = null; // Paper - Brand support
public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
@@ -20425,10 +20273,10 @@ index 6051e5f272838ef23276a90e21c2fc821ca155d1..658e63ebde81dc14c8ab5850fb246dc0
public static <T> TicketType<T> create(String name, Comparator<T> argumentComparator) {
return new TicketType<>(name, argumentComparator, 0L);
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
-index d6a9a6bd95307837ea76c0cb07666641c5e942a6..1c2ec978f923521322aaec59b4e88d26d656b6cd 100644
+index c3e7bd8865cc8990fc59f1ff0dfc1697cbb5ca49..5ece375eaf6bcc61864997a389bb5e24625e4505 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
-@@ -534,4 +534,21 @@ public class WorldGenRegion implements WorldGenLevel {
+@@ -535,4 +535,21 @@ public class WorldGenRegion implements WorldGenLevel {
public long nextSubTickCount() {
return this.subTickCount.getAndIncrement();
}
@@ -20499,10 +20347,10 @@ index 13209267c26f46492a92e820889a9be0bd2287a0..f3b96a921e7d085b51da62fa5493384a
this.desiredChunksPerTick = Double.isNaN((double)desiredBatchSize) ? 0.01F : Mth.clamp(desiredBatchSize, 0.01F, 64.0F);
if (this.unacknowledgedBatches == 0) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index b84d748953e03f1852c4edf3d8d9466f2bce67c6..2bca2ae3688a36ee0e7c951f3ced39606dc4e456 100644
+index 401658927b6bf4946709f0f2aeba01f944ec4dfb..fc540b879230b5a5f8d6e01fa435ce140849a712 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -736,6 +736,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -744,6 +744,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
return;
}
// Paper end - Don't suggest if tab-complete is disabled
@@ -20517,7 +20365,7 @@ index b84d748953e03f1852c4edf3d8d9466f2bce67c6..2bca2ae3688a36ee0e7c951f3ced3960
TAB_COMPLETE_EXECUTOR.execute(() -> {
StringReader stringreader = new StringReader(packet.getCommand());
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 5d56f1a38b898d5532a995ef7e3146f565e165d7..4602f8a4f22eed417bf3c56f0147ed697e349f37 100644
+index b07b19876ba9edb25b89503a8c6e5a5897eb326c..39ebcbac5b735582717dd98c84f065614f361805 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -293,7 +293,7 @@ public abstract class PlayerList {
@@ -20529,7 +20377,7 @@ index 5d56f1a38b898d5532a995ef7e3146f565e165d7..4602f8a4f22eed417bf3c56f0147ed69
player.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
playerconnection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
playerconnection.send(new ClientboundPlayerAbilitiesPacket(player.getAbilities()));
-@@ -927,8 +927,8 @@ public abstract class PlayerList {
+@@ -943,8 +943,8 @@ public abstract class PlayerList {
LevelData worlddata = worldserver2.getLevelData();
entityplayer1.connection.send(new ClientboundRespawnPacket(entityplayer1.createCommonSpawnInfo(worldserver2), (byte) i));
@@ -20540,7 +20388,7 @@ index 5d56f1a38b898d5532a995ef7e3146f565e165d7..4602f8a4f22eed417bf3c56f0147ed69
entityplayer1.connection.teleport(CraftLocation.toBukkit(entityplayer1.position(), worldserver2.getWorld(), entityplayer1.getYRot(), entityplayer1.getXRot())); // CraftBukkit
entityplayer1.connection.send(new ClientboundSetDefaultSpawnPositionPacket(worldserver1.getSharedSpawnPos(), worldserver1.getSharedSpawnAngle()));
entityplayer1.connection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
-@@ -1492,7 +1492,7 @@ public abstract class PlayerList {
+@@ -1496,7 +1496,7 @@ public abstract class PlayerList {
public void setViewDistance(int viewDistance) {
this.viewDistance = viewDistance;
@@ -20549,7 +20397,7 @@ index 5d56f1a38b898d5532a995ef7e3146f565e165d7..4602f8a4f22eed417bf3c56f0147ed69
Iterator iterator = this.server.getAllLevels().iterator();
while (iterator.hasNext()) {
-@@ -1507,7 +1507,7 @@ public abstract class PlayerList {
+@@ -1511,7 +1511,7 @@ public abstract class PlayerList {
public void setSimulationDistance(int simulationDistance) {
this.simulationDistance = simulationDistance;
@@ -20668,10 +20516,10 @@ index 640db9f71608310a64e09f1e3e677c01e6ccd98a..f2a7cb6ebed7a4b4019a09af2a025f62
if (flag1) {
++this.converted;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index b580bb939f3c128ed68e02f2c75764aed49427c6..1c47ebb00421d8d690a85fcca2ae2db0ff8250b0 100644
+index 4575e3e8a21e47d39fd3639163e804ec9dc452a6..b48cca64325c55edf505a08126ccfec5a533d2fa 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -465,6 +465,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -479,6 +479,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
// Paper end
@@ -20730,7 +20578,7 @@ index b580bb939f3c128ed68e02f2c75764aed49427c6..1c47ebb00421d8d690a85fcca2ae2db0
public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
this.passengers = ImmutableList.of();
-@@ -2505,11 +2557,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2560,11 +2612,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return InteractionResult.PASS;
}
@@ -20744,7 +20592,7 @@ index b580bb939f3c128ed68e02f2c75764aed49427c6..1c47ebb00421d8d690a85fcca2ae2db0
return false;
}
-@@ -3909,6 +3961,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3990,6 +4042,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}).count();
}
@@ -20758,7 +20606,7 @@ index b580bb939f3c128ed68e02f2c75764aed49427c6..1c47ebb00421d8d690a85fcca2ae2db0
public boolean hasExactlyOnePlayerPassenger() {
if (this.passengers.isEmpty()) { return false; } // Paper - Optimize indirect passenger iteration
return this.countPlayerPassengers() == 1;
-@@ -4261,6 +4320,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -4342,6 +4401,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return;
}
// Paper end - Block invalid positions and bounding box
@@ -20771,7 +20619,7 @@ index b580bb939f3c128ed68e02f2c75764aed49427c6..1c47ebb00421d8d690a85fcca2ae2db0
// Paper start - Fix MC-4
if (this instanceof ItemEntity) {
if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.fixEntityPositionDesync) {
-@@ -4384,6 +4449,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -4465,6 +4530,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@Override
public final void setRemoved(Entity.RemovalReason reason) {
@@ -20782,19 +20630,19 @@ index b580bb939f3c128ed68e02f2c75764aed49427c6..1c47ebb00421d8d690a85fcca2ae2db0
+ return;
+ }
+ // Paper end - rewrite chunk system
+ final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers
if (this.removalReason == null) {
this.removalReason = reason;
- }
-@@ -4392,7 +4464,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -4474,7 +4546,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.stopRiding();
}
- this.getPassengers().forEach(Entity::stopRiding);
+ if (reason != RemovalReason.UNLOADED_TO_CHUNK) this.getPassengers().forEach(Entity::stopRiding); // Paper - chunk system - don't adjust passenger state when unloading, it's just not safe (and messes with our logic in entity chunk unload)
this.levelCallback.onRemove(reason);
- }
-
-@@ -4407,7 +4479,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+ // Paper start - Folia schedulers
+ if (!(this instanceof ServerPlayer) && reason != RemovalReason.CHANGED_DIMENSION && !alreadyRemoved) {
+@@ -4505,7 +4577,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@Override
public boolean shouldBeSaved() {
@@ -21055,7 +20903,7 @@ index 795a02941d7cecb58ec45b5e79c8d510ff21163a..3fc17817906876e83f040f908b8b1ba6
this.setDirty = updateListener;
this.isValid = valid;
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
-index e7b6f97d8519a5797903664e5ba2a793e37a4bfc..dbdf124638c35510aa0040100c4d80d63ab14ada 100644
+index 57d4d2014f33a2f069d6c5aaa8e87e36b63a7177..cc888bbcd6a50124fa553bc4a8ffd1e8885d3856 100644
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
@@ -18,6 +18,18 @@ import net.minecraft.world.phys.shapes.Shapes;
@@ -21078,10 +20926,10 @@ index e7b6f97d8519a5797903664e5ba2a793e37a4bfc..dbdf124638c35510aa0040100c4d80d6
<T extends Entity> List<T> getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index e8b9050f9abe6f269aab775bb12993bcf18aff2a..8c4d618a6641c38d6df1d320a1945cd006b40280 100644
+index aa5437860c0471dcc0e6b01cb97e1cbadb752fab..9a0d648f04063dd7701d1cbe548a6d45fc216928 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -549,6 +549,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -550,6 +550,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || (chunk.getFullStatus() != null && chunk.getFullStatus().isOrAfter(FullChunkStatus.BLOCK_TICKING)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement
this.sendBlockUpdated(blockposition, iblockdata1, iblockdata, i);
@@ -21093,7 +20941,7 @@ index e8b9050f9abe6f269aab775bb12993bcf18aff2a..8c4d618a6641c38d6df1d320a1945cd0
}
if ((i & 1) != 0) {
-@@ -938,7 +943,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -941,7 +946,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
// Paper end - Perf: Optimize capturedTileEntities lookup
// CraftBukkit end
@@ -21102,7 +20950,7 @@ index e8b9050f9abe6f269aab775bb12993bcf18aff2a..8c4d618a6641c38d6df1d320a1945cd0
}
public void setBlockEntity(BlockEntity blockEntity) {
-@@ -1029,26 +1034,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -1032,26 +1037,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
this.getProfiler().incrementCounter("getEntities");
List<Entity> list = Lists.newArrayList();
@@ -21130,7 +20978,7 @@ index e8b9050f9abe6f269aab775bb12993bcf18aff2a..8c4d618a6641c38d6df1d320a1945cd0
return list;
}
-@@ -1066,34 +1052,23 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -1069,34 +1055,23 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public <T extends Entity> void getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate, List<? super T> result, int limit) {
this.getProfiler().incrementCounter("getEntities");
@@ -21181,10 +21029,10 @@ index e8b9050f9abe6f269aab775bb12993bcf18aff2a..8c4d618a6641c38d6df1d320a1945cd0
}
@Nullable
-@@ -1375,4 +1350,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
- return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
+@@ -1388,4 +1363,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+ }
}
- // Paper end - respect global sound events gamerule
+ // Paper end - notify observers even if grow failed
+ // Paper start
+ //protected final io.papermc.paper.world.EntitySliceManager entitySliceManager; // Paper - rewrite chunk system
+
@@ -21248,7 +21096,7 @@ index cc0d20e9f851268fe8403ac516f426ec1d008150..12eaafdbd324fa36b3f46c3b644bc811
@Nullable default ChunkAccess getChunkIfLoadedImmediately(BlockPos pos) { return this.getChunkIfLoadedImmediately(pos.getX() >> 4, pos.getZ() >> 4);}
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
-index f767c822a8e86ce689d40d12c4ef2db3829a97cc..aa2a014f5451e780219415fffcb64a6e7cdf9b87 100644
+index b26a4eb4951e87f891b59028d98b8ffba8e103a8..b8b78494449c0cd638f9706a803dc54e184d981f 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -114,7 +114,7 @@ public abstract class ChunkGenerator {
@@ -21260,7 +21108,7 @@ index f767c822a8e86ce689d40d12c4ef2db3829a97cc..aa2a014f5451e780219415fffcb64a6e
}
public abstract void applyCarvers(WorldGenRegion chunkRegion, long seed, RandomState noiseConfig, BiomeManager biomeAccess, StructureManager structureAccessor, ChunkAccess chunk, GenerationStep.Carving carverStep);
-@@ -306,7 +306,7 @@ public abstract class ChunkGenerator {
+@@ -309,7 +309,7 @@ public abstract class ChunkGenerator {
return Pair.of(placement.getLocatePos(pos), holder);
}
@@ -21522,7 +21370,7 @@ index 73e682bb3ef3b2e450ec8c594b5365c7a340615e..6a5756bd333d9b221e7770842e5114d2
public void setFullStatus(Supplier<FullChunkStatus> levelTypeProvider) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
-index 7ca4790d564846c1ab9560e349005eea8aef35b8..279da8d43f16b4c1372d0d427891389fb7b6c780 100644
+index 94e9919da2ba5a36afa5b7f97af888cb113bb14b..5aff6454b5b1c7834adca8f1234ec4848aa3709c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
@@ -110,6 +110,17 @@ public class ChunkSerializer {
@@ -21574,7 +21422,7 @@ index 7ca4790d564846c1ab9560e349005eea8aef35b8..279da8d43f16b4c1372d0d427891389f
} else {
ProtoChunk protochunk1 = (ProtoChunk) object1;
-@@ -359,9 +376,41 @@ public class ChunkSerializer {
+@@ -366,9 +383,41 @@ public class ChunkSerializer {
protochunk1.setCarvingMask(worldgenstage_features, new CarvingMask(nbttagcompound5.getLongArray(s1), ((ChunkAccess) object1).getMinBuildHeight()));
}
@@ -21617,7 +21465,7 @@ index 7ca4790d564846c1ab9560e349005eea8aef35b8..279da8d43f16b4c1372d0d427891389f
private static void logErrors(ChunkPos chunkPos, int y, String message) {
ChunkSerializer.LOGGER.error("Recoverable errors when loading section [" + chunkPos.x + ", " + y + ", " + chunkPos.z + "]: " + message);
-@@ -378,6 +427,11 @@ public class ChunkSerializer {
+@@ -385,6 +434,11 @@ public class ChunkSerializer {
// CraftBukkit end
public static CompoundTag write(ServerLevel world, ChunkAccess chunk) {
@@ -21629,7 +21477,7 @@ index 7ca4790d564846c1ab9560e349005eea8aef35b8..279da8d43f16b4c1372d0d427891389f
// Paper start - rewrite light impl
final int minSection = io.papermc.paper.util.WorldUtil.getMinLightSection(world);
final int maxSection = io.papermc.paper.util.WorldUtil.getMaxLightSection(world);
-@@ -390,7 +444,7 @@ public class ChunkSerializer {
+@@ -397,7 +451,7 @@ public class ChunkSerializer {
nbttagcompound.putInt("xPos", chunkcoordintpair.x);
nbttagcompound.putInt("yPos", chunk.getMinSection());
nbttagcompound.putInt("zPos", chunkcoordintpair.z);
@@ -21638,7 +21486,7 @@ index 7ca4790d564846c1ab9560e349005eea8aef35b8..279da8d43f16b4c1372d0d427891389f
nbttagcompound.putLong("InhabitedTime", chunk.getInhabitedTime());
nbttagcompound.putString("Status", BuiltInRegistries.CHUNK_STATUS.getKey(chunk.getStatus()).toString());
BlendingData blendingdata = chunk.getBlendingData();
-@@ -490,8 +544,17 @@ public class ChunkSerializer {
+@@ -497,8 +551,17 @@ public class ChunkSerializer {
nbttagcompound.putBoolean("isLightOn", false); // Paper - set to false but still store, this allows us to detect --eraseCache (as eraseCache _removes_)
}
@@ -21658,7 +21506,7 @@ index 7ca4790d564846c1ab9560e349005eea8aef35b8..279da8d43f16b4c1372d0d427891389f
CompoundTag nbttagcompound2;
-@@ -527,7 +590,14 @@ public class ChunkSerializer {
+@@ -534,7 +597,14 @@ public class ChunkSerializer {
nbttagcompound.put("CarvingMasks", nbttagcompound2);
}
@@ -21673,7 +21521,7 @@ index 7ca4790d564846c1ab9560e349005eea8aef35b8..279da8d43f16b4c1372d0d427891389f
nbttagcompound.put("PostProcessing", ChunkSerializer.packOffsets(chunk.getPostProcessing()));
CompoundTag nbttagcompound3 = new CompoundTag();
Iterator iterator1 = chunk.getHeightmaps().iterator();
-@@ -583,7 +653,7 @@ public class ChunkSerializer {
+@@ -590,7 +660,7 @@ public class ChunkSerializer {
return nbttaglist == null && nbttaglist1 == null ? null : (chunk) -> {
if (nbttaglist != null) {
@@ -21971,7 +21819,7 @@ index 98b3909b536f11eda9c481ffd74066ad0cdb0ebc..0ec0be22f7292d57c40da6f1f4575bde
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
-index 169e375c814ff814d15101d09dccc67783f50465..4d5ab1771129114ef1e4745c43a4fd1813df2e30 100644
+index 8d20e265872e1f8200de186a69a29f498ceb8588..bc8038da65f834249c61a262fc1a5abb7cc91a63 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -44,6 +44,7 @@ public class RegionFile implements AutoCloseable {
@@ -21981,7 +21829,7 @@ index 169e375c814ff814d15101d09dccc67783f50465..4d5ab1771129114ef1e4745c43a4fd18
+ public final java.util.concurrent.locks.ReentrantLock fileLock = new java.util.concurrent.locks.ReentrantLock(); // Paper
public RegionFile(Path file, Path directory, boolean dsync) throws IOException {
- this(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
+ this(file, directory, RegionFileVersion.getCompressionFormat(), dsync); // Paper - Configurable region compression format
@@ -228,7 +229,7 @@ public class RegionFile implements AutoCloseable {
return (byteCount + 4096 - 1) / 4096;
}
@@ -22683,10 +22531,10 @@ index 1eff5e4800ad3b628a42113fb3ba67458e56a40d..d4e0ef75dd12709a0dcf9193821c30b8
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 1761fac48b832fc35cb916131587120e43ac0b08..1a92659da8a6064ab4f54d5e9861633b6b46a8bd 100644
+index b23cc5371cb8fc2cfaba70c73cd9d4b0accb3283..b63a0770e80f16848861a4747586ad22b9f9520b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -1292,7 +1292,6 @@ public final class CraftServer implements Server {
+@@ -1384,7 +1384,6 @@ public final class CraftServer implements Server {
internal.keepSpawnInMemory = creator.keepSpawnLoaded().toBooleanOrElse(internal.getWorld().getKeepSpawnInMemory()); // Paper
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
@@ -22694,7 +22542,7 @@ index 1761fac48b832fc35cb916131587120e43ac0b08..1a92659da8a6064ab4f54d5e9861633b
this.pluginManager.callEvent(new WorldLoadEvent(internal.getWorld()));
return internal.getWorld();
-@@ -1336,7 +1335,7 @@ public final class CraftServer implements Server {
+@@ -1429,7 +1428,7 @@ public final class CraftServer implements Server {
}
handle.getChunkSource().close(save);
@@ -22703,7 +22551,7 @@ index 1761fac48b832fc35cb916131587120e43ac0b08..1a92659da8a6064ab4f54d5e9861633b
handle.convertable.close();
} catch (Exception ex) {
this.getLogger().log(Level.SEVERE, null, ex);
-@@ -2296,7 +2295,7 @@ public final class CraftServer implements Server {
+@@ -2444,7 +2443,7 @@ public final class CraftServer implements Server {
@Override
public boolean isPrimaryThread() {
@@ -22713,10 +22561,10 @@ index 1761fac48b832fc35cb916131587120e43ac0b08..1a92659da8a6064ab4f54d5e9861633b
// Paper start - Adventure
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index c35f5a1a42b76b154bfbb161d23348e76f676090..561ed3b93ba09f17f0f263b90993a7b13ce3f468 100644
+index a8131d68c7b8f762be6ee39e3a4f7f3edb978fe9..65b2902c65011223b344d64179d9dd3594abfa68 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -477,10 +477,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -499,10 +499,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
if (playerChunk == null) return false;
@@ -22734,7 +22582,7 @@ index c35f5a1a42b76b154bfbb161d23348e76f676090..561ed3b93ba09f17f0f263b90993a7b1
ClientboundLevelChunkWithLightPacket refreshPacket = new ClientboundLevelChunkWithLightPacket(chunk, this.world.getLightEngine(), null, null);
for (ServerPlayer player : playersInRange) {
-@@ -488,8 +492,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -510,8 +514,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
player.connection.send(refreshPacket);
}
@@ -22744,7 +22592,7 @@ index c35f5a1a42b76b154bfbb161d23348e76f676090..561ed3b93ba09f17f0f263b90993a7b1
return true;
}
-@@ -566,20 +569,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -590,20 +593,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public Collection<Plugin> getPluginChunkTickets(int x, int z) {
DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager;
@@ -22766,7 +22614,7 @@ index c35f5a1a42b76b154bfbb161d23348e76f676090..561ed3b93ba09f17f0f263b90993a7b1
}
@Override
-@@ -587,7 +577,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -611,7 +601,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
Map<Plugin, ImmutableList.Builder<Chunk>> ret = new HashMap<>();
DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager;
@@ -22775,7 +22623,7 @@ index c35f5a1a42b76b154bfbb161d23348e76f676090..561ed3b93ba09f17f0f263b90993a7b1
long chunkKey = chunkTickets.getLongKey();
SortedArraySet<Ticket<?>> tickets = chunkTickets.getValue();
-@@ -1227,13 +1217,52 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1273,12 +1263,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public int getViewDistance() {
@@ -22787,102 +22635,75 @@ index c35f5a1a42b76b154bfbb161d23348e76f676090..561ed3b93ba09f17f0f263b90993a7b1
public int getSimulationDistance() {
- return this.world.getChunkSource().chunkMap.getDistanceManager().simulationDistance;
+ return this.getHandle().playerChunkLoader.getAPITickDistance(); // Paper - replace player chunk loader
-+ }
-+ // Paper start - view distance api
-+ @Override
-+ public void setViewDistance(int viewDistance) {
-+ if (viewDistance < 2 || viewDistance > 32) {
-+ throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]");
-+ }
-+ net.minecraft.server.level.ChunkMap chunkMap = getHandle().getChunkSource().chunkMap;
-+ chunkMap.setServerViewDistance(viewDistance);
-+ }
-+
-+ @Override
-+ public void setSimulationDistance(int simulationDistance) {
+ }
+
+ public BlockMetadataStore getBlockMetadata() {
+@@ -2420,17 +2410,20 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+
+ @Override
+ public void setSimulationDistance(final int simulationDistance) {
+- throw new UnsupportedOperationException("Not implemented yet");
+ if (simulationDistance < 2 || simulationDistance > 32) {
+ throw new IllegalArgumentException("Simulation distance " + simulationDistance + " is out of range of [2, 32]");
+ }
-+ net.minecraft.server.level.ChunkMap chunkMap = getHandle().getChunkSource().chunkMap;
-+ chunkMap.setTickViewDistance(simulationDistance);
-+ }
-+
-+ @Override
-+ public int getNoTickViewDistance() {
-+ return this.getViewDistance();
-+ }
-+
-+ @Override
-+ public void setNoTickViewDistance(int viewDistance) {
-+ this.setViewDistance(viewDistance);
-+ }
-+
-+ @Override
-+ public int getSendViewDistance() {
++ this.getHandle().chunkSource.chunkMap.setTickViewDistance(simulationDistance);
+ }
+
+ @Override
+ public int getSendViewDistance() {
+- return this.getViewDistance();
+ return this.getHandle().playerChunkLoader.getAPISendViewDistance(); // Paper - replace player chunk loader
-+ }
-+
-+ @Override
-+ public void setSendViewDistance(int viewDistance) {
+ }
+
+ @Override
+ public void setSendViewDistance(final int viewDistance) {
+- throw new UnsupportedOperationException("Not implemented yet");
+ this.getHandle().chunkSource.chunkMap.setSendViewDistance(viewDistance); // Paper - replace player chunk loader
}
-+ // Paper end - view distance api
- public BlockMetadataStore getBlockMetadata() {
- return this.blockMetadata;
+ // Paper start - implement pointers
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 1fe839581edc496826885937ab0e10ec0a056212..b6bf7cf5515400a1f241ebef6cc76073f0a93bfa 100644
+index 5743013c527c80f2dda444b5bf2d8872ff000386..5c1e016de183933c5458deaae257b978e6350307 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -199,6 +199,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
- this.firstPlayed = System.currentTimeMillis();
- }
+@@ -3334,31 +3334,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
-+ // Paper start - implement view distances
-+ @Override
-+ public int getViewDistance() {
+ @Override
+ public int getViewDistance() {
+- return io.papermc.paper.chunk.system.ChunkSystem.getLoadViewDistance(this.getHandle());
+ return io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.getAPIViewDistance(this);
-+ }
-+
-+ @Override
-+ public void setViewDistance(int viewDistance) {
+ }
+
+ @Override
+ public void setViewDistance(final int viewDistance) {
+- throw new UnsupportedOperationException("Not implemented yet");
+ this.getHandle().setLoadViewDistance(viewDistance < 0 ? viewDistance : viewDistance + 1);
-+ }
-+
-+ @Override
-+ public int getSimulationDistance() {
+ }
+
+ @Override
+ public int getSimulationDistance() {
+- return io.papermc.paper.chunk.system.ChunkSystem.getTickViewDistance(this.getHandle());
+ return io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.getAPITickViewDistance(this);
-+ }
-+
-+ @Override
-+ public void setSimulationDistance(int simulationDistance) {
+ }
+
+ @Override
+ public void setSimulationDistance(final int simulationDistance) {
+- throw new UnsupportedOperationException("Not implemented yet");
+ this.getHandle().setTickViewDistance(simulationDistance);
-+ }
-+
-+ @Override
-+ public int getNoTickViewDistance() {
-+ return this.getViewDistance();
-+ }
-+
-+ @Override
-+ public void setNoTickViewDistance(int viewDistance) {
-+ this.setViewDistance(viewDistance);
-+ }
-+
-+ @Override
-+ public int getSendViewDistance() {
+ }
+
+ @Override
+ public int getSendViewDistance() {
+- return io.papermc.paper.chunk.system.ChunkSystem.getSendViewDistance(this.getHandle());
+ return io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.getAPISendViewDistance(this);
-+ }
-+
-+ @Override
-+ public void setSendViewDistance(int viewDistance) {
+ }
+
+ @Override
+ public void setSendViewDistance(final int viewDistance) {
+- throw new UnsupportedOperationException("Not implemented yet");
+ this.getHandle().setSendViewDistance(viewDistance);
-+ }
-+ // Paper end - implement view distances
-+
- public GameProfile getProfile() {
- return this.getHandle().getGameProfile();
}
+ }
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
index f6d003ea707f43287e52f8ffad24be35eeefec69..c6e5d3b7ef3886d0ffa9302d1270c048eaaeb671 100644
--- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
@@ -22897,10 +22718,10 @@ index f6d003ea707f43287e52f8ffad24be35eeefec69..c6e5d3b7ef3886d0ffa9302d1270c048
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
-index e37c2d82ed606cbfe00c152b08c3ab99ac751f69..a650411e3fa7e2a045ac55502c77028be348acf1 100644
+index 7ed861cd67889e525ab4987c0afed245aca08833..86a20c91beff6b27e6ec886e49ba902b216106f2 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
-@@ -824,19 +824,39 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
+@@ -826,19 +826,39 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
@Nullable
@Override
public BlockState getBlockStateIfLoaded(final BlockPos blockposition) {
@@ -22944,14 +22765,13 @@ index e37c2d82ed606cbfe00c152b08c3ab99ac751f69..a650411e3fa7e2a045ac55502c77028b
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
-index 440660dfa70d57e94ae4eef1dce783aee5034f7e..187eda2dd40785eb09528c86718d6b4fd3ab252c 100644
+index 7956002e2d4d583c27e277562312d27ea6871557..819a67aa19c6bd624f5ed28d09b35ff2c151749a 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
-@@ -258,4 +258,20 @@ public class DummyGeneratorAccess implements WorldGenLevel {
- public boolean destroyBlock(BlockPos pos, boolean drop, Entity breakingEntity, int maxUpdateDepth) {
- return false; // SPIGOT-6515
- }
-+
+@@ -268,4 +268,19 @@ public class DummyGeneratorAccess implements WorldGenLevel {
+ @Override
+ public void scheduleTick(BlockPos pos, Fluid fluid, int delay, net.minecraft.world.ticks.TickPriority priority) {}
+ // Paper end - add more methods
+ // Paper start
+ @Override
+ public List<Entity> getHardCollidingEntities(Entity except, AABB box, Predicate<? super Entity> predicate) {
diff --git a/patches/server/0396-incremental-chunk-and-player-saving.patch b/patches/server/0992-incremental-chunk-and-player-saving.patch
index a45acbad50..4f3f105b0b 100644
--- a/patches/server/0396-incremental-chunk-and-player-saving.patch
+++ b/patches/server/0992-incremental-chunk-and-player-saving.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] incremental chunk and player saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index f3afc22e3c4fc792fa4ed5c3ee18d76cd1cd6e85..f03a2995c2eb080ec4db0d6c3aa261a463c08579 100644
+index c546341dc36f5c0526008ff041efff5d491445ff..cae27c2182618bace836ac8356b260d51cad303d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -887,7 +887,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -907,7 +907,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try {
this.isSaving = true;
@@ -17,7 +17,7 @@ index f3afc22e3c4fc792fa4ed5c3ee18d76cd1cd6e85..f03a2995c2eb080ec4db0d6c3aa261a4
flag3 = this.saveAllChunks(suppressLogs, flush, force);
} finally {
this.isSaving = false;
-@@ -1318,16 +1318,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1324,16 +1324,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
--this.ticksUntilAutosave;
@@ -56,10 +56,10 @@ index f3afc22e3c4fc792fa4ed5c3ee18d76cd1cd6e85..f03a2995c2eb080ec4db0d6c3aa261a4
// Paper start - move executeAll() into full server tick timing
try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 6bb0b24e8bc5cd031d192dd0b61a3afd248c62e4..1ab9472a4619204ee633e7e91de5f08cf56a1291 100644
+index 9bb4223fbb665211df11dc89fcd13cb7a92cd5dd..20cdfd2bbd5dc71fd37ccedaf3a8d06b45553c9b 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -600,6 +600,15 @@ public class ServerChunkCache extends ChunkSource {
+@@ -435,6 +435,15 @@ public class ServerChunkCache extends ChunkSource {
} // Paper - Timings
}
@@ -76,10 +76,10 @@ index 6bb0b24e8bc5cd031d192dd0b61a3afd248c62e4..1ab9472a4619204ee633e7e91de5f08c
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 ecc716ce94f40ab8f85e5f57fecad68c08d4e85e..baafe984f2e015e20e57841b5009861cb0a02525 100644
+index dff2dfbe9cc04894d42181c6691e27ad061beb40..09a9452705cc8d4133940c081583d6d38d226f71 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1046,6 +1046,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1290,6 +1290,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos);
}
@@ -115,13 +115,13 @@ index ecc716ce94f40ab8f85e5f57fecad68c08d4e85e..baafe984f2e015e20e57841b5009861c
+ // Paper end - Incremental chunk and player saving
+
public void save(@Nullable ProgressListener progressListener, boolean flush, boolean savingDisabled) {
- ServerChunkCache chunkproviderserver = this.getChunkSource();
-
+ // Paper start - rewrite chunk system - add close param
+ this.save(progressListener, flush, savingDisabled, false);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index ab92c2c0ff5ebb395670c23fe0e3a8122b215874..c4e0fa6c24f9df0d99508ea7d6a9ed974f14835e 100644
+index 36aa6fa15e12da2caec671895d5e627da0e9ff95..e03d2d3d35470cb3971606c66da382672eef1f82 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -190,6 +190,7 @@ import org.bukkit.inventory.MainHand;
+@@ -191,6 +191,7 @@ import org.bukkit.inventory.MainHand;
public class ServerPlayer extends Player {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -130,10 +130,10 @@ index ab92c2c0ff5ebb395670c23fe0e3a8122b215874..c4e0fa6c24f9df0d99508ea7d6a9ed97
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
private static final int FLY_STAT_RECORDING_SPEED = 25;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 54aba3118157f72491cb8c3d5fb5c63750ea6878..a35dda4010c6db1a8e1efb7951ac8732d9a1e16e 100644
+index 39ebcbac5b735582717dd98c84f065614f361805..34bd7e81f9480c97afd69c11eca216b03e6a5a1f 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -551,6 +551,7 @@ public abstract class PlayerList {
+@@ -576,6 +576,7 @@ public abstract class PlayerList {
protected void save(ServerPlayer player) {
if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit
@@ -141,7 +141,7 @@ index 54aba3118157f72491cb8c3d5fb5c63750ea6878..a35dda4010c6db1a8e1efb7951ac8732
this.playerIo.save(player);
ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit
-@@ -1151,10 +1152,22 @@ public abstract class PlayerList {
+@@ -1227,10 +1228,22 @@ public abstract class PlayerList {
}
public void saveAll() {
diff --git a/patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch b/patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch
index 3e357fc47f..7b15fdd4fe 100644
--- a/patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch
+++ b/patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch
@@ -29,10 +29,10 @@ index 369b54b96c682717ef93d05312714b4d30efaceb..beadef19ee136c27601f0d116a869673
this.x = x;
this.y = y;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index d7742e1663101490e6f12f309a079588c7497919..6163a682f12d75fa2658ecd0de33ee56dbc5771b 100644
+index 9a0d648f04063dd7701d1cbe548a6d45fc216928..9ea53a55946fbfa35ccceb9c94bb63bd40d3c2f6 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -419,7 +419,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -342,7 +342,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end
public boolean isInWorldBounds(BlockPos pos) {
diff --git a/patches/server/0992-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch b/patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch
index 6921c1c664..8e271a005e 100644
--- a/patches/server/0992-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch
+++ b/patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch
@@ -62,7 +62,7 @@ index bb8e962e63c7a2d931f9bd7f7c002aa35cfa5fd3..0fa131a6c98adb498fc8d534e0e39647
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
// Paper start - Add predicate for blocks when raytracing
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 9a0d648f04063dd7701d1cbe548a6d45fc216928..d7742e1663101490e6f12f309a079588c7497919 100644
+index 9ea53a55946fbfa35ccceb9c94bb63bd40d3c2f6..6163a682f12d75fa2658ecd0de33ee56dbc5771b 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -334,10 +334,87 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/server/0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
index 4c83d00b56..4c83d00b56 100644
--- a/patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
+++ b/patches/server/0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
diff --git a/patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch b/patches/server/0997-Allow-Saving-of-Oversized-Chunks.patch
index f6a81ca166..f6a81ca166 100644
--- a/patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch
+++ b/patches/server/0997-Allow-Saving-of-Oversized-Chunks.patch
diff --git a/patches/server/0997-Fix-World-isChunkGenerated-calls.patch b/patches/server/0998-Fix-World-isChunkGenerated-calls.patch
index d6d244f7be..d4670f3c2a 100644
--- a/patches/server/0997-Fix-World-isChunkGenerated-calls.patch
+++ b/patches/server/0998-Fix-World-isChunkGenerated-calls.patch
@@ -8,10 +8,10 @@ This patch also adds a chunk status cache on region files (note that
its only purpose is to cache the status on DISK)
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 74c3bc1127b4d81cb8838d3ff4ba5211bdb24393..3c24a700cb417f98bf94631d4c87e66cbdbbba57 100644
+index 5c1accb75655eadd4858ee24cdcdf9b200fbbcb2..42dde36273030494a6e7ff19e55d3b6a7da06fee 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -723,9 +723,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -717,9 +717,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end
private CompletableFuture<Optional<CompoundTag>> readChunk(ChunkPos chunkPos) {
@@ -28,7 +28,7 @@ index 74c3bc1127b4d81cb8838d3ff4ba5211bdb24393..3c24a700cb417f98bf94631d4c87e66c
}
// CraftBukkit start
-@@ -734,6 +738,60 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -728,6 +732,60 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit end
}
@@ -153,7 +153,7 @@ index f27cf743bbc379520263909541d653dd38d1be58..0db8ee3b640e6d1268e9c1cccda85459
// Paper start - don't write garbage data to disk if writing serialization fails
dataoutputstream.close(); // Only write if successful
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 031db5f0bcf4a7d0930a7d376e7f6806d34da4e2..29fa4ebcb1375a64023ada3d7055bc8085846bf4 100644
+index 65b2902c65011223b344d64179d9dd3594abfa68..99405971f51001465b0414c50d2044a95a281ab8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -376,9 +376,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0998-Flat-bedrock-generator-settings.patch b/patches/server/0999-Flat-bedrock-generator-settings.patch
index 7e54f34f22..7e54f34f22 100644
--- a/patches/server/0998-Flat-bedrock-generator-settings.patch
+++ b/patches/server/0999-Flat-bedrock-generator-settings.patch
diff --git a/patches/server/0999-Entity-Activation-Range-2.0.patch b/patches/server/1000-Entity-Activation-Range-2.0.patch
index 42423e9444..64177acf80 100644
--- a/patches/server/0999-Entity-Activation-Range-2.0.patch
+++ b/patches/server/1000-Entity-Activation-Range-2.0.patch
@@ -111,7 +111,7 @@ index 5f3502b148588a76079c1d9f55e4203f6de56406..4357d45305cdf82659fcc0df9fa42b1a
} else {
passenger.stopRiding();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index f83d16fbd7ddaa71578e3de0b35438e699c6fa22..bcd6201818a2a5ca6656e031e1e3321c9a637420 100644
+index b48cca64325c55edf505a08126ccfec5a533d2fa..95a590f4a379c1905e700036042b9bde1c0f3264 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -411,6 +411,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
diff --git a/patches/server/1000-Optional-per-player-mob-spawns.patch b/patches/server/1001-Optional-per-player-mob-spawns.patch
index eb409a4359..f6d37500e1 100644
--- a/patches/server/1000-Optional-per-player-mob-spawns.patch
+++ b/patches/server/1001-Optional-per-player-mob-spawns.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Optional per player mob spawns
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 3c24a700cb417f98bf94631d4c87e66cbdbbba57..b4611b21beb31b109cb5ecfa5aa03ac15e16335a 100644
+index 42dde36273030494a6e7ff19e55d3b6a7da06fee..0d552d4b967687e2bfb92b1e5106071460082409 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -288,9 +288,28 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -39,10 +39,10 @@ index 3c24a700cb417f98bf94631d4c87e66cbdbbba57..b4611b21beb31b109cb5ecfa5aa03ac1
private static double euclideanDistanceSquared(ChunkPos pos, Entity entity) {
double d0 = (double) SectionPos.sectionToBlockCoord(pos.x, 8);
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index ab1a625bb3eb8f45648d387d324983154b12792c..e448f7088cc7691bd2125869feb7422a6b749429 100644
+index 20cdfd2bbd5dc71fd37ccedaf3a8d06b45553c9b..059ab637adf1be576fa1fff36a91b6c5f1b5f035 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -531,7 +531,19 @@ public class ServerChunkCache extends ChunkSource {
+@@ -518,7 +518,19 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.popPush("naturalSpawnCount");
this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
int k = this.distanceManager.getNaturalSpawnChunkCount();
diff --git a/patches/server/1001-Anti-Xray.patch b/patches/server/1002-Anti-Xray.patch
index 9b8c973f5a..17297f90ac 100644
--- a/patches/server/1001-Anti-Xray.patch
+++ b/patches/server/1002-Anti-Xray.patch
@@ -1571,7 +1571,7 @@ index d4e0ef75dd12709a0dcf9193821c30b8943e6c36..fd702027e62eb38d51fb7c46ef268e9b
private static final byte[] EMPTY_LIGHT = new byte[2048];
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index be285f915e669a6b9e29ab80cec4a46546f2d09b..ade9c05017f47e904fec7edb4a8dd2e14280ca14 100644
+index b63a0770e80f16848861a4747586ad22b9f9520b..cd8608fdfce31a9349d1e494be9f7fdf2c98fe85 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2610,7 +2610,7 @@ public final class CraftServer implements Server {
@@ -1584,7 +1584,7 @@ index be285f915e669a6b9e29ab80cec4a46546f2d09b..ade9c05017f47e904fec7edb4a8dd2e1
// Paper start - Allow delegation to vanilla chunk gen
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 29fa4ebcb1375a64023ada3d7055bc8085846bf4..cd559e6aaf4bd2bd322c953bbb186135489ddcaa 100644
+index 99405971f51001465b0414c50d2044a95a281ab8..b27e965005b64c817588b75d467913c27ab1e31b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -522,11 +522,16 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch
index 1cb3a01b46..c4b823d114 100644
--- a/patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch
+++ b/patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Improve cancelling PreCreatureSpawnEvent with per player mob
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index b4611b21beb31b109cb5ecfa5aa03ac15e16335a..e69e68ae3be2760c079338793f33c27f59ebf7cf 100644
+index 0d552d4b967687e2bfb92b1e5106071460082409..9037ba5197eed9d8e616fb65369f6b1a5ea9562c 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -306,8 +306,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -37,10 +37,10 @@ index b4611b21beb31b109cb5ecfa5aa03ac15e16335a..e69e68ae3be2760c079338793f33c27f
// Paper end - Optional per player mob spawns
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index e448f7088cc7691bd2125869feb7422a6b749429..0fad2a160878d4883c88b889bd6ba00b144a2dcd 100644
+index 059ab637adf1be576fa1fff36a91b6c5f1b5f035..5afbb5b307cc67d86dd916dc8f7521d5d021e056 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -537,7 +537,17 @@ public class ServerChunkCache extends ChunkSource {
+@@ -524,7 +524,17 @@ public class ServerChunkCache extends ChunkSource {
if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled
// re-set mob counts
for (ServerPlayer player : this.level.players) {
diff --git a/patches/server/1003-Optimize-Collision-to-not-load-chunks.patch b/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch
index bfcccb5021..88daae9ea4 100644
--- a/patches/server/1003-Optimize-Collision-to-not-load-chunks.patch
+++ b/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch
@@ -26,7 +26,7 @@ index eae6121a2f3fb33146b0a625cc82c8bce8efc91b..b71d7714fbaa7d4493ccddf877c9668f
// CraftBukkit end
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 36daaed2f9b9218dbc3dafa208966680727d8a27..8ba686f9982b44eab7dea965e737d8a564cc55cd 100644
+index 95a590f4a379c1905e700036042b9bde1c0f3264..0fc522f27afb8a0ded061392d011ff67294b16b3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -241,6 +241,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
diff --git a/patches/server/1004-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch
index 8e879a28af..8e879a28af 100644
--- a/patches/server/1004-Optimize-GoalSelector-Goal.Flag-Set-operations.patch
+++ b/patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch
diff --git a/patches/server/1005-Entity-load-save-limit-per-chunk.patch b/patches/server/1006-Entity-load-save-limit-per-chunk.patch
index 65c011c1e1..65c011c1e1 100644
--- a/patches/server/1005-Entity-load-save-limit-per-chunk.patch
+++ b/patches/server/1006-Entity-load-save-limit-per-chunk.patch
diff --git a/patches/server/1006-Fix-and-optimise-world-force-upgrading.patch b/patches/server/1007-Fix-and-optimise-world-force-upgrading.patch
index 97285bbc2c..69b768b90a 100644
--- a/patches/server/1006-Fix-and-optimise-world-force-upgrading.patch
+++ b/patches/server/1007-Fix-and-optimise-world-force-upgrading.patch
@@ -267,7 +267,7 @@ index 72d013d06705b08ed696e3d3b6d631d65800c2c9..61840cfd64caba6595dfc99c91c76a19
Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit
WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 9efd93bd086ea342527b2ff530b4eb4f7df1f777..f1551b0c6a3a466cb755c8061fe7fcbc0b1e34df 100644
+index e04153106d91d235e70cc478fd343a04faf821f4..d6879c1b5f63098c276fa109ac66586e3e4ae2a0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -583,11 +583,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -352,7 +352,7 @@ index 0db8ee3b640e6d1268e9c1cccda85459bd447105..42d37bee3a459adcd46408596ccf93ab
return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index ea3e215e619c38839dd20b225b836133e702d236..b9fa6cb9306238b9b070d03b2a8186e76d84bd3d 100644
+index cd8608fdfce31a9349d1e494be9f7fdf2c98fe85..afb4fa8fa124ed0154762962a3fe59164e968c7c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1345,9 +1345,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/1007-Improved-Watchdog-Support.patch b/patches/server/1008-Improved-Watchdog-Support.patch
index b219f24d03..8dc7b17e31 100644
--- a/patches/server/1007-Improved-Watchdog-Support.patch
+++ b/patches/server/1008-Improved-Watchdog-Support.patch
@@ -71,7 +71,7 @@ index 6f2452de76e8f5fcc1367066e0e753740764eb98..e047dee632022abfe05865d1e71838be
cause = cause.getCause();
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index f1551b0c6a3a466cb755c8061fe7fcbc0b1e34df..153c8994b2f3325c7772b763737ad694ba2b6ce6 100644
+index 25837a1f58526883832b8abd9bd9158b15d9952d..af558f9f5f094d6aea6ba5e85e9a18740f1c7b76 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -296,7 +296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/1008-Optimize-Voxel-Shape-Merging.patch b/patches/server/1009-Optimize-Voxel-Shape-Merging.patch
index 2c47963e34..2c47963e34 100644
--- a/patches/server/1008-Optimize-Voxel-Shape-Merging.patch
+++ b/patches/server/1009-Optimize-Voxel-Shape-Merging.patch
diff --git a/patches/server/1009-Write-SavedData-IO-async.patch b/patches/server/1010-Write-SavedData-IO-async.patch
index ff0b27ee04..d7f6d3dea7 100644
--- a/patches/server/1009-Write-SavedData-IO-async.patch
+++ b/patches/server/1010-Write-SavedData-IO-async.patch
@@ -26,10 +26,10 @@ index 513833c2ea23df5b079d157bc5cb89d5c9754c0b..9017907c0ec67a37a506f09b7e4499ce
this.threadPool.shutdown();
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 0fad2a160878d4883c88b889bd6ba00b144a2dcd..5b5fe47650be05063c258209275819427f73a45c 100644
+index 5afbb5b307cc67d86dd916dc8f7521d5d021e056..4e0f80b26f1a1703184e38d739996b9919699fec 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -465,6 +465,13 @@ public class ServerChunkCache extends ChunkSource {
+@@ -452,6 +452,13 @@ public class ServerChunkCache extends ChunkSource {
public void close(boolean save) { // Paper - rewrite chunk system
this.level.chunkTaskScheduler.chunkHolderManager.close(save, true); // Paper - rewrite chunk system
diff --git a/patches/server/1010-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch b/patches/server/1011-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch
index 7429b07205..7429b07205 100644
--- a/patches/server/1010-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch
+++ b/patches/server/1011-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch
diff --git a/patches/server/1011-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/1012-Use-distance-map-to-optimise-entity-tracker.patch
index d7546cf5f5..891a4e5d21 100644
--- a/patches/server/1011-Use-distance-map-to-optimise-entity-tracker.patch
+++ b/patches/server/1012-Use-distance-map-to-optimise-entity-tracker.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Use distance map to optimise entity tracker
Use the distance map to find candidate players for tracking.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index e69e68ae3be2760c079338793f33c27f59ebf7cf..c68a14b5b738acabc949cab48b9551cc54e98047 100644
+index 9037ba5197eed9d8e616fb65369f6b1a5ea9562c..7e5a8789e06a5ea1d2657ea8ee5c0460da92aaeb 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -146,6 +146,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -124,7 +124,7 @@ index e69e68ae3be2760c079338793f33c27f59ebf7cf..c68a14b5b738acabc949cab48b9551cc
}
// Paper start
-@@ -939,17 +1019,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -933,17 +1013,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public void move(ServerPlayer player) {
@@ -143,7 +143,7 @@ index e69e68ae3be2760c079338793f33c27f59ebf7cf..c68a14b5b738acabc949cab48b9551cc
SectionPos sectionposition = player.getLastSectionPos();
SectionPos sectionposition1 = SectionPos.of((EntityAccess) player);
-@@ -1026,7 +1096,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1020,7 +1090,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
@@ -152,7 +152,7 @@ index e69e68ae3be2760c079338793f33c27f59ebf7cf..c68a14b5b738acabc949cab48b9551cc
if (entity instanceof ServerPlayer) {
ServerPlayer entityplayer = (ServerPlayer) entity;
-@@ -1070,9 +1140,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1064,9 +1134,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.tracker = null; // Paper - We're no longer tracked
}
@@ -192,7 +192,7 @@ index e69e68ae3be2760c079338793f33c27f59ebf7cf..c68a14b5b738acabc949cab48b9551cc
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
-@@ -1222,6 +1320,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1216,6 +1314,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lastSectionPos = SectionPos.of((EntityAccess) entity);
}
@@ -236,7 +236,7 @@ index e69e68ae3be2760c079338793f33c27f59ebf7cf..c68a14b5b738acabc949cab48b9551cc
return object instanceof ChunkMap.TrackedEntity ? ((ChunkMap.TrackedEntity) object).entity.getId() == this.entity.getId() : false;
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 8ba686f9982b44eab7dea965e737d8a564cc55cd..d3c7288e33b125eae88fb017f2e746b47c038f8f 100644
+index 0fc522f27afb8a0ded061392d011ff67294b16b3..c206adff916594ec573459d193cc7f3eda4b4957 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -56,6 +56,7 @@ import net.minecraft.network.syncher.EntityDataSerializers;
@@ -287,7 +287,7 @@ index 8ba686f9982b44eab7dea965e737d8a564cc55cd..d3c7288e33b125eae88fb017f2e746b4
return this.yRot;
}
diff --git a/src/main/java/org/spigotmc/TrackingRange.java b/src/main/java/org/spigotmc/TrackingRange.java
-index 172d231adecf043f9f06b7f5e0365ae82327998d..ed8378ad022c375b0d18172aeccf65cb026d9d68 100644
+index bb06f89a29f30144e7e2113e088a503db006a83c..e4425b242fe73d1fd2bd10c313aa16925432329f 100644
--- a/src/main/java/org/spigotmc/TrackingRange.java
+++ b/src/main/java/org/spigotmc/TrackingRange.java
@@ -55,4 +55,48 @@ public class TrackingRange
diff --git a/patches/server/1012-Optimize-Bit-Operations-by-inlining.patch b/patches/server/1013-Optimize-Bit-Operations-by-inlining.patch
index 269787b9ed..269787b9ed 100644
--- a/patches/server/1012-Optimize-Bit-Operations-by-inlining.patch
+++ b/patches/server/1013-Optimize-Bit-Operations-by-inlining.patch
diff --git a/patches/server/1013-Remove-streams-from-hot-code.patch b/patches/server/1014-Remove-streams-from-hot-code.patch
index 75a38173c7..75a38173c7 100644
--- a/patches/server/1013-Remove-streams-from-hot-code.patch
+++ b/patches/server/1014-Remove-streams-from-hot-code.patch
diff --git a/patches/server/1014-Eigencraft-redstone-implementation.patch b/patches/server/1015-Eigencraft-redstone-implementation.patch
index 0022f6b8df..0022f6b8df 100644
--- a/patches/server/1014-Eigencraft-redstone-implementation.patch
+++ b/patches/server/1015-Eigencraft-redstone-implementation.patch
diff --git a/patches/server/1015-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch
index 30e9a24146..30e9a24146 100644
--- a/patches/server/1015-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch
+++ b/patches/server/1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch
diff --git a/patches/server/1016-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch b/patches/server/1017-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch
index 14c24b80b2..14c24b80b2 100644
--- a/patches/server/1016-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch
+++ b/patches/server/1017-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch
diff --git a/patches/server/1017-Improve-boat-collision-performance.patch b/patches/server/1018-Improve-boat-collision-performance.patch
index 7e6566d525..7e6566d525 100644
--- a/patches/server/1017-Improve-boat-collision-performance.patch
+++ b/patches/server/1018-Improve-boat-collision-performance.patch
diff --git a/patches/server/1018-Optimise-general-POI-access.patch b/patches/server/1019-Optimise-general-POI-access.patch
index 9be40e9753..9be40e9753 100644
--- a/patches/server/1018-Optimise-general-POI-access.patch
+++ b/patches/server/1019-Optimise-general-POI-access.patch
diff --git a/patches/server/1019-Custom-table-implementation-for-blockstate-state-loo.patch b/patches/server/1020-Custom-table-implementation-for-blockstate-state-loo.patch
index 52bdb3212c..52bdb3212c 100644
--- a/patches/server/1019-Custom-table-implementation-for-blockstate-state-loo.patch
+++ b/patches/server/1020-Custom-table-implementation-for-blockstate-state-loo.patch
diff --git a/patches/server/1020-Execute-chunk-tasks-mid-tick.patch b/patches/server/1021-Execute-chunk-tasks-mid-tick.patch
index f3a69c5898..1a20c77ced 100644
--- a/patches/server/1020-Execute-chunk-tasks-mid-tick.patch
+++ b/patches/server/1021-Execute-chunk-tasks-mid-tick.patch
@@ -19,7 +19,7 @@ index 6b3cde6d4d1e63bec01f502f2027ee9fddac08aa..46449728f69ee7d4f78470f8da23c055
private MinecraftTimings() {}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 153c8994b2f3325c7772b763737ad694ba2b6ce6..2f89c5efa0decf792fd2cd079c1d269257edc7b9 100644
+index af558f9f5f094d6aea6ba5e85e9a18740f1c7b76..100cccf92efae2b87be7dff1f21cb5038c823c5a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1293,8 +1293,79 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -103,10 +103,10 @@ index 153c8994b2f3325c7772b763737ad694ba2b6ce6..2f89c5efa0decf792fd2cd079c1d2692
} else {
boolean ret = false; // Paper - force execution of all worlds, do not just bias the first
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 5b5fe47650be05063c258209275819427f73a45c..585e3639ae54c9bb5a2e77181091ab634d53c558 100644
+index 4e0f80b26f1a1703184e38d739996b9919699fec..2b33a3d8fdb86024acb2a3ee9d0a4a7dd4989c98 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -581,6 +581,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -568,6 +568,7 @@ public class ServerChunkCache extends ChunkSource {
boolean flag1 = this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && this.level.getLevelData().getGameTime() % this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
Iterator iterator1 = list.iterator();
@@ -114,7 +114,7 @@ index 5b5fe47650be05063c258209275819427f73a45c..585e3639ae54c9bb5a2e77181091ab63
while (iterator1.hasNext()) {
ServerChunkCache.ChunkAndHolder chunkproviderserver_a = (ServerChunkCache.ChunkAndHolder) iterator1.next();
LevelChunk chunk1 = chunkproviderserver_a.chunk;
-@@ -594,6 +595,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -581,6 +582,7 @@ public class ServerChunkCache extends ChunkSource {
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
this.level.tickChunk(chunk1, l);
diff --git a/patches/server/1021-Optimise-random-block-ticking.patch b/patches/server/1022-Optimise-random-block-ticking.patch
index 4f3d16341d..4f3d16341d 100644
--- a/patches/server/1021-Optimise-random-block-ticking.patch
+++ b/patches/server/1022-Optimise-random-block-ticking.patch
diff --git a/patches/server/1022-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch
index da819eaac8..a47c6db882 100644
--- a/patches/server/1022-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch
+++ b/patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch
@@ -42,7 +42,7 @@ index 4bef691ad22b6638847aebb471a3c28522c7a461..ccbdb68e3bcf5f609e96ddd6e5ccfb27
nbttagcompound.putString("Status", BuiltInRegistries.CHUNK_STATUS.getKey(chunk.getStatus()).toString());
BlendingData blendingdata = chunk.getBlendingData();
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
-index 6d1c8110af0508210aaaae6eef1c59b75e02bf76..08e1df6a2f262c1e20f0ec107bba4a6cc955797e 100644
+index 645a1773237f2002c233ec1f3ff6f0ca46ca4024..d16d7c2fed89fb1347df7ddd95856e7f08c22e8a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
@@ -38,7 +38,7 @@ public class ChunkStorage implements AutoCloseable {
diff --git a/patches/server/1023-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/1024-Use-Velocity-compression-and-cipher-natives.patch
index 8f8f34ad27..8f8f34ad27 100644
--- a/patches/server/1023-Use-Velocity-compression-and-cipher-natives.patch
+++ b/patches/server/1024-Use-Velocity-compression-and-cipher-natives.patch
diff --git a/patches/server/1024-Detail-more-information-in-watchdog-dumps.patch b/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch
index 91a6216c4b..36f45a25f6 100644
--- a/patches/server/1024-Detail-more-information-in-watchdog-dumps.patch
+++ b/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch
@@ -122,7 +122,7 @@ index bac2e7c8178696859ff2d38f1e095d86557fc306..5eaf8585df1f885f4a08fdd06ff4bb73
private void tickPassenger(Entity vehicle, Entity passenger) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 68b003e9b627dab2c4df6e95643a04a2d7e6e67f..4a32ca5e989395aa97b4859f5ca2f1041a2c0a52 100644
+index c206adff916594ec573459d193cc7f3eda4b4957..a6685b3f845aa08bf14fda63d66ce98e51e67678 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1051,8 +1051,43 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
diff --git a/patches/server/1025-Collision-optimisations.patch b/patches/server/1026-Collision-optimisations.patch
index 6671614d85..71ab7a2ee0 100644
--- a/patches/server/1025-Collision-optimisations.patch
+++ b/patches/server/1026-Collision-optimisations.patch
@@ -2214,7 +2214,7 @@ index 0ce7ce1899ac4115051353fc3eb0c622846d6748..0dd44f3625ca9383f22e4862ad3e9245
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index fab2915f055cd3c68a523a6e21b58932695fb7a6..00d18d8bd60d4089c8db16c6edc7b5e731111a58 100644
+index a6685b3f845aa08bf14fda63d66ce98e51e67678..2c06f3ebf7e1069727387bfc60db30c958c14b5a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1238,9 +1238,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
diff --git a/patches/server/1026-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/1027-Optimise-collision-checking-in-player-move-packet-ha.patch
index 1e773118a7..1e773118a7 100644
--- a/patches/server/1026-Optimise-collision-checking-in-player-move-packet-ha.patch
+++ b/patches/server/1027-Optimise-collision-checking-in-player-move-packet-ha.patch
diff --git a/patches/server/1027-Fix-tripwire-state-inconsistency.patch b/patches/server/1028-Fix-tripwire-state-inconsistency.patch
index bce767ae73..bce767ae73 100644
--- a/patches/server/1027-Fix-tripwire-state-inconsistency.patch
+++ b/patches/server/1028-Fix-tripwire-state-inconsistency.patch
diff --git a/patches/server/1028-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/1029-Fix-entity-type-tags-suggestions-in-selectors.patch
index 83872a3693..83872a3693 100644
--- a/patches/server/1028-Fix-entity-type-tags-suggestions-in-selectors.patch
+++ b/patches/server/1029-Fix-entity-type-tags-suggestions-in-selectors.patch
diff --git a/patches/server/1029-Add-Alternate-Current-redstone-implementation.patch b/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch
index 0c4cd1212b..0c4cd1212b 100644
--- a/patches/server/1029-Add-Alternate-Current-redstone-implementation.patch
+++ b/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch
diff --git a/patches/server/1030-optimize-dirt-and-snow-spreading.patch b/patches/server/1031-optimize-dirt-and-snow-spreading.patch
index 223dbd9a3e..223dbd9a3e 100644
--- a/patches/server/1030-optimize-dirt-and-snow-spreading.patch
+++ b/patches/server/1031-optimize-dirt-and-snow-spreading.patch
diff --git a/patches/server/1031-Properly-resend-entities.patch b/patches/server/1032-Properly-resend-entities.patch
index 82e40b8e93..82e40b8e93 100644
--- a/patches/server/1031-Properly-resend-entities.patch
+++ b/patches/server/1032-Properly-resend-entities.patch
diff --git a/patches/server/1032-Optimize-Hoppers.patch b/patches/server/1033-Optimize-Hoppers.patch
index e06fa5cda9..557e2b9fc7 100644
--- a/patches/server/1032-Optimize-Hoppers.patch
+++ b/patches/server/1033-Optimize-Hoppers.patch
@@ -50,7 +50,7 @@ index 0000000000000000000000000000000000000000..5c42823726e70ce6c9d0121d07431548
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 2f89c5efa0decf792fd2cd079c1d269257edc7b9..a966a0fe4fd9d882e81c5e2786e16ff687c892b3 100644
+index 100cccf92efae2b87be7dff1f21cb5038c823c5a..9183e47d51d95e71ab503564a7a59e03c0a54c2f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1627,6 +1627,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/1033-Improve-performance-of-mass-crafts.patch b/patches/server/1034-Improve-performance-of-mass-crafts.patch
index 21ed7a6c78..21ed7a6c78 100644
--- a/patches/server/1033-Improve-performance-of-mass-crafts.patch
+++ b/patches/server/1034-Improve-performance-of-mass-crafts.patch
diff --git a/patches/server/1034-Actually-optimise-explosions.patch b/patches/server/1035-Actually-optimise-explosions.patch
index da42c9e195..da42c9e195 100644
--- a/patches/server/1034-Actually-optimise-explosions.patch
+++ b/patches/server/1035-Actually-optimise-explosions.patch
diff --git a/patches/server/1035-Optimise-chunk-tick-iteration.patch b/patches/server/1036-Optimise-chunk-tick-iteration.patch
index 31e9d1bc60..9aeb33c382 100644
--- a/patches/server/1035-Optimise-chunk-tick-iteration.patch
+++ b/patches/server/1036-Optimise-chunk-tick-iteration.patch
@@ -108,7 +108,7 @@ index 2b998bdbe49bf8211b755e0eb7c1bf13ac280eab..627a88ec8c3b215b19b55a6d461c8754
List list;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index c68a14b5b738acabc949cab48b9551cc54e98047..5637dcf1f6c76df33988c3279171aafbc1868a82 100644
+index 7e5a8789e06a5ea1d2657ea8ee5c0460da92aaeb..5a7278b093e37b95fb005ad5cc3cac90ac36f8fb 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -191,6 +191,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -187,10 +187,10 @@ index c80a625f7289e3bb33c6851d2072957e153ca1fb..7c425ac50c83757b66a2178bc19d4c92
public String getDebugStatus() {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 585e3639ae54c9bb5a2e77181091ab634d53c558..ce1cee91351d2665437573b0d756420769637fa0 100644
+index 2b33a3d8fdb86024acb2a3ee9d0a4a7dd4989c98..366c0c9b45a819f7f94ebe3e49b8ab7f9edf9ce7 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -521,18 +521,10 @@ public class ServerChunkCache extends ChunkSource {
+@@ -508,18 +508,10 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.push("pollingChunks");
gameprofilerfiller.push("filteringLoadedChunks");
@@ -211,7 +211,7 @@ index 585e3639ae54c9bb5a2e77181091ab634d53c558..ce1cee91351d2665437573b0d7564207
if (this.level.getServer().tickRateManager().runsNormally()) {
gameprofilerfiller.popPush("naturalSpawnCount");
-@@ -567,38 +559,109 @@ public class ServerChunkCache extends ChunkSource {
+@@ -554,38 +546,109 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.popPush("spawnAndTick");
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
@@ -337,7 +337,7 @@ index 585e3639ae54c9bb5a2e77181091ab634d53c558..ce1cee91351d2665437573b0d7564207
this.level.timings.chunkTicks.stopTiming(); // Paper
gameprofilerfiller.popPush("customSpawners");
-@@ -610,11 +673,23 @@ public class ServerChunkCache extends ChunkSource {
+@@ -597,11 +660,23 @@ public class ServerChunkCache extends ChunkSource {
}
gameprofilerfiller.popPush("broadcast");
diff --git a/patches/server/1036-Lag-compensation-ticks.patch b/patches/server/1037-Lag-compensation-ticks.patch
index 17c4a518a7..86c4c02378 100644
--- a/patches/server/1036-Lag-compensation-ticks.patch
+++ b/patches/server/1037-Lag-compensation-ticks.patch
@@ -8,7 +8,7 @@ Areas affected by lag comepnsation:
- Eating food items
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index a966a0fe4fd9d882e81c5e2786e16ff687c892b3..58da8abd1603359bb9f2772a6420b55108e22ceb 100644
+index 9183e47d51d95e71ab503564a7a59e03c0a54c2f..baa33011136c1436733a413fdca16763b09d604b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -310,6 +310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/1037-Optimise-nearby-player-retrieval.patch b/patches/server/1038-Optimise-nearby-player-retrieval.patch
index c6ab594786..c6ab594786 100644
--- a/patches/server/1037-Optimise-nearby-player-retrieval.patch
+++ b/patches/server/1038-Optimise-nearby-player-retrieval.patch
diff --git a/patches/server/1038-Distance-manager-tick-timings.patch b/patches/server/1039-Distance-manager-tick-timings.patch
index f946d92596..f946d92596 100644
--- a/patches/server/1038-Distance-manager-tick-timings.patch
+++ b/patches/server/1039-Distance-manager-tick-timings.patch
diff --git a/patches/server/1039-Handle-Oversized-block-entities-in-chunks.patch b/patches/server/1040-Handle-Oversized-block-entities-in-chunks.patch
index 1bdb933b52..1bdb933b52 100644
--- a/patches/server/1039-Handle-Oversized-block-entities-in-chunks.patch
+++ b/patches/server/1040-Handle-Oversized-block-entities-in-chunks.patch
diff --git a/patches/server/1040-Further-improve-server-tick-loop.patch b/patches/server/1041-Further-improve-server-tick-loop.patch
index f071acc84f..902156f89f 100644
--- a/patches/server/1040-Further-improve-server-tick-loop.patch
+++ b/patches/server/1041-Further-improve-server-tick-loop.patch
@@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 58da8abd1603359bb9f2772a6420b55108e22ceb..4e1011dca1081a5246981fabb93f142442dcc92c 100644
+index 709698179e8da694c447221f0449e33ebd9b3c9f..23d2264dfc4f763a7198eb543e7f86a5a5aa85c3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -292,7 +292,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -141,25 +141,22 @@ index 58da8abd1603359bb9f2772a6420b55108e22ceb..4e1011dca1081a5246981fabb93f1424
this.startMetricsRecordingTick();
this.profiler.push("tick");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index ff9948589c93d4cf5d5b0beda42a0bb105f89539..9d00c98ddfa1b9c04e6d587dcdf779822f35964a 100644
+index afb4fa8fa124ed0154762962a3fe59164e968c7c..25f41119bcc19bab7cd2fdb044147b3f78a8ef1c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2969,6 +2969,15 @@ public final class CraftServer implements Server {
- return this.getServer().tickTimes5s.getAverage();
- }
+@@ -3026,7 +3026,11 @@ public final class CraftServer implements Server {
-+ @Override
-+ public double[] getTPS() {
+ @Override
+ public double[] getTPS() {
+- return new double[]{0, 0, 0}; // TODO
+ return new double[] {
-+ net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(),
-+ net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(),
-+ net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
++ net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(),
++ net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(),
++ net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
+ };
-+ }
-+
- // Spigot start
- private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
- {
+ }
+
+ // Paper start - adventure sounds
diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
index d9ec48be0fdd2bfea938aa29e36b0f6ffa839ab2..9eb2823cc8f83bad2626fc77578b0162d9ed5782 100644
--- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java
diff --git a/patches/server/0642-Send-full-pos-packets-for-hard-colliding-entities.patch b/patches/server/1042-Send-full-pos-packets-for-hard-colliding-entities.patch
index 60fd4ee073..45738a19b2 100644
--- a/patches/server/0642-Send-full-pos-packets-for-hard-colliding-entities.patch
+++ b/patches/server/1042-Send-full-pos-packets-for-hard-colliding-entities.patch
@@ -9,10 +9,10 @@ Configurable under
`send-full-pos-for-hard-colliding-entities`
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
-index a83b4d9b61230ecf5f776269cab228cf49c5f546..75b722ebc6c1fc6a45a0d3a3e57b5f131f2cf815 100644
+index 9154af6523f4eaab1636e0bad30f743244e47471..529ab44baaf573b97cf7e89560c548642733188f 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
-@@ -177,7 +177,7 @@ public class ServerEntity {
+@@ -183,7 +183,7 @@ public class ServerEntity {
long i1 = this.positionCodec.encodeZ(vec3d);
boolean flag6 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;
diff --git a/scripts/moveback.py b/scripts/moveback.py
index b0f7e2cca3..6c7fca436c 100644
--- a/scripts/moveback.py
+++ b/scripts/moveback.py
@@ -3,7 +3,7 @@ import sys
# Use inside of server patch dir
# py ../../scripts/moveback.py 'Rewrite chunk system'
-patch_target = 750 # TODO: Update this
+patch_target = 992 # TODO: Update this
def increment_number(filename):