aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-07-17 10:24:53 -0700
committerSpottedleaf <[email protected]>2024-07-17 10:28:32 -0700
commit00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6 (patch)
tree82639515bc5e9ae00c1e639e72137ed51e1ac688
parent967f98aa81da851740aeb429778e46159fd188df (diff)
downloadPaper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.tar.gz
Paper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.zip
Remove Moonrise utils to MCUtils, remove duplicated/unused utils
-rw-r--r--patches/server/0009-MC-Utils.patch4943
-rw-r--r--patches/server/0010-Adventure.patch24
-rw-r--r--patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch6
-rw-r--r--patches/server/0023-Timings-v2.patch37
-rw-r--r--patches/server/0024-Add-TickThread.patch109
-rw-r--r--patches/server/0024-Further-improve-server-tick-loop.patch (renamed from patches/server/0025-Further-improve-server-tick-loop.patch)2
-rw-r--r--patches/server/0025-Add-command-line-option-to-load-extra-plugin-jars-no.patch (renamed from patches/server/0026-Add-command-line-option-to-load-extra-plugin-jars-no.patch)2
-rw-r--r--patches/server/0026-Support-components-in-ItemMeta.patch (renamed from patches/server/0027-Support-components-in-ItemMeta.patch)2
-rw-r--r--patches/server/0027-Configurable-cactus-bamboo-and-reed-growth-height.patch (renamed from patches/server/0028-Configurable-cactus-bamboo-and-reed-growth-height.patch)0
-rw-r--r--patches/server/0028-Configurable-baby-zombie-movement-speed.patch (renamed from patches/server/0029-Configurable-baby-zombie-movement-speed.patch)0
-rw-r--r--patches/server/0029-Configurable-fishing-time-ranges.patch (renamed from patches/server/0030-Configurable-fishing-time-ranges.patch)0
-rw-r--r--patches/server/0030-Allow-nerfed-mobs-to-jump.patch (renamed from patches/server/0031-Allow-nerfed-mobs-to-jump.patch)0
-rw-r--r--patches/server/0031-Add-configurable-entity-despawn-distances.patch (renamed from patches/server/0032-Add-configurable-entity-despawn-distances.patch)0
-rw-r--r--patches/server/0032-Drop-falling-block-and-tnt-entities-at-the-specified.patch (renamed from patches/server/0033-Drop-falling-block-and-tnt-entities-at-the-specified.patch)0
-rw-r--r--patches/server/0033-Expose-server-build-information.patch (renamed from patches/server/0034-Expose-server-build-information.patch)4
-rw-r--r--patches/server/0034-Player-affects-spawning-API.patch (renamed from patches/server/0035-Player-affects-spawning-API.patch)2
-rw-r--r--patches/server/0035-Only-refresh-abilities-if-needed.patch (renamed from patches/server/0036-Only-refresh-abilities-if-needed.patch)2
-rw-r--r--patches/server/0036-Entity-Origin-API.patch (renamed from patches/server/0037-Entity-Origin-API.patch)2
-rw-r--r--patches/server/0037-Prevent-block-entity-and-entity-crashes.patch (renamed from patches/server/0038-Prevent-block-entity-and-entity-crashes.patch)0
-rw-r--r--patches/server/0038-Configurable-top-of-nether-void-damage.patch (renamed from patches/server/0039-Configurable-top-of-nether-void-damage.patch)0
-rw-r--r--patches/server/0039-Check-online-mode-before-converting-and-renaming-pla.patch (renamed from patches/server/0040-Check-online-mode-before-converting-and-renaming-pla.patch)0
-rw-r--r--patches/server/0040-Add-more-entities-to-activation-range-ignore-list.patch (renamed from patches/server/0041-Add-more-entities-to-activation-range-ignore-list.patch)0
-rw-r--r--patches/server/0041-Configurable-end-credits.patch (renamed from patches/server/0042-Configurable-end-credits.patch)4
-rw-r--r--patches/server/0042-Fix-lag-from-explosions-processing-dead-entities.patch (renamed from patches/server/0043-Fix-lag-from-explosions-processing-dead-entities.patch)0
-rw-r--r--patches/server/0043-Optimize-explosions.patch (renamed from patches/server/0044-Optimize-explosions.patch)4
-rw-r--r--patches/server/0044-Disable-explosion-knockback.patch (renamed from patches/server/0045-Disable-explosion-knockback.patch)0
-rw-r--r--patches/server/0045-Disable-thunder.patch (renamed from patches/server/0046-Disable-thunder.patch)2
-rw-r--r--patches/server/0046-Disable-ice-and-snow.patch (renamed from patches/server/0047-Disable-ice-and-snow.patch)2
-rw-r--r--patches/server/0047-Configurable-mob-spawner-tick-rate.patch (renamed from patches/server/0048-Configurable-mob-spawner-tick-rate.patch)0
-rw-r--r--patches/server/0048-Use-null-Locale-by-default.patch (renamed from patches/server/0049-Use-null-Locale-by-default.patch)8
-rw-r--r--patches/server/0049-Add-BeaconEffectEvent.patch (renamed from patches/server/0050-Add-BeaconEffectEvent.patch)0
-rw-r--r--patches/server/0050-Configurable-container-update-tick-rate.patch (renamed from patches/server/0051-Configurable-container-update-tick-rate.patch)4
-rw-r--r--patches/server/0051-Use-UserCache-for-player-heads.patch (renamed from patches/server/0052-Use-UserCache-for-player-heads.patch)0
-rw-r--r--patches/server/0052-Disable-spigot-tick-limiters.patch (renamed from patches/server/0053-Disable-spigot-tick-limiters.patch)0
-rw-r--r--patches/server/0053-Fix-spawn-location-event-changing-location.patch (renamed from patches/server/0054-Fix-spawn-location-event-changing-location.patch)0
-rw-r--r--patches/server/0054-Configurable-Disabling-Cat-Chest-Detection.patch (renamed from patches/server/0055-Configurable-Disabling-Cat-Chest-Detection.patch)0
-rw-r--r--patches/server/0055-Improve-Player-chat-API-handling.patch (renamed from patches/server/0056-Improve-Player-chat-API-handling.patch)2
-rw-r--r--patches/server/0056-All-chunks-are-slime-spawn-chunks-toggle.patch (renamed from patches/server/0057-All-chunks-are-slime-spawn-chunks-toggle.patch)0
-rw-r--r--patches/server/0057-Expose-server-CommandMap.patch (renamed from patches/server/0058-Expose-server-CommandMap.patch)0
-rw-r--r--patches/server/0058-Be-a-bit-more-informative-in-maxHealth-exception.patch (renamed from patches/server/0059-Be-a-bit-more-informative-in-maxHealth-exception.patch)0
-rw-r--r--patches/server/0059-Player-Tab-List-and-Title-APIs.patch (renamed from patches/server/0060-Player-Tab-List-and-Title-APIs.patch)2
-rw-r--r--patches/server/0060-Add-configurable-portal-search-radius.patch (renamed from patches/server/0061-Add-configurable-portal-search-radius.patch)0
-rw-r--r--patches/server/0061-Add-velocity-warnings.patch (renamed from patches/server/0062-Add-velocity-warnings.patch)0
-rw-r--r--patches/server/0062-Add-exception-reporting-event.patch (renamed from patches/server/0063-Add-exception-reporting-event.patch)0
-rw-r--r--patches/server/0063-Disable-Scoreboards-for-non-players-by-default.patch (renamed from patches/server/0064-Disable-Scoreboards-for-non-players-by-default.patch)0
-rw-r--r--patches/server/0064-Add-methods-for-working-with-arrows-stuck-in-living-.patch (renamed from patches/server/0065-Add-methods-for-working-with-arrows-stuck-in-living-.patch)0
-rw-r--r--patches/server/0065-Chunk-Save-Reattempt.patch (renamed from patches/server/0066-Chunk-Save-Reattempt.patch)0
-rw-r--r--patches/server/0066-Complete-resource-pack-API.patch (renamed from patches/server/0067-Complete-resource-pack-API.patch)2
-rw-r--r--patches/server/0067-Default-loading-permissions.yml-before-plugins.patch (renamed from patches/server/0068-Default-loading-permissions.yml-before-plugins.patch)0
-rw-r--r--patches/server/0068-Allow-Reloading-of-Custom-Permissions.patch (renamed from patches/server/0069-Allow-Reloading-of-Custom-Permissions.patch)0
-rw-r--r--patches/server/0069-Remove-Metadata-on-reload.patch (renamed from patches/server/0070-Remove-Metadata-on-reload.patch)0
-rw-r--r--patches/server/0070-Handle-Item-Meta-Inconsistencies.patch (renamed from patches/server/0071-Handle-Item-Meta-Inconsistencies.patch)0
-rw-r--r--patches/server/0071-Configurable-Non-Player-Arrow-Despawn-Rate.patch (renamed from patches/server/0072-Configurable-Non-Player-Arrow-Despawn-Rate.patch)0
-rw-r--r--patches/server/0072-Add-World-Util-Methods.patch (renamed from patches/server/0073-Add-World-Util-Methods.patch)0
-rw-r--r--patches/server/0073-Custom-replacement-for-eaten-items.patch (renamed from patches/server/0074-Custom-replacement-for-eaten-items.patch)0
-rw-r--r--patches/server/0074-handle-NaN-health-absorb-values-and-repair-bad-data.patch (renamed from patches/server/0075-handle-NaN-health-absorb-values-and-repair-bad-data.patch)2
-rw-r--r--patches/server/0075-Use-a-Shared-Random-for-Entities.patch (renamed from patches/server/0076-Use-a-Shared-Random-for-Entities.patch)0
-rw-r--r--patches/server/0076-Configurable-spawn-chances-for-skeleton-horses.patch (renamed from patches/server/0077-Configurable-spawn-chances-for-skeleton-horses.patch)2
-rw-r--r--patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch (renamed from patches/server/0078-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch)6
-rw-r--r--patches/server/0078-Entity-AddTo-RemoveFrom-World-Events.patch (renamed from patches/server/0079-Entity-AddTo-RemoveFrom-World-Events.patch)2
-rw-r--r--patches/server/0079-Configurable-Chunk-Inhabited-Time.patch (renamed from patches/server/0080-Configurable-Chunk-Inhabited-Time.patch)0
-rw-r--r--patches/server/0080-EntityPathfindEvent.patch (renamed from patches/server/0081-EntityPathfindEvent.patch)0
-rw-r--r--patches/server/0081-Sanitise-RegionFileCache-and-make-configurable.patch (renamed from patches/server/0082-Sanitise-RegionFileCache-and-make-configurable.patch)0
-rw-r--r--patches/server/0082-Do-not-load-chunks-for-Pathfinding.patch (renamed from patches/server/0083-Do-not-load-chunks-for-Pathfinding.patch)0
-rw-r--r--patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch (renamed from patches/server/0084-Add-PlayerUseUnknownEntityEvent.patch)0
-rw-r--r--patches/server/0084-Configurable-random-tick-rates-for-blocks.patch (renamed from patches/server/0085-Configurable-random-tick-rates-for-blocks.patch)0
-rw-r--r--patches/server/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch (renamed from patches/server/0086-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch)2
-rw-r--r--patches/server/0086-Optimize-DataBits.patch (renamed from patches/server/0087-Optimize-DataBits.patch)0
-rw-r--r--patches/server/0087-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch (renamed from patches/server/0088-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch)0
-rw-r--r--patches/server/0088-Configurable-Player-Collision.patch (renamed from patches/server/0089-Configurable-Player-Collision.patch)2
-rw-r--r--patches/server/0089-Add-handshake-event-to-allow-plugins-to-handle-clien.patch (renamed from patches/server/0090-Add-handshake-event-to-allow-plugins-to-handle-clien.patch)0
-rw-r--r--patches/server/0090-Configurable-RCON-IP-address.patch (renamed from patches/server/0091-Configurable-RCON-IP-address.patch)0
-rw-r--r--patches/server/0091-EntityRegainHealthEvent-isFastRegen-API.patch (renamed from patches/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch)0
-rw-r--r--patches/server/0092-Add-ability-to-configure-frosted_ice-properties.patch (renamed from patches/server/0093-Add-ability-to-configure-frosted_ice-properties.patch)0
-rw-r--r--patches/server/0093-remove-null-possibility-for-getServer-singleton.patch (renamed from patches/server/0094-remove-null-possibility-for-getServer-singleton.patch)4
-rw-r--r--patches/server/0094-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch (renamed from patches/server/0095-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch)0
-rw-r--r--patches/server/0095-LootTable-API-and-replenishable-lootables.patch (renamed from patches/server/0096-LootTable-API-and-replenishable-lootables.patch)0
-rw-r--r--patches/server/0096-System-property-for-disabling-watchdoge.patch (renamed from patches/server/0097-System-property-for-disabling-watchdoge.patch)0
-rw-r--r--patches/server/0097-Async-GameProfileCache-saving.patch (renamed from patches/server/0098-Async-GameProfileCache-saving.patch)2
-rw-r--r--patches/server/0098-Optional-TNT-doesn-t-move-in-water.patch (renamed from patches/server/0099-Optional-TNT-doesn-t-move-in-water.patch)0
-rw-r--r--patches/server/0099-Faster-redstone-torch-rapid-clock-removal.patch (renamed from patches/server/0100-Faster-redstone-torch-rapid-clock-removal.patch)0
-rw-r--r--patches/server/0100-Add-server-name-parameter.patch (renamed from patches/server/0101-Add-server-name-parameter.patch)2
-rw-r--r--patches/server/0101-Fix-global-sound-handling.patch (renamed from patches/server/0102-Fix-global-sound-handling.patch)2
-rw-r--r--patches/server/0102-Avoid-blocking-on-Network-Manager-creation.patch (renamed from patches/server/0103-Avoid-blocking-on-Network-Manager-creation.patch)0
-rw-r--r--patches/server/0103-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch (renamed from patches/server/0104-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch)0
-rw-r--r--patches/server/0104-Add-setting-for-proxy-online-mode-status.patch (renamed from patches/server/0105-Add-setting-for-proxy-online-mode-status.patch)0
-rw-r--r--patches/server/0105-Optimise-BlockState-s-hashCode-equals.patch (renamed from patches/server/0106-Optimise-BlockState-s-hashCode-equals.patch)0
-rw-r--r--patches/server/0106-Configurable-packet-in-spam-threshold.patch (renamed from patches/server/0107-Configurable-packet-in-spam-threshold.patch)0
-rw-r--r--patches/server/0107-Configurable-flying-kick-messages.patch (renamed from patches/server/0108-Configurable-flying-kick-messages.patch)0
-rw-r--r--patches/server/0108-Add-EntityZapEvent.patch (renamed from patches/server/0109-Add-EntityZapEvent.patch)0
-rw-r--r--patches/server/0109-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch (renamed from patches/server/0110-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch)0
-rw-r--r--patches/server/0110-Cache-user-authenticator-threads.patch (renamed from patches/server/0111-Cache-user-authenticator-threads.patch)0
-rw-r--r--patches/server/0111-Allow-Reloading-of-Command-Aliases.patch (renamed from patches/server/0112-Allow-Reloading-of-Command-Aliases.patch)0
-rw-r--r--patches/server/0112-Add-source-to-PlayerExpChangeEvent.patch (renamed from patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch)0
-rw-r--r--patches/server/0113-Add-ProjectileCollideEvent.patch (renamed from patches/server/0114-Add-ProjectileCollideEvent.patch)0
-rw-r--r--patches/server/0114-Prevent-Pathfinding-out-of-World-Border.patch (renamed from patches/server/0115-Prevent-Pathfinding-out-of-World-Border.patch)0
-rw-r--r--patches/server/0115-Optimize-Level.hasChunkAt-BlockPosition-Z.patch (renamed from patches/server/0116-Optimize-Level.hasChunkAt-BlockPosition-Z.patch)0
-rw-r--r--patches/server/0116-Bound-Treasure-Maps-to-World-Border.patch (renamed from patches/server/0117-Bound-Treasure-Maps-to-World-Border.patch)0
-rw-r--r--patches/server/0117-Configurable-Cartographer-Treasure-Maps.patch (renamed from patches/server/0118-Configurable-Cartographer-Treasure-Maps.patch)0
-rw-r--r--patches/server/0118-Add-API-methods-to-control-if-armor-stands-can-move.patch (renamed from patches/server/0119-Add-API-methods-to-control-if-armor-stands-can-move.patch)0
-rw-r--r--patches/server/0119-String-based-Action-Bar-API.patch (renamed from patches/server/0120-String-based-Action-Bar-API.patch)2
-rw-r--r--patches/server/0120-Properly-fix-item-duplication-bug.patch (renamed from patches/server/0121-Properly-fix-item-duplication-bug.patch)4
-rw-r--r--patches/server/0121-Firework-API-s.patch (renamed from patches/server/0122-Firework-API-s.patch)0
-rw-r--r--patches/server/0122-PlayerTeleportEndGatewayEvent.patch (renamed from patches/server/0123-PlayerTeleportEndGatewayEvent.patch)4
-rw-r--r--patches/server/0123-Provide-E-TE-Chunk-count-stat-methods.patch (renamed from patches/server/0124-Provide-E-TE-Chunk-count-stat-methods.patch)6
-rw-r--r--patches/server/0124-Enforce-Sync-Player-Saves.patch (renamed from patches/server/0125-Enforce-Sync-Player-Saves.patch)0
-rw-r--r--patches/server/0125-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch (renamed from patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch)0
-rw-r--r--patches/server/0126-Cap-Entity-Collisions.patch (renamed from patches/server/0127-Cap-Entity-Collisions.patch)0
-rw-r--r--patches/server/0127-Remove-CraftScheduler-Async-Task-Debugger.patch (renamed from patches/server/0128-Remove-CraftScheduler-Async-Task-Debugger.patch)0
-rw-r--r--patches/server/0128-Properly-handle-async-calls-to-restart-the-server.patch (renamed from patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch)2
-rw-r--r--patches/server/0129-Add-option-to-make-parrots-stay-on-shoulders-despite.patch (renamed from patches/server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch)0
-rw-r--r--patches/server/0130-Add-configuration-option-to-prevent-player-names-fro.patch (renamed from patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch)0
-rw-r--r--patches/server/0131-provide-a-configurable-option-to-disable-creeper-lin.patch (renamed from patches/server/0132-provide-a-configurable-option-to-disable-creeper-lin.patch)2
-rw-r--r--patches/server/0132-Item-canEntityPickup.patch (renamed from patches/server/0133-Item-canEntityPickup.patch)0
-rw-r--r--patches/server/0133-PlayerPickupItemEvent-setFlyAtPlayer.patch (renamed from patches/server/0134-PlayerPickupItemEvent-setFlyAtPlayer.patch)0
-rw-r--r--patches/server/0134-PlayerAttemptPickupItemEvent.patch (renamed from patches/server/0135-PlayerAttemptPickupItemEvent.patch)0
-rw-r--r--patches/server/0135-Do-not-submit-profile-lookups-to-worldgen-threads.patch (renamed from patches/server/0136-Do-not-submit-profile-lookups-to-worldgen-threads.patch)0
-rw-r--r--patches/server/0136-Basic-PlayerProfile-API.patch (renamed from patches/server/0137-Basic-PlayerProfile-API.patch)0
-rw-r--r--patches/server/0137-Add-UnknownCommandEvent.patch (renamed from patches/server/0138-Add-UnknownCommandEvent.patch)0
-rw-r--r--patches/server/0138-Shoulder-Entities-Release-API.patch (renamed from patches/server/0139-Shoulder-Entities-Release-API.patch)0
-rw-r--r--patches/server/0139-Profile-Lookup-Events.patch (renamed from patches/server/0140-Profile-Lookup-Events.patch)0
-rw-r--r--patches/server/0140-Block-player-logins-during-server-shutdown.patch (renamed from patches/server/0141-Block-player-logins-during-server-shutdown.patch)0
-rw-r--r--patches/server/0141-Entity-fromMobSpawner.patch (renamed from patches/server/0142-Entity-fromMobSpawner.patch)0
-rw-r--r--patches/server/0142-Improve-the-Saddle-API-for-Horses.patch (renamed from patches/server/0143-Improve-the-Saddle-API-for-Horses.patch)0
-rw-r--r--patches/server/0143-ensureServerConversions-API.patch (renamed from patches/server/0144-ensureServerConversions-API.patch)0
-rw-r--r--patches/server/0144-Implement-getI18NDisplayName.patch (renamed from patches/server/0145-Implement-getI18NDisplayName.patch)0
-rw-r--r--patches/server/0145-ProfileWhitelistVerifyEvent.patch (renamed from patches/server/0146-ProfileWhitelistVerifyEvent.patch)0
-rw-r--r--patches/server/0146-Fix-this-stupid-bullshit.patch (renamed from patches/server/0147-Fix-this-stupid-bullshit.patch)0
-rw-r--r--patches/server/0147-LivingEntity-setKiller.patch (renamed from patches/server/0148-LivingEntity-setKiller.patch)0
-rw-r--r--patches/server/0148-Ocelot-despawns-should-honor-nametags-and-leash.patch (renamed from patches/server/0149-Ocelot-despawns-should-honor-nametags-and-leash.patch)0
-rw-r--r--patches/server/0149-Reset-spawner-timer-when-spawner-event-is-cancelled.patch (renamed from patches/server/0150-Reset-spawner-timer-when-spawner-event-is-cancelled.patch)0
-rw-r--r--patches/server/0150-Allow-specifying-a-custom-authentication-servers-dow.patch (renamed from patches/server/0151-Allow-specifying-a-custom-authentication-servers-dow.patch)0
-rw-r--r--patches/server/0151-Add-PlayerJumpEvent.patch (renamed from patches/server/0152-Add-PlayerJumpEvent.patch)0
-rw-r--r--patches/server/0152-handle-ServerboundKeepAlivePacket-async.patch (renamed from patches/server/0153-handle-ServerboundKeepAlivePacket-async.patch)0
-rw-r--r--patches/server/0153-Expose-client-protocol-version-and-virtual-host.patch (renamed from patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch)2
-rw-r--r--patches/server/0154-revert-serverside-behavior-of-keepalives.patch (renamed from patches/server/0155-revert-serverside-behavior-of-keepalives.patch)0
-rw-r--r--patches/server/0155-Send-attack-SoundEffects-only-to-players-who-can-see.patch (renamed from patches/server/0156-Send-attack-SoundEffects-only-to-players-who-can-see.patch)0
-rw-r--r--patches/server/0156-Add-PlayerArmorChangeEvent.patch (renamed from patches/server/0157-Add-PlayerArmorChangeEvent.patch)0
-rw-r--r--patches/server/0157-Prevent-logins-from-being-processed-when-the-player-.patch (renamed from patches/server/0158-Prevent-logins-from-being-processed-when-the-player-.patch)0
-rw-r--r--patches/server/0158-Fix-MC-117075-Block-entity-unload-lag-spike.patch (renamed from patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch)0
-rw-r--r--patches/server/0159-use-CB-BlockState-implementations-for-captured-block.patch (renamed from patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch)0
-rw-r--r--patches/server/0160-API-to-get-a-BlockState-without-a-snapshot.patch (renamed from patches/server/0161-API-to-get-a-BlockState-without-a-snapshot.patch)0
-rw-r--r--patches/server/0161-AsyncTabCompleteEvent.patch (renamed from patches/server/0162-AsyncTabCompleteEvent.patch)0
-rw-r--r--patches/server/0162-PlayerPickupExperienceEvent.patch (renamed from patches/server/0163-PlayerPickupExperienceEvent.patch)0
-rw-r--r--patches/server/0163-Ability-to-apply-mending-to-XP-API.patch (renamed from patches/server/0164-Ability-to-apply-mending-to-XP-API.patch)2
-rw-r--r--patches/server/0164-PlayerNaturallySpawnCreaturesEvent.patch (renamed from patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch)16
-rw-r--r--patches/server/0165-Add-setPlayerProfile-API-for-Skulls.patch (renamed from patches/server/0166-Add-setPlayerProfile-API-for-Skulls.patch)2
-rw-r--r--patches/server/0166-PreCreatureSpawnEvent.patch (renamed from patches/server/0167-PreCreatureSpawnEvent.patch)0
-rw-r--r--patches/server/0167-Fill-Profile-Property-Events.patch (renamed from patches/server/0168-Fill-Profile-Property-Events.patch)0
-rw-r--r--patches/server/0168-Add-PlayerAdvancementCriterionGrantEvent.patch (renamed from patches/server/0169-Add-PlayerAdvancementCriterionGrantEvent.patch)0
-rw-r--r--patches/server/0169-Add-ArmorStand-Item-Meta.patch (renamed from patches/server/0170-Add-ArmorStand-Item-Meta.patch)0
-rw-r--r--patches/server/0170-Extend-Player-Interact-cancellation.patch (renamed from patches/server/0171-Extend-Player-Interact-cancellation.patch)0
-rw-r--r--patches/server/0171-Tameable-getOwnerUniqueId-API.patch (renamed from patches/server/0172-Tameable-getOwnerUniqueId-API.patch)0
-rw-r--r--patches/server/0172-Toggleable-player-crits.patch (renamed from patches/server/0173-Toggleable-player-crits.patch)0
-rw-r--r--patches/server/0173-Disable-Explicit-Network-Manager-Flushing.patch (renamed from patches/server/0174-Disable-Explicit-Network-Manager-Flushing.patch)0
-rw-r--r--patches/server/0174-Implement-extended-PaperServerListPingEvent.patch (renamed from patches/server/0175-Implement-extended-PaperServerListPingEvent.patch)6
-rw-r--r--patches/server/0175-Add-more-fields-to-AsyncPreLoginEvent.patch (renamed from patches/server/0176-Add-more-fields-to-AsyncPreLoginEvent.patch)0
-rw-r--r--patches/server/0176-Player.setPlayerProfile-API.patch (renamed from patches/server/0177-Player.setPlayerProfile-API.patch)2
-rw-r--r--patches/server/0177-getPlayerUniqueId-API.patch (renamed from patches/server/0178-getPlayerUniqueId-API.patch)0
-rw-r--r--patches/server/0178-Improved-Async-Task-Scheduler.patch (renamed from patches/server/0179-Improved-Async-Task-Scheduler.patch)0
-rw-r--r--patches/server/0179-Make-legacy-ping-handler-more-reliable.patch (renamed from patches/server/0180-Make-legacy-ping-handler-more-reliable.patch)0
-rw-r--r--patches/server/0180-Call-PaperServerListPingEvent-for-legacy-pings.patch (renamed from patches/server/0181-Call-PaperServerListPingEvent-for-legacy-pings.patch)0
-rw-r--r--patches/server/0181-Flag-to-disable-the-channel-limit.patch (renamed from patches/server/0182-Flag-to-disable-the-channel-limit.patch)2
-rw-r--r--patches/server/0182-Add-openSign-method-to-HumanEntity.patch (renamed from patches/server/0183-Add-openSign-method-to-HumanEntity.patch)0
-rw-r--r--patches/server/0183-Configurable-sprint-interruption-on-attack.patch (renamed from patches/server/0184-Configurable-sprint-interruption-on-attack.patch)0
-rw-r--r--patches/server/0184-EndermanEscapeEvent.patch (renamed from patches/server/0185-EndermanEscapeEvent.patch)0
-rw-r--r--patches/server/0185-Enderman.teleportRandomly.patch (renamed from patches/server/0186-Enderman.teleportRandomly.patch)0
-rw-r--r--patches/server/0186-Block-Enderpearl-Travel-Exploit.patch (renamed from patches/server/0187-Block-Enderpearl-Travel-Exploit.patch)2
-rw-r--r--patches/server/0187-Expand-World.spawnParticle-API-and-add-Builder.patch (renamed from patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch)4
-rw-r--r--patches/server/0188-Fix-exploit-that-allowed-colored-signs-to-be-created.patch (renamed from patches/server/0189-Fix-exploit-that-allowed-colored-signs-to-be-created.patch)0
-rw-r--r--patches/server/0189-EndermanAttackPlayerEvent.patch (renamed from patches/server/0190-EndermanAttackPlayerEvent.patch)0
-rw-r--r--patches/server/0190-WitchConsumePotionEvent.patch (renamed from patches/server/0191-WitchConsumePotionEvent.patch)0
-rw-r--r--patches/server/0191-WitchThrowPotionEvent.patch (renamed from patches/server/0192-WitchThrowPotionEvent.patch)0
-rw-r--r--patches/server/0192-WitchReadyPotionEvent.patch (renamed from patches/server/0193-WitchReadyPotionEvent.patch)0
-rw-r--r--patches/server/0193-ItemStack-getMaxItemUseDuration.patch (renamed from patches/server/0194-ItemStack-getMaxItemUseDuration.patch)0
-rw-r--r--patches/server/0194-Add-EntityTeleportEndGatewayEvent.patch (renamed from patches/server/0195-Add-EntityTeleportEndGatewayEvent.patch)0
-rw-r--r--patches/server/0195-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch (renamed from patches/server/0196-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch)2
-rw-r--r--patches/server/0196-Fix-CraftEntity-hashCode.patch (renamed from patches/server/0197-Fix-CraftEntity-hashCode.patch)0
-rw-r--r--patches/server/0197-Configurable-LootPool-luck-formula.patch (renamed from patches/server/0198-Configurable-LootPool-luck-formula.patch)0
-rw-r--r--patches/server/0198-Print-Error-details-when-failing-to-save-player-data.patch (renamed from patches/server/0199-Print-Error-details-when-failing-to-save-player-data.patch)0
-rw-r--r--patches/server/0199-Make-shield-blocking-delay-configurable.patch (renamed from patches/server/0200-Make-shield-blocking-delay-configurable.patch)0
-rw-r--r--patches/server/0200-Improve-EntityShootBowEvent.patch (renamed from patches/server/0201-Improve-EntityShootBowEvent.patch)0
-rw-r--r--patches/server/0201-PlayerReadyArrowEvent.patch (renamed from patches/server/0202-PlayerReadyArrowEvent.patch)0
-rw-r--r--patches/server/0202-Add-entity-knockback-events.patch (renamed from patches/server/0203-Add-entity-knockback-events.patch)0
-rw-r--r--patches/server/0203-Expand-Explosions-API.patch (renamed from patches/server/0204-Expand-Explosions-API.patch)2
-rw-r--r--patches/server/0204-LivingEntity-Active-Item-API.patch (renamed from patches/server/0205-LivingEntity-Active-Item-API.patch)0
-rw-r--r--patches/server/0205-RangedEntity-API.patch (renamed from patches/server/0206-RangedEntity-API.patch)0
-rw-r--r--patches/server/0206-Add-config-to-disable-ender-dragon-legacy-check.patch (renamed from patches/server/0207-Add-config-to-disable-ender-dragon-legacy-check.patch)0
-rw-r--r--patches/server/0207-Implement-World.getEntity-UUID-API.patch (renamed from patches/server/0208-Implement-World.getEntity-UUID-API.patch)2
-rw-r--r--patches/server/0208-InventoryCloseEvent-Reason-API.patch (renamed from patches/server/0209-InventoryCloseEvent-Reason-API.patch)14
-rw-r--r--patches/server/0209-Vex-get-setSummoner-API.patch (renamed from patches/server/0210-Vex-get-setSummoner-API.patch)0
-rw-r--r--patches/server/0210-Refresh-player-inventory-when-cancelling-PlayerInter.patch (renamed from patches/server/0211-Refresh-player-inventory-when-cancelling-PlayerInter.patch)0
-rw-r--r--patches/server/0211-add-more-information-to-Entity.toString.patch (renamed from patches/server/0212-add-more-information-to-Entity.toString.patch)0
-rw-r--r--patches/server/0212-EnderDragon-Events.patch (renamed from patches/server/0213-EnderDragon-Events.patch)0
-rw-r--r--patches/server/0213-PlayerElytraBoostEvent.patch (renamed from patches/server/0214-PlayerElytraBoostEvent.patch)0
-rw-r--r--patches/server/0214-PlayerLaunchProjectileEvent.patch (renamed from patches/server/0215-PlayerLaunchProjectileEvent.patch)0
-rw-r--r--patches/server/0215-Improve-BlockPosition-inlining.patch (renamed from patches/server/0216-Improve-BlockPosition-inlining.patch)0
-rw-r--r--patches/server/0216-Option-to-prevent-armor-stands-from-doing-entity-loo.patch (renamed from patches/server/0217-Option-to-prevent-armor-stands-from-doing-entity-loo.patch)0
-rw-r--r--patches/server/0217-Vanished-players-don-t-have-rights.patch (renamed from patches/server/0218-Vanished-players-don-t-have-rights.patch)0
-rw-r--r--patches/server/0218-Allow-disabling-armor-stand-ticking.patch (renamed from patches/server/0219-Allow-disabling-armor-stand-ticking.patch)0
-rw-r--r--patches/server/0219-SkeletonHorse-Additions.patch (renamed from patches/server/0220-SkeletonHorse-Additions.patch)0
-rw-r--r--patches/server/0220-Expand-ArmorStand-API.patch (renamed from patches/server/0221-Expand-ArmorStand-API.patch)0
-rw-r--r--patches/server/0221-AnvilDamageEvent.patch (renamed from patches/server/0222-AnvilDamageEvent.patch)0
-rw-r--r--patches/server/0222-Add-TNTPrimeEvent.patch (renamed from patches/server/0223-Add-TNTPrimeEvent.patch)0
-rw-r--r--patches/server/0223-Break-up-and-make-tab-spam-limits-configurable.patch (renamed from patches/server/0224-Break-up-and-make-tab-spam-limits-configurable.patch)0
-rw-r--r--patches/server/0224-Fix-NBT-type-issues.patch (renamed from patches/server/0225-Fix-NBT-type-issues.patch)0
-rw-r--r--patches/server/0225-Remove-unnecessary-itemmeta-handling.patch (renamed from patches/server/0226-Remove-unnecessary-itemmeta-handling.patch)0
-rw-r--r--patches/server/0226-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch (renamed from patches/server/0227-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch)8
-rw-r--r--patches/server/0227-Add-Early-Warning-Feature-to-WatchDog.patch (renamed from patches/server/0228-Add-Early-Warning-Feature-to-WatchDog.patch)2
-rw-r--r--patches/server/0228-Use-ConcurrentHashMap-in-JsonList.patch (renamed from patches/server/0229-Use-ConcurrentHashMap-in-JsonList.patch)0
-rw-r--r--patches/server/0229-Use-a-Queue-for-Queueing-Commands.patch (renamed from patches/server/0230-Use-a-Queue-for-Queueing-Commands.patch)0
-rw-r--r--patches/server/0230-Ability-to-get-block-entities-from-a-chunk-without-s.patch (renamed from patches/server/0231-Ability-to-get-block-entities-from-a-chunk-without-s.patch)0
-rw-r--r--patches/server/0231-Optimize-BlockPosition-helper-methods.patch (renamed from patches/server/0232-Optimize-BlockPosition-helper-methods.patch)0
-rw-r--r--patches/server/0232-Restore-vanilla-default-mob-spawn-range-and-water-an.patch (renamed from patches/server/0233-Restore-vanilla-default-mob-spawn-range-and-water-an.patch)0
-rw-r--r--patches/server/0233-Slime-Pathfinder-Events.patch (renamed from patches/server/0234-Slime-Pathfinder-Events.patch)0
-rw-r--r--patches/server/0234-Configurable-speed-for-water-flowing-over-lava.patch (renamed from patches/server/0235-Configurable-speed-for-water-flowing-over-lava.patch)0
-rw-r--r--patches/server/0235-Optimize-CraftBlockData-Creation.patch (renamed from patches/server/0236-Optimize-CraftBlockData-Creation.patch)0
-rw-r--r--patches/server/0236-Optimize-MappedRegistry.patch (renamed from patches/server/0237-Optimize-MappedRegistry.patch)0
-rw-r--r--patches/server/0237-Add-PhantomPreSpawnEvent.patch (renamed from patches/server/0238-Add-PhantomPreSpawnEvent.patch)0
-rw-r--r--patches/server/0238-Add-More-Creeper-API.patch (renamed from patches/server/0239-Add-More-Creeper-API.patch)0
-rw-r--r--patches/server/0239-Inventory-removeItemAnySlot.patch (renamed from patches/server/0240-Inventory-removeItemAnySlot.patch)0
-rw-r--r--patches/server/0240-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch (renamed from patches/server/0241-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch)2
-rw-r--r--patches/server/0241-Add-ray-tracing-methods-to-LivingEntity.patch (renamed from patches/server/0242-Add-ray-tracing-methods-to-LivingEntity.patch)0
-rw-r--r--patches/server/0242-Expose-attack-cooldown-methods-for-Player.patch (renamed from patches/server/0243-Expose-attack-cooldown-methods-for-Player.patch)2
-rw-r--r--patches/server/0243-Improve-death-events.patch (renamed from patches/server/0244-Improve-death-events.patch)10
-rw-r--r--patches/server/0244-Allow-chests-to-be-placed-with-NBT-data.patch (renamed from patches/server/0245-Allow-chests-to-be-placed-with-NBT-data.patch)0
-rw-r--r--patches/server/0245-Mob-Pathfinding-API.patch (renamed from patches/server/0246-Mob-Pathfinding-API.patch)0
-rw-r--r--patches/server/0246-Prevent-various-interactions-from-causing-chunk-load.patch (renamed from patches/server/0247-Prevent-various-interactions-from-causing-chunk-load.patch)0
-rw-r--r--patches/server/0247-Prevent-mob-spawning-from-loading-generating-chunks.patch (renamed from patches/server/0248-Prevent-mob-spawning-from-loading-generating-chunks.patch)0
-rw-r--r--patches/server/0248-Implement-furnace-cook-speed-multiplier-API.patch (renamed from patches/server/0249-Implement-furnace-cook-speed-multiplier-API.patch)0
-rw-r--r--patches/server/0249-Honor-EntityAgeable.ageLock.patch (renamed from patches/server/0250-Honor-EntityAgeable.ageLock.patch)2
-rw-r--r--patches/server/0250-Configurable-connection-throttle-kick-message.patch (renamed from patches/server/0251-Configurable-connection-throttle-kick-message.patch)0
-rw-r--r--patches/server/0251-Prevent-chunk-loading-from-Fluid-Flowing.patch (renamed from patches/server/0252-Prevent-chunk-loading-from-Fluid-Flowing.patch)0
-rw-r--r--patches/server/0252-PreSpawnerSpawnEvent.patch (renamed from patches/server/0253-PreSpawnerSpawnEvent.patch)0
-rw-r--r--patches/server/0253-Add-LivingEntity-getTargetEntity.patch (renamed from patches/server/0254-Add-LivingEntity-getTargetEntity.patch)0
-rw-r--r--patches/server/0254-Add-sun-related-API.patch (renamed from patches/server/0255-Add-sun-related-API.patch)2
-rw-r--r--patches/server/0255-Turtle-API.patch (renamed from patches/server/0256-Turtle-API.patch)0
-rw-r--r--patches/server/0256-Call-player-spectator-target-events-and-improve-impl.patch (renamed from patches/server/0257-Call-player-spectator-target-events-and-improve-impl.patch)4
-rw-r--r--patches/server/0257-Add-more-Witch-API.patch (renamed from patches/server/0258-Add-more-Witch-API.patch)0
-rw-r--r--patches/server/0258-Check-Drowned-for-Villager-Aggression-Config.patch (renamed from patches/server/0259-Check-Drowned-for-Villager-Aggression-Config.patch)0
-rw-r--r--patches/server/0259-Add-option-to-prevent-players-from-moving-into-unloa.patch (renamed from patches/server/0260-Add-option-to-prevent-players-from-moving-into-unloa.patch)0
-rw-r--r--patches/server/0260-Reset-players-airTicks-on-respawn.patch (renamed from patches/server/0261-Reset-players-airTicks-on-respawn.patch)4
-rw-r--r--patches/server/0261-Don-t-sleep-after-profile-lookups-if-not-needed.patch (renamed from patches/server/0262-Don-t-sleep-after-profile-lookups-if-not-needed.patch)0
-rw-r--r--patches/server/0262-Improve-Server-Thread-Pool-and-Thread-Priorities.patch (renamed from patches/server/0263-Improve-Server-Thread-Pool-and-Thread-Priorities.patch)2
-rw-r--r--patches/server/0263-Optimize-World-Time-Updates.patch (renamed from patches/server/0264-Optimize-World-Time-Updates.patch)4
-rw-r--r--patches/server/0264-Restore-custom-InventoryHolder-support.patch (renamed from patches/server/0265-Restore-custom-InventoryHolder-support.patch)0
-rw-r--r--patches/server/0265-Fix-SpongeAbsortEvent-handling.patch (renamed from patches/server/0266-Fix-SpongeAbsortEvent-handling.patch)0
-rw-r--r--patches/server/0266-Don-t-allow-digging-into-unloaded-chunks.patch (renamed from patches/server/0267-Don-t-allow-digging-into-unloaded-chunks.patch)0
-rw-r--r--patches/server/0267-Make-the-default-permission-message-configurable.patch (renamed from patches/server/0268-Make-the-default-permission-message-configurable.patch)0
-rw-r--r--patches/server/0268-force-entity-dismount-during-teleportation.patch (renamed from patches/server/0269-force-entity-dismount-during-teleportation.patch)4
-rw-r--r--patches/server/0269-Add-more-Zombie-API.patch (renamed from patches/server/0270-Add-more-Zombie-API.patch)0
-rw-r--r--patches/server/0270-Book-Size-Limits.patch (renamed from patches/server/0271-Book-Size-Limits.patch)0
-rw-r--r--patches/server/0271-Add-PlayerConnectionCloseEvent.patch (renamed from patches/server/0272-Add-PlayerConnectionCloseEvent.patch)0
-rw-r--r--patches/server/0272-Replace-OfflinePlayer-getLastPlayed.patch (renamed from patches/server/0273-Replace-OfflinePlayer-getLastPlayed.patch)4
-rw-r--r--patches/server/0273-Workaround-for-vehicle-tracking-issue-on-disconnect.patch (renamed from patches/server/0274-Workaround-for-vehicle-tracking-issue-on-disconnect.patch)4
-rw-r--r--patches/server/0274-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch (renamed from patches/server/0275-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch)2
-rw-r--r--patches/server/0275-BlockDestroyEvent.patch (renamed from patches/server/0276-BlockDestroyEvent.patch)0
-rw-r--r--patches/server/0276-Async-command-map-building.patch (renamed from patches/server/0277-Async-command-map-building.patch)2
-rw-r--r--patches/server/0277-Brigadier-Mojang-API.patch (renamed from patches/server/0278-Brigadier-Mojang-API.patch)0
-rw-r--r--patches/server/0278-Improve-exact-choice-recipe-ingredients.patch (renamed from patches/server/0279-Improve-exact-choice-recipe-ingredients.patch)0
-rw-r--r--patches/server/0279-Limit-Client-Sign-length-more.patch (renamed from patches/server/0280-Limit-Client-Sign-length-more.patch)0
-rw-r--r--patches/server/0280-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch (renamed from patches/server/0281-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch)0
-rw-r--r--patches/server/0281-Fixes-and-additions-to-the-spawn-reason-API.patch (renamed from patches/server/0282-Fixes-and-additions-to-the-spawn-reason-API.patch)2
-rw-r--r--patches/server/0282-Fire-event-on-GS4-query.patch (renamed from patches/server/0283-Fire-event-on-GS4-query.patch)0
-rw-r--r--patches/server/0283-Add-PlayerPostRespawnEvent.patch (renamed from patches/server/0284-Add-PlayerPostRespawnEvent.patch)0
-rw-r--r--patches/server/0284-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch (renamed from patches/server/0285-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch)0
-rw-r--r--patches/server/0285-Server-Tick-Events.patch (renamed from patches/server/0286-Server-Tick-Events.patch)4
-rw-r--r--patches/server/0286-PlayerDeathEvent-getItemsToKeep.patch (renamed from patches/server/0287-PlayerDeathEvent-getItemsToKeep.patch)6
-rw-r--r--patches/server/0287-Optimize-Captured-BlockEntity-Lookup.patch (renamed from patches/server/0288-Optimize-Captured-BlockEntity-Lookup.patch)0
-rw-r--r--patches/server/0288-Mob-Spawner-API-Enhancements.patch (renamed from patches/server/0289-Mob-Spawner-API-Enhancements.patch)0
-rw-r--r--patches/server/0289-Fix-CB-call-to-changed-postToMainThread-method.patch (renamed from patches/server/0290-Fix-CB-call-to-changed-postToMainThread-method.patch)0
-rw-r--r--patches/server/0290-Fix-sounds-when-item-frames-are-modified-MC-123450.patch (renamed from patches/server/0291-Fix-sounds-when-item-frames-are-modified-MC-123450.patch)0
-rw-r--r--patches/server/0291-Implement-CraftBlockSoundGroup.patch (renamed from patches/server/0292-Implement-CraftBlockSoundGroup.patch)0
-rw-r--r--patches/server/0292-Expose-the-internal-current-tick.patch (renamed from patches/server/0293-Expose-the-internal-current-tick.patch)0
-rw-r--r--patches/server/0293-Show-blockstate-location-if-we-failed-to-read-it.patch (renamed from patches/server/0294-Show-blockstate-location-if-we-failed-to-read-it.patch)0
-rw-r--r--patches/server/0294-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch (renamed from patches/server/0295-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch)0
-rw-r--r--patches/server/0295-Configurable-projectile-relative-velocity.patch (renamed from patches/server/0296-Configurable-projectile-relative-velocity.patch)0
-rw-r--r--patches/server/0296-offset-item-frame-ticking.patch (renamed from patches/server/0297-offset-item-frame-ticking.patch)0
-rw-r--r--patches/server/0297-Prevent-consuming-the-wrong-itemstack.patch (renamed from patches/server/0298-Prevent-consuming-the-wrong-itemstack.patch)0
-rw-r--r--patches/server/0298-Dont-send-unnecessary-sign-update.patch (renamed from patches/server/0299-Dont-send-unnecessary-sign-update.patch)0
-rw-r--r--patches/server/0299-Add-option-to-disable-pillager-patrols.patch (renamed from patches/server/0300-Add-option-to-disable-pillager-patrols.patch)0
-rw-r--r--patches/server/0300-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch (renamed from patches/server/0301-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch)0
-rw-r--r--patches/server/0301-MC-145656-Fix-Follow-Range-Initial-Target.patch (renamed from patches/server/0302-MC-145656-Fix-Follow-Range-Initial-Target.patch)0
-rw-r--r--patches/server/0302-Duplicate-UUID-Resolve-Option.patch (renamed from patches/server/0303-Duplicate-UUID-Resolve-Option.patch)0
-rw-r--r--patches/server/0303-PlayerDeathEvent-shouldDropExperience.patch (renamed from patches/server/0304-PlayerDeathEvent-shouldDropExperience.patch)4
-rw-r--r--patches/server/0304-Prevent-bees-loading-chunks-checking-hive-position.patch (renamed from patches/server/0305-Prevent-bees-loading-chunks-checking-hive-position.patch)0
-rw-r--r--patches/server/0305-Don-t-load-Chunks-from-Hoppers-and-other-things.patch (renamed from patches/server/0306-Don-t-load-Chunks-from-Hoppers-and-other-things.patch)0
-rw-r--r--patches/server/0306-Optimise-EntityGetter-getPlayerByUUID.patch (renamed from patches/server/0307-Optimise-EntityGetter-getPlayerByUUID.patch)2
-rw-r--r--patches/server/0307-Fix-items-not-falling-correctly.patch (renamed from patches/server/0308-Fix-items-not-falling-correctly.patch)0
-rw-r--r--patches/server/0308-Optimize-call-to-getFluid-for-explosions.patch (renamed from patches/server/0309-Optimize-call-to-getFluid-for-explosions.patch)0
-rw-r--r--patches/server/0309-Guard-against-serializing-mismatching-chunk-coordina.patch (renamed from patches/server/0310-Guard-against-serializing-mismatching-chunk-coordina.patch)0
-rw-r--r--patches/server/0310-Alternative-item-despawn-rate.patch (renamed from patches/server/0311-Alternative-item-despawn-rate.patch)0
-rw-r--r--patches/server/0311-Tracking-Range-Improvements.patch (renamed from patches/server/0312-Tracking-Range-Improvements.patch)4
-rw-r--r--patches/server/0312-Bees-get-gravity-in-void.-Fixes-MC-167279.patch (renamed from patches/server/0313-Bees-get-gravity-in-void.-Fixes-MC-167279.patch)0
-rw-r--r--patches/server/0313-Improve-Block-breakNaturally-API.patch (renamed from patches/server/0314-Improve-Block-breakNaturally-API.patch)0
-rw-r--r--patches/server/0314-Optimise-getChunkAt-calls-for-loaded-chunks.patch (renamed from patches/server/0315-Optimise-getChunkAt-calls-for-loaded-chunks.patch)6
-rw-r--r--patches/server/0315-Add-debug-for-sync-chunk-loads.patch (renamed from patches/server/0316-Add-debug-for-sync-chunk-loads.patch)6
-rw-r--r--patches/server/0316-Improve-java-version-check.patch (renamed from patches/server/0317-Improve-java-version-check.patch)2
-rw-r--r--patches/server/0317-Add-ThrownEggHatchEvent.patch (renamed from patches/server/0318-Add-ThrownEggHatchEvent.patch)0
-rw-r--r--patches/server/0318-Entity-Jump-API.patch (renamed from patches/server/0319-Entity-Jump-API.patch)0
-rw-r--r--patches/server/0319-Add-option-to-nerf-pigmen-from-nether-portals.patch (renamed from patches/server/0320-Add-option-to-nerf-pigmen-from-nether-portals.patch)0
-rw-r--r--patches/server/0320-Make-the-GUI-graph-fancier.patch (renamed from patches/server/0321-Make-the-GUI-graph-fancier.patch)0
-rw-r--r--patches/server/0321-add-hand-to-BlockMultiPlaceEvent.patch (renamed from patches/server/0322-add-hand-to-BlockMultiPlaceEvent.patch)0
-rw-r--r--patches/server/0322-Validate-tripwire-hook-placement-before-update.patch (renamed from patches/server/0323-Validate-tripwire-hook-placement-before-update.patch)0
-rw-r--r--patches/server/0323-Add-option-to-allow-iron-golems-to-spawn-in-air.patch (renamed from patches/server/0324-Add-option-to-allow-iron-golems-to-spawn-in-air.patch)0
-rw-r--r--patches/server/0324-Configurable-chance-of-villager-zombie-infection.patch (renamed from patches/server/0325-Configurable-chance-of-villager-zombie-infection.patch)0
-rw-r--r--patches/server/0325-Optimise-Chunk-getFluid.patch (renamed from patches/server/0326-Optimise-Chunk-getFluid.patch)0
-rw-r--r--patches/server/0326-Set-spigots-verbose-world-setting-to-false-by-def.patch (renamed from patches/server/0327-Set-spigots-verbose-world-setting-to-false-by-def.patch)0
-rw-r--r--patches/server/0327-Add-tick-times-API-and-mspt-command.patch (renamed from patches/server/0328-Add-tick-times-API-and-mspt-command.patch)6
-rw-r--r--patches/server/0328-Expose-MinecraftServer-isRunning.patch (renamed from patches/server/0329-Expose-MinecraftServer-isRunning.patch)0
-rw-r--r--patches/server/0329-Add-Raw-Byte-ItemStack-Serialization.patch (renamed from patches/server/0330-Add-Raw-Byte-ItemStack-Serialization.patch)0
-rw-r--r--patches/server/0330-Pillager-patrol-spawn-settings-and-per-player-option.patch (renamed from patches/server/0331-Pillager-patrol-spawn-settings-and-per-player-option.patch)2
-rw-r--r--patches/server/0331-Remote-Connections-shouldn-t-hold-up-shutdown.patch (renamed from patches/server/0332-Remote-Connections-shouldn-t-hold-up-shutdown.patch)0
-rw-r--r--patches/server/0332-Do-not-allow-bees-to-load-chunks-for-beehives.patch (renamed from patches/server/0333-Do-not-allow-bees-to-load-chunks-for-beehives.patch)0
-rw-r--r--patches/server/0333-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch (renamed from patches/server/0334-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch)6
-rw-r--r--patches/server/0334-Don-t-tick-dead-players.patch (renamed from patches/server/0335-Don-t-tick-dead-players.patch)4
-rw-r--r--patches/server/0335-Dead-Player-s-shouldn-t-be-able-to-move.patch (renamed from patches/server/0336-Dead-Player-s-shouldn-t-be-able-to-move.patch)0
-rw-r--r--patches/server/0336-Don-t-move-existing-players-to-world-spawn.patch (renamed from patches/server/0337-Don-t-move-existing-players-to-world-spawn.patch)6
-rw-r--r--patches/server/0337-Optimize-Pathfinding.patch (renamed from patches/server/0338-Optimize-Pathfinding.patch)0
-rw-r--r--patches/server/0338-Reduce-Either-Optional-allocation.patch (renamed from patches/server/0339-Reduce-Either-Optional-allocation.patch)0
-rw-r--r--patches/server/0339-Reduce-memory-footprint-of-CompoundTag.patch (renamed from patches/server/0340-Reduce-memory-footprint-of-CompoundTag.patch)0
-rw-r--r--patches/server/0340-Prevent-opening-inventories-when-frozen.patch (renamed from patches/server/0341-Prevent-opening-inventories-when-frozen.patch)6
-rw-r--r--patches/server/0341-Don-t-run-entity-collision-code-if-not-needed.patch (renamed from patches/server/0342-Don-t-run-entity-collision-code-if-not-needed.patch)0
-rw-r--r--patches/server/0342-Implement-Player-Client-Options-API.patch (renamed from patches/server/0343-Implement-Player-Client-Options-API.patch)12
-rw-r--r--patches/server/0343-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch (renamed from patches/server/0344-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch)0
-rw-r--r--patches/server/0344-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch (renamed from patches/server/0345-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch)6
-rw-r--r--patches/server/0345-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch (renamed from patches/server/0346-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch)0
-rw-r--r--patches/server/0346-Add-PlayerAttackEntityCooldownResetEvent.patch (renamed from patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch)0
-rw-r--r--patches/server/0347-Don-t-fire-BlockFade-on-worldgen-threads.patch (renamed from patches/server/0348-Don-t-fire-BlockFade-on-worldgen-threads.patch)0
-rw-r--r--patches/server/0348-Add-phantom-creative-and-insomniac-controls.patch (renamed from patches/server/0349-Add-phantom-creative-and-insomniac-controls.patch)0
-rw-r--r--patches/server/0349-Fix-item-duplication-and-teleport-issues.patch (renamed from patches/server/0350-Fix-item-duplication-and-teleport-issues.patch)0
-rw-r--r--patches/server/0350-Villager-Restocks-API.patch (renamed from patches/server/0351-Villager-Restocks-API.patch)0
-rw-r--r--patches/server/0351-Validate-PickItem-Packet-and-kick-for-invalid.patch (renamed from patches/server/0352-Validate-PickItem-Packet-and-kick-for-invalid.patch)0
-rw-r--r--patches/server/0352-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch (renamed from patches/server/0353-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch)2
-rw-r--r--patches/server/0353-misc-debugging-dumps.patch (renamed from patches/server/0354-misc-debugging-dumps.patch)2
-rw-r--r--patches/server/0354-Prevent-teleporting-dead-entities.patch (renamed from patches/server/0355-Prevent-teleporting-dead-entities.patch)0
-rw-r--r--patches/server/0355-Implement-Mob-Goal-API.patch (renamed from patches/server/0356-Implement-Mob-Goal-API.patch)21
-rw-r--r--patches/server/0356-Add-villager-reputation-API.patch (renamed from patches/server/0357-Add-villager-reputation-API.patch)0
-rw-r--r--patches/server/0357-ExperienceOrb-merging-stacking-API-and-fixes.patch (renamed from patches/server/0358-ExperienceOrb-merging-stacking-API-and-fixes.patch)0
-rw-r--r--patches/server/0358-Fix-PotionEffect-ignores-icon-flag.patch (renamed from patches/server/0359-Fix-PotionEffect-ignores-icon-flag.patch)0
-rw-r--r--patches/server/0359-Potential-bed-API.patch (renamed from patches/server/0360-Potential-bed-API.patch)2
-rw-r--r--patches/server/0360-Wait-for-Async-Tasks-during-shutdown.patch (renamed from patches/server/0361-Wait-for-Async-Tasks-during-shutdown.patch)2
-rw-r--r--patches/server/0361-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch (renamed from patches/server/0362-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch)0
-rw-r--r--patches/server/0362-Add-option-for-console-having-all-permissions.patch (renamed from patches/server/0363-Add-option-for-console-having-all-permissions.patch)0
-rw-r--r--patches/server/0363-Fix-villager-trading-demand-MC-163962.patch (renamed from patches/server/0364-Fix-villager-trading-demand-MC-163962.patch)0
-rw-r--r--patches/server/0364-Maps-shouldn-t-load-chunks.patch (renamed from patches/server/0365-Maps-shouldn-t-load-chunks.patch)0
-rw-r--r--patches/server/0365-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch (renamed from patches/server/0366-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch)0
-rw-r--r--patches/server/0366-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch (renamed from patches/server/0367-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch)0
-rw-r--r--patches/server/0367-Fix-piston-physics-inconsistency-MC-188840.patch (renamed from patches/server/0368-Fix-piston-physics-inconsistency-MC-188840.patch)0
-rw-r--r--patches/server/0368-Fix-missing-chunks-due-to-integer-overflow.patch (renamed from patches/server/0369-Fix-missing-chunks-due-to-integer-overflow.patch)0
-rw-r--r--patches/server/0369-Prevent-position-desync-causing-tp-exploit.patch (renamed from patches/server/0370-Prevent-position-desync-causing-tp-exploit.patch)0
-rw-r--r--patches/server/0370-Inventory-getHolder-method-without-block-snapshot.patch (renamed from patches/server/0371-Inventory-getHolder-method-without-block-snapshot.patch)0
-rw-r--r--patches/server/0371-Add-PlayerRecipeBookClickEvent.patch (renamed from patches/server/0372-Add-PlayerRecipeBookClickEvent.patch)0
-rw-r--r--patches/server/0372-Hide-sync-chunk-writes-behind-flag.patch (renamed from patches/server/0373-Hide-sync-chunk-writes-behind-flag.patch)0
-rw-r--r--patches/server/0373-Add-permission-for-command-blocks.patch (renamed from patches/server/0374-Add-permission-for-command-blocks.patch)0
-rw-r--r--patches/server/0374-Ensure-Entity-position-and-AABB-are-never-invalid.patch (renamed from patches/server/0375-Ensure-Entity-position-and-AABB-are-never-invalid.patch)0
-rw-r--r--patches/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch (renamed from patches/server/0376-Fix-Per-World-Difficulty-Remembering-Difficulty.patch)8
-rw-r--r--patches/server/0376-Paper-dumpitem-command.patch (renamed from patches/server/0377-Paper-dumpitem-command.patch)0
-rw-r--r--patches/server/0377-Improve-Legacy-Component-serialization-size.patch (renamed from patches/server/0378-Improve-Legacy-Component-serialization-size.patch)2
-rw-r--r--patches/server/0378-Add-Plugin-Tickets-to-API-Chunk-Methods.patch (renamed from patches/server/0379-Add-Plugin-Tickets-to-API-Chunk-Methods.patch)4
-rw-r--r--patches/server/0379-Add-BlockStateMeta-clearBlockState.patch (renamed from patches/server/0380-Add-BlockStateMeta-clearBlockState.patch)0
-rw-r--r--patches/server/0380-Convert-legacy-attributes-in-Item-Meta.patch (renamed from patches/server/0381-Convert-legacy-attributes-in-Item-Meta.patch)2
-rw-r--r--patches/server/0381-Do-not-accept-invalid-client-settings.patch (renamed from patches/server/0382-Do-not-accept-invalid-client-settings.patch)0
-rw-r--r--patches/server/0382-Improve-fix-EntityTargetLivingEntityEvent.patch (renamed from patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch)0
-rw-r--r--patches/server/0383-Add-entity-liquid-API.patch (renamed from patches/server/0384-Add-entity-liquid-API.patch)0
-rw-r--r--patches/server/0384-Add-PrepareResultEvent.patch (renamed from patches/server/0385-Add-PrepareResultEvent.patch)0
-rw-r--r--patches/server/0385-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch (renamed from patches/server/0386-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch)0
-rw-r--r--patches/server/0386-Fix-arrows-never-despawning-MC-125757.patch (renamed from patches/server/0387-Fix-arrows-never-despawning-MC-125757.patch)0
-rw-r--r--patches/server/0387-Thread-Safe-Vanilla-Command-permission-checking.patch (renamed from patches/server/0388-Thread-Safe-Vanilla-Command-permission-checking.patch)0
-rw-r--r--patches/server/0388-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch (renamed from patches/server/0389-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch)0
-rw-r--r--patches/server/0389-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch (renamed from patches/server/0390-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch)0
-rw-r--r--patches/server/0390-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch (renamed from patches/server/0391-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch)0
-rw-r--r--patches/server/0391-Optimize-NetworkManager-Exception-Handling.patch (renamed from patches/server/0392-Optimize-NetworkManager-Exception-Handling.patch)0
-rw-r--r--patches/server/0392-Fix-some-rails-connecting-improperly.patch (renamed from patches/server/0393-Fix-some-rails-connecting-improperly.patch)0
-rw-r--r--patches/server/0393-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch (renamed from patches/server/0394-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch)0
-rw-r--r--patches/server/0394-Brand-support.patch (renamed from patches/server/0395-Brand-support.patch)8
-rw-r--r--patches/server/0395-Add-playPickupItemAnimation-to-LivingEntity.patch (renamed from patches/server/0396-Add-playPickupItemAnimation-to-LivingEntity.patch)0
-rw-r--r--patches/server/0396-Don-t-require-FACING-data.patch (renamed from patches/server/0397-Don-t-require-FACING-data.patch)0
-rw-r--r--patches/server/0397-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch (renamed from patches/server/0398-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch)4
-rw-r--r--patches/server/0398-Add-moon-phase-API.patch (renamed from patches/server/0399-Add-moon-phase-API.patch)0
-rw-r--r--patches/server/0399-Do-not-let-the-server-load-chunks-from-newer-version.patch (renamed from patches/server/0400-Do-not-let-the-server-load-chunks-from-newer-version.patch)0
-rw-r--r--patches/server/0400-Prevent-headless-pistons-from-being-created.patch (renamed from patches/server/0401-Prevent-headless-pistons-from-being-created.patch)0
-rw-r--r--patches/server/0401-Add-BellRingEvent.patch (renamed from patches/server/0402-Add-BellRingEvent.patch)0
-rw-r--r--patches/server/0402-Add-zombie-targets-turtle-egg-config.patch (renamed from patches/server/0403-Add-zombie-targets-turtle-egg-config.patch)0
-rw-r--r--patches/server/0403-Buffer-joins-to-world.patch (renamed from patches/server/0404-Buffer-joins-to-world.patch)0
-rw-r--r--patches/server/0404-Fix-hex-colors-not-working-in-some-kick-messages.patch (renamed from patches/server/0405-Fix-hex-colors-not-working-in-some-kick-messages.patch)0
-rw-r--r--patches/server/0405-PortalCreateEvent-needs-to-know-its-entity.patch (renamed from patches/server/0406-PortalCreateEvent-needs-to-know-its-entity.patch)0
-rw-r--r--patches/server/0406-Add-more-Evoker-API.patch (renamed from patches/server/0407-Add-more-Evoker-API.patch)0
-rw-r--r--patches/server/0407-Add-methods-to-get-translation-keys.patch (renamed from patches/server/0408-Add-methods-to-get-translation-keys.patch)0
-rw-r--r--patches/server/0408-Create-HoverEvent-from-ItemStack-Entity.patch (renamed from patches/server/0409-Create-HoverEvent-from-ItemStack-Entity.patch)0
-rw-r--r--patches/server/0409-Cache-block-data-strings.patch (renamed from patches/server/0410-Cache-block-data-strings.patch)4
-rw-r--r--patches/server/0410-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch (renamed from patches/server/0411-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch)0
-rw-r--r--patches/server/0411-Add-additional-open-container-api-to-HumanEntity.patch (renamed from patches/server/0412-Add-additional-open-container-api-to-HumanEntity.patch)0
-rw-r--r--patches/server/0412-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch (renamed from patches/server/0413-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch)0
-rw-r--r--patches/server/0413-Extend-block-drop-capture-to-capture-all-items-added.patch (renamed from patches/server/0414-Extend-block-drop-capture-to-capture-all-items-added.patch)2
-rw-r--r--patches/server/0414-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch (renamed from patches/server/0415-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch)0
-rw-r--r--patches/server/0415-Lazily-track-plugin-scoreboards-by-default.patch (renamed from patches/server/0416-Lazily-track-plugin-scoreboards-by-default.patch)0
-rw-r--r--patches/server/0416-Entity-isTicking.patch (renamed from patches/server/0417-Entity-isTicking.patch)0
-rw-r--r--patches/server/0417-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch (renamed from patches/server/0418-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch)4
-rw-r--r--patches/server/0418-Fix-Concurrency-issue-in-ShufflingList.patch (renamed from patches/server/0419-Fix-Concurrency-issue-in-ShufflingList.patch)0
-rw-r--r--patches/server/0419-Reset-Ender-Crystals-on-Dragon-Spawn.patch (renamed from patches/server/0420-Reset-Ender-Crystals-on-Dragon-Spawn.patch)0
-rw-r--r--patches/server/0420-Fix-for-large-move-vectors-crashing-server.patch (renamed from patches/server/0421-Fix-for-large-move-vectors-crashing-server.patch)0
-rw-r--r--patches/server/0421-Optimise-getType-calls.patch (renamed from patches/server/0422-Optimise-getType-calls.patch)0
-rw-r--r--patches/server/0422-Villager-resetOffers.patch (renamed from patches/server/0423-Villager-resetOffers.patch)0
-rw-r--r--patches/server/0423-Retain-block-place-order-when-capturing-blockstates.patch (renamed from patches/server/0424-Retain-block-place-order-when-capturing-blockstates.patch)0
-rw-r--r--patches/server/0424-Fix-item-locations-dropped-from-campfires.patch (renamed from patches/server/0425-Fix-item-locations-dropped-from-campfires.patch)0
-rw-r--r--patches/server/0425-Fix-bell-block-entity-memory-leak.patch (renamed from patches/server/0426-Fix-bell-block-entity-memory-leak.patch)0
-rw-r--r--patches/server/0426-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch (renamed from patches/server/0427-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch)0
-rw-r--r--patches/server/0427-Add-getOfflinePlayerIfCached-String.patch (renamed from patches/server/0428-Add-getOfflinePlayerIfCached-String.patch)0
-rw-r--r--patches/server/0428-Add-ignore-discounts-API.patch (renamed from patches/server/0429-Add-ignore-discounts-API.patch)0
-rw-r--r--patches/server/0429-Toggle-for-removing-existing-dragon.patch (renamed from patches/server/0430-Toggle-for-removing-existing-dragon.patch)0
-rw-r--r--patches/server/0430-Fix-client-lag-on-advancement-loading.patch (renamed from patches/server/0431-Fix-client-lag-on-advancement-loading.patch)0
-rw-r--r--patches/server/0431-Item-no-age-no-player-pickup.patch (renamed from patches/server/0432-Item-no-age-no-player-pickup.patch)0
-rw-r--r--patches/server/0432-Beacon-API-custom-effect-ranges.patch (renamed from patches/server/0433-Beacon-API-custom-effect-ranges.patch)0
-rw-r--r--patches/server/0433-Add-API-for-quit-reason.patch (renamed from patches/server/0434-Add-API-for-quit-reason.patch)6
-rw-r--r--patches/server/0434-Add-Wandering-Trader-spawn-rate-config-options.patch (renamed from patches/server/0435-Add-Wandering-Trader-spawn-rate-config-options.patch)0
-rw-r--r--patches/server/0435-Add-Destroy-Speed-API.patch (renamed from patches/server/0436-Add-Destroy-Speed-API.patch)0
-rw-r--r--patches/server/0436-Fix-Player-spawnParticle-x-y-z-precision-loss.patch (renamed from patches/server/0437-Fix-Player-spawnParticle-x-y-z-precision-loss.patch)2
-rw-r--r--patches/server/0437-Add-LivingEntity-clearActiveItem.patch (renamed from patches/server/0438-Add-LivingEntity-clearActiveItem.patch)0
-rw-r--r--patches/server/0438-Add-PlayerItemCooldownEvent.patch (renamed from patches/server/0439-Add-PlayerItemCooldownEvent.patch)0
-rw-r--r--patches/server/0439-Significantly-improve-performance-of-the-end-generat.patch (renamed from patches/server/0440-Significantly-improve-performance-of-the-end-generat.patch)0
-rw-r--r--patches/server/0440-More-lightning-API.patch (renamed from patches/server/0441-More-lightning-API.patch)0
-rw-r--r--patches/server/0441-Climbing-should-not-bypass-cramming-gamerule.patch (renamed from patches/server/0442-Climbing-should-not-bypass-cramming-gamerule.patch)0
-rw-r--r--patches/server/0442-Add-missing-default-perms-for-commands.patch (renamed from patches/server/0443-Add-missing-default-perms-for-commands.patch)0
-rw-r--r--patches/server/0443-Add-PlayerShearBlockEvent.patch (renamed from patches/server/0444-Add-PlayerShearBlockEvent.patch)0
-rw-r--r--patches/server/0444-Limit-recipe-packets.patch (renamed from patches/server/0445-Limit-recipe-packets.patch)0
-rw-r--r--patches/server/0445-Fix-CraftSound-backwards-compatibility.patch (renamed from patches/server/0446-Fix-CraftSound-backwards-compatibility.patch)0
-rw-r--r--patches/server/0446-Player-Chunk-Load-Unload-Events.patch (renamed from patches/server/0447-Player-Chunk-Load-Unload-Events.patch)0
-rw-r--r--patches/server/0447-Optimize-Dynamic-get-Missing-Keys.patch (renamed from patches/server/0448-Optimize-Dynamic-get-Missing-Keys.patch)0
-rw-r--r--patches/server/0448-Expose-LivingEntity-hurt-direction.patch (renamed from patches/server/0449-Expose-LivingEntity-hurt-direction.patch)0
-rw-r--r--patches/server/0449-Add-OBSTRUCTED-reason-to-BedEnterResult.patch (renamed from patches/server/0450-Add-OBSTRUCTED-reason-to-BedEnterResult.patch)0
-rw-r--r--patches/server/0450-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch (renamed from patches/server/0451-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch)0
-rw-r--r--patches/server/0451-Add-TargetHitEvent.patch (renamed from patches/server/0452-Add-TargetHitEvent.patch)0
-rw-r--r--patches/server/0452-MC-4-Fix-item-position-desync.patch (renamed from patches/server/0453-MC-4-Fix-item-position-desync.patch)0
-rw-r--r--patches/server/0453-Additional-Block-Material-API.patch (renamed from patches/server/0454-Additional-Block-Material-API.patch)0
-rw-r--r--patches/server/0454-Fix-harming-potion-dupe.patch (renamed from patches/server/0455-Fix-harming-potion-dupe.patch)0
-rw-r--r--patches/server/0455-API-to-get-Material-from-Boats-and-Minecarts.patch (renamed from patches/server/0456-API-to-get-Material-from-Boats-and-Minecarts.patch)0
-rw-r--r--patches/server/0456-Allow-disabling-mob-spawner-spawn-egg-transformation.patch (renamed from patches/server/0457-Allow-disabling-mob-spawner-spawn-egg-transformation.patch)0
-rw-r--r--patches/server/0457-Fix-Not-a-string-Map-Conversion-spam.patch (renamed from patches/server/0458-Fix-Not-a-string-Map-Conversion-spam.patch)0
-rw-r--r--patches/server/0458-Add-PlayerFlowerPotManipulateEvent.patch (renamed from patches/server/0459-Add-PlayerFlowerPotManipulateEvent.patch)0
-rw-r--r--patches/server/0459-Fix-interact-event-not-being-called-sometimes.patch (renamed from patches/server/0460-Fix-interact-event-not-being-called-sometimes.patch)0
-rw-r--r--patches/server/0460-Zombie-API-breaking-doors.patch (renamed from patches/server/0461-Zombie-API-breaking-doors.patch)0
-rw-r--r--patches/server/0461-Fix-nerfed-slime-when-splitting.patch (renamed from patches/server/0462-Fix-nerfed-slime-when-splitting.patch)0
-rw-r--r--patches/server/0462-Add-EntityLoadCrossbowEvent.patch (renamed from patches/server/0463-Add-EntityLoadCrossbowEvent.patch)0
-rw-r--r--patches/server/0463-Add-WorldGameRuleChangeEvent.patch (renamed from patches/server/0464-Add-WorldGameRuleChangeEvent.patch)2
-rw-r--r--patches/server/0464-Add-ServerResourcesReloadedEvent.patch (renamed from patches/server/0465-Add-ServerResourcesReloadedEvent.patch)6
-rw-r--r--patches/server/0465-Add-world-settings-for-mobs-picking-up-loot.patch (renamed from patches/server/0466-Add-world-settings-for-mobs-picking-up-loot.patch)0
-rw-r--r--patches/server/0466-Add-BlockFailedDispenseEvent.patch (renamed from patches/server/0467-Add-BlockFailedDispenseEvent.patch)0
-rw-r--r--patches/server/0467-Add-PlayerLecternPageChangeEvent.patch (renamed from patches/server/0468-Add-PlayerLecternPageChangeEvent.patch)0
-rw-r--r--patches/server/0468-Add-PlayerLoomPatternSelectEvent.patch (renamed from patches/server/0469-Add-PlayerLoomPatternSelectEvent.patch)0
-rw-r--r--patches/server/0469-Configurable-door-breaking-difficulty.patch (renamed from patches/server/0470-Configurable-door-breaking-difficulty.patch)0
-rw-r--r--patches/server/0470-Empty-commands-shall-not-be-dispatched.patch (renamed from patches/server/0471-Empty-commands-shall-not-be-dispatched.patch)0
-rw-r--r--patches/server/0471-Remove-stale-POIs.patch (renamed from patches/server/0472-Remove-stale-POIs.patch)2
-rw-r--r--patches/server/0472-Fix-villager-boat-exploit.patch (renamed from patches/server/0473-Fix-villager-boat-exploit.patch)0
-rw-r--r--patches/server/0473-Add-sendOpLevel-API.patch (renamed from patches/server/0474-Add-sendOpLevel-API.patch)2
-rw-r--r--patches/server/0474-Add-RegistryAccess-for-managing-Registries.patch (renamed from patches/server/0475-Add-RegistryAccess-for-managing-Registries.patch)0
-rw-r--r--patches/server/0475-Add-StructuresLocateEvent.patch (renamed from patches/server/0476-Add-StructuresLocateEvent.patch)0
-rw-r--r--patches/server/0476-Collision-option-for-requiring-a-player-participant.patch (renamed from patches/server/0477-Collision-option-for-requiring-a-player-participant.patch)0
-rw-r--r--patches/server/0477-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch (renamed from patches/server/0478-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch)0
-rw-r--r--patches/server/0478-Return-chat-component-with-empty-text-instead-of-thr.patch (renamed from patches/server/0479-Return-chat-component-with-empty-text-instead-of-thr.patch)0
-rw-r--r--patches/server/0479-Make-schedule-command-per-world.patch (renamed from patches/server/0480-Make-schedule-command-per-world.patch)0
-rw-r--r--patches/server/0480-Configurable-max-leash-distance.patch (renamed from patches/server/0481-Configurable-max-leash-distance.patch)0
-rw-r--r--patches/server/0481-Add-BlockPreDispenseEvent.patch (renamed from patches/server/0482-Add-BlockPreDispenseEvent.patch)0
-rw-r--r--patches/server/0482-Add-PlayerChangeBeaconEffectEvent.patch (renamed from patches/server/0483-Add-PlayerChangeBeaconEffectEvent.patch)0
-rw-r--r--patches/server/0483-Add-toggle-for-always-placing-the-dragon-egg.patch (renamed from patches/server/0484-Add-toggle-for-always-placing-the-dragon-egg.patch)0
-rw-r--r--patches/server/0484-Add-PlayerStonecutterRecipeSelectEvent.patch (renamed from patches/server/0485-Add-PlayerStonecutterRecipeSelectEvent.patch)0
-rw-r--r--patches/server/0485-Expand-EntityUnleashEvent.patch (renamed from patches/server/0486-Expand-EntityUnleashEvent.patch)0
-rw-r--r--patches/server/0486-Reset-shield-blocking-on-dimension-change.patch (renamed from patches/server/0487-Reset-shield-blocking-on-dimension-change.patch)4
-rw-r--r--patches/server/0487-Add-DragonEggFormEvent.patch (renamed from patches/server/0488-Add-DragonEggFormEvent.patch)0
-rw-r--r--patches/server/0488-Add-EntityMoveEvent.patch (renamed from patches/server/0489-Add-EntityMoveEvent.patch)6
-rw-r--r--patches/server/0489-added-option-to-disable-pathfinding-updates-on-block.patch (renamed from patches/server/0490-added-option-to-disable-pathfinding-updates-on-block.patch)2
-rw-r--r--patches/server/0490-Inline-shift-direction-fields.patch (renamed from patches/server/0491-Inline-shift-direction-fields.patch)0
-rw-r--r--patches/server/0491-Allow-adding-items-to-BlockDropItemEvent.patch (renamed from patches/server/0492-Allow-adding-items-to-BlockDropItemEvent.patch)0
-rw-r--r--patches/server/0492-Add-getMainThreadExecutor-to-BukkitScheduler.patch (renamed from patches/server/0493-Add-getMainThreadExecutor-to-BukkitScheduler.patch)0
-rw-r--r--patches/server/0493-living-entity-allow-attribute-registration.patch (renamed from patches/server/0494-living-entity-allow-attribute-registration.patch)0
-rw-r--r--patches/server/0494-fix-dead-slime-setSize-invincibility.patch (renamed from patches/server/0495-fix-dead-slime-setSize-invincibility.patch)0
-rw-r--r--patches/server/0495-Merchant-getRecipes-should-return-an-immutable-list.patch (renamed from patches/server/0496-Merchant-getRecipes-should-return-an-immutable-list.patch)0
-rw-r--r--patches/server/0496-Expose-Tracked-Players.patch (renamed from patches/server/0497-Expose-Tracked-Players.patch)0
-rw-r--r--patches/server/0497-Improve-ServerGUI.patch (renamed from patches/server/0498-Improve-ServerGUI.patch)0
-rw-r--r--patches/server/0498-fix-converting-txt-to-json-file.patch (renamed from patches/server/0499-fix-converting-txt-to-json-file.patch)0
-rw-r--r--patches/server/0499-Add-worldborder-events.patch (renamed from patches/server/0500-Add-worldborder-events.patch)0
-rw-r--r--patches/server/0500-Add-PlayerNameEntityEvent.patch (renamed from patches/server/0501-Add-PlayerNameEntityEvent.patch)0
-rw-r--r--patches/server/0501-Add-recipe-to-cook-events.patch (renamed from patches/server/0502-Add-recipe-to-cook-events.patch)0
-rw-r--r--patches/server/0502-Add-Block-isValidTool.patch (renamed from patches/server/0503-Add-Block-isValidTool.patch)0
-rw-r--r--patches/server/0503-Allow-using-signs-inside-spawn-protection.patch (renamed from patches/server/0504-Allow-using-signs-inside-spawn-protection.patch)0
-rw-r--r--patches/server/0504-Expand-world-key-API.patch (renamed from patches/server/0505-Expand-world-key-API.patch)0
-rw-r--r--patches/server/0505-Add-fast-alternative-constructor-for-Rotations.patch (renamed from patches/server/0506-Add-fast-alternative-constructor-for-Rotations.patch)0
-rw-r--r--patches/server/0506-Drop-carried-item-when-player-has-disconnected.patch (renamed from patches/server/0507-Drop-carried-item-when-player-has-disconnected.patch)0
-rw-r--r--patches/server/0507-forced-whitelist-use-configurable-kick-message.patch (renamed from patches/server/0508-forced-whitelist-use-configurable-kick-message.patch)4
-rw-r--r--patches/server/0508-Don-t-ignore-result-of-PlayerEditBookEvent.patch (renamed from patches/server/0509-Don-t-ignore-result-of-PlayerEditBookEvent.patch)0
-rw-r--r--patches/server/0509-Expose-protocol-version.patch (renamed from patches/server/0510-Expose-protocol-version.patch)0
-rw-r--r--patches/server/0510-Enhance-console-tab-completions-for-brigadier-comman.patch (renamed from patches/server/0511-Enhance-console-tab-completions-for-brigadier-comman.patch)0
-rw-r--r--patches/server/0511-Fix-PlayerItemConsumeEvent-cancelling-properly.patch (renamed from patches/server/0512-Fix-PlayerItemConsumeEvent-cancelling-properly.patch)0
-rw-r--r--patches/server/0512-Add-bypass-host-check.patch (renamed from patches/server/0513-Add-bypass-host-check.patch)0
-rw-r--r--patches/server/0513-Set-area-affect-cloud-rotation.patch (renamed from patches/server/0514-Set-area-affect-cloud-rotation.patch)0
-rw-r--r--patches/server/0514-add-isDeeplySleeping-to-HumanEntity.patch (renamed from patches/server/0515-add-isDeeplySleeping-to-HumanEntity.patch)2
-rw-r--r--patches/server/0515-add-consumeFuel-to-FurnaceBurnEvent.patch (renamed from patches/server/0516-add-consumeFuel-to-FurnaceBurnEvent.patch)0
-rw-r--r--patches/server/0516-add-get-set-drop-chance-to-EntityEquipment.patch (renamed from patches/server/0517-add-get-set-drop-chance-to-EntityEquipment.patch)0
-rw-r--r--patches/server/0517-fix-PigZombieAngerEvent-cancellation.patch (renamed from patches/server/0518-fix-PigZombieAngerEvent-cancellation.patch)0
-rw-r--r--patches/server/0518-fix-PlayerItemHeldEvent-firing-twice.patch (renamed from patches/server/0519-fix-PlayerItemHeldEvent-firing-twice.patch)0
-rw-r--r--patches/server/0519-Add-PlayerDeepSleepEvent.patch (renamed from patches/server/0520-Add-PlayerDeepSleepEvent.patch)0
-rw-r--r--patches/server/0520-More-World-API.patch (renamed from patches/server/0521-More-World-API.patch)2
-rw-r--r--patches/server/0521-Add-PlayerBedFailEnterEvent.patch (renamed from patches/server/0522-Add-PlayerBedFailEnterEvent.patch)0
-rw-r--r--patches/server/0522-Implement-methods-to-convert-between-Component-and-B.patch (renamed from patches/server/0523-Implement-methods-to-convert-between-Component-and-B.patch)0
-rw-r--r--patches/server/0523-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch (renamed from patches/server/0524-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch)4
-rw-r--r--patches/server/0524-Introduce-beacon-activation-deactivation-events.patch (renamed from patches/server/0525-Introduce-beacon-activation-deactivation-events.patch)0
-rw-r--r--patches/server/0525-Add-Channel-initialization-listeners.patch (renamed from patches/server/0526-Add-Channel-initialization-listeners.patch)0
-rw-r--r--patches/server/0526-Send-empty-commands-if-tab-completion-is-disabled.patch (renamed from patches/server/0527-Send-empty-commands-if-tab-completion-is-disabled.patch)0
-rw-r--r--patches/server/0527-Add-more-WanderingTrader-API.patch (renamed from patches/server/0528-Add-more-WanderingTrader-API.patch)0
-rw-r--r--patches/server/0528-Add-EntityBlockStorage-clearEntities.patch (renamed from patches/server/0529-Add-EntityBlockStorage-clearEntities.patch)2
-rw-r--r--patches/server/0529-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch (renamed from patches/server/0530-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch)0
-rw-r--r--patches/server/0530-Add-HiddenPotionEffect-API.patch (renamed from patches/server/0531-Add-HiddenPotionEffect-API.patch)0
-rw-r--r--patches/server/0531-Inventory-close.patch (renamed from patches/server/0532-Inventory-close.patch)0
-rw-r--r--patches/server/0532-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch (renamed from patches/server/0533-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch)0
-rw-r--r--patches/server/0533-Add-basic-Datapack-API.patch (renamed from patches/server/0534-Add-basic-Datapack-API.patch)0
-rw-r--r--patches/server/0534-Add-environment-variable-to-disable-server-gui.patch (renamed from patches/server/0535-Add-environment-variable-to-disable-server-gui.patch)0
-rw-r--r--patches/server/0535-Expand-PlayerGameModeChangeEvent.patch (renamed from patches/server/0536-Expand-PlayerGameModeChangeEvent.patch)10
-rw-r--r--patches/server/0536-ItemStack-repair-check-API.patch (renamed from patches/server/0537-ItemStack-repair-check-API.patch)0
-rw-r--r--patches/server/0537-More-Enchantment-API.patch (renamed from patches/server/0538-More-Enchantment-API.patch)0
-rw-r--r--patches/server/0538-Move-range-check-for-block-placing-up.patch (renamed from patches/server/0539-Move-range-check-for-block-placing-up.patch)0
-rw-r--r--patches/server/0539-Add-Mob-lookAt-API.patch (renamed from patches/server/0540-Add-Mob-lookAt-API.patch)0
-rw-r--r--patches/server/0540-Correctly-check-if-bucket-dispenses-will-succeed-for.patch (renamed from patches/server/0541-Correctly-check-if-bucket-dispenses-will-succeed-for.patch)0
-rw-r--r--patches/server/0541-Add-Unix-domain-socket-support.patch (renamed from patches/server/0542-Add-Unix-domain-socket-support.patch)0
-rw-r--r--patches/server/0542-Add-EntityInsideBlockEvent.patch (renamed from patches/server/0543-Add-EntityInsideBlockEvent.patch)2
-rw-r--r--patches/server/0543-Improve-item-default-attribute-API.patch (renamed from patches/server/0544-Improve-item-default-attribute-API.patch)0
-rw-r--r--patches/server/0544-Add-cause-to-Weather-ThunderChangeEvents.patch (renamed from patches/server/0545-Add-cause-to-Weather-ThunderChangeEvents.patch)4
-rw-r--r--patches/server/0545-More-Lidded-Block-API.patch (renamed from patches/server/0546-More-Lidded-Block-API.patch)0
-rw-r--r--patches/server/0546-Limit-item-frame-cursors-on-maps.patch (renamed from patches/server/0547-Limit-item-frame-cursors-on-maps.patch)0
-rw-r--r--patches/server/0547-Add-PlayerKickEvent-causes.patch (renamed from patches/server/0548-Add-PlayerKickEvent-causes.patch)6
-rw-r--r--patches/server/0548-Add-PufferFishStateChangeEvent.patch (renamed from patches/server/0549-Add-PufferFishStateChangeEvent.patch)0
-rw-r--r--patches/server/0549-Fix-PlayerBucketEmptyEvent-result-itemstack.patch (renamed from patches/server/0550-Fix-PlayerBucketEmptyEvent-result-itemstack.patch)0
-rw-r--r--patches/server/0550-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch (renamed from patches/server/0551-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch)0
-rw-r--r--patches/server/0551-Add-option-to-fix-items-merging-through-walls.patch (renamed from patches/server/0552-Add-option-to-fix-items-merging-through-walls.patch)0
-rw-r--r--patches/server/0552-Add-BellRevealRaiderEvent.patch (renamed from patches/server/0553-Add-BellRevealRaiderEvent.patch)0
-rw-r--r--patches/server/0553-Fix-invulnerable-end-crystals.patch (renamed from patches/server/0554-Fix-invulnerable-end-crystals.patch)0
-rw-r--r--patches/server/0554-Add-ElderGuardianAppearanceEvent.patch (renamed from patches/server/0555-Add-ElderGuardianAppearanceEvent.patch)0
-rw-r--r--patches/server/0555-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch (renamed from patches/server/0556-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch)0
-rw-r--r--patches/server/0556-Line-Of-Sight-Changes.patch (renamed from patches/server/0557-Line-Of-Sight-Changes.patch)0
-rw-r--r--patches/server/0557-add-per-world-spawn-limits.patch (renamed from patches/server/0558-add-per-world-spawn-limits.patch)2
-rw-r--r--patches/server/0558-Fix-potions-splash-events.patch (renamed from patches/server/0559-Fix-potions-splash-events.patch)0
-rw-r--r--patches/server/0559-Add-more-LimitedRegion-API.patch (renamed from patches/server/0560-Add-more-LimitedRegion-API.patch)0
-rw-r--r--patches/server/0560-Fix-PlayerDropItemEvent-using-wrong-item.patch (renamed from patches/server/0561-Fix-PlayerDropItemEvent-using-wrong-item.patch)4
-rw-r--r--patches/server/0561-Missing-Entity-API.patch (renamed from patches/server/0562-Missing-Entity-API.patch)4
-rw-r--r--patches/server/0562-Fix-return-value-of-Block-applyBoneMeal-always-being.patch (renamed from patches/server/0563-Fix-return-value-of-Block-applyBoneMeal-always-being.patch)0
-rw-r--r--patches/server/0563-Use-getChunkIfLoadedImmediately-in-places.patch (renamed from patches/server/0564-Use-getChunkIfLoadedImmediately-in-places.patch)2
-rw-r--r--patches/server/0564-Fix-commands-from-signs-not-firing-command-events.patch (renamed from patches/server/0565-Fix-commands-from-signs-not-firing-command-events.patch)0
-rw-r--r--patches/server/0565-Add-PlayerArmSwingEvent.patch (renamed from patches/server/0566-Add-PlayerArmSwingEvent.patch)0
-rw-r--r--patches/server/0566-Fix-kick-event-leave-message-not-being-sent.patch (renamed from patches/server/0567-Fix-kick-event-leave-message-not-being-sent.patch)4
-rw-r--r--patches/server/0567-Don-t-apply-cramming-damage-to-players.patch (renamed from patches/server/0568-Don-t-apply-cramming-damage-to-players.patch)4
-rw-r--r--patches/server/0568-Rate-options-and-timings-for-sensors-and-behaviors.patch (renamed from patches/server/0569-Rate-options-and-timings-for-sensors-and-behaviors.patch)0
-rw-r--r--patches/server/0569-Add-missing-forceDrop-toggles.patch (renamed from patches/server/0570-Add-missing-forceDrop-toggles.patch)0
-rw-r--r--patches/server/0570-Stinger-API.patch (renamed from patches/server/0571-Stinger-API.patch)0
-rw-r--r--patches/server/0571-Add-System.out-err-catcher.patch (renamed from patches/server/0572-Add-System.out-err-catcher.patch)0
-rw-r--r--patches/server/0572-Prevent-AFK-kick-while-watching-end-credits.patch (renamed from patches/server/0573-Prevent-AFK-kick-while-watching-end-credits.patch)0
-rw-r--r--patches/server/0573-Allow-skipping-writing-of-comments-to-server.propert.patch (renamed from patches/server/0574-Allow-skipping-writing-of-comments-to-server.propert.patch)0
-rw-r--r--patches/server/0574-Add-PlayerSetSpawnEvent.patch (renamed from patches/server/0575-Add-PlayerSetSpawnEvent.patch)10
-rw-r--r--patches/server/0575-Make-hoppers-respect-inventory-max-stack-size.patch (renamed from patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch)0
-rw-r--r--patches/server/0576-Optimize-entity-tracker-passenger-checks.patch (renamed from patches/server/0577-Optimize-entity-tracker-passenger-checks.patch)0
-rw-r--r--patches/server/0577-Config-option-for-Piglins-guarding-chests.patch (renamed from patches/server/0578-Config-option-for-Piglins-guarding-chests.patch)0
-rw-r--r--patches/server/0578-Add-EntityDamageItemEvent.patch (renamed from patches/server/0579-Add-EntityDamageItemEvent.patch)0
-rw-r--r--patches/server/0579-Optimize-indirect-passenger-iteration.patch (renamed from patches/server/0580-Optimize-indirect-passenger-iteration.patch)0
-rw-r--r--patches/server/0580-Configurable-item-frame-map-cursor-update-interval.patch (renamed from patches/server/0581-Configurable-item-frame-map-cursor-update-interval.patch)0
-rw-r--r--patches/server/0581-Change-EnderEye-target-without-changing-other-things.patch (renamed from patches/server/0582-Change-EnderEye-target-without-changing-other-things.patch)0
-rw-r--r--patches/server/0582-Add-BlockBreakBlockEvent.patch (renamed from patches/server/0583-Add-BlockBreakBlockEvent.patch)0
-rw-r--r--patches/server/0583-Option-to-prevent-data-components-copy-in-smithing-r.patch (renamed from patches/server/0584-Option-to-prevent-data-components-copy-in-smithing-r.patch)0
-rw-r--r--patches/server/0584-More-CommandBlock-API.patch (renamed from patches/server/0585-More-CommandBlock-API.patch)0
-rw-r--r--patches/server/0585-Add-missing-team-sidebar-display-slots.patch (renamed from patches/server/0586-Add-missing-team-sidebar-display-slots.patch)0
-rw-r--r--patches/server/0586-Add-back-EntityPortalExitEvent.patch (renamed from patches/server/0587-Add-back-EntityPortalExitEvent.patch)0
-rw-r--r--patches/server/0587-Add-methods-to-find-targets-for-lightning-strikes.patch (renamed from patches/server/0588-Add-methods-to-find-targets-for-lightning-strikes.patch)4
-rw-r--r--patches/server/0588-Get-entity-default-attributes.patch (renamed from patches/server/0589-Get-entity-default-attributes.patch)0
-rw-r--r--patches/server/0589-Left-handed-API.patch (renamed from patches/server/0590-Left-handed-API.patch)0
-rw-r--r--patches/server/0590-Add-more-advancement-API.patch (renamed from patches/server/0591-Add-more-advancement-API.patch)0
-rw-r--r--patches/server/0591-Add-ItemFactory-getSpawnEgg-API.patch (renamed from patches/server/0592-Add-ItemFactory-getSpawnEgg-API.patch)0
-rw-r--r--patches/server/0592-Add-critical-damage-API.patch (renamed from patches/server/0593-Add-critical-damage-API.patch)0
-rw-r--r--patches/server/0593-Fix-issues-with-mob-conversion.patch (renamed from patches/server/0594-Fix-issues-with-mob-conversion.patch)0
-rw-r--r--patches/server/0594-Add-hasCollision-methods-to-various-places.patch (renamed from patches/server/0595-Add-hasCollision-methods-to-various-places.patch)0
-rw-r--r--patches/server/0595-Goat-ram-API.patch (renamed from patches/server/0596-Goat-ram-API.patch)0
-rw-r--r--patches/server/0596-Add-API-for-resetting-a-single-score.patch (renamed from patches/server/0597-Add-API-for-resetting-a-single-score.patch)0
-rw-r--r--patches/server/0597-Add-Raw-Byte-Entity-Serialization.patch (renamed from patches/server/0598-Add-Raw-Byte-Entity-Serialization.patch)0
-rw-r--r--patches/server/0598-Vanilla-command-permission-fixes.patch (renamed from patches/server/0599-Vanilla-command-permission-fixes.patch)0
-rw-r--r--patches/server/0599-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch (renamed from patches/server/0600-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch)6
-rw-r--r--patches/server/0600-Fix-GameProfileCache-concurrency.patch (renamed from patches/server/0601-Fix-GameProfileCache-concurrency.patch)0
-rw-r--r--patches/server/0601-Improve-and-expand-AsyncCatcher.patch (renamed from patches/server/0602-Improve-and-expand-AsyncCatcher.patch)8
-rw-r--r--patches/server/0602-Add-paper-mobcaps-and-paper-playermobcaps.patch (renamed from patches/server/0603-Add-paper-mobcaps-and-paper-playermobcaps.patch)2
-rw-r--r--patches/server/0603-Sanitize-ResourceLocation-error-logging.patch (renamed from patches/server/0604-Sanitize-ResourceLocation-error-logging.patch)0
-rw-r--r--patches/server/0604-Manually-inline-methods-in-BlockPosition.patch (renamed from patches/server/0605-Manually-inline-methods-in-BlockPosition.patch)0
-rw-r--r--patches/server/0605-Name-craft-scheduler-threads-according-to-the-plugin.patch (renamed from patches/server/0606-Name-craft-scheduler-threads-according-to-the-plugin.patch)0
-rw-r--r--patches/server/0606-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch (renamed from patches/server/0607-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch)0
-rw-r--r--patches/server/0607-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch (renamed from patches/server/0608-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch)0
-rw-r--r--patches/server/0608-Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch (renamed from patches/server/0609-Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch)0
-rw-r--r--patches/server/0609-Time-scoreboard-search.patch (renamed from patches/server/0610-Time-scoreboard-search.patch)0
-rw-r--r--patches/server/0610-Oprimise-map-impl-for-tracked-players.patch (renamed from patches/server/0611-Oprimise-map-impl-for-tracked-players.patch)4
-rw-r--r--patches/server/0611-Add-missing-InventoryType.patch (renamed from patches/server/0612-Add-missing-InventoryType.patch)0
-rw-r--r--patches/server/0612-Optimise-BlockSoil-nearby-water-lookup.patch (renamed from patches/server/0613-Optimise-BlockSoil-nearby-water-lookup.patch)0
-rw-r--r--patches/server/0613-Fix-merchant-inventory-not-closing-on-entity-removal.patch (renamed from patches/server/0614-Fix-merchant-inventory-not-closing-on-entity-removal.patch)2
-rw-r--r--patches/server/0614-Check-requirement-before-suggesting-root-nodes.patch (renamed from patches/server/0615-Check-requirement-before-suggesting-root-nodes.patch)0
-rw-r--r--patches/server/0615-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch (renamed from patches/server/0616-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch)0
-rw-r--r--patches/server/0616-Add-packet-limiter-config.patch (renamed from patches/server/0617-Add-packet-limiter-config.patch)0
-rw-r--r--patches/server/0617-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch (renamed from patches/server/0618-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch)0
-rw-r--r--patches/server/0618-Ensure-valid-vehicle-status.patch (renamed from patches/server/0619-Ensure-valid-vehicle-status.patch)4
-rw-r--r--patches/server/0619-Prevent-softlocked-end-exit-portal-generation.patch (renamed from patches/server/0620-Prevent-softlocked-end-exit-portal-generation.patch)0
-rw-r--r--patches/server/0620-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch (renamed from patches/server/0621-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch)0
-rw-r--r--patches/server/0621-Don-t-log-debug-logging-being-disabled.patch (renamed from patches/server/0622-Don-t-log-debug-logging-being-disabled.patch)0
-rw-r--r--patches/server/0622-fix-various-menus-with-empty-level-accesses.patch (renamed from patches/server/0623-fix-various-menus-with-empty-level-accesses.patch)0
-rw-r--r--patches/server/0623-Preserve-overstacked-loot.patch (renamed from patches/server/0624-Preserve-overstacked-loot.patch)0
-rw-r--r--patches/server/0624-Update-head-rotation-in-missing-places.patch (renamed from patches/server/0625-Update-head-rotation-in-missing-places.patch)0
-rw-r--r--patches/server/0625-prevent-unintended-light-block-manipulation.patch (renamed from patches/server/0626-prevent-unintended-light-block-manipulation.patch)0
-rw-r--r--patches/server/0626-Fix-CraftCriteria-defaults-map.patch (renamed from patches/server/0627-Fix-CraftCriteria-defaults-map.patch)0
-rw-r--r--patches/server/0627-Fix-upstreams-block-state-factories.patch (renamed from patches/server/0628-Fix-upstreams-block-state-factories.patch)0
-rw-r--r--patches/server/0628-Configurable-feature-seeds.patch (renamed from patches/server/0629-Configurable-feature-seeds.patch)0
-rw-r--r--patches/server/0629-Add-root-admin-user-detection.patch (renamed from patches/server/0630-Add-root-admin-user-detection.patch)0
-rw-r--r--patches/server/0630-don-t-attempt-to-teleport-dead-entities.patch (renamed from patches/server/0631-don-t-attempt-to-teleport-dead-entities.patch)0
-rw-r--r--patches/server/0631-Prevent-excessive-velocity-through-repeated-crits.patch (renamed from patches/server/0632-Prevent-excessive-velocity-through-repeated-crits.patch)0
-rw-r--r--patches/server/0632-Remove-client-side-code-using-deprecated-for-removal.patch (renamed from patches/server/0633-Remove-client-side-code-using-deprecated-for-removal.patch)0
-rw-r--r--patches/server/0633-Fix-Spigot-growth-modifiers.patch (renamed from patches/server/0634-Fix-Spigot-growth-modifiers.patch)0
-rw-r--r--patches/server/0634-Prevent-ContainerOpenersCounter-openCount-from-going.patch (renamed from patches/server/0635-Prevent-ContainerOpenersCounter-openCount-from-going.patch)0
-rw-r--r--patches/server/0635-Add-PlayerItemFrameChangeEvent.patch (renamed from patches/server/0636-Add-PlayerItemFrameChangeEvent.patch)0
-rw-r--r--patches/server/0636-Optimize-HashMapPalette.patch (renamed from patches/server/0637-Optimize-HashMapPalette.patch)0
-rw-r--r--patches/server/0637-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch (renamed from patches/server/0638-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch)0
-rw-r--r--patches/server/0638-Add-more-Campfire-API.patch (renamed from patches/server/0639-Add-more-Campfire-API.patch)0
-rw-r--r--patches/server/0639-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch (renamed from patches/server/0640-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch)0
-rw-r--r--patches/server/0640-Forward-CraftEntity-in-teleport-command.patch (renamed from patches/server/0641-Forward-CraftEntity-in-teleport-command.patch)0
-rw-r--r--patches/server/0641-Improve-scoreboard-entries.patch (renamed from patches/server/0642-Improve-scoreboard-entries.patch)0
-rw-r--r--patches/server/0642-Entity-powdered-snow-API.patch (renamed from patches/server/0643-Entity-powdered-snow-API.patch)0
-rw-r--r--patches/server/0643-Add-API-for-item-entity-health.patch (renamed from patches/server/0644-Add-API-for-item-entity-health.patch)0
-rw-r--r--patches/server/0644-Configurable-max-block-light-for-monster-spawning.patch (renamed from patches/server/0645-Configurable-max-block-light-for-monster-spawning.patch)0
-rw-r--r--patches/server/0645-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch (renamed from patches/server/0646-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch)0
-rw-r--r--patches/server/0646-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch (renamed from patches/server/0647-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch)0
-rw-r--r--patches/server/0647-Bucketable-API.patch (renamed from patches/server/0648-Bucketable-API.patch)0
-rw-r--r--patches/server/0648-Validate-usernames.patch (renamed from patches/server/0649-Validate-usernames.patch)0
-rw-r--r--patches/server/0649-Make-water-animal-spawn-height-configurable.patch (renamed from patches/server/0650-Make-water-animal-spawn-height-configurable.patch)0
-rw-r--r--patches/server/0650-Expose-vanilla-BiomeProvider-from-WorldInfo.patch (renamed from patches/server/0651-Expose-vanilla-BiomeProvider-from-WorldInfo.patch)4
-rw-r--r--patches/server/0651-Add-config-option-for-worlds-affected-by-time-cmd.patch (renamed from patches/server/0652-Add-config-option-for-worlds-affected-by-time-cmd.patch)0
-rw-r--r--patches/server/0652-Add-missing-IAE-check-for-PersistentDataContainer-ha.patch (renamed from patches/server/0653-Add-missing-IAE-check-for-PersistentDataContainer-ha.patch)0
-rw-r--r--patches/server/0653-Multiple-Entries-with-Scoreboards.patch (renamed from patches/server/0654-Multiple-Entries-with-Scoreboards.patch)0
-rw-r--r--patches/server/0654-Reset-placed-block-on-exception.patch (renamed from patches/server/0655-Reset-placed-block-on-exception.patch)0
-rw-r--r--patches/server/0655-Add-configurable-height-for-slime-spawn.patch (renamed from patches/server/0656-Add-configurable-height-for-slime-spawn.patch)0
-rw-r--r--patches/server/0656-Fix-xp-reward-for-baby-zombies.patch (renamed from patches/server/0657-Fix-xp-reward-for-baby-zombies.patch)0
-rw-r--r--patches/server/0657-Multi-Block-Change-API-Implementation.patch (renamed from patches/server/0658-Multi-Block-Change-API-Implementation.patch)2
-rw-r--r--patches/server/0658-Fix-NotePlayEvent.patch (renamed from patches/server/0659-Fix-NotePlayEvent.patch)0
-rw-r--r--patches/server/0659-Freeze-Tick-Lock-API.patch (renamed from patches/server/0660-Freeze-Tick-Lock-API.patch)0
-rw-r--r--patches/server/0660-More-PotionEffectType-API.patch (renamed from patches/server/0661-More-PotionEffectType-API.patch)0
-rw-r--r--patches/server/0661-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch (renamed from patches/server/0662-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch)0
-rw-r--r--patches/server/0662-API-for-creating-command-sender-which-forwards-feedb.patch (renamed from patches/server/0663-API-for-creating-command-sender-which-forwards-feedb.patch)0
-rw-r--r--patches/server/0663-Add-missing-structure-set-seed-configs.patch (renamed from patches/server/0664-Add-missing-structure-set-seed-configs.patch)0
-rw-r--r--patches/server/0664-Fix-cancelled-powdered-snow-bucket-placement.patch (renamed from patches/server/0665-Fix-cancelled-powdered-snow-bucket-placement.patch)0
-rw-r--r--patches/server/0665-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch (renamed from patches/server/0666-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch)0
-rw-r--r--patches/server/0666-Add-GameEvent-tags.patch (renamed from patches/server/0667-Add-GameEvent-tags.patch)0
-rw-r--r--patches/server/0667-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch (renamed from patches/server/0668-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch)2
-rw-r--r--patches/server/0668-Furnace-RecipesUsed-API.patch (renamed from patches/server/0669-Furnace-RecipesUsed-API.patch)0
-rw-r--r--patches/server/0669-Configurable-sculk-sensor-listener-range.patch (renamed from patches/server/0670-Configurable-sculk-sensor-listener-range.patch)0
-rw-r--r--patches/server/0670-Add-missing-block-data-mins-and-maxes.patch (renamed from patches/server/0671-Add-missing-block-data-mins-and-maxes.patch)0
-rw-r--r--patches/server/0671-Option-to-have-default-CustomSpawners-in-custom-worl.patch (renamed from patches/server/0672-Option-to-have-default-CustomSpawners-in-custom-worl.patch)2
-rw-r--r--patches/server/0672-Put-world-into-worldlist-before-initing-the-world.patch (renamed from patches/server/0673-Put-world-into-worldlist-before-initing-the-world.patch)2
-rw-r--r--patches/server/0673-Custom-Potion-Mixes.patch (renamed from patches/server/0674-Custom-Potion-Mixes.patch)4
-rw-r--r--patches/server/0674-Force-close-world-loading-screen.patch (renamed from patches/server/0675-Force-close-world-loading-screen.patch)0
-rw-r--r--patches/server/0675-Fix-falling-block-spawn-methods.patch (renamed from patches/server/0676-Fix-falling-block-spawn-methods.patch)2
-rw-r--r--patches/server/0676-Expose-furnace-minecart-push-values.patch (renamed from patches/server/0677-Expose-furnace-minecart-push-values.patch)0
-rw-r--r--patches/server/0677-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch (renamed from patches/server/0678-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch)0
-rw-r--r--patches/server/0678-More-Projectile-API.patch (renamed from patches/server/0679-More-Projectile-API.patch)2
-rw-r--r--patches/server/0679-Fix-swamp-hut-cat-generation-deadlock.patch (renamed from patches/server/0680-Fix-swamp-hut-cat-generation-deadlock.patch)0
-rw-r--r--patches/server/0680-Don-t-allow-vehicle-movement-from-players-while-tele.patch (renamed from patches/server/0681-Don-t-allow-vehicle-movement-from-players-while-tele.patch)0
-rw-r--r--patches/server/0681-Implement-getComputedBiome-API.patch (renamed from patches/server/0682-Implement-getComputedBiome-API.patch)0
-rw-r--r--patches/server/0682-Make-some-itemstacks-nonnull.patch (renamed from patches/server/0683-Make-some-itemstacks-nonnull.patch)0
-rw-r--r--patches/server/0683-Implement-enchantWithLevels-API.patch (renamed from patches/server/0684-Implement-enchantWithLevels-API.patch)0
-rw-r--r--patches/server/0684-Fix-saving-in-unloadWorld.patch (renamed from patches/server/0685-Fix-saving-in-unloadWorld.patch)0
-rw-r--r--patches/server/0685-Buffer-OOB-setBlock-calls.patch (renamed from patches/server/0686-Buffer-OOB-setBlock-calls.patch)0
-rw-r--r--patches/server/0686-Add-TameableDeathMessageEvent.patch (renamed from patches/server/0687-Add-TameableDeathMessageEvent.patch)0
-rw-r--r--patches/server/0687-Fix-new-block-data-for-EntityChangeBlockEvent.patch (renamed from patches/server/0688-Fix-new-block-data-for-EntityChangeBlockEvent.patch)0
-rw-r--r--patches/server/0688-fix-player-loottables-running-when-mob-loot-gamerule.patch (renamed from patches/server/0689-fix-player-loottables-running-when-mob-loot-gamerule.patch)4
-rw-r--r--patches/server/0689-Ensure-entity-passenger-world-matches-ridden-entity.patch (renamed from patches/server/0690-Ensure-entity-passenger-world-matches-ridden-entity.patch)0
-rw-r--r--patches/server/0690-cache-resource-keys.patch (renamed from patches/server/0691-cache-resource-keys.patch)0
-rw-r--r--patches/server/0691-Allow-changing-the-EnderDragon-podium.patch (renamed from patches/server/0692-Allow-changing-the-EnderDragon-podium.patch)0
-rw-r--r--patches/server/0692-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch (renamed from patches/server/0693-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch)0
-rw-r--r--patches/server/0693-Prevent-tile-entity-copies-loading-chunks.patch (renamed from patches/server/0694-Prevent-tile-entity-copies-loading-chunks.patch)0
-rw-r--r--patches/server/0694-Use-username-instead-of-display-name-in-PlayerList-g.patch (renamed from patches/server/0695-Use-username-instead-of-display-name-in-PlayerList-g.patch)0
-rw-r--r--patches/server/0695-Expand-PlayerItemDamageEvent.patch (renamed from patches/server/0696-Expand-PlayerItemDamageEvent.patch)0
-rw-r--r--patches/server/0696-WorldCreator-keepSpawnLoaded.patch (renamed from patches/server/0697-WorldCreator-keepSpawnLoaded.patch)0
-rw-r--r--patches/server/0697-Fix-CME-in-CraftPersistentDataTypeRegistry.patch (renamed from patches/server/0698-Fix-CME-in-CraftPersistentDataTypeRegistry.patch)0
-rw-r--r--patches/server/0698-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch (renamed from patches/server/0699-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch)0
-rw-r--r--patches/server/0699-Add-EntityDyeEvent-and-CollarColorable-interface.patch (renamed from patches/server/0700-Add-EntityDyeEvent-and-CollarColorable-interface.patch)0
-rw-r--r--patches/server/0700-Fire-CauldronLevelChange-on-initial-fill.patch (renamed from patches/server/0701-Fire-CauldronLevelChange-on-initial-fill.patch)0
-rw-r--r--patches/server/0701-fix-powder-snow-cauldrons-not-turning-to-water.patch (renamed from patches/server/0702-fix-powder-snow-cauldrons-not-turning-to-water.patch)0
-rw-r--r--patches/server/0702-Add-PlayerStopUsingItemEvent.patch (renamed from patches/server/0703-Add-PlayerStopUsingItemEvent.patch)0
-rw-r--r--patches/server/0703-Don-t-tick-markers.patch (renamed from patches/server/0704-Don-t-tick-markers.patch)2
-rw-r--r--patches/server/0704-Expand-FallingBlock-API.patch (renamed from patches/server/0705-Expand-FallingBlock-API.patch)0
-rw-r--r--patches/server/0705-Add-support-for-Proxy-Protocol.patch (renamed from patches/server/0706-Add-support-for-Proxy-Protocol.patch)0
-rw-r--r--patches/server/0706-Fix-OfflinePlayer-getBedSpawnLocation.patch (renamed from patches/server/0707-Fix-OfflinePlayer-getBedSpawnLocation.patch)0
-rw-r--r--patches/server/0707-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch (renamed from patches/server/0708-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch)0
-rw-r--r--patches/server/0708-Sanitize-sent-BlockEntity-NBT.patch (renamed from patches/server/0709-Sanitize-sent-BlockEntity-NBT.patch)0
-rw-r--r--patches/server/0709-Disable-component-selector-resolving-in-books-by-def.patch (renamed from patches/server/0710-Disable-component-selector-resolving-in-books-by-def.patch)0
-rw-r--r--patches/server/0710-Prevent-entity-loading-causing-async-lookups.patch (renamed from patches/server/0711-Prevent-entity-loading-causing-async-lookups.patch)0
-rw-r--r--patches/server/0711-Throw-exception-on-world-create-while-being-ticked.patch (renamed from patches/server/0712-Throw-exception-on-world-create-while-being-ticked.patch)8
-rw-r--r--patches/server/0712-Dont-resent-entity-on-art-update.patch (renamed from patches/server/0713-Dont-resent-entity-on-art-update.patch)0
-rw-r--r--patches/server/0713-Add-WardenAngerChangeEvent.patch (renamed from patches/server/0714-Add-WardenAngerChangeEvent.patch)0
-rw-r--r--patches/server/0714-Add-option-for-strict-advancement-dimension-checks.patch (renamed from patches/server/0715-Add-option-for-strict-advancement-dimension-checks.patch)4
-rw-r--r--patches/server/0715-Add-missing-important-BlockStateListPopulator-method.patch (renamed from patches/server/0716-Add-missing-important-BlockStateListPopulator-method.patch)0
-rw-r--r--patches/server/0716-Nameable-Banner-API.patch (renamed from patches/server/0717-Nameable-Banner-API.patch)0
-rw-r--r--patches/server/0717-Don-t-broadcast-messages-to-command-blocks.patch (renamed from patches/server/0718-Don-t-broadcast-messages-to-command-blocks.patch)0
-rw-r--r--patches/server/0718-Prevent-empty-items-from-being-added-to-world.patch (renamed from patches/server/0719-Prevent-empty-items-from-being-added-to-world.patch)2
-rw-r--r--patches/server/0719-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch (renamed from patches/server/0720-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch)0
-rw-r--r--patches/server/0720-Add-Player-getFishHook.patch (renamed from patches/server/0721-Add-Player-getFishHook.patch)2
-rw-r--r--patches/server/0721-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch (renamed from patches/server/0722-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch)0
-rw-r--r--patches/server/0722-Add-various-missing-EntityDropItemEvent-calls.patch (renamed from patches/server/0723-Add-various-missing-EntityDropItemEvent-calls.patch)0
-rw-r--r--patches/server/0723-Fix-Bee-flower-NPE.patch (renamed from patches/server/0724-Fix-Bee-flower-NPE.patch)0
-rw-r--r--patches/server/0724-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch (renamed from patches/server/0725-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch)0
-rw-r--r--patches/server/0725-More-Teleport-API.patch (renamed from patches/server/0726-More-Teleport-API.patch)2
-rw-r--r--patches/server/0726-Add-EntityPortalReadyEvent.patch (renamed from patches/server/0727-Add-EntityPortalReadyEvent.patch)0
-rw-r--r--patches/server/0727-Don-t-use-level-random-in-entity-constructors.patch (renamed from patches/server/0728-Don-t-use-level-random-in-entity-constructors.patch)0
-rw-r--r--patches/server/0728-Send-block-entities-after-destroy-prediction.patch (renamed from patches/server/0729-Send-block-entities-after-destroy-prediction.patch)0
-rw-r--r--patches/server/0729-Warn-on-plugins-accessing-faraway-chunks.patch (renamed from patches/server/0730-Warn-on-plugins-accessing-faraway-chunks.patch)2
-rw-r--r--patches/server/0730-Custom-Chat-Completion-Suggestions-API.patch (renamed from patches/server/0731-Custom-Chat-Completion-Suggestions-API.patch)2
-rw-r--r--patches/server/0731-Add-and-fix-missing-BlockFadeEvents.patch (renamed from patches/server/0732-Add-and-fix-missing-BlockFadeEvents.patch)4
-rw-r--r--patches/server/0732-Collision-API.patch (renamed from patches/server/0733-Collision-API.patch)0
-rw-r--r--patches/server/0733-Fix-suggest-command-message-for-brigadier-syntax-exc.patch (renamed from patches/server/0734-Fix-suggest-command-message-for-brigadier-syntax-exc.patch)0
-rw-r--r--patches/server/0734-Block-Ticking-API.patch (renamed from patches/server/0735-Block-Ticking-API.patch)0
-rw-r--r--patches/server/0735-Add-Velocity-IP-Forwarding-Support.patch (renamed from patches/server/0736-Add-Velocity-IP-Forwarding-Support.patch)0
-rw-r--r--patches/server/0736-Add-NamespacedKey-biome-methods.patch (renamed from patches/server/0737-Add-NamespacedKey-biome-methods.patch)0
-rw-r--r--patches/server/0737-Fix-plugin-loggers-on-server-shutdown.patch (renamed from patches/server/0738-Fix-plugin-loggers-on-server-shutdown.patch)4
-rw-r--r--patches/server/0738-Stop-large-look-changes-from-crashing-the-server.patch (renamed from patches/server/0739-Stop-large-look-changes-from-crashing-the-server.patch)0
-rw-r--r--patches/server/0739-Fire-EntityChangeBlockEvent-in-more-places.patch (renamed from patches/server/0740-Fire-EntityChangeBlockEvent-in-more-places.patch)0
-rw-r--r--patches/server/0740-Missing-eating-regain-reason.patch (renamed from patches/server/0741-Missing-eating-regain-reason.patch)0
-rw-r--r--patches/server/0741-Missing-effect-cause.patch (renamed from patches/server/0742-Missing-effect-cause.patch)0
-rw-r--r--patches/server/0742-Added-byte-array-serialization-deserialization-for-P.patch (renamed from patches/server/0743-Added-byte-array-serialization-deserialization-for-P.patch)0
-rw-r--r--patches/server/0743-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch (renamed from patches/server/0744-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch)0
-rw-r--r--patches/server/0744-Call-BlockPhysicsEvent-more-often.patch (renamed from patches/server/0745-Call-BlockPhysicsEvent-more-often.patch)0
-rw-r--r--patches/server/0745-Configurable-chat-thread-limit.patch (renamed from patches/server/0746-Configurable-chat-thread-limit.patch)2
-rw-r--r--patches/server/0746-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch (renamed from patches/server/0747-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch)0
-rw-r--r--patches/server/0747-fix-Jigsaw-block-kicking-user.patch (renamed from patches/server/0748-fix-Jigsaw-block-kicking-user.patch)0
-rw-r--r--patches/server/0748-use-BlockFormEvent-for-mud-converting-into-clay.patch (renamed from patches/server/0749-use-BlockFormEvent-for-mud-converting-into-clay.patch)0
-rw-r--r--patches/server/0749-Add-getDrops-to-BlockState.patch (renamed from patches/server/0750-Add-getDrops-to-BlockState.patch)0
-rw-r--r--patches/server/0750-Fix-a-bunch-of-vanilla-bugs.patch (renamed from patches/server/0751-Fix-a-bunch-of-vanilla-bugs.patch)6
-rw-r--r--patches/server/0751-Remove-unnecessary-onTrackingStart-during-navigation.patch (renamed from patches/server/0752-Remove-unnecessary-onTrackingStart-during-navigation.patch)2
-rw-r--r--patches/server/0752-Fix-custom-piglin-loved-items.patch (renamed from patches/server/0753-Fix-custom-piglin-loved-items.patch)0
-rw-r--r--patches/server/0753-EntityPickupItemEvent-fixes.patch (renamed from patches/server/0754-EntityPickupItemEvent-fixes.patch)0
-rw-r--r--patches/server/0754-Correctly-handle-interactions-with-items-on-cooldown.patch (renamed from patches/server/0755-Correctly-handle-interactions-with-items-on-cooldown.patch)0
-rw-r--r--patches/server/0755-Add-PlayerInventorySlotChangeEvent.patch (renamed from patches/server/0756-Add-PlayerInventorySlotChangeEvent.patch)4
-rw-r--r--patches/server/0756-Elder-Guardian-appearance-API.patch (renamed from patches/server/0757-Elder-Guardian-appearance-API.patch)2
-rw-r--r--patches/server/0757-Allow-changing-bed-s-occupied-property.patch (renamed from patches/server/0758-Allow-changing-bed-s-occupied-property.patch)0
-rw-r--r--patches/server/0758-Add-entity-knockback-API.patch (renamed from patches/server/0759-Add-entity-knockback-API.patch)0
-rw-r--r--patches/server/0759-Detect-headless-JREs.patch (renamed from patches/server/0760-Detect-headless-JREs.patch)0
-rw-r--r--patches/server/0760-fix-entity-vehicle-collision-event-not-called.patch (renamed from patches/server/0761-fix-entity-vehicle-collision-event-not-called.patch)0
-rw-r--r--patches/server/0761-Add-EntityToggleSitEvent.patch (renamed from patches/server/0762-Add-EntityToggleSitEvent.patch)0
-rw-r--r--patches/server/0762-Add-fire-tick-delay-option.patch (renamed from patches/server/0763-Add-fire-tick-delay-option.patch)0
-rw-r--r--patches/server/0763-Add-Moving-Piston-API.patch (renamed from patches/server/0764-Add-Moving-Piston-API.patch)0
-rw-r--r--patches/server/0764-Ignore-impossible-spawn-tick.patch (renamed from patches/server/0765-Ignore-impossible-spawn-tick.patch)0
-rw-r--r--patches/server/0765-Fix-EntityArgument-suggestion-permissions-to-align-w.patch (renamed from patches/server/0766-Fix-EntityArgument-suggestion-permissions-to-align-w.patch)0
-rw-r--r--patches/server/0766-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch (renamed from patches/server/0767-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch)0
-rw-r--r--patches/server/0767-Add-PrePlayerAttackEntityEvent.patch (renamed from patches/server/0768-Add-PrePlayerAttackEntityEvent.patch)0
-rw-r--r--patches/server/0768-ensure-reset-EnderDragon-boss-event-name.patch (renamed from patches/server/0769-ensure-reset-EnderDragon-boss-event-name.patch)0
-rw-r--r--patches/server/0769-Add-Player-Warden-Warning-API.patch (renamed from patches/server/0770-Add-Player-Warden-Warning-API.patch)2
-rw-r--r--patches/server/0770-More-vanilla-friendly-methods-to-update-trades.patch (renamed from patches/server/0771-More-vanilla-friendly-methods-to-update-trades.patch)0
-rw-r--r--patches/server/0771-Add-paper-dumplisteners-command.patch (renamed from patches/server/0772-Add-paper-dumplisteners-command.patch)0
-rw-r--r--patches/server/0772-check-global-player-list-where-appropriate.patch (renamed from patches/server/0773-check-global-player-list-where-appropriate.patch)2
-rw-r--r--patches/server/0773-Fix-async-entity-add-due-to-fungus-trees.patch (renamed from patches/server/0774-Fix-async-entity-add-due-to-fungus-trees.patch)0
-rw-r--r--patches/server/0774-ItemStack-damage-API.patch (renamed from patches/server/0775-ItemStack-damage-API.patch)0
-rw-r--r--patches/server/0775-Friction-API.patch (renamed from patches/server/0776-Friction-API.patch)0
-rw-r--r--patches/server/0776-Ability-to-control-player-s-insomnia-and-phantoms.patch (renamed from patches/server/0777-Ability-to-control-player-s-insomnia-and-phantoms.patch)0
-rw-r--r--patches/server/0777-Fix-premature-player-kicks-on-shutdown.patch (renamed from patches/server/0778-Fix-premature-player-kicks-on-shutdown.patch)4
-rw-r--r--patches/server/0778-Sync-offhand-slot-in-menus.patch (renamed from patches/server/0779-Sync-offhand-slot-in-menus.patch)4
-rw-r--r--patches/server/0779-Player-Entity-Tracking-Events.patch (renamed from patches/server/0780-Player-Entity-Tracking-Events.patch)4
-rw-r--r--patches/server/0780-Limit-pet-look-distance.patch (renamed from patches/server/0781-Limit-pet-look-distance.patch)0
-rw-r--r--patches/server/0781-fix-Instruments.patch (renamed from patches/server/0782-fix-Instruments.patch)2
-rw-r--r--patches/server/0782-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch (renamed from patches/server/0783-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch)0
-rw-r--r--patches/server/0783-Fix-inconsistencies-in-dispense-events-regarding-sta.patch (renamed from patches/server/0784-Fix-inconsistencies-in-dispense-events-regarding-sta.patch)0
-rw-r--r--patches/server/0784-Add-BlockLockCheckEvent.patch (renamed from patches/server/0785-Add-BlockLockCheckEvent.patch)0
-rw-r--r--patches/server/0785-Add-Sneaking-API-for-Entities.patch (renamed from patches/server/0786-Add-Sneaking-API-for-Entities.patch)0
-rw-r--r--patches/server/0786-Improve-logging-and-errors.patch (renamed from patches/server/0787-Improve-logging-and-errors.patch)0
-rw-r--r--patches/server/0787-Improve-PortalEvents.patch (renamed from patches/server/0788-Improve-PortalEvents.patch)0
-rw-r--r--patches/server/0788-Add-config-option-for-spider-worldborder-climbing.patch (renamed from patches/server/0789-Add-config-option-for-spider-worldborder-climbing.patch)0
-rw-r--r--patches/server/0789-Add-missing-SpigotConfig-logCommands-check.patch (renamed from patches/server/0790-Add-missing-SpigotConfig-logCommands-check.patch)0
-rw-r--r--patches/server/0790-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch (renamed from patches/server/0791-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch)0
-rw-r--r--patches/server/0791-Flying-Fall-Damage.patch (renamed from patches/server/0792-Flying-Fall-Damage.patch)2
-rw-r--r--patches/server/0792-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch (renamed from patches/server/0793-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch)0
-rw-r--r--patches/server/0793-config-for-disabling-entity-tag-tags.patch (renamed from patches/server/0794-config-for-disabling-entity-tag-tags.patch)0
-rw-r--r--patches/server/0794-Use-single-player-info-update-packet-on-join.patch (renamed from patches/server/0795-Use-single-player-info-update-packet-on-join.patch)0
-rw-r--r--patches/server/0795-Correctly-shrink-items-during-EntityResurrectEvent.patch (renamed from patches/server/0796-Correctly-shrink-items-during-EntityResurrectEvent.patch)0
-rw-r--r--patches/server/0796-Win-Screen-API.patch (renamed from patches/server/0797-Win-Screen-API.patch)2
-rw-r--r--patches/server/0797-Remove-CraftItemStack-setAmount-null-assignment.patch (renamed from patches/server/0798-Remove-CraftItemStack-setAmount-null-assignment.patch)0
-rw-r--r--patches/server/0798-Fix-force-opening-enchantment-tables.patch (renamed from patches/server/0799-Fix-force-opening-enchantment-tables.patch)0
-rw-r--r--patches/server/0799-Add-Entity-Body-Yaw-API.patch (renamed from patches/server/0800-Add-Entity-Body-Yaw-API.patch)0
-rw-r--r--patches/server/0800-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch (renamed from patches/server/0801-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch)0
-rw-r--r--patches/server/0801-Add-EntityFertilizeEggEvent.patch (renamed from patches/server/0802-Add-EntityFertilizeEggEvent.patch)0
-rw-r--r--patches/server/0802-Fix-HumanEntity-drop-not-updating-the-client-inv.patch (renamed from patches/server/0803-Fix-HumanEntity-drop-not-updating-the-client-inv.patch)0
-rw-r--r--patches/server/0803-Add-CompostItemEvent-and-EntityCompostItemEvent.patch (renamed from patches/server/0804-Add-CompostItemEvent-and-EntityCompostItemEvent.patch)0
-rw-r--r--patches/server/0804-Correctly-handle-ArmorStand-invisibility.patch (renamed from patches/server/0805-Correctly-handle-ArmorStand-invisibility.patch)0
-rw-r--r--patches/server/0805-Fix-advancement-triggers-for-entity-damage.patch (renamed from patches/server/0806-Fix-advancement-triggers-for-entity-damage.patch)0
-rw-r--r--patches/server/0806-Fix-text-display-error-on-spawn.patch (renamed from patches/server/0807-Fix-text-display-error-on-spawn.patch)0
-rw-r--r--patches/server/0807-Fix-inventories-returning-null-Locations.patch (renamed from patches/server/0808-Fix-inventories-returning-null-Locations.patch)0
-rw-r--r--patches/server/0808-Add-Shearable-API.patch (renamed from patches/server/0809-Add-Shearable-API.patch)0
-rw-r--r--patches/server/0809-Fix-SpawnEggMeta-get-setSpawnedType.patch (renamed from patches/server/0810-Fix-SpawnEggMeta-get-setSpawnedType.patch)0
-rw-r--r--patches/server/0810-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch (renamed from patches/server/0811-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch)0
-rw-r--r--patches/server/0811-Treat-sequence-violations-like-they-should-be.patch (renamed from patches/server/0812-Treat-sequence-violations-like-they-should-be.patch)0
-rw-r--r--patches/server/0812-Prevent-causing-expired-keys-from-impacting-new-join.patch (renamed from patches/server/0813-Prevent-causing-expired-keys-from-impacting-new-join.patch)0
-rw-r--r--patches/server/0813-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch (renamed from patches/server/0814-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch)2
-rw-r--r--patches/server/0814-Use-array-for-gamerule-storage.patch (renamed from patches/server/0815-Use-array-for-gamerule-storage.patch)0
-rw-r--r--patches/server/0815-Fix-a-couple-of-upstream-bed-issues.patch (renamed from patches/server/0816-Fix-a-couple-of-upstream-bed-issues.patch)0
-rw-r--r--patches/server/0816-Fix-demo-flag-not-enabling-demo-mode.patch (renamed from patches/server/0817-Fix-demo-flag-not-enabling-demo-mode.patch)0
-rw-r--r--patches/server/0817-Add-Mob-Experience-reward-API.patch (renamed from patches/server/0818-Add-Mob-Experience-reward-API.patch)0
-rw-r--r--patches/server/0818-Break-redstone-on-top-of-trap-doors-early.patch (renamed from patches/server/0819-Break-redstone-on-top-of-trap-doors-early.patch)0
-rw-r--r--patches/server/0819-Avoid-Lazy-Initialization-for-Enum-Fields.patch (renamed from patches/server/0820-Avoid-Lazy-Initialization-for-Enum-Fields.patch)0
-rw-r--r--patches/server/0820-More-accurate-isInOpenWater-impl.patch (renamed from patches/server/0821-More-accurate-isInOpenWater-impl.patch)0
-rw-r--r--patches/server/0821-Expand-PlayerItemMendEvent.patch (renamed from patches/server/0822-Expand-PlayerItemMendEvent.patch)2
-rw-r--r--patches/server/0822-Refresh-ProjectileSource-for-projectiles.patch (renamed from patches/server/0823-Refresh-ProjectileSource-for-projectiles.patch)0
-rw-r--r--patches/server/0823-Add-transient-modifier-API.patch (renamed from patches/server/0824-Add-transient-modifier-API.patch)0
-rw-r--r--patches/server/0824-Fix-block-place-logic.patch (renamed from patches/server/0825-Fix-block-place-logic.patch)0
-rw-r--r--patches/server/0825-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch (renamed from patches/server/0826-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch)0
-rw-r--r--patches/server/0826-Call-BlockGrowEvent-for-missing-blocks.patch (renamed from patches/server/0827-Call-BlockGrowEvent-for-missing-blocks.patch)0
-rw-r--r--patches/server/0827-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch (renamed from patches/server/0828-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch)0
-rw-r--r--patches/server/0828-fix-MapLike-spam-for-missing-key-selector.patch (renamed from patches/server/0829-fix-MapLike-spam-for-missing-key-selector.patch)0
-rw-r--r--patches/server/0829-Fix-sniffer-removeExploredLocation.patch (renamed from patches/server/0830-Fix-sniffer-removeExploredLocation.patch)0
-rw-r--r--patches/server/0830-Add-method-to-remove-all-active-potion-effects.patch (renamed from patches/server/0831-Add-method-to-remove-all-active-potion-effects.patch)0
-rw-r--r--patches/server/0831-Fix-incorrect-crafting-result-amount-for-fireworks.patch (renamed from patches/server/0832-Fix-incorrect-crafting-result-amount-for-fireworks.patch)0
-rw-r--r--patches/server/0832-Add-event-for-player-editing-sign.patch (renamed from patches/server/0833-Add-event-for-player-editing-sign.patch)0
-rw-r--r--patches/server/0833-Only-tick-item-frames-if-players-can-see-it.patch (renamed from patches/server/0834-Only-tick-item-frames-if-players-can-see-it.patch)0
-rw-r--r--patches/server/0834-Fix-cmd-permission-levels-for-command-blocks.patch (renamed from patches/server/0835-Fix-cmd-permission-levels-for-command-blocks.patch)0
-rw-r--r--patches/server/0835-Add-option-to-disable-block-updates.patch (renamed from patches/server/0836-Add-option-to-disable-block-updates.patch)0
-rw-r--r--patches/server/0836-Call-missing-BlockDispenseEvent.patch (renamed from patches/server/0837-Call-missing-BlockDispenseEvent.patch)0
-rw-r--r--patches/server/0837-Don-t-load-chunks-for-supporting-block-checks.patch (renamed from patches/server/0838-Don-t-load-chunks-for-supporting-block-checks.patch)0
-rw-r--r--patches/server/0838-Optimize-player-lookups-for-beacons.patch (renamed from patches/server/0839-Optimize-player-lookups-for-beacons.patch)0
-rw-r--r--patches/server/0839-Add-Sign-getInteractableSideFor.patch (renamed from patches/server/0840-Add-Sign-getInteractableSideFor.patch)0
-rw-r--r--patches/server/0840-fix-item-meta-for-tadpole-buckets.patch (renamed from patches/server/0841-fix-item-meta-for-tadpole-buckets.patch)0
-rw-r--r--patches/server/0841-Fix-BanList-API.patch (renamed from patches/server/0842-Fix-BanList-API.patch)2
-rw-r--r--patches/server/0842-Determine-lava-and-water-fluid-explosion-resistance-.patch (renamed from patches/server/0843-Determine-lava-and-water-fluid-explosion-resistance-.patch)0
-rw-r--r--patches/server/0843-Fix-possible-NPE-on-painting-creation.patch (renamed from patches/server/0844-Fix-possible-NPE-on-painting-creation.patch)0
-rw-r--r--patches/server/0844-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch (renamed from patches/server/0845-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch)0
-rw-r--r--patches/server/0845-ExperienceOrb-should-call-EntitySpawnEvent.patch (renamed from patches/server/0846-ExperienceOrb-should-call-EntitySpawnEvent.patch)0
-rw-r--r--patches/server/0846-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch (renamed from patches/server/0847-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch)0
-rw-r--r--patches/server/0847-Add-whitelist-events.patch (renamed from patches/server/0848-Add-whitelist-events.patch)0
-rw-r--r--patches/server/0848-Implement-PlayerFailMoveEvent.patch (renamed from patches/server/0849-Implement-PlayerFailMoveEvent.patch)0
-rw-r--r--patches/server/0849-Folia-scheduler-and-owned-region-API.patch (renamed from patches/server/0850-Folia-scheduler-and-owned-region-API.patch)24
-rw-r--r--patches/server/0850-Only-erase-allay-memory-on-non-item-targets.patch (renamed from patches/server/0851-Only-erase-allay-memory-on-non-item-targets.patch)0
-rw-r--r--patches/server/0851-API-for-updating-recipes-on-clients.patch (renamed from patches/server/0852-API-for-updating-recipes-on-clients.patch)2
-rw-r--r--patches/server/0852-Fix-rotation-when-spawning-display-entities.patch (renamed from patches/server/0853-Fix-rotation-when-spawning-display-entities.patch)0
-rw-r--r--patches/server/0853-Only-capture-actual-tree-growth.patch (renamed from patches/server/0854-Only-capture-actual-tree-growth.patch)0
-rw-r--r--patches/server/0854-Use-correct-source-for-mushroom-block-spread-event.patch (renamed from patches/server/0855-Use-correct-source-for-mushroom-block-spread-event.patch)0
-rw-r--r--patches/server/0855-Respect-randomizeData-on-more-entities-when-spawning.patch (renamed from patches/server/0856-Respect-randomizeData-on-more-entities-when-spawning.patch)0
-rw-r--r--patches/server/0856-Use-correct-seed-on-api-world-load.patch (renamed from patches/server/0857-Use-correct-seed-on-api-world-load.patch)2
-rw-r--r--patches/server/0857-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch (renamed from patches/server/0858-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch)0
-rw-r--r--patches/server/0858-Cache-map-ids-on-item-frames.patch (renamed from patches/server/0859-Cache-map-ids-on-item-frames.patch)0
-rw-r--r--patches/server/0859-Fix-custom-statistic-criteria-creation.patch (renamed from patches/server/0860-Fix-custom-statistic-criteria-creation.patch)0
-rw-r--r--patches/server/0860-Bandaid-fix-for-Effect.patch (renamed from patches/server/0861-Bandaid-fix-for-Effect.patch)4
-rw-r--r--patches/server/0861-SculkCatalyst-bloom-API.patch (renamed from patches/server/0862-SculkCatalyst-bloom-API.patch)0
-rw-r--r--patches/server/0862-API-for-an-entity-s-scoreboard-name.patch (renamed from patches/server/0863-API-for-an-entity-s-scoreboard-name.patch)0
-rw-r--r--patches/server/0863-Deprecate-and-replace-methods-with-old-StructureType.patch (renamed from patches/server/0864-Deprecate-and-replace-methods-with-old-StructureType.patch)2
-rw-r--r--patches/server/0864-Don-t-tab-complete-namespaced-commands-if-send-names.patch (renamed from patches/server/0865-Don-t-tab-complete-namespaced-commands-if-send-names.patch)0
-rw-r--r--patches/server/0865-Properly-handle-BlockBreakEvent-isDropItems.patch (renamed from patches/server/0866-Properly-handle-BlockBreakEvent-isDropItems.patch)0
-rw-r--r--patches/server/0866-Fire-entity-death-event-for-ender-dragon.patch (renamed from patches/server/0867-Fire-entity-death-event-for-ender-dragon.patch)0
-rw-r--r--patches/server/0867-Configurable-entity-tracking-range-by-Y-coordinate.patch (renamed from patches/server/0868-Configurable-entity-tracking-range-by-Y-coordinate.patch)4
-rw-r--r--patches/server/0868-Add-Listing-API-for-Player.patch (renamed from patches/server/0869-Add-Listing-API-for-Player.patch)2
-rw-r--r--patches/server/0869-Configurable-Region-Compression-Format.patch (renamed from patches/server/0870-Configurable-Region-Compression-Format.patch)0
-rw-r--r--patches/server/0870-Add-BlockFace-to-BlockDamageEvent.patch (renamed from patches/server/0871-Add-BlockFace-to-BlockDamageEvent.patch)0
-rw-r--r--patches/server/0871-Fix-NPE-on-Boat-getStatus.patch (renamed from patches/server/0872-Fix-NPE-on-Boat-getStatus.patch)0
-rw-r--r--patches/server/0872-Expand-Pose-API.patch (renamed from patches/server/0873-Expand-Pose-API.patch)0
-rw-r--r--patches/server/0873-More-DragonBattle-API.patch (renamed from patches/server/0874-More-DragonBattle-API.patch)0
-rw-r--r--patches/server/0874-Add-PlayerPickItemEvent.patch (renamed from patches/server/0875-Add-PlayerPickItemEvent.patch)0
-rw-r--r--patches/server/0875-Allow-trident-custom-damage.patch (renamed from patches/server/0876-Allow-trident-custom-damage.patch)0
-rw-r--r--patches/server/0876-Expose-hand-in-BlockCanBuildEvent.patch (renamed from patches/server/0877-Expose-hand-in-BlockCanBuildEvent.patch)0
-rw-r--r--patches/server/0877-Optimize-nearest-structure-border-iteration.patch (renamed from patches/server/0878-Optimize-nearest-structure-border-iteration.patch)0
-rw-r--r--patches/server/0878-Implement-OfflinePlayer-isConnected.patch (renamed from patches/server/0879-Implement-OfflinePlayer-isConnected.patch)2
-rw-r--r--patches/server/0879-Fix-inventory-desync.patch (renamed from patches/server/0880-Fix-inventory-desync.patch)4
-rw-r--r--patches/server/0880-Add-titleOverride-to-InventoryOpenEvent.patch (renamed from patches/server/0881-Add-titleOverride-to-InventoryOpenEvent.patch)6
-rw-r--r--patches/server/0881-Configure-sniffer-egg-hatch-time.patch (renamed from patches/server/0882-Configure-sniffer-egg-hatch-time.patch)0
-rw-r--r--patches/server/0882-Do-crystal-portal-proximity-check-before-entity-look.patch (renamed from patches/server/0883-Do-crystal-portal-proximity-check-before-entity-look.patch)0
-rw-r--r--patches/server/0883-Skip-POI-finding-if-stuck-in-vehicle.patch (renamed from patches/server/0884-Skip-POI-finding-if-stuck-in-vehicle.patch)0
-rw-r--r--patches/server/0884-Add-slot-sanity-checks-in-container-clicks.patch (renamed from patches/server/0885-Add-slot-sanity-checks-in-container-clicks.patch)0
-rw-r--r--patches/server/0885-Call-BlockRedstoneEvents-for-lecterns.patch (renamed from patches/server/0886-Call-BlockRedstoneEvents-for-lecterns.patch)0
-rw-r--r--patches/server/0886-Allow-proper-checking-of-empty-item-stacks.patch (renamed from patches/server/0887-Allow-proper-checking-of-empty-item-stacks.patch)0
-rw-r--r--patches/server/0887-Fix-silent-equipment-change-for-mobs.patch (renamed from patches/server/0888-Fix-silent-equipment-change-for-mobs.patch)0
-rw-r--r--patches/server/0888-Fix-spigot-s-Forced-Stats.patch (renamed from patches/server/0889-Fix-spigot-s-Forced-Stats.patch)0
-rw-r--r--patches/server/0889-Add-missing-InventoryHolders-to-inventories.patch (renamed from patches/server/0890-Add-missing-InventoryHolders-to-inventories.patch)0
-rw-r--r--patches/server/0890-Do-not-read-tile-entities-in-chunks-that-are-positio.patch (renamed from patches/server/0891-Do-not-read-tile-entities-in-chunks-that-are-positio.patch)0
-rw-r--r--patches/server/0891-Add-missing-logs-for-log-ips-config-option.patch (renamed from patches/server/0892-Add-missing-logs-for-log-ips-config-option.patch)0
-rw-r--r--patches/server/0892-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch (renamed from patches/server/0893-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch)0
-rw-r--r--patches/server/0893-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch (renamed from patches/server/0894-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch)0
-rw-r--r--patches/server/0894-Fix-team-sidebar-objectives-not-being-cleared.patch (renamed from patches/server/0895-Fix-team-sidebar-objectives-not-being-cleared.patch)0
-rw-r--r--patches/server/0895-Fix-missing-map-initialize-event-call.patch (renamed from patches/server/0896-Fix-missing-map-initialize-event-call.patch)2
-rw-r--r--patches/server/0896-Update-entity-data-when-attaching-firework-to-entity.patch (renamed from patches/server/0897-Update-entity-data-when-attaching-firework-to-entity.patch)0
-rw-r--r--patches/server/0897-Fix-UnsafeValues-loadAdvancement.patch (renamed from patches/server/0898-Fix-UnsafeValues-loadAdvancement.patch)0
-rw-r--r--patches/server/0898-Add-player-idle-duration-API.patch (renamed from patches/server/0899-Add-player-idle-duration-API.patch)2
-rw-r--r--patches/server/0899-Don-t-check-if-we-can-see-non-visible-entities.patch (renamed from patches/server/0900-Don-t-check-if-we-can-see-non-visible-entities.patch)4
-rw-r--r--patches/server/0900-Fix-NPE-in-SculkBloomEvent-world-access.patch (renamed from patches/server/0901-Fix-NPE-in-SculkBloomEvent-world-access.patch)0
-rw-r--r--patches/server/0901-Allow-null-itemstack-for-Player-sendEquipmentChange.patch (renamed from patches/server/0902-Allow-null-itemstack-for-Player-sendEquipmentChange.patch)2
-rw-r--r--patches/server/0902-Optimize-VarInts.patch (renamed from patches/server/0903-Optimize-VarInts.patch)0
-rw-r--r--patches/server/0903-Add-API-to-get-the-collision-shape-of-a-block-before.patch (renamed from patches/server/0904-Add-API-to-get-the-collision-shape-of-a-block-before.patch)0
-rw-r--r--patches/server/0904-Add-predicate-for-blocks-when-raytracing.patch (renamed from patches/server/0905-Add-predicate-for-blocks-when-raytracing.patch)2
-rw-r--r--patches/server/0905-Broadcast-take-item-packets-with-collector-as-source.patch (renamed from patches/server/0906-Broadcast-take-item-packets-with-collector-as-source.patch)0
-rw-r--r--patches/server/0906-Expand-LingeringPotion-API.patch (renamed from patches/server/0907-Expand-LingeringPotion-API.patch)0
-rw-r--r--patches/server/0907-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch (renamed from patches/server/0908-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch)2
-rw-r--r--patches/server/0908-Add-hand-to-fish-event-for-all-player-interactions.patch (renamed from patches/server/0909-Add-hand-to-fish-event-for-all-player-interactions.patch)0
-rw-r--r--patches/server/0909-Fix-several-issues-with-EntityBreedEvent.patch (renamed from patches/server/0910-Fix-several-issues-with-EntityBreedEvent.patch)0
-rw-r--r--patches/server/0910-Add-UUID-attribute-modifier-API.patch (renamed from patches/server/0911-Add-UUID-attribute-modifier-API.patch)0
-rw-r--r--patches/server/0911-Fix-missing-event-call-for-entity-teleport-API.patch (renamed from patches/server/0912-Fix-missing-event-call-for-entity-teleport-API.patch)0
-rw-r--r--patches/server/0912-Lazily-create-LootContext-for-criterions.patch (renamed from patches/server/0913-Lazily-create-LootContext-for-criterions.patch)0
-rw-r--r--patches/server/0913-Don-t-fire-sync-events-during-worldgen.patch (renamed from patches/server/0914-Don-t-fire-sync-events-during-worldgen.patch)2
-rw-r--r--patches/server/0914-Add-Structure-check-API.patch (renamed from patches/server/0915-Add-Structure-check-API.patch)2
-rw-r--r--patches/server/0915-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch (renamed from patches/server/0916-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch)0
-rw-r--r--patches/server/0916-Restore-vanilla-entity-drops-behavior.patch (renamed from patches/server/0917-Restore-vanilla-entity-drops-behavior.patch)4
-rw-r--r--patches/server/0917-Dont-resend-blocks-on-interactions.patch (renamed from patches/server/0918-Dont-resend-blocks-on-interactions.patch)0
-rw-r--r--patches/server/0918-add-more-scoreboard-API.patch (renamed from patches/server/0919-add-more-scoreboard-API.patch)0
-rw-r--r--patches/server/0919-Improve-Registry.patch (renamed from patches/server/0920-Improve-Registry.patch)0
-rw-r--r--patches/server/0920-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch (renamed from patches/server/0921-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch)0
-rw-r--r--patches/server/0921-Add-experience-points-API.patch (renamed from patches/server/0922-Add-experience-points-API.patch)2
-rw-r--r--patches/server/0922-Add-drops-to-shear-events.patch (renamed from patches/server/0923-Add-drops-to-shear-events.patch)0
-rw-r--r--patches/server/0923-Add-PlayerShieldDisableEvent.patch (renamed from patches/server/0924-Add-PlayerShieldDisableEvent.patch)0
-rw-r--r--patches/server/0924-Validate-ResourceLocation-in-NBT-reading.patch (renamed from patches/server/0925-Validate-ResourceLocation-in-NBT-reading.patch)0
-rw-r--r--patches/server/0925-Properly-handle-experience-dropping-on-block-break.patch (renamed from patches/server/0926-Properly-handle-experience-dropping-on-block-break.patch)0
-rw-r--r--patches/server/0926-Fixup-NamespacedKey-handling.patch (renamed from patches/server/0927-Fixup-NamespacedKey-handling.patch)0
-rw-r--r--patches/server/0927-Expose-LootTable-of-DecoratedPot.patch (renamed from patches/server/0928-Expose-LootTable-of-DecoratedPot.patch)0
-rw-r--r--patches/server/0928-Reduce-allocation-of-Vec3D-by-entity-tracker.patch (renamed from patches/server/0929-Reduce-allocation-of-Vec3D-by-entity-tracker.patch)4
-rw-r--r--patches/server/0929-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch (renamed from patches/server/0930-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch)0
-rw-r--r--patches/server/0930-Add-ShulkerDuplicateEvent.patch (renamed from patches/server/0931-Add-ShulkerDuplicateEvent.patch)0
-rw-r--r--patches/server/0931-Add-api-for-spawn-egg-texture-colors.patch (renamed from patches/server/0932-Add-api-for-spawn-egg-texture-colors.patch)0
-rw-r--r--patches/server/0932-Add-Lifecycle-Event-system.patch (renamed from patches/server/0933-Add-Lifecycle-Event-system.patch)2
-rw-r--r--patches/server/0933-ItemStack-Tooltip-API.patch (renamed from patches/server/0934-ItemStack-Tooltip-API.patch)0
-rw-r--r--patches/server/0934-Add-getChunkSnapshot-includeLightData-parameter.patch (renamed from patches/server/0935-Add-getChunkSnapshot-includeLightData-parameter.patch)0
-rw-r--r--patches/server/0935-Add-FluidState-API.patch (renamed from patches/server/0936-Add-FluidState-API.patch)0
-rw-r--r--patches/server/0936-add-number-format-api.patch (renamed from patches/server/0937-add-number-format-api.patch)0
-rw-r--r--patches/server/0937-improve-BanList-types.patch (renamed from patches/server/0938-improve-BanList-types.patch)2
-rw-r--r--patches/server/0938-Expanded-Hopper-API.patch (renamed from patches/server/0939-Expanded-Hopper-API.patch)0
-rw-r--r--patches/server/0939-Add-BlockBreakProgressUpdateEvent.patch (renamed from patches/server/0940-Add-BlockBreakProgressUpdateEvent.patch)2
-rw-r--r--patches/server/0940-Deprecate-ItemStack-setType.patch (renamed from patches/server/0941-Deprecate-ItemStack-setType.patch)0
-rw-r--r--patches/server/0941-Add-CartographyItemEvent.patch (renamed from patches/server/0942-Add-CartographyItemEvent.patch)0
-rw-r--r--patches/server/0942-More-Raid-API.patch (renamed from patches/server/0943-More-Raid-API.patch)2
-rw-r--r--patches/server/0943-Add-onboarding-message-for-initial-server-start.patch (renamed from patches/server/0944-Add-onboarding-message-for-initial-server-start.patch)4
-rw-r--r--patches/server/0944-Configurable-max-block-fluid-ticks.patch (renamed from patches/server/0945-Configurable-max-block-fluid-ticks.patch)2
-rw-r--r--patches/server/0945-Fix-bees-aging-inside-hives.patch (renamed from patches/server/0946-Fix-bees-aging-inside-hives.patch)0
-rw-r--r--patches/server/0946-Disable-memory-reserve-allocating.patch (renamed from patches/server/0947-Disable-memory-reserve-allocating.patch)0
-rw-r--r--patches/server/0947-Fire-EntityDamageByEntityEvent-for-unowned-wither-sk.patch (renamed from patches/server/0948-Fire-EntityDamageByEntityEvent-for-unowned-wither-sk.patch)0
-rw-r--r--patches/server/0948-Fix-DamageSource-API.patch (renamed from patches/server/0949-Fix-DamageSource-API.patch)0
-rw-r--r--patches/server/0949-Fix-creation-of-invalid-block-entity-during-world-ge.patch (renamed from patches/server/0950-Fix-creation-of-invalid-block-entity-during-world-ge.patch)0
-rw-r--r--patches/server/0950-Fix-possible-StackOverflowError-for-some-dispenses.patch (renamed from patches/server/0951-Fix-possible-StackOverflowError-for-some-dispenses.patch)0
-rw-r--r--patches/server/0951-Improve-tag-parser-handling.patch (renamed from patches/server/0952-Improve-tag-parser-handling.patch)0
-rw-r--r--patches/server/0952-Item-Mutation-Fixes.patch (renamed from patches/server/0953-Item-Mutation-Fixes.patch)0
-rw-r--r--patches/server/0953-Per-world-ticks-per-spawn-settings.patch (renamed from patches/server/0954-Per-world-ticks-per-spawn-settings.patch)0
-rw-r--r--patches/server/0954-Properly-track-the-changed-item-from-dispense-events.patch (renamed from patches/server/0955-Properly-track-the-changed-item-from-dispense-events.patch)0
-rw-r--r--patches/server/0955-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch (renamed from patches/server/0956-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch)0
-rw-r--r--patches/server/0956-Fix-tripwire-disarming-not-working-as-intended.patch (renamed from patches/server/0957-Fix-tripwire-disarming-not-working-as-intended.patch)0
-rw-r--r--patches/server/0957-Add-config-for-mobs-immune-to-default-effects.patch (renamed from patches/server/0958-Add-config-for-mobs-immune-to-default-effects.patch)0
-rw-r--r--patches/server/0958-Deep-clone-nbt-tags-in-PDC.patch (renamed from patches/server/0959-Deep-clone-nbt-tags-in-PDC.patch)0
-rw-r--r--patches/server/0959-Support-old-UUID-format-for-NBT.patch (renamed from patches/server/0960-Support-old-UUID-format-for-NBT.patch)0
-rw-r--r--patches/server/0960-Fix-shield-disable-inconsistency.patch (renamed from patches/server/0961-Fix-shield-disable-inconsistency.patch)0
-rw-r--r--patches/server/0961-Handle-Large-Packets-disconnecting-client.patch (renamed from patches/server/0962-Handle-Large-Packets-disconnecting-client.patch)0
-rw-r--r--patches/server/0962-Fix-ItemFlags.patch (renamed from patches/server/0963-Fix-ItemFlags.patch)0
-rw-r--r--patches/server/0963-Fix-Player-setBlockUpdate.patch (renamed from patches/server/0964-Fix-Player-setBlockUpdate.patch)2
-rw-r--r--patches/server/0964-Fix-helmet-damage-reduction-inconsistencies.patch (renamed from patches/server/0965-Fix-helmet-damage-reduction-inconsistencies.patch)0
-rw-r--r--patches/server/0965-Revert-to-vanilla-handling-of-LivingEntity-actuallyH.patch (renamed from patches/server/0966-Revert-to-vanilla-handling-of-LivingEntity-actuallyH.patch)0
-rw-r--r--patches/server/0966-improve-checking-handled-tags-in-itemmeta.patch (renamed from patches/server/0967-improve-checking-handled-tags-in-itemmeta.patch)0
-rw-r--r--patches/server/0967-General-ItemMeta-fixes.patch (renamed from patches/server/0968-General-ItemMeta-fixes.patch)0
-rw-r--r--patches/server/0968-Expose-hasColor-to-leather-armor.patch (renamed from patches/server/0969-Expose-hasColor-to-leather-armor.patch)0
-rw-r--r--patches/server/0969-Added-API-to-get-player-ha-proxy-address.patch (renamed from patches/server/0970-Added-API-to-get-player-ha-proxy-address.patch)2
-rw-r--r--patches/server/0970-More-Chest-Block-API.patch (renamed from patches/server/0971-More-Chest-Block-API.patch)0
-rw-r--r--patches/server/0971-Print-data-component-type-on-encoding-error.patch (renamed from patches/server/0972-Print-data-component-type-on-encoding-error.patch)0
-rw-r--r--patches/server/0972-Brigadier-based-command-API.patch (renamed from patches/server/0973-Brigadier-based-command-API.patch)8
-rw-r--r--patches/server/0973-Fix-issues-with-Recipe-API.patch (renamed from patches/server/0974-Fix-issues-with-Recipe-API.patch)0
-rw-r--r--patches/server/0974-Fix-equipment-slot-and-group-API.patch (renamed from patches/server/0975-Fix-equipment-slot-and-group-API.patch)0
-rw-r--r--patches/server/0975-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch (renamed from patches/server/0976-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch)0
-rw-r--r--patches/server/0976-Prevent-sending-oversized-item-data-in-equipment-and.patch (renamed from patches/server/0977-Prevent-sending-oversized-item-data-in-equipment-and.patch)0
-rw-r--r--patches/server/0977-Prevent-NPE-if-hooked-entity-was-cleared.patch (renamed from patches/server/0978-Prevent-NPE-if-hooked-entity-was-cleared.patch)0
-rw-r--r--patches/server/0978-Fix-cancelling-BlockPlaceEvent-calling-onRemove.patch (renamed from patches/server/0979-Fix-cancelling-BlockPlaceEvent-calling-onRemove.patch)0
-rw-r--r--patches/server/0979-Add-missing-fishing-event-state.patch (renamed from patches/server/0980-Add-missing-fishing-event-state.patch)0
-rw-r--r--patches/server/0980-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch (renamed from patches/server/0981-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch)0
-rw-r--r--patches/server/0981-Fix-sending-disconnect-packet-in-phases-where-it-doe.patch (renamed from patches/server/0982-Fix-sending-disconnect-packet-in-phases-where-it-doe.patch)0
-rw-r--r--patches/server/0982-Adopt-MaterialRerouting.patch (renamed from patches/server/0983-Adopt-MaterialRerouting.patch)0
-rw-r--r--patches/server/0983-Suspicious-Effect-Entry-API.patch (renamed from patches/server/0984-Suspicious-Effect-Entry-API.patch)0
-rw-r--r--patches/server/0984-check-if-itemstack-is-stackable-first.patch (renamed from patches/server/0985-check-if-itemstack-is-stackable-first.patch)0
-rw-r--r--patches/server/0985-Fix-removing-recipes-from-RecipeIterator.patch (renamed from patches/server/0986-Fix-removing-recipes-from-RecipeIterator.patch)0
-rw-r--r--patches/server/0986-Configurable-damage-tick-when-blocking-with-shield.patch (renamed from patches/server/0987-Configurable-damage-tick-when-blocking-with-shield.patch)0
-rw-r--r--patches/server/0987-Properly-remove-the-experimental-smithing-inventory-.patch (renamed from patches/server/0988-Properly-remove-the-experimental-smithing-inventory-.patch)0
-rw-r--r--patches/server/0988-Moonrise-optimisation-patches.patch (renamed from patches/server/0989-Moonrise-optimisation-patches.patch)4782
-rw-r--r--patches/server/0989-Rewrite-dataconverter-system.patch (renamed from patches/server/0990-Rewrite-dataconverter-system.patch)0
-rw-r--r--patches/server/0990-disable-forced-empty-world-ticks.patch (renamed from patches/server/0991-disable-forced-empty-world-ticks.patch)4
-rw-r--r--patches/server/0991-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch (renamed from patches/server/0992-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch)2
-rw-r--r--patches/server/0992-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch (renamed from patches/server/0993-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch)4
-rw-r--r--patches/server/0993-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch (renamed from patches/server/0994-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch)2
-rw-r--r--patches/server/0994-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/0995-Allow-Saving-of-Oversized-Chunks.patch (renamed from patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch)0
-rw-r--r--patches/server/0996-Flat-bedrock-generator-settings.patch (renamed from patches/server/0997-Flat-bedrock-generator-settings.patch)0
-rw-r--r--patches/server/0997-Entity-Activation-Range-2.0.patch (renamed from patches/server/0998-Entity-Activation-Range-2.0.patch)14
-rw-r--r--patches/server/0998-Optional-per-player-mob-spawns.patch (renamed from patches/server/0999-Optional-per-player-mob-spawns.patch)30
-rw-r--r--patches/server/0999-Anti-Xray.patch (renamed from patches/server/1000-Anti-Xray.patch)14
-rw-r--r--patches/server/1000-Eigencraft-redstone-implementation.patch (renamed from patches/server/1001-Eigencraft-redstone-implementation.patch)0
-rw-r--r--patches/server/1001-Add-Alternate-Current-redstone-implementation.patch (renamed from patches/server/1002-Add-Alternate-Current-redstone-implementation.patch)6
-rw-r--r--patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch (renamed from patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch)22
-rw-r--r--patches/server/1003-Use-Velocity-compression-and-cipher-natives.patch (renamed from patches/server/1004-Use-Velocity-compression-and-cipher-natives.patch)0
-rw-r--r--patches/server/1004-Optimize-Collision-to-not-load-chunks.patch (renamed from patches/server/1005-Optimize-Collision-to-not-load-chunks.patch)0
-rw-r--r--patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch (renamed from patches/server/1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch)30
-rw-r--r--patches/server/1006-Optimize-Hoppers.patch (renamed from patches/server/1007-Optimize-Hoppers.patch)4
-rw-r--r--patches/server/1007-Entity-load-save-limit-per-chunk.patch (renamed from patches/server/1008-Entity-load-save-limit-per-chunk.patch)0
-rw-r--r--patches/server/1008-Optimize-Voxel-Shape-Merging.patch (renamed from patches/server/1009-Optimize-Voxel-Shape-Merging.patch)0
-rw-r--r--patches/server/1009-Optimize-Bit-Operations-by-inlining.patch (renamed from patches/server/1010-Optimize-Bit-Operations-by-inlining.patch)0
-rw-r--r--patches/server/1010-Remove-streams-from-hot-code.patch (renamed from patches/server/1011-Remove-streams-from-hot-code.patch)0
-rw-r--r--patches/server/1011-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch (renamed from patches/server/1012-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch)0
-rw-r--r--patches/server/1012-Custom-table-implementation-for-blockstate-state-loo.patch (renamed from patches/server/1013-Custom-table-implementation-for-blockstate-state-loo.patch)0
-rw-r--r--patches/server/1013-Fix-entity-type-tags-suggestions-in-selectors.patch (renamed from patches/server/1014-Fix-entity-type-tags-suggestions-in-selectors.patch)0
-rw-r--r--patches/server/1014-Handle-Oversized-block-entities-in-chunks.patch (renamed from patches/server/1015-Handle-Oversized-block-entities-in-chunks.patch)0
-rw-r--r--patches/server/1015-API-for-checking-sent-chunks.patch (renamed from patches/server/1016-API-for-checking-sent-chunks.patch)4
-rw-r--r--patches/server/1016-Check-distance-in-entity-interactions.patch (renamed from patches/server/1017-Check-distance-in-entity-interactions.patch)0
-rw-r--r--patches/server/1017-Configurable-Sand-Duping.patch (renamed from patches/server/1018-Configurable-Sand-Duping.patch)0
-rw-r--r--patches/server/1018-Optimise-general-POI-access.patch (renamed from patches/server/1019-Optimise-general-POI-access.patch)8
-rw-r--r--patches/server/1019-Improve-performance-of-mass-crafts.patch (renamed from patches/server/1020-Improve-performance-of-mass-crafts.patch)0
-rw-r--r--patches/server/1020-Properly-resend-entities.patch (renamed from patches/server/1021-Properly-resend-entities.patch)0
-rw-r--r--patches/server/1021-Registry-Modification-API.patch (renamed from patches/server/1022-Registry-Modification-API.patch)0
-rw-r--r--patches/server/1022-Add-registry-entry-and-builders.patch (renamed from patches/server/1023-Add-registry-entry-and-builders.patch)0
-rw-r--r--patches/server/1023-Improved-Watchdog-Support.patch (renamed from patches/server/1024-Improved-Watchdog-Support.patch)22
-rw-r--r--patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch (renamed from patches/server/1025-Proxy-ItemStack-to-CraftItemStack.patch)0
-rw-r--r--patches/server/1025-Make-a-PDC-view-accessible-directly-from-ItemStack.patch (renamed from patches/server/1026-Make-a-PDC-view-accessible-directly-from-ItemStack.patch)0
-rw-r--r--patches/server/1026-Prioritize-Minecraft-commands-in-function-parsing-an.patch (renamed from patches/server/1027-Prioritize-Minecraft-commands-in-function-parsing-an.patch)0
-rw-r--r--patches/server/1027-optimize-dirt-and-snow-spreading.patch (renamed from patches/server/1028-optimize-dirt-and-snow-spreading.patch)0
-rw-r--r--patches/server/1028-Fix-NPE-for-Jukebox-setRecord.patch (renamed from patches/server/1029-Fix-NPE-for-Jukebox-setRecord.patch)0
-rw-r--r--patches/server/1029-Fix-CraftWorld-isChunkGenerated.patch (renamed from patches/server/1030-Fix-CraftWorld-isChunkGenerated.patch)4
-rw-r--r--patches/server/1030-Add-debug-for-chunk-system-unload-crash.patch (renamed from patches/server/1031-Add-debug-for-chunk-system-unload-crash.patch)6
-rw-r--r--patches/server/1031-fix-horse-inventories.patch (renamed from patches/server/1032-fix-horse-inventories.patch)0
-rw-r--r--patches/server/1032-Only-call-EntityDamageEvents-before-actuallyHurt.patch (renamed from patches/server/1033-Only-call-EntityDamageEvents-before-actuallyHurt.patch)0
-rw-r--r--patches/server/1033-Fix-entity-tracker-desync-when-new-players-are-added.patch (renamed from patches/server/1034-Fix-entity-tracker-desync-when-new-players-are-added.patch)4
-rw-r--r--patches/server/1034-Lag-compensation-ticks.patch (renamed from patches/server/1035-Lag-compensation-ticks.patch)10
-rw-r--r--patches/server/1035-Detail-more-information-in-watchdog-dumps.patch (renamed from patches/server/1036-Detail-more-information-in-watchdog-dumps.patch)18
-rw-r--r--patches/server/1036-Write-SavedData-IO-async.patch (renamed from patches/server/1037-Write-SavedData-IO-async.patch)10
-rw-r--r--patches/server/1037-Correctly-call-PlayerItemBreakEvent.patch (renamed from patches/server/1038-Correctly-call-PlayerItemBreakEvent.patch)0
-rw-r--r--patches/server/1038-Add-ItemType-getItemRarity.patch (renamed from patches/server/1039-Add-ItemType-getItemRarity.patch)0
-rw-r--r--patches/server/1039-Incremental-chunk-and-player-saving.patch (renamed from patches/server/1040-Incremental-chunk-and-player-saving.patch)10
-rw-r--r--patches/server/1040-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch (renamed from patches/server/1041-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch)2
1022 files changed, 3960 insertions, 6864 deletions
diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch
index 653f48c157..44889e7585 100644
--- a/patches/server/0009-MC-Utils.patch
+++ b/patches/server/0009-MC-Utils.patch
@@ -12,147 +12,13 @@ public net.minecraft.server.level.ServerChunkCache mainThreadProcessor
public net.minecraft.server.level.ServerChunkCache$MainThreadExecutor
public net.minecraft.world.level.chunk.LevelChunkSection states
-diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java b/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/EntityList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/EntityList.java
new file mode 100644
-index 0000000000000000000000000000000000000000..554f4d4e63c1431721989e6f502a32ccc53a8807
+index 0000000000000000000000000000000000000000..ba68998f6ef57b24c72fd833bd7de440de9501cc
--- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java
-@@ -0,0 +1,128 @@
-+package com.destroystokyo.paper.util.maplist;
-+
-+import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
-+import java.util.Arrays;
-+import java.util.Iterator;
-+import java.util.NoSuchElementException;
-+import net.minecraft.world.level.chunk.LevelChunk;
-+
-+// list with O(1) remove & contains
-+/**
-+ * @author Spottedleaf
-+ */
-+public final class ChunkList implements Iterable<LevelChunk> {
-+
-+ protected final Long2IntOpenHashMap chunkToIndex = new Long2IntOpenHashMap(2, 0.8f);
-+ {
-+ this.chunkToIndex.defaultReturnValue(Integer.MIN_VALUE);
-+ }
-+
-+ protected static final LevelChunk[] EMPTY_LIST = new LevelChunk[0];
-+
-+ protected LevelChunk[] chunks = EMPTY_LIST;
-+ protected int count;
-+
-+ public int size() {
-+ return this.count;
-+ }
-+
-+ public boolean contains(final LevelChunk chunk) {
-+ return this.chunkToIndex.containsKey(chunk.coordinateKey);
-+ }
-+
-+ public boolean remove(final LevelChunk chunk) {
-+ final int index = this.chunkToIndex.remove(chunk.coordinateKey);
-+ if (index == Integer.MIN_VALUE) {
-+ return false;
-+ }
-+
-+ // move the entity at the end to this index
-+ final int endIndex = --this.count;
-+ final LevelChunk end = this.chunks[endIndex];
-+ if (index != endIndex) {
-+ // not empty after this call
-+ this.chunkToIndex.put(end.coordinateKey, index); // update index
-+ }
-+ this.chunks[index] = end;
-+ this.chunks[endIndex] = null;
-+
-+ return true;
-+ }
-+
-+ public boolean add(final LevelChunk chunk) {
-+ final int count = this.count;
-+ final int currIndex = this.chunkToIndex.putIfAbsent(chunk.coordinateKey, count);
-+
-+ if (currIndex != Integer.MIN_VALUE) {
-+ return false; // already in this list
-+ }
-+
-+ LevelChunk[] list = this.chunks;
-+
-+ if (list.length == count) {
-+ // resize required
-+ list = this.chunks = Arrays.copyOf(list, (int)Math.max(4L, count * 2L)); // overflow results in negative
-+ }
-+
-+ list[count] = chunk;
-+ this.count = count + 1;
-+
-+ return true;
-+ }
-+
-+ public LevelChunk getChecked(final int index) {
-+ if (index < 0 || index >= this.count) {
-+ throw new IndexOutOfBoundsException("Index: " + index + " is out of bounds, size: " + this.count);
-+ }
-+ return this.chunks[index];
-+ }
-+
-+ public LevelChunk getUnchecked(final int index) {
-+ return this.chunks[index];
-+ }
-+
-+ public LevelChunk[] getRawData() {
-+ return this.chunks;
-+ }
-+
-+ public void clear() {
-+ this.chunkToIndex.clear();
-+ Arrays.fill(this.chunks, 0, this.count, null);
-+ this.count = 0;
-+ }
-+
-+ @Override
-+ public Iterator<LevelChunk> iterator() {
-+ return new Iterator<LevelChunk>() {
-+
-+ LevelChunk lastRet;
-+ int current;
-+
-+ @Override
-+ public boolean hasNext() {
-+ return this.current < ChunkList.this.count;
-+ }
-+
-+ @Override
-+ public LevelChunk next() {
-+ if (this.current >= ChunkList.this.count) {
-+ throw new NoSuchElementException();
-+ }
-+ return this.lastRet = ChunkList.this.chunks[this.current++];
-+ }
-+
-+ @Override
-+ public void remove() {
-+ final LevelChunk lastRet = this.lastRet;
-+
-+ if (lastRet == null) {
-+ throw new IllegalStateException();
-+ }
-+ this.lastRet = null;
-+
-+ ChunkList.this.remove(lastRet);
-+ --this.current;
-+ }
-+ };
-+ }
-+}
-diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..0133ea6feb1ab88f021f66855669f58367e7420b
---- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
-@@ -0,0 +1,128 @@
-+package com.destroystokyo.paper.util.maplist;
++++ b/src/main/java/ca/spottedleaf/moonrise/common/list/EntityList.java
+@@ -0,0 +1,129 @@
++package ca.spottedleaf.moonrise.common.list;
+
+import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
+import net.minecraft.world.entity.Entity;
@@ -161,6 +27,7 @@ index 0000000000000000000000000000000000000000..0133ea6feb1ab88f021f66855669f583
+import java.util.NoSuchElementException;
+
+// list with O(1) remove & contains
++
+/**
+ * @author Spottedleaf
+ */
@@ -280,13 +147,13 @@ index 0000000000000000000000000000000000000000..0133ea6feb1ab88f021f66855669f583
+ };
+ }
+}
-diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/IBlockDataList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/IBlockDataList.java
new file mode 100644
-index 0000000000000000000000000000000000000000..277cfd9d1e8fff5d9b5e534b75c3c5162d58b0b7
+index 0000000000000000000000000000000000000000..fcfbca333234c09f7c056bbfcd9ac8860b20a8db
--- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
-@@ -0,0 +1,128 @@
-+package com.destroystokyo.paper.util.maplist;
++++ b/src/main/java/ca/spottedleaf/moonrise/common/list/IBlockDataList.java
+@@ -0,0 +1,125 @@
++package ca.spottedleaf.moonrise.common.list;
+
+import it.unimi.dsi.fastutil.longs.LongIterator;
+import it.unimi.dsi.fastutil.shorts.Short2LongOpenHashMap;
@@ -295,12 +162,9 @@ index 0000000000000000000000000000000000000000..277cfd9d1e8fff5d9b5e534b75c3c516
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.chunk.GlobalPalette;
+
-+/**
-+ * @author Spottedleaf
-+ */
+public final class IBlockDataList {
+
-+ static final GlobalPalette<BlockState> GLOBAL_PALETTE = new GlobalPalette<>(Block.BLOCK_STATE_REGISTRY);
++ private static final GlobalPalette<BlockState> GLOBAL_PALETTE = new GlobalPalette<>(Block.BLOCK_STATE_REGISTRY);
+
+ // map of location -> (index | (location << 16) | (palette id << 32))
+ private final Short2LongOpenHashMap map = new Short2LongOpenHashMap(2, 0.8f);
@@ -414,33 +278,365 @@ index 0000000000000000000000000000000000000000..277cfd9d1e8fff5d9b5e534b75c3c516
+ return this.map.values().iterator();
+ }
+}
-diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java b/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
+\ No newline at end of file
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/IteratorSafeOrderedReferenceSet.java b/src/main/java/ca/spottedleaf/moonrise/common/list/IteratorSafeOrderedReferenceSet.java
new file mode 100644
-index 0000000000000000000000000000000000000000..190c5f0b02a3d99054704ae1afbffb3498ddffe1
+index 0000000000000000000000000000000000000000..c21e00812f1aaa1279834a0562d360d6b89e146c
--- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
-@@ -0,0 +1,125 @@
-+package com.destroystokyo.paper.util.maplist;
++++ b/src/main/java/ca/spottedleaf/moonrise/common/list/IteratorSafeOrderedReferenceSet.java
+@@ -0,0 +1,312 @@
++package ca.spottedleaf.moonrise.common.list;
++
++import it.unimi.dsi.fastutil.objects.Reference2IntLinkedOpenHashMap;
++import it.unimi.dsi.fastutil.objects.Reference2IntMap;
++import java.util.Arrays;
++import java.util.NoSuchElementException;
++
++public final class IteratorSafeOrderedReferenceSet<E> {
++
++ public static final int ITERATOR_FLAG_SEE_ADDITIONS = 1 << 0;
++
++ private final Reference2IntLinkedOpenHashMap<E> indexMap;
++ private int firstInvalidIndex = -1;
++
++ /* list impl */
++ private E[] listElements;
++ private int listSize;
++
++ private final double maxFragFactor;
++
++ private int iteratorCount;
++
++ public IteratorSafeOrderedReferenceSet() {
++ this(16, 0.75f, 16, 0.2);
++ }
++
++ public IteratorSafeOrderedReferenceSet(final int setCapacity, final float setLoadFactor, final int arrayCapacity,
++ final double maxFragFactor) {
++ this.indexMap = new Reference2IntLinkedOpenHashMap<>(setCapacity, setLoadFactor);
++ this.indexMap.defaultReturnValue(-1);
++ this.maxFragFactor = maxFragFactor;
++ this.listElements = (E[])new Object[arrayCapacity];
++ }
++
++ /*
++ public void check() {
++ int iterated = 0;
++ ReferenceOpenHashSet<E> check = new ReferenceOpenHashSet<>();
++ if (this.listElements != null) {
++ for (int i = 0; i < this.listSize; ++i) {
++ Object obj = this.listElements[i];
++ if (obj != null) {
++ iterated++;
++ if (!check.add((E)obj)) {
++ throw new IllegalStateException("contains duplicate");
++ }
++ if (!this.contains((E)obj)) {
++ throw new IllegalStateException("desync");
++ }
++ }
++ }
++ }
++
++ if (iterated != this.size()) {
++ throw new IllegalStateException("Size is mismatched! Got " + iterated + ", expected " + this.size());
++ }
++
++ check.clear();
++ iterated = 0;
++ for (final java.util.Iterator<E> iterator = this.unsafeIterator(IteratorSafeOrderedReferenceSet.ITERATOR_FLAG_SEE_ADDITIONS); iterator.hasNext();) {
++ final E element = iterator.next();
++ iterated++;
++ if (!check.add(element)) {
++ throw new IllegalStateException("contains duplicate (iterator is wrong)");
++ }
++ if (!this.contains(element)) {
++ throw new IllegalStateException("desync (iterator is wrong)");
++ }
++ }
++
++ if (iterated != this.size()) {
++ throw new IllegalStateException("Size is mismatched! (iterator is wrong) Got " + iterated + ", expected " + this.size());
++ }
++ }
++ */
++
++ private double getFragFactor() {
++ return 1.0 - ((double)this.indexMap.size() / (double)this.listSize);
++ }
++
++ public int createRawIterator() {
++ ++this.iteratorCount;
++ if (this.indexMap.isEmpty()) {
++ return -1;
++ } else {
++ return this.firstInvalidIndex == 0 ? this.indexMap.getInt(this.indexMap.firstKey()) : 0;
++ }
++ }
++
++ public int advanceRawIterator(final int index) {
++ final E[] elements = this.listElements;
++ int ret = index + 1;
++ for (int len = this.listSize; ret < len; ++ret) {
++ if (elements[ret] != null) {
++ return ret;
++ }
++ }
++
++ return -1;
++ }
++
++ public void finishRawIterator() {
++ if (--this.iteratorCount == 0) {
++ if (this.getFragFactor() >= this.maxFragFactor) {
++ this.defrag();
++ }
++ }
++ }
++
++ public boolean remove(final E element) {
++ final int index = this.indexMap.removeInt(element);
++ if (index >= 0) {
++ if (this.firstInvalidIndex < 0 || index < this.firstInvalidIndex) {
++ this.firstInvalidIndex = index;
++ }
++ if (this.listElements[index] != element) {
++ throw new IllegalStateException();
++ }
++ this.listElements[index] = null;
++ if (this.iteratorCount == 0 && this.getFragFactor() >= this.maxFragFactor) {
++ this.defrag();
++ }
++ //this.check();
++ return true;
++ }
++ return false;
++ }
++
++ public boolean contains(final E element) {
++ return this.indexMap.containsKey(element);
++ }
++
++ public boolean add(final E element) {
++ final int listSize = this.listSize;
++
++ final int previous = this.indexMap.putIfAbsent(element, listSize);
++ if (previous != -1) {
++ return false;
++ }
++
++ if (listSize >= this.listElements.length) {
++ this.listElements = Arrays.copyOf(this.listElements, listSize * 2);
++ }
++ this.listElements[listSize] = element;
++ this.listSize = listSize + 1;
++
++ //this.check();
++ return true;
++ }
++
++ private void defrag() {
++ if (this.firstInvalidIndex < 0) {
++ return; // nothing to do
++ }
++
++ if (this.indexMap.isEmpty()) {
++ Arrays.fill(this.listElements, 0, this.listSize, null);
++ this.listSize = 0;
++ this.firstInvalidIndex = -1;
++ //this.check();
++ return;
++ }
++
++ final E[] backingArray = this.listElements;
++
++ int lastValidIndex;
++ java.util.Iterator<Reference2IntMap.Entry<E>> iterator;
++
++ if (this.firstInvalidIndex == 0) {
++ iterator = this.indexMap.reference2IntEntrySet().fastIterator();
++ lastValidIndex = 0;
++ } else {
++ lastValidIndex = this.firstInvalidIndex;
++ final E key = backingArray[lastValidIndex - 1];
++ iterator = this.indexMap.reference2IntEntrySet().fastIterator(new Reference2IntMap.Entry<E>() {
++ @Override
++ public int getIntValue() {
++ throw new UnsupportedOperationException();
++ }
++
++ @Override
++ public int setValue(int i) {
++ throw new UnsupportedOperationException();
++ }
++
++ @Override
++ public E getKey() {
++ return key;
++ }
++ });
++ }
++
++ while (iterator.hasNext()) {
++ final Reference2IntMap.Entry<E> entry = iterator.next();
++
++ final int newIndex = lastValidIndex++;
++ backingArray[newIndex] = entry.getKey();
++ entry.setValue(newIndex);
++ }
++
++ // cleanup end
++ Arrays.fill(backingArray, lastValidIndex, this.listSize, null);
++ this.listSize = lastValidIndex;
++ this.firstInvalidIndex = -1;
++ //this.check();
++ }
++
++ public E rawGet(final int index) {
++ return this.listElements[index];
++ }
++
++ public int size() {
++ // always returns the correct amount - listSize can be different
++ return this.indexMap.size();
++ }
++
++ public IteratorSafeOrderedReferenceSet.Iterator<E> iterator() {
++ return this.iterator(0);
++ }
++
++ public IteratorSafeOrderedReferenceSet.Iterator<E> iterator(final int flags) {
++ ++this.iteratorCount;
++ return new BaseIterator<>(this, true, (flags & ITERATOR_FLAG_SEE_ADDITIONS) != 0 ? Integer.MAX_VALUE : this.listSize);
++ }
++
++ public java.util.Iterator<E> unsafeIterator() {
++ return this.unsafeIterator(0);
++ }
++ public java.util.Iterator<E> unsafeIterator(final int flags) {
++ return new BaseIterator<>(this, false, (flags & ITERATOR_FLAG_SEE_ADDITIONS) != 0 ? Integer.MAX_VALUE : this.listSize);
++ }
++
++ public static interface Iterator<E> extends java.util.Iterator<E> {
++
++ public void finishedIterating();
++
++ }
++
++ private static final class BaseIterator<E> implements IteratorSafeOrderedReferenceSet.Iterator<E> {
++
++ private final IteratorSafeOrderedReferenceSet<E> set;
++ private final boolean canFinish;
++ private final int maxIndex;
++ private int nextIndex;
++ private E pendingValue;
++ private boolean finished;
++ private E lastReturned;
++
++ private BaseIterator(final IteratorSafeOrderedReferenceSet<E> set, final boolean canFinish, final int maxIndex) {
++ this.set = set;
++ this.canFinish = canFinish;
++ this.maxIndex = maxIndex;
++ }
++
++ @Override
++ public boolean hasNext() {
++ if (this.finished) {
++ return false;
++ }
++ if (this.pendingValue != null) {
++ return true;
++ }
++
++ final E[] elements = this.set.listElements;
++ int index, len;
++ for (index = this.nextIndex, len = Math.min(this.maxIndex, this.set.listSize); index < len; ++index) {
++ final E element = elements[index];
++ if (element != null) {
++ this.pendingValue = element;
++ this.nextIndex = index + 1;
++ return true;
++ }
++ }
++
++ this.nextIndex = index;
++ return false;
++ }
++
++ @Override
++ public E next() {
++ if (!this.hasNext()) {
++ throw new NoSuchElementException();
++ }
++ final E ret = this.pendingValue;
++
++ this.pendingValue = null;
++ this.lastReturned = ret;
++
++ return ret;
++ }
++
++ @Override
++ public void remove() {
++ final E lastReturned = this.lastReturned;
++ if (lastReturned == null) {
++ throw new IllegalStateException();
++ }
++ this.lastReturned = null;
++ this.set.remove(lastReturned);
++ }
++
++ @Override
++ public void finishedIterating() {
++ if (this.finished || !this.canFinish) {
++ throw new IllegalStateException();
++ }
++ this.lastReturned = null;
++ this.finished = true;
++ this.set.finishRawIterator();
++ }
++ }
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/ReferenceList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/ReferenceList.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..2e876b918672e8ef3b5197b7e6b1597247fdeaa1
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/list/ReferenceList.java
+@@ -0,0 +1,142 @@
++package ca.spottedleaf.moonrise.common.list;
+
+import it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
-+/**
-+ * @author Spottedleaf
-+ */
+public final class ReferenceList<E> implements Iterable<E> {
+
-+ protected final Reference2IntOpenHashMap<E> referenceToIndex = new Reference2IntOpenHashMap<>(2, 0.8f);
-+ {
++ private static final Object[] EMPTY_LIST = new Object[0];
++
++ private final Reference2IntOpenHashMap<E> referenceToIndex;
++ private E[] references;
++ private int count;
++
++ public ReferenceList() {
++ this((E[])EMPTY_LIST);
++ }
++
++ public ReferenceList(final E[] referenceArray) {
++ this.references = referenceArray;
++ this.referenceToIndex = new Reference2IntOpenHashMap<>(2, 0.8f);
+ this.referenceToIndex.defaultReturnValue(Integer.MIN_VALUE);
+ }
+
-+ protected static final Object[] EMPTY_LIST = new Object[0];
++ private ReferenceList(final E[] references, final int count, final Reference2IntOpenHashMap<E> referenceToIndex) {
++ this.references = references;
++ this.count = count;
++ this.referenceToIndex = referenceToIndex;
++ }
+
-+ protected Object[] references = EMPTY_LIST;
-+ protected int count;
++ public ReferenceList<E> copy() {
++ return new ReferenceList<>(this.references.clone(), this.count, this.referenceToIndex.clone());
++ }
+
+ public int size() {
+ return this.count;
@@ -477,7 +673,7 @@ index 0000000000000000000000000000000000000000..190c5f0b02a3d99054704ae1afbffb34
+ return false; // already in this list
+ }
+
-+ Object[] list = this.references;
++ E[] list = this.references;
+
+ if (list.length == count) {
+ // resize required
@@ -494,17 +690,21 @@ index 0000000000000000000000000000000000000000..190c5f0b02a3d99054704ae1afbffb34
+ if (index < 0 || index >= this.count) {
+ throw new IndexOutOfBoundsException("Index: " + index + " is out of bounds, size: " + this.count);
+ }
-+ return (E)this.references[index];
++ return this.references[index];
+ }
+
+ public E getUnchecked(final int index) {
-+ return (E)this.references[index];
++ return this.references[index];
+ }
+
+ public Object[] getRawData() {
+ return this.references;
+ }
+
++ public E[] getRawDataUnchecked() {
++ return this.references;
++ }
++
+ public void clear() {
+ this.referenceToIndex.clear();
+ Arrays.fill(this.references, 0, this.count, null);
@@ -527,7 +727,7 @@ index 0000000000000000000000000000000000000000..190c5f0b02a3d99054704ae1afbffb34
+ if (this.current >= ReferenceList.this.count) {
+ throw new NoSuchElementException();
+ }
-+ return this.lastRet = (E)ReferenceList.this.references[this.current++];
++ return this.lastRet = ReferenceList.this.references[this.current++];
+ }
+
+ @Override
@@ -545,1111 +745,2255 @@ index 0000000000000000000000000000000000000000..190c5f0b02a3d99054704ae1afbffb34
+ };
+ }
+}
-diff --git a/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/SortedList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/SortedList.java
new file mode 100644
-index 0000000000000000000000000000000000000000..41b9405d6759d865e0d14dd4f95163e9690e967d
+index 0000000000000000000000000000000000000000..db92261a6cb3758391108361096417c61bc82cdc
--- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java
-@@ -0,0 +1,453 @@
-+package com.destroystokyo.paper.util.misc;
++++ b/src/main/java/ca/spottedleaf/moonrise/common/list/SortedList.java
+@@ -0,0 +1,117 @@
++package ca.spottedleaf.moonrise.common.list;
+
-+import io.papermc.paper.util.IntegerUtil;
-+import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
-+import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
-+import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
-+import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
-+import io.papermc.paper.util.MCUtil;
-+import net.minecraft.server.MinecraftServer;
-+import net.minecraft.world.level.ChunkPos;
-+import javax.annotation.Nullable;
-+import java.util.Iterator;
++import java.lang.reflect.Array;
++import java.util.Arrays;
++import java.util.Comparator;
+
-+/** @author Spottedleaf */
-+public abstract class AreaMap<E> {
++public final class SortedList<E> {
+
-+ /* Tested via https://gist.github.com/Spottedleaf/520419c6f41ef348fe9926ce674b7217 */
++ private static final Object[] EMPTY_LIST = new Object[0];
+
-+ protected final Object2LongOpenHashMap<E> objectToLastCoordinate = new Object2LongOpenHashMap<>();
-+ protected final Object2IntOpenHashMap<E> objectToViewDistance = new Object2IntOpenHashMap<>();
++ private Comparator<? super E> comparator;
++ private E[] elements;
++ private int count;
+
-+ {
-+ this.objectToViewDistance.defaultReturnValue(-1);
-+ this.objectToLastCoordinate.defaultReturnValue(Long.MIN_VALUE);
++ public SortedList(final Comparator<? super E> comparator) {
++ this((E[])EMPTY_LIST, comparator);
+ }
+
-+ // we use linked for better iteration.
-+ // map of: coordinate to set of objects in coordinate
-+ protected final Long2ObjectOpenHashMap<PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E>> areaMap = new Long2ObjectOpenHashMap<>(1024, 0.7f);
-+ protected final PooledLinkedHashSets<E> pooledHashSets;
-+
-+ protected final ChangeCallback<E> addCallback;
-+ protected final ChangeCallback<E> removeCallback;
-+ protected final ChangeSourceCallback<E> changeSourceCallback;
-+
-+ public AreaMap() {
-+ this(new PooledLinkedHashSets<>());
++ public SortedList(final E[] elements, final Comparator<? super E> comparator) {
++ this.elements = elements;
++ this.comparator = comparator;
+ }
+
-+ // let users define a "global" or "shared" pooled sets if they wish
-+ public AreaMap(final PooledLinkedHashSets<E> pooledHashSets) {
-+ this(pooledHashSets, null, null);
-+ }
++ // start, end are inclusive
++ private static <E> int insertIdx(final E[] elements, final E element, final Comparator<E> comparator,
++ int start, int end) {
++ while (start <= end) {
++ final int middle = (start + end) >>> 1;
+
-+ public AreaMap(final PooledLinkedHashSets<E> pooledHashSets, final ChangeCallback<E> addCallback, final ChangeCallback<E> removeCallback) {
-+ this(pooledHashSets, addCallback, removeCallback, null);
-+ }
-+ public AreaMap(final PooledLinkedHashSets<E> pooledHashSets, final ChangeCallback<E> addCallback, final ChangeCallback<E> removeCallback, final ChangeSourceCallback<E> changeSourceCallback) {
-+ this.pooledHashSets = pooledHashSets;
-+ this.addCallback = addCallback;
-+ this.removeCallback = removeCallback;
-+ this.changeSourceCallback = changeSourceCallback;
-+ }
++ final E middleVal = elements[middle];
+
-+ @Nullable
-+ public final PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> getObjectsInRange(final long key) {
-+ return this.areaMap.get(key);
-+ }
++ final int cmp = comparator.compare(element, middleVal);
+
-+ @Nullable
-+ public final PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> getObjectsInRange(final ChunkPos chunkPos) {
-+ return this.areaMap.get(MCUtil.getCoordinateKey(chunkPos));
-+ }
++ if (cmp < 0) {
++ end = middle - 1;
++ } else {
++ start = middle + 1;
++ }
++ }
+
-+ @Nullable
-+ public final PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> getObjectsInRange(final int chunkX, final int chunkZ) {
-+ return this.areaMap.get(MCUtil.getCoordinateKey(chunkX, chunkZ));
++ return start;
+ }
+
-+ // Long.MIN_VALUE indicates the object is not mapped
-+ public final long getLastCoordinate(final E object) {
-+ return this.objectToLastCoordinate.getOrDefault(object, Long.MIN_VALUE);
++ public int size() {
++ return this.count;
+ }
+
-+ // -1 indicates the object is not mapped
-+ public final int getLastViewDistance(final E object) {
-+ return this.objectToViewDistance.getOrDefault(object, -1);
++ public boolean isEmpty() {
++ return this.count == 0;
+ }
+
-+ // returns the total number of mapped chunks
-+ public final int size() {
-+ return this.areaMap.size();
-+ }
++ public int add(final E element) {
++ E[] elements = this.elements;
++ final int count = this.count;
++ this.count = count + 1;
++ final Comparator<? super E> comparator = this.comparator;
+
-+ public final void addOrUpdate(final E object, final int chunkX, final int chunkZ, final int viewDistance) {
-+ final int oldViewDistance = this.objectToViewDistance.put(object, viewDistance);
-+ final long newPos = MCUtil.getCoordinateKey(chunkX, chunkZ);
-+ final long oldPos = this.objectToLastCoordinate.put(object, newPos);
++ final int idx = insertIdx(elements, element, comparator, 0, count - 1);
+
-+ if (oldViewDistance == -1) {
-+ this.addObject(object, chunkX, chunkZ, Integer.MIN_VALUE, Integer.MIN_VALUE, viewDistance);
-+ this.addObjectCallback(object, chunkX, chunkZ, viewDistance);
++ if (count >= elements.length) {
++ // copy and insert at the same time
++ if (idx == count) {
++ this.elements = elements = Arrays.copyOf(elements, (int)Math.max(4L, count * 2L)); // overflow results in negative
++ elements[count] = element;
++ return idx;
++ } else {
++ final E[] newElements = (E[])Array.newInstance(elements.getClass().getComponentType(), (int)Math.max(4L, count * 2L));
++ System.arraycopy(elements, 0, newElements, 0, idx);
++ newElements[idx] = element;
++ System.arraycopy(elements, idx, newElements, idx + 1, count - idx);
++ this.elements = newElements;
++ return idx;
++ }
+ } else {
-+ this.updateObject(object, oldPos, newPos, oldViewDistance, viewDistance);
-+ this.updateObjectCallback(object, oldPos, newPos, oldViewDistance, viewDistance);
++ if (idx == count) {
++ // no copy needed
++ elements[idx] = element;
++ return idx;
++ } else {
++ // shift elements down
++ System.arraycopy(elements, idx, elements, idx + 1, count - idx);
++ elements[idx] = element;
++ return idx;
++ }
+ }
-+ //this.validate(object, viewDistance);
+ }
+
-+ public final boolean update(final E object, final int chunkX, final int chunkZ, final int viewDistance) {
-+ final int oldViewDistance = this.objectToViewDistance.replace(object, viewDistance);
-+ if (oldViewDistance == -1) {
-+ return false;
-+ } else {
-+ final long newPos = MCUtil.getCoordinateKey(chunkX, chunkZ);
-+ final long oldPos = this.objectToLastCoordinate.put(object, newPos);
-+ this.updateObject(object, oldPos, newPos, oldViewDistance, viewDistance);
-+ this.updateObjectCallback(object, oldPos, newPos, oldViewDistance, viewDistance);
++ public E get(final int idx) {
++ if (idx < 0 || idx >= this.count) {
++ throw new IndexOutOfBoundsException(idx);
+ }
-+ //this.validate(object, viewDistance);
-+ return true;
++ return this.elements[idx];
+ }
+
-+ // called after the distance map updates
-+ protected void updateObjectCallback(final E Object, final long oldPosition, final long newPosition, final int oldViewDistance, final int newViewDistance) {
-+ if (newPosition != oldPosition && this.changeSourceCallback != null) {
-+ this.changeSourceCallback.accept(Object, oldPosition, newPosition);
-+ }
-+ }
+
-+ public final boolean add(final E object, final int chunkX, final int chunkZ, final int viewDistance) {
-+ final int oldViewDistance = this.objectToViewDistance.putIfAbsent(object, viewDistance);
-+ if (oldViewDistance != -1) {
-+ return false;
++ public E remove(final E element) {
++ E[] elements = this.elements;
++ final int count = this.count;
++ final Comparator<? super E> comparator = this.comparator;
++
++ final int idx = Arrays.binarySearch(elements, 0, count, element, comparator);
++ if (idx < 0) {
++ return null;
+ }
+
-+ final long newPos = MCUtil.getCoordinateKey(chunkX, chunkZ);
-+ this.objectToLastCoordinate.put(object, newPos);
-+ this.addObject(object, chunkX, chunkZ, Integer.MIN_VALUE, Integer.MIN_VALUE, viewDistance);
-+ this.addObjectCallback(object, chunkX, chunkZ, viewDistance);
++ final int last = this.count - 1;
++ this.count = last;
+
-+ //this.validate(object, viewDistance);
++ final E ret = elements[idx];
+
-+ return true;
++ System.arraycopy(elements, idx + 1, elements, idx, last - idx);
++
++ elements[last] = null;
++
++ return ret;
+ }
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/Int2IntArraySortedMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/Int2IntArraySortedMap.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..62caf61a4b0b7ebc764006ea8bbd0274594d9f4a
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/map/Int2IntArraySortedMap.java
+@@ -0,0 +1,77 @@
++package ca.spottedleaf.moonrise.common.map;
+
-+ // called after the distance map updates
-+ protected void addObjectCallback(final E object, final int chunkX, final int chunkZ, final int viewDistance) {}
++import it.unimi.dsi.fastutil.ints.Int2IntFunction;
+
-+ public final boolean remove(final E object) {
-+ final long position = this.objectToLastCoordinate.removeLong(object);
-+ final int viewDistance = this.objectToViewDistance.removeInt(object);
++import java.util.Arrays;
+
-+ if (viewDistance == -1) {
-+ return false;
-+ }
++public class Int2IntArraySortedMap {
+
-+ final int currentX = MCUtil.getCoordinateX(position);
-+ final int currentZ = MCUtil.getCoordinateZ(position);
++ protected int[] key;
++ protected int[] val;
++ protected int size;
+
-+ this.removeObject(object, currentX, currentZ, currentX, currentZ, viewDistance);
-+ this.removeObjectCallback(object, currentX, currentZ, viewDistance);
-+ //this.validate(object, -1);
-+ return true;
++ public Int2IntArraySortedMap() {
++ this.key = new int[8];
++ this.val = new int[8];
+ }
+
-+ // called after the distance map updates
-+ protected void removeObjectCallback(final E object, final int chunkX, final int chunkZ, final int viewDistance) {}
++ public int put(final int key, final int value) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index >= 0) {
++ final int current = this.val[index];
++ this.val[index] = value;
++ return current;
++ }
++ final int insert = -(index + 1);
++ // shift entries down
++ if (this.size >= this.val.length) {
++ this.key = Arrays.copyOf(this.key, this.key.length * 2);
++ this.val = Arrays.copyOf(this.val, this.val.length * 2);
++ }
++ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
++ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
++ ++this.size;
++
++ this.key[insert] = key;
++ this.val[insert] = value;
+
-+ protected abstract PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> getEmptySetFor(final E object);
++ return 0;
++ }
+
-+ // expensive op, only for debug
-+ protected void validate(final E object, final int viewDistance) {
-+ int entiesGot = 0;
-+ int expectedEntries = (2 * viewDistance + 1);
-+ expectedEntries *= expectedEntries;
-+ if (viewDistance < 0) {
-+ expectedEntries = 0;
++ public int computeIfAbsent(final int key, final Int2IntFunction producer) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index >= 0) {
++ return this.val[index];
++ }
++ final int insert = -(index + 1);
++ // shift entries down
++ if (this.size >= this.val.length) {
++ this.key = Arrays.copyOf(this.key, this.key.length * 2);
++ this.val = Arrays.copyOf(this.val, this.val.length * 2);
+ }
++ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
++ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
++ ++this.size;
+
-+ final long currPosition = this.objectToLastCoordinate.getLong(object);
++ this.key[insert] = key;
+
-+ final int centerX = MCUtil.getCoordinateX(currPosition);
-+ final int centerZ = MCUtil.getCoordinateZ(currPosition);
++ return this.val[insert] = producer.apply(key);
++ }
+
-+ for (Iterator<Long2ObjectLinkedOpenHashMap.Entry<PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E>>> iterator = this.areaMap.long2ObjectEntrySet().fastIterator();
-+ iterator.hasNext();) {
++ public int get(final int key) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index < 0) {
++ return 0;
++ }
++ return this.val[index];
++ }
+
-+ final Long2ObjectLinkedOpenHashMap.Entry<PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E>> entry = iterator.next();
-+ final long key = entry.getLongKey();
-+ final PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> map = entry.getValue();
++ public int getFloor(final int key) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index < 0) {
++ final int insert = -(index + 1) - 1;
++ return insert < 0 ? 0 : this.val[insert];
++ }
++ return this.val[index];
++ }
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/Int2ObjectArraySortedMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/Int2ObjectArraySortedMap.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..fea9e8ba7caaf6259614090d4f872619470d32f9
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/map/Int2ObjectArraySortedMap.java
+@@ -0,0 +1,74 @@
++package ca.spottedleaf.moonrise.common.map;
+
-+ if (map.referenceCount == 0) {
-+ throw new IllegalStateException("Invalid map");
-+ }
++import java.util.Arrays;
++import java.util.function.IntFunction;
+
-+ if (map.contains(object)) {
-+ ++entiesGot;
++public class Int2ObjectArraySortedMap<V> {
+
-+ final int chunkX = MCUtil.getCoordinateX(key);
-+ final int chunkZ = MCUtil.getCoordinateZ(key);
++ protected int[] key;
++ protected V[] val;
++ protected int size;
+
-+ final int dist = Math.max(IntegerUtil.branchlessAbs(chunkX - centerX), IntegerUtil.branchlessAbs(chunkZ - centerZ));
++ public Int2ObjectArraySortedMap() {
++ this.key = new int[8];
++ this.val = (V[])new Object[8];
++ }
+
-+ if (dist > viewDistance) {
-+ throw new IllegalStateException("Expected view distance " + viewDistance + ", got " + dist);
-+ }
-+ }
++ public V put(final int key, final V value) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index >= 0) {
++ final V current = this.val[index];
++ this.val[index] = value;
++ return current;
+ }
-+
-+ if (entiesGot != expectedEntries) {
-+ throw new IllegalStateException("Expected " + expectedEntries + ", got " + entiesGot);
++ final int insert = -(index + 1);
++ // shift entries down
++ if (this.size >= this.val.length) {
++ this.key = Arrays.copyOf(this.key, this.key.length * 2);
++ this.val = Arrays.copyOf(this.val, this.val.length * 2);
+ }
++ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
++ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
++
++ this.key[insert] = key;
++ this.val[insert] = value;
++
++ return null;
+ }
+
-+ private void addObjectTo(final E object, final int chunkX, final int chunkZ, final int currChunkX,
-+ final int currChunkZ, final int prevChunkX, final int prevChunkZ) {
-+ final long key = MCUtil.getCoordinateKey(chunkX, chunkZ);
++ public V computeIfAbsent(final int key, final IntFunction<V> producer) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index >= 0) {
++ return this.val[index];
++ }
++ final int insert = -(index + 1);
++ // shift entries down
++ if (this.size >= this.val.length) {
++ this.key = Arrays.copyOf(this.key, this.key.length * 2);
++ this.val = Arrays.copyOf(this.val, this.val.length * 2);
++ }
++ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
++ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
+
-+ PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> empty = this.getEmptySetFor(object);
-+ PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> current = this.areaMap.putIfAbsent(key, empty);
++ this.key[insert] = key;
+
-+ if (current != null) {
-+ PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> next = this.pooledHashSets.findMapWith(current, object);
-+ if (next == current) {
-+ throw new IllegalStateException("Expected different map: got " + next.toString());
-+ }
-+ this.areaMap.put(key, next);
++ return this.val[insert] = producer.apply(key);
++ }
+
-+ current = next;
-+ // fall through to callback
-+ } else {
-+ current = empty;
++ public V get(final int key) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index < 0) {
++ return null;
+ }
++ return this.val[index];
++ }
+
-+ if (this.addCallback != null) {
-+ try {
-+ this.addCallback.accept(object, chunkX, chunkZ, currChunkX, currChunkZ, prevChunkX, prevChunkZ, current);
-+ } catch (final Throwable ex) {
-+ if (ex instanceof ThreadDeath) {
-+ throw (ThreadDeath)ex;
-+ }
-+ MinecraftServer.LOGGER.error("Add callback for map threw exception ", ex);
-+ }
++ public V getFloor(final int key) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index < 0) {
++ final int insert = -(index + 1);
++ return this.val[insert];
+ }
++ return this.val[index];
+ }
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/Long2IntArraySortedMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/Long2IntArraySortedMap.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..c077ca606934e9f13da3a8e2a194f82a99fe9ae9
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/map/Long2IntArraySortedMap.java
+@@ -0,0 +1,77 @@
++package ca.spottedleaf.moonrise.common.map;
+
-+ private void removeObjectFrom(final E object, final int chunkX, final int chunkZ, final int currChunkX,
-+ final int currChunkZ, final int prevChunkX, final int prevChunkZ) {
-+ final long key = MCUtil.getCoordinateKey(chunkX, chunkZ);
++import it.unimi.dsi.fastutil.longs.Long2IntFunction;
+
-+ PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> current = this.areaMap.get(key);
++import java.util.Arrays;
+
-+ if (current == null) {
-+ throw new IllegalStateException("Current map may not be null for " + object + ", (" + chunkX + "," + chunkZ + ")");
-+ }
++public class Long2IntArraySortedMap {
+
-+ PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> next = this.pooledHashSets.findMapWithout(current, object);
++ protected long[] key;
++ protected int[] val;
++ protected int size;
+
-+ if (next == current) {
-+ throw new IllegalStateException("Current map [" + next.toString() + "] should have contained " + object + ", (" + chunkX + "," + chunkZ + ")");
-+ }
++ public Long2IntArraySortedMap() {
++ this.key = new long[8];
++ this.val = new int[8];
++ }
+
-+ if (next != null) {
-+ this.areaMap.put(key, next);
-+ } else {
-+ this.areaMap.remove(key);
++ public int put(final long key, final int value) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index >= 0) {
++ final int current = this.val[index];
++ this.val[index] = value;
++ return current;
+ }
-+
-+ if (this.removeCallback != null) {
-+ try {
-+ this.removeCallback.accept(object, chunkX, chunkZ, currChunkX, currChunkZ, prevChunkX, prevChunkZ, next);
-+ } catch (final Throwable ex) {
-+ if (ex instanceof ThreadDeath) {
-+ throw (ThreadDeath)ex;
-+ }
-+ MinecraftServer.LOGGER.error("Remove callback for map threw exception ", ex);
-+ }
++ final int insert = -(index + 1);
++ // shift entries down
++ if (this.size >= this.val.length) {
++ this.key = Arrays.copyOf(this.key, this.key.length * 2);
++ this.val = Arrays.copyOf(this.val, this.val.length * 2);
+ }
++ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
++ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
++ ++this.size;
++
++ this.key[insert] = key;
++ this.val[insert] = value;
++
++ return 0;
+ }
+
-+ private void addObject(final E object, final int chunkX, final int chunkZ, final int prevChunkX, final int prevChunkZ, final int viewDistance) {
-+ final int maxX = chunkX + viewDistance;
-+ final int maxZ = chunkZ + viewDistance;
-+ final int minX = chunkX - viewDistance;
-+ final int minZ = chunkZ - viewDistance;
-+ for (int x = minX; x <= maxX; ++x) {
-+ for (int z = minZ; z <= maxZ; ++z) {
-+ this.addObjectTo(object, x, z, chunkX, chunkZ, prevChunkX, prevChunkZ);
-+ }
++ public int computeIfAbsent(final long key, final Long2IntFunction producer) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index >= 0) {
++ return this.val[index];
++ }
++ final int insert = -(index + 1);
++ // shift entries down
++ if (this.size >= this.val.length) {
++ this.key = Arrays.copyOf(this.key, this.key.length * 2);
++ this.val = Arrays.copyOf(this.val, this.val.length * 2);
+ }
++ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
++ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
++ ++this.size;
++
++ this.key[insert] = key;
++
++ return this.val[insert] = producer.apply(key);
+ }
+
-+ private void removeObject(final E object, final int chunkX, final int chunkZ, final int currentChunkX, final int currentChunkZ, final int viewDistance) {
-+ final int maxX = chunkX + viewDistance;
-+ final int maxZ = chunkZ + viewDistance;
-+ final int minX = chunkX - viewDistance;
-+ final int minZ = chunkZ - viewDistance;
-+ for (int x = minX; x <= maxX; ++x) {
-+ for (int z = minZ; z <= maxZ; ++z) {
-+ this.removeObjectFrom(object, x, z, currentChunkX, currentChunkZ, chunkX, chunkZ);
-+ }
++ public int get(final long key) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index < 0) {
++ return 0;
+ }
++ return this.val[index];
+ }
+
-+ /* math sign function except 0 returns 1 */
-+ protected static int sign(int val) {
-+ return 1 | (val >> (Integer.SIZE - 1));
++ public int getFloor(final long key) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index < 0) {
++ final int insert = -(index + 1) - 1;
++ return insert < 0 ? 0 : this.val[insert];
++ }
++ return this.val[index];
+ }
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/Long2ObjectArraySortedMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/Long2ObjectArraySortedMap.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..b24d037af5709196b66c79c692e1814cd5b20e49
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/map/Long2ObjectArraySortedMap.java
+@@ -0,0 +1,76 @@
++package ca.spottedleaf.moonrise.common.map;
+
-+ private void updateObject(final E object, final long oldPosition, final long newPosition, final int oldViewDistance, final int newViewDistance) {
-+ final int toX = MCUtil.getCoordinateX(newPosition);
-+ final int toZ = MCUtil.getCoordinateZ(newPosition);
-+ final int fromX = MCUtil.getCoordinateX(oldPosition);
-+ final int fromZ = MCUtil.getCoordinateZ(oldPosition);
++import java.util.Arrays;
++import java.util.function.LongFunction;
+
-+ final int dx = toX - fromX;
-+ final int dz = toZ - fromZ;
++public class Long2ObjectArraySortedMap<V> {
+
-+ final int totalX = IntegerUtil.branchlessAbs(fromX - toX);
-+ final int totalZ = IntegerUtil.branchlessAbs(fromZ - toZ);
++ protected long[] key;
++ protected V[] val;
++ protected int size;
+
-+ if (Math.max(totalX, totalZ) > (2 * Math.max(newViewDistance, oldViewDistance))) {
-+ // teleported?
-+ this.removeObject(object, fromX, fromZ, fromX, fromZ, oldViewDistance);
-+ this.addObject(object, toX, toZ, fromX, fromZ, newViewDistance);
-+ return;
++ public Long2ObjectArraySortedMap() {
++ this.key = new long[8];
++ this.val = (V[])new Object[8];
++ }
++
++ public V put(final long key, final V value) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index >= 0) {
++ final V current = this.val[index];
++ this.val[index] = value;
++ return current;
+ }
++ final int insert = -(index + 1);
++ // shift entries down
++ if (this.size >= this.val.length) {
++ this.key = Arrays.copyOf(this.key, this.key.length * 2);
++ this.val = Arrays.copyOf(this.val, this.val.length * 2);
++ }
++ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
++ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
++ ++this.size;
+
-+ if (oldViewDistance != newViewDistance) {
-+ // remove loop
++ this.key[insert] = key;
++ this.val[insert] = value;
+
-+ final int oldMinX = fromX - oldViewDistance;
-+ final int oldMinZ = fromZ - oldViewDistance;
-+ final int oldMaxX = fromX + oldViewDistance;
-+ final int oldMaxZ = fromZ + oldViewDistance;
-+ for (int currX = oldMinX; currX <= oldMaxX; ++currX) {
-+ for (int currZ = oldMinZ; currZ <= oldMaxZ; ++currZ) {
++ return null;
++ }
+
-+ // only remove if we're outside the new view distance...
-+ if (Math.max(IntegerUtil.branchlessAbs(currX - toX), IntegerUtil.branchlessAbs(currZ - toZ)) > newViewDistance) {
-+ this.removeObjectFrom(object, currX, currZ, toX, toZ, fromX, fromZ);
-+ }
-+ }
-+ }
++ public V computeIfAbsent(final long key, final LongFunction<V> producer) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index >= 0) {
++ return this.val[index];
++ }
++ final int insert = -(index + 1);
++ // shift entries down
++ if (this.size >= this.val.length) {
++ this.key = Arrays.copyOf(this.key, this.key.length * 2);
++ this.val = Arrays.copyOf(this.val, this.val.length * 2);
++ }
++ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
++ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
++ ++this.size;
+
-+ // add loop
++ this.key[insert] = key;
+
-+ final int newMinX = toX - newViewDistance;
-+ final int newMinZ = toZ - newViewDistance;
-+ final int newMaxX = toX + newViewDistance;
-+ final int newMaxZ = toZ + newViewDistance;
-+ for (int currX = newMinX; currX <= newMaxX; ++currX) {
-+ for (int currZ = newMinZ; currZ <= newMaxZ; ++currZ) {
++ return this.val[insert] = producer.apply(key);
++ }
+
-+ // only add if we're outside the old view distance...
-+ if (Math.max(IntegerUtil.branchlessAbs(currX - fromX), IntegerUtil.branchlessAbs(currZ - fromZ)) > oldViewDistance) {
-+ this.addObjectTo(object, currX, currZ, toX, toZ, fromX, fromZ);
-+ }
-+ }
-+ }
++ public V get(final long key) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index < 0) {
++ return null;
++ }
++ return this.val[index];
++ }
+
-+ return;
++ public V getFloor(final long key) {
++ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
++ if (index < 0) {
++ final int insert = -(index + 1) - 1;
++ return insert < 0 ? null : this.val[insert];
+ }
++ return this.val[index];
++ }
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2BooleanMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2BooleanMap.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..aa86882bb7b0712f29d7344009093c0e7a81be84
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2BooleanMap.java
+@@ -0,0 +1,48 @@
++package ca.spottedleaf.moonrise.common.map;
+
-+ // x axis is width
-+ // z axis is height
-+ // right refers to the x axis of where we moved
-+ // top refers to the z axis of where we moved
++import it.unimi.dsi.fastutil.longs.Long2BooleanFunction;
++import it.unimi.dsi.fastutil.longs.Long2BooleanLinkedOpenHashMap;
+
-+ // same view distance
++public final class SynchronisedLong2BooleanMap {
++ private final Long2BooleanLinkedOpenHashMap map = new Long2BooleanLinkedOpenHashMap();
++ private final int limit;
+
-+ // used for relative positioning
-+ final int up = sign(dz); // 1 if dz >= 0, -1 otherwise
-+ final int right = sign(dx); // 1 if dx >= 0, -1 otherwise
++ public SynchronisedLong2BooleanMap(final int limit) {
++ this.limit = limit;
++ }
+
-+ // The area excluded by overlapping the two view distance squares creates four rectangles:
-+ // Two on the left, and two on the right. The ones on the left we consider the "removed" section
-+ // and on the right the "added" section.
-+ // https://i.imgur.com/MrnOBgI.png is a reference image. Note that the outside border is not actually
-+ // exclusive to the regions they surround.
++ // must hold lock on map
++ private void purgeEntries() {
++ while (this.map.size() > this.limit) {
++ this.map.removeLastBoolean();
++ }
++ }
+
-+ // 4 points of the rectangle
-+ int maxX; // exclusive
-+ int minX; // inclusive
-+ int maxZ; // exclusive
-+ int minZ; // inclusive
++ public boolean remove(final long key) {
++ synchronized (this.map) {
++ return this.map.remove(key);
++ }
++ }
+
-+ if (dx != 0) {
-+ // handle right addition
++ // note:
++ public boolean getOrCompute(final long key, final Long2BooleanFunction ifAbsent) {
++ synchronized (this.map) {
++ if (this.map.containsKey(key)) {
++ return this.map.getAndMoveToFirst(key);
++ }
++ }
+
-+ maxX = toX + (oldViewDistance * right) + right; // exclusive
-+ minX = fromX + (oldViewDistance * right) + right; // inclusive
-+ maxZ = fromZ + (oldViewDistance * up) + up; // exclusive
-+ minZ = toZ - (oldViewDistance * up); // inclusive
++ final boolean put = ifAbsent.get(key);
+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.addObjectTo(object, currX, currZ, toX, toZ, fromX, fromZ);
-+ }
++ synchronized (this.map) {
++ if (this.map.containsKey(key)) {
++ return this.map.getAndMoveToFirst(key);
+ }
++ this.map.putAndMoveToFirst(key, put);
++
++ this.purgeEntries();
++
++ return put;
+ }
++ }
++}
+\ No newline at end of file
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2ObjectMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2ObjectMap.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..dbb51afc6cefe0071fe3ddcd2c1109f2755c3b4d
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2ObjectMap.java
+@@ -0,0 +1,47 @@
++package ca.spottedleaf.moonrise.common.map;
+
-+ if (dz != 0) {
-+ // handle up addition
++import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
++import java.util.function.BiFunction;
+
-+ maxX = toX + (oldViewDistance * right) + right; // exclusive
-+ minX = toX - (oldViewDistance * right); // inclusive
-+ maxZ = toZ + (oldViewDistance * up) + up; // exclusive
-+ minZ = fromZ + (oldViewDistance * up) + up; // inclusive
++public final class SynchronisedLong2ObjectMap<V> {
++ private final Long2ObjectLinkedOpenHashMap<V> map = new Long2ObjectLinkedOpenHashMap<>();
++ private final int limit;
+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.addObjectTo(object, currX, currZ, toX, toZ, fromX, fromZ);
-+ }
-+ }
++ public SynchronisedLong2ObjectMap(final int limit) {
++ this.limit = limit;
++ }
++
++ // must hold lock on map
++ private void purgeEntries() {
++ while (this.map.size() > this.limit) {
++ this.map.removeLast();
+ }
++ }
+
-+ if (dx != 0) {
-+ // handle left removal
++ public V get(final long key) {
++ synchronized (this.map) {
++ return this.map.getAndMoveToFirst(key);
++ }
++ }
+
-+ maxX = toX - (oldViewDistance * right); // exclusive
-+ minX = fromX - (oldViewDistance * right); // inclusive
-+ maxZ = fromZ + (oldViewDistance * up) + up; // exclusive
-+ minZ = toZ - (oldViewDistance * up); // inclusive
++ public V put(final long key, final V value) {
++ synchronized (this.map) {
++ final V ret = this.map.putAndMoveToFirst(key, value);
++ this.purgeEntries();
++ return ret;
++ }
++ }
+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.removeObjectFrom(object, currX, currZ, toX, toZ, fromX, fromZ);
-+ }
-+ }
++ public V compute(final long key, final BiFunction<? super Long, ? super V, ? extends V> remappingFunction) {
++ synchronized (this.map) {
++ // first, compute the value - if one is added, it will be at the last entry
++ this.map.compute(key, remappingFunction);
++ // move the entry to first, just in case it was added at last
++ final V ret = this.map.getAndMoveToFirst(key);
++ // now purge the last entries
++ this.purgeEntries();
++
++ return ret;
+ }
++ }
++}
+\ No newline at end of file
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/AllocatingRateLimiter.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/AllocatingRateLimiter.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..9c0eff9017b24bb65b1029cefb5d0bfcb9beff01
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/AllocatingRateLimiter.java
+@@ -0,0 +1,75 @@
++package ca.spottedleaf.moonrise.common.misc;
+
-+ if (dz != 0) {
-+ // handle down removal
++public final class AllocatingRateLimiter {
+
-+ maxX = fromX + (oldViewDistance * right) + right; // exclusive
-+ minX = fromX - (oldViewDistance * right); // inclusive
-+ maxZ = toZ - (oldViewDistance * up); // exclusive
-+ minZ = fromZ - (oldViewDistance * up); // inclusive
++ // max difference granularity in ns
++ private final long maxGranularity;
+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.removeObjectFrom(object, currX, currZ, toX, toZ, fromX, fromZ);
-+ }
-+ }
-+ }
++ private double allocation = 0.0;
++ private long lastAllocationUpdate;
++ // the carry is used to store the remainder of the last take, so that the take amount remains the same (minus floating point error)
++ // over any time period using take regardless of the number of take calls or the intervals between the take calls
++ // i.e. take obtains 3.5 elements, stores 0.5 to this field for the next take() call to use and returns 3
++ private double takeCarry = 0.0;
++ private long lastTakeUpdate;
++
++ public AllocatingRateLimiter(final long maxGranularity) {
++ this.maxGranularity = maxGranularity;
+ }
+
-+ @FunctionalInterface
-+ public static interface ChangeCallback<E> {
++ public void reset(final long time) {
++ this.allocation = 0.0;
++ this.lastAllocationUpdate = time;
++ this.takeCarry = 0.0;
++ this.lastTakeUpdate = time;
++ }
+
-+ // if there is no previous position, then prevPos = Integer.MIN_VALUE
-+ void accept(final E object, final int rangeX, final int rangeZ, final int currPosX, final int currPosZ, final int prevPosX, final int prevPosZ,
-+ final PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> newState);
++ // rate in units/s, and time in ns
++ public void tickAllocation(final long time, final double rate, final double maxAllocation) {
++ final long diff = Math.min(this.maxGranularity, time - this.lastAllocationUpdate);
++ this.lastAllocationUpdate = time;
+
++ this.allocation = Math.min(maxAllocation - this.takeCarry, this.allocation + rate * (diff*1.0E-9D));
+ }
+
-+ @FunctionalInterface
-+ public static interface ChangeSourceCallback<E> {
-+ void accept(final E object, final long prevPos, final long newPos);
++ public long previewAllocation(final long time, final double rate, final long maxTake) {
++ if (maxTake < 1L) {
++ return 0L;
++ }
++
++ final long diff = Math.min(this.maxGranularity, time - this.lastTakeUpdate);
++
++ // note: abs(takeCarry) <= 1.0
++ final double take = Math.min(
++ Math.min((double)maxTake - this.takeCarry, this.allocation),
++ rate * (diff*1.0E-9)
++ );
++
++ return (long)Math.floor(this.takeCarry + take);
++ }
++
++ // rate in units/s, and time in ns
++ public long takeAllocation(final long time, final double rate, final long maxTake) {
++ if (maxTake < 1L) {
++ return 0L;
++ }
++
++ double ret = this.takeCarry;
++ final long diff = Math.min(this.maxGranularity, time - this.lastTakeUpdate);
++ this.lastTakeUpdate = time;
++
++ // note: abs(takeCarry) <= 1.0
++ final double take = Math.min(
++ Math.min((double)maxTake - this.takeCarry, this.allocation),
++ rate * (diff*1.0E-9)
++ );
++
++ ret += take;
++ this.allocation -= take;
++
++ final long retInteger = (long)Math.floor(ret);
++ this.takeCarry = ret - (double)retInteger;
++
++ return retInteger;
+ }
+}
-diff --git a/src/main/java/com/destroystokyo/paper/util/misc/DistanceTrackingAreaMap.java b/src/main/java/com/destroystokyo/paper/util/misc/DistanceTrackingAreaMap.java
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed26WayDistancePropagator3D.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed26WayDistancePropagator3D.java
new file mode 100644
-index 0000000000000000000000000000000000000000..896c3ff7ddb07f1f6f05f90e1e3fe7fb615071d4
+index 0000000000000000000000000000000000000000..460e27ab0506c83a28934800ee74ee886d4b025e
--- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/misc/DistanceTrackingAreaMap.java
-@@ -0,0 +1,175 @@
-+package com.destroystokyo.paper.util.misc;
++++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed26WayDistancePropagator3D.java
+@@ -0,0 +1,297 @@
++package ca.spottedleaf.moonrise.common.misc;
+
-+import io.papermc.paper.util.IntegerUtil;
-+import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
-+import io.papermc.paper.util.MCUtil;
-+import net.minecraft.world.level.ChunkPos;
++import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
++import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap;
++import it.unimi.dsi.fastutil.longs.LongIterator;
++import it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet;
+
-+/** @author Spottedleaf */
-+public abstract class DistanceTrackingAreaMap<E> extends AreaMap<E> {
++public final class Delayed26WayDistancePropagator3D {
+
-+ // use this map only if you need distance tracking, the tracking here is obviously going to hit harder.
++ // this map is considered "stale" unless updates are propagated.
++ protected final Delayed8WayDistancePropagator2D.LevelMap levels = new Delayed8WayDistancePropagator2D.LevelMap(8192*2, 0.6f);
++
++ // this map is never stale
++ protected final Long2ByteOpenHashMap sources = new Long2ByteOpenHashMap(4096, 0.6f);
++
++ // Generally updates to positions are made close to other updates, so we link to decrease cache misses when
++ // propagating updates
++ protected final LongLinkedOpenHashSet updatedSources = new LongLinkedOpenHashSet();
++
++ @FunctionalInterface
++ public static interface LevelChangeCallback {
++
++ /**
++ * This can be called for intermediate updates. So do not rely on newLevel being close to or
++ * the exact level that is expected after a full propagation has occured.
++ */
++ public void onLevelUpdate(final long coordinate, final byte oldLevel, final byte newLevel);
+
-+ protected final Long2IntOpenHashMap chunkToNearestDistance = new Long2IntOpenHashMap(1024, 0.7f);
-+ {
-+ this.chunkToNearestDistance.defaultReturnValue(-1);
+ }
+
-+ protected final DistanceChangeCallback<E> distanceChangeCallback;
++ protected final LevelChangeCallback changeCallback;
+
-+ public DistanceTrackingAreaMap() {
-+ this(new PooledLinkedHashSets<>());
++ public Delayed26WayDistancePropagator3D() {
++ this(null);
+ }
+
-+ // let users define a "global" or "shared" pooled sets if they wish
-+ public DistanceTrackingAreaMap(final PooledLinkedHashSets<E> pooledHashSets) {
-+ this(pooledHashSets, null, null, null);
++ public Delayed26WayDistancePropagator3D(final LevelChangeCallback changeCallback) {
++ this.changeCallback = changeCallback;
+ }
+
-+ public DistanceTrackingAreaMap(final PooledLinkedHashSets<E> pooledHashSets, final ChangeCallback<E> addCallback, final ChangeCallback<E> removeCallback,
-+ final DistanceChangeCallback<E> distanceChangeCallback) {
-+ super(pooledHashSets, addCallback, removeCallback);
-+ this.distanceChangeCallback = distanceChangeCallback;
++ public int getLevel(final long pos) {
++ return this.levels.get(pos);
+ }
+
-+ // ret -1 if there is nothing mapped
-+ public final int getNearestObjectDistance(final long key) {
-+ return this.chunkToNearestDistance.get(key);
++ public int getLevel(final int x, final int y, final int z) {
++ return this.levels.get(CoordinateUtils.getChunkSectionKey(x, y, z));
+ }
+
-+ // ret -1 if there is nothing mapped
-+ public final int getNearestObjectDistance(final ChunkPos chunkPos) {
-+ return this.chunkToNearestDistance.get(MCUtil.getCoordinateKey(chunkPos));
++ public void setSource(final int x, final int y, final int z, final int level) {
++ this.setSource(CoordinateUtils.getChunkSectionKey(x, y, z), level);
+ }
+
-+ // ret -1 if there is nothing mapped
-+ public final int getNearestObjectDistance(final int chunkX, final int chunkZ) {
-+ return this.chunkToNearestDistance.get(MCUtil.getCoordinateKey(chunkX, chunkZ));
++ public void setSource(final long coordinate, final int level) {
++ if ((level & 63) != level || level == 0) {
++ throw new IllegalArgumentException("Level must be in (0, 63], not " + level);
++ }
++
++ final byte byteLevel = (byte)level;
++ final byte oldLevel = this.sources.put(coordinate, byteLevel);
++
++ if (oldLevel == byteLevel) {
++ return; // nothing to do
++ }
++
++ // queue to update later
++ this.updatedSources.add(coordinate);
+ }
+
-+ protected final void recalculateDistance(final int chunkX, final int chunkZ) {
-+ final long key = MCUtil.getCoordinateKey(chunkX, chunkZ);
-+ final PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> state = this.areaMap.get(key);
-+ if (state == null) {
-+ final int oldDistance = this.chunkToNearestDistance.remove(key);
-+ // nothing here.
-+ if (oldDistance == -1) {
-+ // nothing was here previously
-+ return;
-+ }
-+ if (this.distanceChangeCallback != null) {
-+ this.distanceChangeCallback.accept(chunkX, chunkZ, oldDistance, -1, null);
-+ }
-+ return;
++ public void removeSource(final int x, final int y, final int z) {
++ this.removeSource(CoordinateUtils.getChunkSectionKey(x, y, z));
++ }
++
++ public void removeSource(final long coordinate) {
++ if (this.sources.remove(coordinate) != 0) {
++ this.updatedSources.add(coordinate);
+ }
++ }
+
-+ int newDistance = Integer.MAX_VALUE;
++ // queues used for BFS propagating levels
++ protected final Delayed8WayDistancePropagator2D.WorkQueue[] levelIncreaseWorkQueues = new Delayed8WayDistancePropagator2D.WorkQueue[64];
++ {
++ for (int i = 0; i < this.levelIncreaseWorkQueues.length; ++i) {
++ this.levelIncreaseWorkQueues[i] = new Delayed8WayDistancePropagator2D.WorkQueue();
++ }
++ }
++ protected final Delayed8WayDistancePropagator2D.WorkQueue[] levelRemoveWorkQueues = new Delayed8WayDistancePropagator2D.WorkQueue[64];
++ {
++ for (int i = 0; i < this.levelRemoveWorkQueues.length; ++i) {
++ this.levelRemoveWorkQueues[i] = new Delayed8WayDistancePropagator2D.WorkQueue();
++ }
++ }
++ protected long levelIncreaseWorkQueueBitset;
++ protected long levelRemoveWorkQueueBitset;
+
-+ final Object[] rawData = state.getBackingSet();
-+ for (int i = 0, len = rawData.length; i < len; ++i) {
-+ final Object raw = rawData[i];
++ protected final void addToIncreaseWorkQueue(final long coordinate, final byte level) {
++ final Delayed8WayDistancePropagator2D.WorkQueue queue = this.levelIncreaseWorkQueues[level];
++ queue.queuedCoordinates.enqueue(coordinate);
++ queue.queuedLevels.enqueue(level);
+
-+ if (raw == null) {
-+ continue;
-+ }
++ this.levelIncreaseWorkQueueBitset |= (1L << level);
++ }
+
-+ final E object = (E)raw;
-+ final long location = this.objectToLastCoordinate.getLong(object);
++ protected final void addToIncreaseWorkQueue(final long coordinate, final byte index, final byte level) {
++ final Delayed8WayDistancePropagator2D.WorkQueue queue = this.levelIncreaseWorkQueues[index];
++ queue.queuedCoordinates.enqueue(coordinate);
++ queue.queuedLevels.enqueue(level);
+
-+ final int distance = Math.max(IntegerUtil.branchlessAbs(chunkX - MCUtil.getCoordinateX(location)), IntegerUtil.branchlessAbs(chunkZ - MCUtil.getCoordinateZ(location)));
++ this.levelIncreaseWorkQueueBitset |= (1L << index);
++ }
+
-+ if (distance < newDistance) {
-+ newDistance = distance;
-+ }
++ protected final void addToRemoveWorkQueue(final long coordinate, final byte level) {
++ final Delayed8WayDistancePropagator2D.WorkQueue queue = this.levelRemoveWorkQueues[level];
++ queue.queuedCoordinates.enqueue(coordinate);
++ queue.queuedLevels.enqueue(level);
++
++ this.levelRemoveWorkQueueBitset |= (1L << level);
++ }
++
++ public boolean propagateUpdates() {
++ if (this.updatedSources.isEmpty()) {
++ return false;
+ }
+
-+ final int oldDistance = this.chunkToNearestDistance.put(key, newDistance);
++ boolean ret = false;
++
++ for (final LongIterator iterator = this.updatedSources.iterator(); iterator.hasNext();) {
++ final long coordinate = iterator.nextLong();
+
-+ if (oldDistance != newDistance) {
-+ if (this.distanceChangeCallback != null) {
-+ this.distanceChangeCallback.accept(chunkX, chunkZ, oldDistance, newDistance, state);
++ final byte currentLevel = this.levels.get(coordinate);
++ final byte updatedSource = this.sources.get(coordinate);
++
++ if (currentLevel == updatedSource) {
++ continue;
++ }
++ ret = true;
++
++ if (updatedSource > currentLevel) {
++ // level increase
++ this.addToIncreaseWorkQueue(coordinate, updatedSource);
++ } else {
++ // level decrease
++ this.addToRemoveWorkQueue(coordinate, currentLevel);
++ // if the current coordinate is a source, then the decrease propagation will detect that and queue
++ // the source propagation
+ }
+ }
++
++ this.updatedSources.clear();
++
++ // propagate source level increases first for performance reasons (in crowded areas hopefully the additions
++ // make the removes remove less)
++ this.propagateIncreases();
++
++ // now we propagate the decreases (which will then re-propagate clobbered sources)
++ this.propagateDecreases();
++
++ return ret;
+ }
+
-+ @Override
-+ protected void addObjectCallback(final E object, final int chunkX, final int chunkZ, final int viewDistance) {
-+ final int maxX = chunkX + viewDistance;
-+ final int maxZ = chunkZ + viewDistance;
-+ final int minX = chunkX - viewDistance;
-+ final int minZ = chunkZ - viewDistance;
-+ for (int x = minX; x <= maxX; ++x) {
-+ for (int z = minZ; z <= maxZ; ++z) {
-+ this.recalculateDistance(x, z);
++ protected void propagateIncreases() {
++ for (int queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelIncreaseWorkQueueBitset);
++ this.levelIncreaseWorkQueueBitset != 0L;
++ this.levelIncreaseWorkQueueBitset ^= (1L << queueIndex), queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelIncreaseWorkQueueBitset)) {
++
++ final Delayed8WayDistancePropagator2D.WorkQueue queue = this.levelIncreaseWorkQueues[queueIndex];
++ while (!queue.queuedLevels.isEmpty()) {
++ final long coordinate = queue.queuedCoordinates.removeFirstLong();
++ byte level = queue.queuedLevels.removeFirstByte();
++
++ final boolean neighbourCheck = level < 0;
++
++ final byte currentLevel;
++ if (neighbourCheck) {
++ level = (byte)-level;
++ currentLevel = this.levels.get(coordinate);
++ } else {
++ currentLevel = this.levels.putIfGreater(coordinate, level);
++ }
++
++ if (neighbourCheck) {
++ // used when propagating from decrease to indicate that this level needs to check its neighbours
++ // this means the level at coordinate could be equal, but would still need neighbours checked
++
++ if (currentLevel != level) {
++ // something caused the level to change, which means something propagated to it (which means
++ // us propagating here is redundant), or something removed the level (which means we
++ // cannot propagate further)
++ continue;
++ }
++ } else if (currentLevel >= level) {
++ // something higher/equal propagated
++ continue;
++ }
++ if (this.changeCallback != null) {
++ this.changeCallback.onLevelUpdate(coordinate, currentLevel, level);
++ }
++
++ if (level == 1) {
++ // can't propagate 0 to neighbours
++ continue;
++ }
++
++ // propagate to neighbours
++ final byte neighbourLevel = (byte)(level - 1);
++ final int x = CoordinateUtils.getChunkSectionX(coordinate);
++ final int y = CoordinateUtils.getChunkSectionY(coordinate);
++ final int z = CoordinateUtils.getChunkSectionZ(coordinate);
++
++ for (int dy = -1; dy <= 1; ++dy) {
++ for (int dz = -1; dz <= 1; ++dz) {
++ for (int dx = -1; dx <= 1; ++dx) {
++ if ((dy | dz | dx) == 0) {
++ // already propagated to coordinate
++ continue;
++ }
++
++ // sure we can check the neighbour level in the map right now and avoid a propagation,
++ // but then we would still have to recheck it when popping the value off of the queue!
++ // so just avoid the double lookup
++ final long neighbourCoordinate = CoordinateUtils.getChunkSectionKey(dx + x, dy + y, dz + z);
++ this.addToIncreaseWorkQueue(neighbourCoordinate, neighbourLevel);
++ }
++ }
++ }
+ }
+ }
+ }
+
-+ @Override
-+ protected void removeObjectCallback(final E object, final int chunkX, final int chunkZ, final int viewDistance) {
-+ final int maxX = chunkX + viewDistance;
-+ final int maxZ = chunkZ + viewDistance;
-+ final int minX = chunkX - viewDistance;
-+ final int minZ = chunkZ - viewDistance;
-+ for (int x = minX; x <= maxX; ++x) {
-+ for (int z = minZ; z <= maxZ; ++z) {
-+ this.recalculateDistance(x, z);
++ protected void propagateDecreases() {
++ for (int queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelRemoveWorkQueueBitset);
++ this.levelRemoveWorkQueueBitset != 0L;
++ this.levelRemoveWorkQueueBitset ^= (1L << queueIndex), queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelRemoveWorkQueueBitset)) {
++
++ final Delayed8WayDistancePropagator2D.WorkQueue queue = this.levelRemoveWorkQueues[queueIndex];
++ while (!queue.queuedLevels.isEmpty()) {
++ final long coordinate = queue.queuedCoordinates.removeFirstLong();
++ final byte level = queue.queuedLevels.removeFirstByte();
++
++ final byte currentLevel = this.levels.removeIfGreaterOrEqual(coordinate, level);
++ if (currentLevel == 0) {
++ // something else removed
++ continue;
++ }
++
++ if (currentLevel > level) {
++ // something higher propagated here or we hit the propagation of another source
++ // in the second case we need to re-propagate because we could have just clobbered another source's
++ // propagation
++ this.addToIncreaseWorkQueue(coordinate, currentLevel, (byte)-currentLevel); // indicate to the increase code that the level's neighbours need checking
++ continue;
++ }
++
++ if (this.changeCallback != null) {
++ this.changeCallback.onLevelUpdate(coordinate, currentLevel, (byte)0);
++ }
++
++ final byte source = this.sources.get(coordinate);
++ if (source != 0) {
++ // must re-propagate source later
++ this.addToIncreaseWorkQueue(coordinate, source);
++ }
++
++ if (level == 0) {
++ // can't propagate -1 to neighbours
++ // we have to check neighbours for removing 1 just in case the neighbour is 2
++ continue;
++ }
++
++ // propagate to neighbours
++ final byte neighbourLevel = (byte)(level - 1);
++ final int x = CoordinateUtils.getChunkSectionX(coordinate);
++ final int y = CoordinateUtils.getChunkSectionY(coordinate);
++ final int z = CoordinateUtils.getChunkSectionZ(coordinate);
++
++ for (int dy = -1; dy <= 1; ++dy) {
++ for (int dz = -1; dz <= 1; ++dz) {
++ for (int dx = -1; dx <= 1; ++dx) {
++ if ((dy | dz | dx) == 0) {
++ // already propagated to coordinate
++ continue;
++ }
++
++ // sure we can check the neighbour level in the map right now and avoid a propagation,
++ // but then we would still have to recheck it when popping the value off of the queue!
++ // so just avoid the double lookup
++ final long neighbourCoordinate = CoordinateUtils.getChunkSectionKey(dx + x, dy + y, dz + z);
++ this.addToRemoveWorkQueue(neighbourCoordinate, neighbourLevel);
++ }
++ }
++ }
+ }
+ }
++
++ // propagate sources we clobbered in the process
++ this.propagateIncreases();
+ }
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed8WayDistancePropagator2D.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed8WayDistancePropagator2D.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..ab2fa1563d5e32a5313dfcc1da411cab45fb5ca0
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed8WayDistancePropagator2D.java
+@@ -0,0 +1,718 @@
++package ca.spottedleaf.moonrise.common.misc;
++
++import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
++import it.unimi.dsi.fastutil.HashCommon;
++import it.unimi.dsi.fastutil.bytes.ByteArrayFIFOQueue;
++import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap;
++import it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue;
++import it.unimi.dsi.fastutil.longs.LongIterator;
++import it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet;
+
-+ @Override
-+ protected void updateObjectCallback(final E object, final long oldPosition, final long newPosition, final int oldViewDistance, final int newViewDistance) {
-+ if (oldPosition == newPosition && newViewDistance == oldViewDistance) {
-+ return;
++public final class Delayed8WayDistancePropagator2D {
++
++ // Test
++ /*
++ protected static void test(int x, int z, com.destroystokyo.paper.util.misc.DistanceTrackingAreaMap<Ticket> reference, Delayed8WayDistancePropagator2D test) {
++ int got = test.getLevel(x, z);
++
++ int expect = 0;
++ Object[] nearest = reference.getObjectsInRange(x, z) == null ? null : reference.getObjectsInRange(x, z).getBackingSet();
++ if (nearest != null) {
++ for (Object _obj : nearest) {
++ if (_obj instanceof Ticket) {
++ Ticket ticket = (Ticket)_obj;
++ long ticketCoord = reference.getLastCoordinate(ticket);
++ int viewDistance = reference.getLastViewDistance(ticket);
++ int distance = Math.max(com.destroystokyo.paper.util.math.IntegerUtil.branchlessAbs(MCUtil.getCoordinateX(ticketCoord) - x),
++ com.destroystokyo.paper.util.math.IntegerUtil.branchlessAbs(MCUtil.getCoordinateZ(ticketCoord) - z));
++ int level = viewDistance - distance;
++ if (level > expect) {
++ expect = level;
++ }
++ }
++ }
+ }
+
-+ final int toX = MCUtil.getCoordinateX(newPosition);
-+ final int toZ = MCUtil.getCoordinateZ(newPosition);
-+ final int fromX = MCUtil.getCoordinateX(oldPosition);
-+ final int fromZ = MCUtil.getCoordinateZ(oldPosition);
++ if (expect != got) {
++ throw new IllegalStateException("Expected " + expect + " at pos (" + x + "," + z + ") but got " + got);
++ }
++ }
+
-+ final int totalX = IntegerUtil.branchlessAbs(fromX - toX);
-+ final int totalZ = IntegerUtil.branchlessAbs(fromZ - toZ);
++ static class Ticket {
+
-+ if (Math.max(totalX, totalZ) > (2 * Math.max(newViewDistance, oldViewDistance))) {
-+ // teleported?
-+ this.removeObjectCallback(object, fromX, fromZ, oldViewDistance);
-+ this.addObjectCallback(object, toX, toZ, newViewDistance);
-+ return;
++ int x;
++ int z;
++
++ final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<Ticket> empty
++ = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this);
++
++ }
++
++ public static void main(final String[] args) {
++ com.destroystokyo.paper.util.misc.DistanceTrackingAreaMap<Ticket> reference = new com.destroystokyo.paper.util.misc.DistanceTrackingAreaMap<Ticket>() {
++ @Override
++ protected com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<Ticket> getEmptySetFor(Ticket object) {
++ return object.empty;
++ }
++ };
++ Delayed8WayDistancePropagator2D test = new Delayed8WayDistancePropagator2D();
++
++ final int maxDistance = 64;
++ // test origin
++ {
++ Ticket originTicket = new Ticket();
++ int originDistance = 31;
++ // test single source
++ reference.add(originTicket, 0, 0, originDistance);
++ test.setSource(0, 0, originDistance); test.propagateUpdates(); // set and propagate
++ for (int dx = -originDistance; dx <= originDistance; ++dx) {
++ for (int dz = -originDistance; dz <= originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
++ }
++ // test single source decrease
++ reference.update(originTicket, 0, 0, originDistance/2);
++ test.setSource(0, 0, originDistance/2); test.propagateUpdates(); // set and propagate
++ for (int dx = -originDistance; dx <= originDistance; ++dx) {
++ for (int dz = -originDistance; dz <= originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
++ }
++ // test source increase
++ originDistance = 2*originDistance;
++ reference.update(originTicket, 0, 0, originDistance);
++ test.setSource(0, 0, originDistance); test.propagateUpdates(); // set and propagate
++ for (int dx = -4*originDistance; dx <= 4*originDistance; ++dx) {
++ for (int dz = -4*originDistance; dz <= 4*originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
++ }
++
++ reference.remove(originTicket);
++ test.removeSource(0, 0); test.propagateUpdates();
+ }
+
-+ final int minX = Math.min(fromX - oldViewDistance, toX - newViewDistance);
-+ final int maxX = Math.max(fromX + oldViewDistance, toX + newViewDistance);
-+ final int minZ = Math.min(fromZ - oldViewDistance, toZ - newViewDistance);
-+ final int maxZ = Math.max(fromZ + oldViewDistance, toZ + newViewDistance);
++ // test multiple sources at origin
++ {
++ int originDistance = 31;
++ java.util.List<Ticket> list = new java.util.ArrayList<>();
++ for (int i = 0; i < 10; ++i) {
++ Ticket a = new Ticket();
++ list.add(a);
++ a.x = (i & 1) == 1 ? -i : i;
++ a.z = (i & 1) == 1 ? -i : i;
++ }
++ for (Ticket ticket : list) {
++ reference.add(ticket, ticket.x, ticket.z, originDistance);
++ test.setSource(ticket.x, ticket.z, originDistance);
++ }
++ test.propagateUpdates();
++
++ for (int dx = -8*originDistance; dx <= 8*originDistance; ++dx) {
++ for (int dz = -8*originDistance; dz <= 8*originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
++ }
++
++ // test ticket level decrease
+
-+ for (int x = minX; x <= maxX; ++x) {
-+ for (int z = minZ; z <= maxZ; ++z) {
-+ final int distXOld = IntegerUtil.branchlessAbs(x - fromX);
-+ final int distZOld = IntegerUtil.branchlessAbs(z - fromZ);
++ for (Ticket ticket : list) {
++ reference.update(ticket, ticket.x, ticket.z, originDistance/2);
++ test.setSource(ticket.x, ticket.z, originDistance/2);
++ }
++ test.propagateUpdates();
+
-+ if (Math.max(distXOld, distZOld) <= oldViewDistance) {
-+ this.recalculateDistance(x, z);
++ for (int dx = -8*originDistance; dx <= 8*originDistance; ++dx) {
++ for (int dz = -8*originDistance; dz <= 8*originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
++ }
++
++ // test ticket level increase
++
++ for (Ticket ticket : list) {
++ reference.update(ticket, ticket.x, ticket.z, originDistance*2);
++ test.setSource(ticket.x, ticket.z, originDistance*2);
++ }
++ test.propagateUpdates();
++
++ for (int dx = -16*originDistance; dx <= 16*originDistance; ++dx) {
++ for (int dz = -16*originDistance; dz <= 16*originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
++ }
++
++ // test ticket remove
++ for (int i = 0, len = list.size(); i < len; ++i) {
++ if ((i & 3) != 0) {
+ continue;
+ }
++ Ticket ticket = list.get(i);
++ reference.remove(ticket);
++ test.removeSource(ticket.x, ticket.z);
++ }
++ test.propagateUpdates();
++
++ for (int dx = -16*originDistance; dx <= 16*originDistance; ++dx) {
++ for (int dz = -16*originDistance; dz <= 16*originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
++ }
++ }
++
++ // now test at coordinate offsets
++ // test offset
++ {
++ Ticket originTicket = new Ticket();
++ int originDistance = 31;
++ int offX = 54432;
++ int offZ = -134567;
++ // test single source
++ reference.add(originTicket, offX, offZ, originDistance);
++ test.setSource(offX, offZ, originDistance); test.propagateUpdates(); // set and propagate
++ for (int dx = -originDistance; dx <= originDistance; ++dx) {
++ for (int dz = -originDistance; dz <= originDistance; ++dz) {
++ test(dx + offX, dz + offZ, reference, test);
++ }
++ }
++ // test single source decrease
++ reference.update(originTicket, offX, offZ, originDistance/2);
++ test.setSource(offX, offZ, originDistance/2); test.propagateUpdates(); // set and propagate
++ for (int dx = -originDistance; dx <= originDistance; ++dx) {
++ for (int dz = -originDistance; dz <= originDistance; ++dz) {
++ test(dx + offX, dz + offZ, reference, test);
++ }
++ }
++ // test source increase
++ originDistance = 2*originDistance;
++ reference.update(originTicket, offX, offZ, originDistance);
++ test.setSource(offX, offZ, originDistance); test.propagateUpdates(); // set and propagate
++ for (int dx = -4*originDistance; dx <= 4*originDistance; ++dx) {
++ for (int dz = -4*originDistance; dz <= 4*originDistance; ++dz) {
++ test(dx + offX, dz + offZ, reference, test);
++ }
++ }
++
++ reference.remove(originTicket);
++ test.removeSource(offX, offZ); test.propagateUpdates();
++ }
++
++ // test multiple sources at origin
++ {
++ int originDistance = 31;
++ int offX = 54432;
++ int offZ = -134567;
++ java.util.List<Ticket> list = new java.util.ArrayList<>();
++ for (int i = 0; i < 10; ++i) {
++ Ticket a = new Ticket();
++ list.add(a);
++ a.x = offX + ((i & 1) == 1 ? -i : i);
++ a.z = offZ + ((i & 1) == 1 ? -i : i);
++ }
++ for (Ticket ticket : list) {
++ reference.add(ticket, ticket.x, ticket.z, originDistance);
++ test.setSource(ticket.x, ticket.z, originDistance);
++ }
++ test.propagateUpdates();
++
++ for (int dx = -8*originDistance; dx <= 8*originDistance; ++dx) {
++ for (int dz = -8*originDistance; dz <= 8*originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
++ }
++
++ // test ticket level decrease
++
++ for (Ticket ticket : list) {
++ reference.update(ticket, ticket.x, ticket.z, originDistance/2);
++ test.setSource(ticket.x, ticket.z, originDistance/2);
++ }
++ test.propagateUpdates();
++
++ for (int dx = -8*originDistance; dx <= 8*originDistance; ++dx) {
++ for (int dz = -8*originDistance; dz <= 8*originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
++ }
++
++ // test ticket level increase
+
-+ final int distXNew = IntegerUtil.branchlessAbs(x - toX);
-+ final int distZNew = IntegerUtil.branchlessAbs(z - toZ);
++ for (Ticket ticket : list) {
++ reference.update(ticket, ticket.x, ticket.z, originDistance*2);
++ test.setSource(ticket.x, ticket.z, originDistance*2);
++ }
++ test.propagateUpdates();
+
-+ if (Math.max(distXNew, distZNew) <= newViewDistance) {
-+ this.recalculateDistance(x, z);
++ for (int dx = -16*originDistance; dx <= 16*originDistance; ++dx) {
++ for (int dz = -16*originDistance; dz <= 16*originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
++ }
++
++ // test ticket remove
++ for (int i = 0, len = list.size(); i < len; ++i) {
++ if ((i & 3) != 0) {
+ continue;
+ }
++ Ticket ticket = list.get(i);
++ reference.remove(ticket);
++ test.removeSource(ticket.x, ticket.z);
++ }
++ test.propagateUpdates();
++
++ for (int dx = -16*originDistance; dx <= 16*originDistance; ++dx) {
++ for (int dz = -16*originDistance; dz <= 16*originDistance; ++dz) {
++ test(dx, dz, reference, test);
++ }
+ }
+ }
+ }
++ */
++
++ // this map is considered "stale" unless updates are propagated.
++ protected final LevelMap levels = new LevelMap(8192*2, 0.6f);
++
++ // this map is never stale
++ protected final Long2ByteOpenHashMap sources = new Long2ByteOpenHashMap(4096, 0.6f);
++
++ // Generally updates to positions are made close to other updates, so we link to decrease cache misses when
++ // propagating updates
++ protected final LongLinkedOpenHashSet updatedSources = new LongLinkedOpenHashSet();
+
+ @FunctionalInterface
-+ public static interface DistanceChangeCallback<E> {
++ public static interface LevelChangeCallback {
+
-+ void accept(final int posX, final int posZ, final int oldNearestDistance, final int newNearestDistance,
-+ final PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<E> state);
++ /**
++ * This can be called for intermediate updates. So do not rely on newLevel being close to or
++ * the exact level that is expected after a full propagation has occured.
++ */
++ public void onLevelUpdate(final long coordinate, final byte oldLevel, final byte newLevel);
+
+ }
-+}
-diff --git a/src/main/java/com/destroystokyo/paper/util/misc/PlayerAreaMap.java b/src/main/java/com/destroystokyo/paper/util/misc/PlayerAreaMap.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..46954db7ecd35ac4018fdf476df7c8020d7ce6c8
---- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/misc/PlayerAreaMap.java
-@@ -0,0 +1,32 @@
-+package com.destroystokyo.paper.util.misc;
-+
-+import net.minecraft.server.level.ServerPlayer;
+
-+/**
-+ * @author Spottedleaf
-+ */
-+public final class PlayerAreaMap extends AreaMap<ServerPlayer> {
++ protected final LevelChangeCallback changeCallback;
+
-+ public PlayerAreaMap() {
-+ super();
++ public Delayed8WayDistancePropagator2D() {
++ this(null);
+ }
+
-+ public PlayerAreaMap(final PooledLinkedHashSets<ServerPlayer> pooledHashSets) {
-+ super(pooledHashSets);
++ public Delayed8WayDistancePropagator2D(final LevelChangeCallback changeCallback) {
++ this.changeCallback = changeCallback;
+ }
+
-+ public PlayerAreaMap(final PooledLinkedHashSets<ServerPlayer> pooledHashSets, final ChangeCallback<ServerPlayer> addCallback,
-+ final ChangeCallback<ServerPlayer> removeCallback) {
-+ this(pooledHashSets, addCallback, removeCallback, null);
++ public int getLevel(final long pos) {
++ return this.levels.get(pos);
+ }
+
-+ public PlayerAreaMap(final PooledLinkedHashSets<ServerPlayer> pooledHashSets, final ChangeCallback<ServerPlayer> addCallback,
-+ final ChangeCallback<ServerPlayer> removeCallback, final ChangeSourceCallback<ServerPlayer> changeSourceCallback) {
-+ super(pooledHashSets, addCallback, removeCallback, changeSourceCallback);
++ public int getLevel(final int x, final int z) {
++ return this.levels.get(CoordinateUtils.getChunkKey(x, z));
+ }
+
-+ @Override
-+ protected PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> getEmptySetFor(final ServerPlayer player) {
-+ return player.cachedSingleHashSet;
++ public void setSource(final int x, final int z, final int level) {
++ this.setSource(CoordinateUtils.getChunkKey(x, z), level);
+ }
-+}
-diff --git a/src/main/java/com/destroystokyo/paper/util/misc/PlayerDistanceTrackingAreaMap.java b/src/main/java/com/destroystokyo/paper/util/misc/PlayerDistanceTrackingAreaMap.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..d05dcea15f7047b58736c7c0e07920a04d6c5abe
---- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/misc/PlayerDistanceTrackingAreaMap.java
-@@ -0,0 +1,24 @@
-+package com.destroystokyo.paper.util.misc;
+
-+import net.minecraft.server.level.ServerPlayer;
++ public void setSource(final long coordinate, final int level) {
++ if ((level & 63) != level || level == 0) {
++ throw new IllegalArgumentException("Level must be in (0, 63], not " + level);
++ }
+
-+public class PlayerDistanceTrackingAreaMap extends DistanceTrackingAreaMap<ServerPlayer> {
++ final byte byteLevel = (byte)level;
++ final byte oldLevel = this.sources.put(coordinate, byteLevel);
+
-+ public PlayerDistanceTrackingAreaMap() {
-+ super();
++ if (oldLevel == byteLevel) {
++ return; // nothing to do
++ }
++
++ // queue to update later
++ this.updatedSources.add(coordinate);
+ }
+
-+ public PlayerDistanceTrackingAreaMap(final PooledLinkedHashSets<ServerPlayer> pooledHashSets) {
-+ super(pooledHashSets);
++ public void removeSource(final int x, final int z) {
++ this.removeSource(CoordinateUtils.getChunkKey(x, z));
+ }
+
-+ public PlayerDistanceTrackingAreaMap(final PooledLinkedHashSets<ServerPlayer> pooledHashSets, final ChangeCallback<ServerPlayer> addCallback,
-+ final ChangeCallback<ServerPlayer> removeCallback, final DistanceChangeCallback<ServerPlayer> distanceChangeCallback) {
-+ super(pooledHashSets, addCallback, removeCallback, distanceChangeCallback);
++ public void removeSource(final long coordinate) {
++ if (this.sources.remove(coordinate) != 0) {
++ this.updatedSources.add(coordinate);
++ }
+ }
+
-+ @Override
-+ protected PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> getEmptySetFor(final ServerPlayer player) {
-+ return player.cachedSingleHashSet;
++ // queues used for BFS propagating levels
++ protected final WorkQueue[] levelIncreaseWorkQueues = new WorkQueue[64];
++ {
++ for (int i = 0; i < this.levelIncreaseWorkQueues.length; ++i) {
++ this.levelIncreaseWorkQueues[i] = new WorkQueue();
++ }
+ }
-+}
-diff --git a/src/main/java/com/destroystokyo/paper/util/misc/PooledLinkedHashSets.java b/src/main/java/com/destroystokyo/paper/util/misc/PooledLinkedHashSets.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..e51104e65a07b6ea7bbbcbb6afb066ef6401cc5b
---- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/misc/PooledLinkedHashSets.java
-@@ -0,0 +1,287 @@
-+package com.destroystokyo.paper.util.misc;
++ protected final WorkQueue[] levelRemoveWorkQueues = new WorkQueue[64];
++ {
++ for (int i = 0; i < this.levelRemoveWorkQueues.length; ++i) {
++ this.levelRemoveWorkQueues[i] = new WorkQueue();
++ }
++ }
++ protected long levelIncreaseWorkQueueBitset;
++ protected long levelRemoveWorkQueueBitset;
+
-+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
-+import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
-+import java.lang.ref.WeakReference;
++ protected final void addToIncreaseWorkQueue(final long coordinate, final byte level) {
++ final WorkQueue queue = this.levelIncreaseWorkQueues[level];
++ queue.queuedCoordinates.enqueue(coordinate);
++ queue.queuedLevels.enqueue(level);
+
-+/** @author Spottedleaf */
-+public class PooledLinkedHashSets<E> {
++ this.levelIncreaseWorkQueueBitset |= (1L << level);
++ }
+
-+ /* Tested via https://gist.github.com/Spottedleaf/a93bb7a8993d6ce142d3efc5932bf573 */
++ protected final void addToIncreaseWorkQueue(final long coordinate, final byte index, final byte level) {
++ final WorkQueue queue = this.levelIncreaseWorkQueues[index];
++ queue.queuedCoordinates.enqueue(coordinate);
++ queue.queuedLevels.enqueue(level);
++
++ this.levelIncreaseWorkQueueBitset |= (1L << index);
++ }
+
-+ // we really want to avoid that equals() check as much as possible...
-+ protected final Object2ObjectOpenHashMap<PooledObjectLinkedOpenHashSet<E>, PooledObjectLinkedOpenHashSet<E>> mapPool = new Object2ObjectOpenHashMap<>(128, 0.25f);
++ protected final void addToRemoveWorkQueue(final long coordinate, final byte level) {
++ final WorkQueue queue = this.levelRemoveWorkQueues[level];
++ queue.queuedCoordinates.enqueue(coordinate);
++ queue.queuedLevels.enqueue(level);
+
-+ protected void decrementReferenceCount(final PooledObjectLinkedOpenHashSet<E> current) {
-+ if (current.referenceCount == 0) {
-+ throw new IllegalStateException("Cannot decrement reference count for " + current);
++ this.levelRemoveWorkQueueBitset |= (1L << level);
++ }
++
++ public boolean propagateUpdates() {
++ if (this.updatedSources.isEmpty()) {
++ return false;
+ }
-+ if (current.referenceCount == -1 || --current.referenceCount > 0) {
-+ return;
++
++ boolean ret = false;
++
++ for (final LongIterator iterator = this.updatedSources.iterator(); iterator.hasNext();) {
++ final long coordinate = iterator.nextLong();
++
++ final byte currentLevel = this.levels.get(coordinate);
++ final byte updatedSource = this.sources.get(coordinate);
++
++ if (currentLevel == updatedSource) {
++ continue;
++ }
++ ret = true;
++
++ if (updatedSource > currentLevel) {
++ // level increase
++ this.addToIncreaseWorkQueue(coordinate, updatedSource);
++ } else {
++ // level decrease
++ this.addToRemoveWorkQueue(coordinate, currentLevel);
++ // if the current coordinate is a source, then the decrease propagation will detect that and queue
++ // the source propagation
++ }
+ }
+
-+ this.mapPool.remove(current);
-+ return;
++ this.updatedSources.clear();
++
++ // propagate source level increases first for performance reasons (in crowded areas hopefully the additions
++ // make the removes remove less)
++ this.propagateIncreases();
++
++ // now we propagate the decreases (which will then re-propagate clobbered sources)
++ this.propagateDecreases();
++
++ return ret;
+ }
+
-+ public PooledObjectLinkedOpenHashSet<E> findMapWith(final PooledObjectLinkedOpenHashSet<E> current, final E object) {
-+ final PooledObjectLinkedOpenHashSet<E> cached = current.getAddCache(object);
++ protected void propagateIncreases() {
++ for (int queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelIncreaseWorkQueueBitset);
++ this.levelIncreaseWorkQueueBitset != 0L;
++ this.levelIncreaseWorkQueueBitset ^= (1L << queueIndex), queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelIncreaseWorkQueueBitset)) {
++
++ final WorkQueue queue = this.levelIncreaseWorkQueues[queueIndex];
++ while (!queue.queuedLevels.isEmpty()) {
++ final long coordinate = queue.queuedCoordinates.removeFirstLong();
++ byte level = queue.queuedLevels.removeFirstByte();
++
++ final boolean neighbourCheck = level < 0;
++
++ final byte currentLevel;
++ if (neighbourCheck) {
++ level = (byte)-level;
++ currentLevel = this.levels.get(coordinate);
++ } else {
++ currentLevel = this.levels.putIfGreater(coordinate, level);
++ }
++
++ if (neighbourCheck) {
++ // used when propagating from decrease to indicate that this level needs to check its neighbours
++ // this means the level at coordinate could be equal, but would still need neighbours checked
++
++ if (currentLevel != level) {
++ // something caused the level to change, which means something propagated to it (which means
++ // us propagating here is redundant), or something removed the level (which means we
++ // cannot propagate further)
++ continue;
++ }
++ } else if (currentLevel >= level) {
++ // something higher/equal propagated
++ continue;
++ }
++ if (this.changeCallback != null) {
++ this.changeCallback.onLevelUpdate(coordinate, currentLevel, level);
++ }
+
-+ if (cached != null) {
-+ decrementReferenceCount(current);
++ if (level == 1) {
++ // can't propagate 0 to neighbours
++ continue;
++ }
+
-+ if (cached.referenceCount == 0) {
-+ // bring the map back from the dead
-+ PooledObjectLinkedOpenHashSet<E> contending = this.mapPool.putIfAbsent(cached, cached);
-+ if (contending != null) {
-+ // a map already exists with the elements we want
-+ if (contending.referenceCount != -1) {
-+ ++contending.referenceCount;
++ // propagate to neighbours
++ final byte neighbourLevel = (byte)(level - 1);
++ final int x = (int)coordinate;
++ final int z = (int)(coordinate >>> 32);
++
++ for (int dx = -1; dx <= 1; ++dx) {
++ for (int dz = -1; dz <= 1; ++dz) {
++ if ((dx | dz) == 0) {
++ // already propagated to coordinate
++ continue;
++ }
++
++ // sure we can check the neighbour level in the map right now and avoid a propagation,
++ // but then we would still have to recheck it when popping the value off of the queue!
++ // so just avoid the double lookup
++ final long neighbourCoordinate = CoordinateUtils.getChunkKey(x + dx, z + dz);
++ this.addToIncreaseWorkQueue(neighbourCoordinate, neighbourLevel);
+ }
-+ current.updateAddCache(object, contending);
-+ return contending;
++ }
++ }
++ }
++ }
++
++ protected void propagateDecreases() {
++ for (int queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelRemoveWorkQueueBitset);
++ this.levelRemoveWorkQueueBitset != 0L;
++ this.levelRemoveWorkQueueBitset ^= (1L << queueIndex), queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelRemoveWorkQueueBitset)) {
++
++ final WorkQueue queue = this.levelRemoveWorkQueues[queueIndex];
++ while (!queue.queuedLevels.isEmpty()) {
++ final long coordinate = queue.queuedCoordinates.removeFirstLong();
++ final byte level = queue.queuedLevels.removeFirstByte();
++
++ final byte currentLevel = this.levels.removeIfGreaterOrEqual(coordinate, level);
++ if (currentLevel == 0) {
++ // something else removed
++ continue;
++ }
++
++ if (currentLevel > level) {
++ // something higher propagated here or we hit the propagation of another source
++ // in the second case we need to re-propagate because we could have just clobbered another source's
++ // propagation
++ this.addToIncreaseWorkQueue(coordinate, currentLevel, (byte)-currentLevel); // indicate to the increase code that the level's neighbours need checking
++ continue;
++ }
++
++ if (this.changeCallback != null) {
++ this.changeCallback.onLevelUpdate(coordinate, currentLevel, (byte)0);
++ }
++
++ final byte source = this.sources.get(coordinate);
++ if (source != 0) {
++ // must re-propagate source later
++ this.addToIncreaseWorkQueue(coordinate, source);
++ }
++
++ if (level == 0) {
++ // can't propagate -1 to neighbours
++ // we have to check neighbours for removing 1 just in case the neighbour is 2
++ continue;
+ }
+
-+ cached.referenceCount = 1;
-+ } else if (cached.referenceCount != -1) {
-+ ++cached.referenceCount;
++ // propagate to neighbours
++ final byte neighbourLevel = (byte)(level - 1);
++ final int x = (int)coordinate;
++ final int z = (int)(coordinate >>> 32);
++
++ for (int dx = -1; dx <= 1; ++dx) {
++ for (int dz = -1; dz <= 1; ++dz) {
++ if ((dx | dz) == 0) {
++ // already propagated to coordinate
++ continue;
++ }
++
++ // sure we can check the neighbour level in the map right now and avoid a propagation,
++ // but then we would still have to recheck it when popping the value off of the queue!
++ // so just avoid the double lookup
++ final long neighbourCoordinate = CoordinateUtils.getChunkKey(x + dx, z + dz);
++ this.addToRemoveWorkQueue(neighbourCoordinate, neighbourLevel);
++ }
++ }
+ }
++ }
+
-+ return cached;
++ // propagate sources we clobbered in the process
++ this.propagateIncreases();
++ }
++
++ protected static final class LevelMap extends Long2ByteOpenHashMap {
++ public LevelMap() {
++ super();
+ }
+
-+ if (!current.add(object)) {
-+ return current;
++ public LevelMap(final int expected, final float loadFactor) {
++ super(expected, loadFactor);
+ }
+
-+ // we use get/put since we use a different key on put
-+ PooledObjectLinkedOpenHashSet<E> ret = this.mapPool.get(current);
++ // copied from superclass
++ private int find(final long k) {
++ if (k == 0L) {
++ return this.containsNullKey ? this.n : -(this.n + 1);
++ } else {
++ final long[] key = this.key;
++ long curr;
++ int pos;
++ if ((curr = key[pos = (int)HashCommon.mix(k) & this.mask]) == 0L) {
++ return -(pos + 1);
++ } else if (k == curr) {
++ return pos;
++ } else {
++ while((curr = key[pos = pos + 1 & this.mask]) != 0L) {
++ if (k == curr) {
++ return pos;
++ }
++ }
+
-+ if (ret == null) {
-+ ret = new PooledObjectLinkedOpenHashSet<>(current);
-+ current.remove(object);
-+ this.mapPool.put(ret, ret);
-+ ret.referenceCount = 1;
-+ } else {
-+ if (ret.referenceCount != -1) {
-+ ++ret.referenceCount;
++ return -(pos + 1);
++ }
+ }
-+ current.remove(object);
+ }
+
-+ current.updateAddCache(object, ret);
++ // copied from superclass
++ private void insert(final int pos, final long k, final byte v) {
++ if (pos == this.n) {
++ this.containsNullKey = true;
++ }
+
-+ decrementReferenceCount(current);
-+ return ret;
-+ }
++ this.key[pos] = k;
++ this.value[pos] = v;
++ if (this.size++ >= this.maxFill) {
++ this.rehash(HashCommon.arraySize(this.size + 1, this.f));
++ }
++ }
+
-+ // rets null if current.size() == 1
-+ public PooledObjectLinkedOpenHashSet<E> findMapWithout(final PooledObjectLinkedOpenHashSet<E> current, final E object) {
-+ if (current.set.size() == 1) {
-+ decrementReferenceCount(current);
-+ return null;
++ // copied from superclass
++ public byte putIfGreater(final long key, final byte value) {
++ final int pos = this.find(key);
++ if (pos < 0) {
++ if (this.defRetValue < value) {
++ this.insert(-pos - 1, key, value);
++ }
++ return this.defRetValue;
++ } else {
++ final byte curr = this.value[pos];
++ if (value > curr) {
++ this.value[pos] = value;
++ return curr;
++ }
++ return curr;
++ }
+ }
+
-+ final PooledObjectLinkedOpenHashSet<E> cached = current.getRemoveCache(object);
++ // copied from superclass
++ private void removeEntry(final int pos) {
++ --this.size;
++ this.shiftKeys(pos);
++ if (this.n > this.minN && this.size < this.maxFill / 4 && this.n > 16) {
++ this.rehash(this.n / 2);
++ }
++ }
+
-+ if (cached != null) {
-+ decrementReferenceCount(current);
++ // copied from superclass
++ private void removeNullEntry() {
++ this.containsNullKey = false;
++ --this.size;
++ if (this.n > this.minN && this.size < this.maxFill / 4 && this.n > 16) {
++ this.rehash(this.n / 2);
++ }
++ }
+
-+ if (cached.referenceCount == 0) {
-+ // bring the map back from the dead
-+ PooledObjectLinkedOpenHashSet<E> contending = this.mapPool.putIfAbsent(cached, cached);
-+ if (contending != null) {
-+ // a map already exists with the elements we want
-+ if (contending.referenceCount != -1) {
-+ ++contending.referenceCount;
-+ }
-+ current.updateRemoveCache(object, contending);
-+ return contending;
++ // copied from superclass
++ public byte removeIfGreaterOrEqual(final long key, final byte value) {
++ if (key == 0L) {
++ if (!this.containsNullKey) {
++ return this.defRetValue;
+ }
++ final byte current = this.value[this.n];
++ if (value >= current) {
++ this.removeNullEntry();
++ return current;
++ }
++ return current;
++ } else {
++ long[] keys = this.key;
++ byte[] values = this.value;
++ long curr;
++ int pos;
++ if ((curr = keys[pos = (int)HashCommon.mix(key) & this.mask]) == 0L) {
++ return this.defRetValue;
++ } else if (key == curr) {
++ final byte current = values[pos];
++ if (value >= current) {
++ this.removeEntry(pos);
++ return current;
++ }
++ return current;
++ } else {
++ while((curr = keys[pos = pos + 1 & this.mask]) != 0L) {
++ if (key == curr) {
++ final byte current = values[pos];
++ if (value >= current) {
++ this.removeEntry(pos);
++ return current;
++ }
++ return current;
++ }
++ }
+
-+ cached.referenceCount = 1;
-+ } else if (cached.referenceCount != -1) {
-+ ++cached.referenceCount;
++ return this.defRetValue;
++ }
+ }
-+
-+ return cached;
+ }
++ }
+
-+ if (!current.remove(object)) {
-+ return current;
++ protected static final class WorkQueue {
++
++ public final NoResizeLongArrayFIFODeque queuedCoordinates = new NoResizeLongArrayFIFODeque();
++ public final NoResizeByteArrayFIFODeque queuedLevels = new NoResizeByteArrayFIFODeque();
++
++ }
++
++ protected static final class NoResizeLongArrayFIFODeque extends LongArrayFIFOQueue {
++
++ /**
++ * Assumes non-empty. If empty, undefined behaviour.
++ */
++ public long removeFirstLong() {
++ // copied from superclass
++ long t = this.array[this.start];
++ if (++this.start == this.length) {
++ this.start = 0;
++ }
++
++ return t;
+ }
++ }
+
-+ // we use get/put since we use a different key on put
-+ PooledObjectLinkedOpenHashSet<E> ret = this.mapPool.get(current);
++ protected static final class NoResizeByteArrayFIFODeque extends ByteArrayFIFOQueue {
+
-+ if (ret == null) {
-+ ret = new PooledObjectLinkedOpenHashSet<>(current);
-+ current.add(object);
-+ this.mapPool.put(ret, ret);
-+ ret.referenceCount = 1;
-+ } else {
-+ if (ret.referenceCount != -1) {
-+ ++ret.referenceCount;
++ /**
++ * Assumes non-empty. If empty, undefined behaviour.
++ */
++ public byte removeFirstByte() {
++ // copied from superclass
++ byte t = this.array[this.start];
++ if (++this.start == this.length) {
++ this.start = 0;
+ }
-+ current.add(object);
++
++ return t;
+ }
++ }
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..ab093b0e8ac6f762921eb1d15f5217345c4eba05
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
+@@ -0,0 +1,211 @@
++package ca.spottedleaf.moonrise.common.misc;
++
++import ca.spottedleaf.moonrise.common.list.ReferenceList;
++import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
++import ca.spottedleaf.moonrise.common.util.MoonriseConstants;
++import ca.spottedleaf.moonrise.common.util.ChunkSystem;
++import ca.spottedleaf.moonrise.patches.chunk_tick_iteration.ChunkTickConstants;
++import it.unimi.dsi.fastutil.longs.Long2ReferenceOpenHashMap;
++import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
++import net.minecraft.core.BlockPos;
++import net.minecraft.server.level.ServerLevel;
++import net.minecraft.server.level.ServerPlayer;
++import net.minecraft.world.level.ChunkPos;
+
-+ current.updateRemoveCache(object, ret);
++public final class NearbyPlayers {
+
-+ decrementReferenceCount(current);
-+ return ret;
++ public static enum NearbyMapType {
++ GENERAL,
++ GENERAL_SMALL,
++ GENERAL_REALLY_SMALL,
++ TICK_VIEW_DISTANCE,
++ VIEW_DISTANCE,
++ SPAWN_RANGE, // Moonrise - chunk tick iteration
+ }
+
-+ static final class RawSetObjectLinkedOpenHashSet<E> extends ObjectOpenHashSet<E> {
++ private static final NearbyMapType[] MAP_TYPES = NearbyMapType.values();
++ public static final int TOTAL_MAP_TYPES = MAP_TYPES.length;
+
-+ public RawSetObjectLinkedOpenHashSet() {
-+ super();
++ private static final int GENERAL_AREA_VIEW_DISTANCE = MoonriseConstants.MAX_VIEW_DISTANCE + 1;
++ private static final int GENERAL_SMALL_VIEW_DISTANCE = 10;
++ private static final int GENERAL_REALLY_SMALL_VIEW_DISTANCE = 3;
++
++ public static final int GENERAL_AREA_VIEW_DISTANCE_BLOCKS = (GENERAL_AREA_VIEW_DISTANCE << 4);
++ public static final int GENERAL_SMALL_AREA_VIEW_DISTANCE_BLOCKS = (GENERAL_SMALL_VIEW_DISTANCE << 4);
++ public static final int GENERAL_REALLY_SMALL_AREA_VIEW_DISTANCE_BLOCKS = (GENERAL_REALLY_SMALL_VIEW_DISTANCE << 4);
++
++ private final ServerLevel world;
++ private final Reference2ReferenceOpenHashMap<ServerPlayer, TrackedPlayer[]> players = new Reference2ReferenceOpenHashMap<>();
++ private final Long2ReferenceOpenHashMap<TrackedChunk> byChunk = new Long2ReferenceOpenHashMap<>();
++
++ public NearbyPlayers(final ServerLevel world) {
++ this.world = world;
++ }
++
++ public void addPlayer(final ServerPlayer player) {
++ final TrackedPlayer[] newTrackers = new TrackedPlayer[TOTAL_MAP_TYPES];
++ if (this.players.putIfAbsent(player, newTrackers) != null) {
++ throw new IllegalStateException("Already have player " + player);
+ }
+
-+ public RawSetObjectLinkedOpenHashSet(final int capacity) {
-+ super(capacity);
++ final ChunkPos chunk = player.chunkPosition();
++
++ for (int i = 0; i < TOTAL_MAP_TYPES; ++i) {
++ // use 0 for default, will be updated by tickPlayer
++ (newTrackers[i] = new TrackedPlayer(player, MAP_TYPES[i])).add(chunk.x, chunk.z, 0);
+ }
+
-+ public RawSetObjectLinkedOpenHashSet(final int capacity, final float loadFactor) {
-+ super(capacity, loadFactor);
++ // update view distances
++ this.tickPlayer(player);
++ }
++
++ public void removePlayer(final ServerPlayer player) {
++ final TrackedPlayer[] players = this.players.remove(player);
++ if (players == null) {
++ return; // May be called during teleportation before the player is actually placed
+ }
+
-+ @Override
-+ public RawSetObjectLinkedOpenHashSet<E> clone() {
-+ return (RawSetObjectLinkedOpenHashSet<E>)super.clone();
++ for (final TrackedPlayer tracker : players) {
++ tracker.remove();
+ }
++ }
+
-+ public E[] getRawSet() {
-+ return this.key;
++ public void tickPlayer(final ServerPlayer player) {
++ final TrackedPlayer[] players = this.players.get(player);
++ if (players == null) {
++ throw new IllegalStateException("Don't have player " + player);
+ }
++
++ final ChunkPos chunk = player.chunkPosition();
++
++ players[NearbyMapType.GENERAL.ordinal()].update(chunk.x, chunk.z, GENERAL_AREA_VIEW_DISTANCE);
++ players[NearbyMapType.GENERAL_SMALL.ordinal()].update(chunk.x, chunk.z, GENERAL_SMALL_VIEW_DISTANCE);
++ players[NearbyMapType.GENERAL_REALLY_SMALL.ordinal()].update(chunk.x, chunk.z, GENERAL_REALLY_SMALL_VIEW_DISTANCE);
++ players[NearbyMapType.TICK_VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, ChunkSystem.getTickViewDistance(player));
++ players[NearbyMapType.VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, ChunkSystem.getLoadViewDistance(player));
++ players[NearbyMapType.SPAWN_RANGE.ordinal()].update(chunk.x, chunk.z, ChunkTickConstants.PLAYER_SPAWN_TRACK_RANGE); // Moonrise - chunk tick iteration
+ }
+
-+ public static final class PooledObjectLinkedOpenHashSet<E> {
++ public TrackedChunk getChunk(final ChunkPos pos) {
++ return this.byChunk.get(CoordinateUtils.getChunkKey(pos));
++ }
+
-+ private static final WeakReference NULL_REFERENCE = new WeakReference<>(null);
++ public TrackedChunk getChunk(final BlockPos pos) {
++ return this.byChunk.get(CoordinateUtils.getChunkKey(pos));
++ }
+
-+ final RawSetObjectLinkedOpenHashSet<E> set;
-+ int referenceCount; // -1 if special
-+ int hash; // optimize hashcode
++ public ReferenceList<ServerPlayer> getPlayers(final BlockPos pos, final NearbyMapType type) {
++ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(pos));
+
-+ // add cache
-+ WeakReference<E> lastAddObject = NULL_REFERENCE;
-+ WeakReference<PooledObjectLinkedOpenHashSet<E>> lastAddMap = NULL_REFERENCE;
++ return chunk == null ? null : chunk.players[type.ordinal()];
++ }
+
-+ // remove cache
-+ WeakReference<E> lastRemoveObject = NULL_REFERENCE;
-+ WeakReference<PooledObjectLinkedOpenHashSet<E>> lastRemoveMap = NULL_REFERENCE;
++ public ReferenceList<ServerPlayer> getPlayers(final ChunkPos pos, final NearbyMapType type) {
++ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(pos));
+
-+ public PooledObjectLinkedOpenHashSet(final PooledLinkedHashSets<E> pooledSets) {
-+ this.set = new RawSetObjectLinkedOpenHashSet<>(2, 0.8f);
-+ }
++ return chunk == null ? null : chunk.players[type.ordinal()];
++ }
+
-+ public PooledObjectLinkedOpenHashSet(final E single) {
-+ this((PooledLinkedHashSets<E>)null);
-+ this.referenceCount = -1;
-+ this.add(single);
++ public ReferenceList<ServerPlayer> getPlayersByChunk(final int chunkX, final int chunkZ, final NearbyMapType type) {
++ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
++
++ return chunk == null ? null : chunk.players[type.ordinal()];
++ }
++
++ public ReferenceList<ServerPlayer> getPlayersByBlock(final int blockX, final int blockZ, final NearbyMapType type) {
++ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(blockX >> 4, blockZ >> 4));
++
++ return chunk == null ? null : chunk.players[type.ordinal()];
++ }
++
++ public static final class TrackedChunk {
++
++ private static final ServerPlayer[] EMPTY_PLAYERS_ARRAY = new ServerPlayer[0];
++
++ private final ReferenceList<ServerPlayer>[] players = new ReferenceList[TOTAL_MAP_TYPES];
++ private int nonEmptyLists;
++ private long updateCount;
++
++ public boolean isEmpty() {
++ return this.nonEmptyLists == 0;
+ }
+
-+ public PooledObjectLinkedOpenHashSet(final PooledObjectLinkedOpenHashSet<E> other) {
-+ this.set = other.set.clone();
-+ this.hash = other.hash;
++ public long getUpdateCount() {
++ return this.updateCount;
+ }
+
-+ // from https://github.com/Spottedleaf/ConcurrentUtil/blob/master/src/main/java/ca/spottedleaf/concurrentutil/util/IntegerUtil.java
-+ // generated by https://github.com/skeeto/hash-prospector
-+ private static int hash0(int x) {
-+ x *= 0x36935555;
-+ x ^= x >>> 16;
-+ return x;
++ public ReferenceList<ServerPlayer> getPlayers(final NearbyMapType type) {
++ return this.players[type.ordinal()];
+ }
+
-+ PooledObjectLinkedOpenHashSet<E> getAddCache(final E element) {
-+ final E currentAdd = this.lastAddObject.get();
++ public void addPlayer(final ServerPlayer player, final NearbyMapType type) {
++ ++this.updateCount;
+
-+ if (currentAdd == null || !(currentAdd == element || currentAdd.equals(element))) {
-+ return null;
++ final int idx = type.ordinal();
++ final ReferenceList<ServerPlayer> list = this.players[idx];
++ if (list == null) {
++ ++this.nonEmptyLists;
++ (this.players[idx] = new ReferenceList<>(EMPTY_PLAYERS_ARRAY)).add(player);
++ return;
+ }
+
-+ return this.lastAddMap.get();
++ if (!list.add(player)) {
++ throw new IllegalStateException("Already contains player " + player);
++ }
+ }
+
-+ PooledObjectLinkedOpenHashSet<E> getRemoveCache(final E element) {
-+ final E currentRemove = this.lastRemoveObject.get();
++ public void removePlayer(final ServerPlayer player, final NearbyMapType type) {
++ ++this.updateCount;
+
-+ if (currentRemove == null || !(currentRemove == element || currentRemove.equals(element))) {
-+ return null;
++ final int idx = type.ordinal();
++ final ReferenceList<ServerPlayer> list = this.players[idx];
++ if (list == null) {
++ throw new IllegalStateException("Does not contain player " + player);
+ }
+
-+ return this.lastRemoveMap.get();
++ if (!list.remove(player)) {
++ throw new IllegalStateException("Does not contain player " + player);
++ }
++
++ if (list.size() == 0) {
++ this.players[idx] = null;
++ --this.nonEmptyLists;
++ }
+ }
++ }
+
-+ void updateAddCache(final E element, final PooledObjectLinkedOpenHashSet<E> map) {
-+ this.lastAddObject = new WeakReference<>(element);
-+ this.lastAddMap = new WeakReference<>(map);
++ private final class TrackedPlayer extends SingleUserAreaMap<ServerPlayer> {
++
++ private final NearbyMapType type;
++
++ public TrackedPlayer(final ServerPlayer player, final NearbyMapType type) {
++ super(player);
++ this.type = type;
+ }
+
-+ void updateRemoveCache(final E element, final PooledObjectLinkedOpenHashSet<E> map) {
-+ this.lastRemoveObject = new WeakReference<>(element);
-+ this.lastRemoveMap = new WeakReference<>(map);
++ @Override
++ protected void addCallback(final ServerPlayer parameter, final int chunkX, final int chunkZ) {
++ final long chunkKey = CoordinateUtils.getChunkKey(chunkX, chunkZ);
++
++ NearbyPlayers.this.byChunk.computeIfAbsent(chunkKey, (final long keyInMap) -> {
++ return new TrackedChunk();
++ }).addPlayer(parameter, this.type);
+ }
+
-+ boolean add(final E element) {
-+ boolean added = this.set.add(element);
++ @Override
++ protected void removeCallback(final ServerPlayer parameter, final int chunkX, final int chunkZ) {
++ final long chunkKey = CoordinateUtils.getChunkKey(chunkX, chunkZ);
+
-+ if (added) {
-+ this.hash += hash0(element.hashCode());
++ final TrackedChunk chunk = NearbyPlayers.this.byChunk.get(chunkKey);
++ if (chunk == null) {
++ throw new IllegalStateException("Chunk should exist at " + new ChunkPos(chunkKey));
+ }
+
-+ return added;
++ chunk.removePlayer(parameter, this.type);
++
++ if (chunk.isEmpty()) {
++ NearbyPlayers.this.byChunk.remove(chunkKey);
++ }
+ }
++ }
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/PositionCountingAreaMap.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/PositionCountingAreaMap.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..efefd94b652228d877db5dbca8b28354ad42529f
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/PositionCountingAreaMap.java
+@@ -0,0 +1,94 @@
++package ca.spottedleaf.moonrise.common.misc;
+
-+ boolean remove(Object element) {
-+ boolean removed = this.set.remove(element);
++import ca.spottedleaf.concurrentutil.util.IntPairUtil;
++import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
++import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
++import it.unimi.dsi.fastutil.objects.ReferenceSet;
+
-+ if (removed) {
-+ this.hash -= hash0(element.hashCode());
-+ }
++public final class PositionCountingAreaMap<T> {
++
++ private final Reference2ReferenceOpenHashMap<T, PositionCounter> counters = new Reference2ReferenceOpenHashMap<>();
++ private final Long2IntOpenHashMap positions = new Long2IntOpenHashMap();
++
++ public ReferenceSet<T> getObjects() {
++ return this.counters.keySet();
++ }
++
++ public int getTotalPositions() {
++ return this.positions.size();
++ }
++
++ public boolean hasObjectsNear(final int toX, final int toZ) {
++ return this.positions.containsKey(IntPairUtil.key(toX, toZ));
++ }
+
-+ return removed;
++ public int getObjectsNear(final int toX, final int toZ) {
++ return this.positions.get(IntPairUtil.key(toX, toZ));
++ }
++
++ public boolean add(final T parameter, final int toX, final int toZ, final int distance) {
++ final PositionCounter existing = this.counters.get(parameter);
++ if (existing != null) {
++ return false;
+ }
+
-+ public boolean contains(final Object element) {
-+ return this.set.contains(element);
++ final PositionCounter counter = new PositionCounter(parameter);
++
++ this.counters.put(parameter, counter);
++
++ return counter.add(toX, toZ, distance);
++ }
++
++ public boolean addOrUpdate(final T parameter, final int toX, final int toZ, final int distance) {
++ final PositionCounter existing = this.counters.get(parameter);
++ if (existing != null) {
++ return existing.update(toX, toZ, distance);
+ }
+
-+ public E[] getBackingSet() {
-+ return this.set.getRawSet();
++ final PositionCounter counter = new PositionCounter(parameter);
++
++ this.counters.put(parameter, counter);
++
++ return counter.add(toX, toZ, distance);
++ }
++
++ public boolean remove(final T parameter) {
++ final PositionCounter counter = this.counters.remove(parameter);
++ if (counter == null) {
++ return false;
+ }
+
-+ public int size() {
-+ return this.set.size();
++ counter.remove();
++
++ return true;
++ }
++
++ public boolean update(final T parameter, final int toX, final int toZ, final int distance) {
++ final PositionCounter counter = this.counters.get(parameter);
++ if (counter == null) {
++ return false;
+ }
+
-+ @Override
-+ public int hashCode() {
-+ return this.hash;
++ return counter.update(toX, toZ, distance);
++ }
++
++ private final class PositionCounter extends SingleUserAreaMap<T> {
++
++ public PositionCounter(final T parameter) {
++ super(parameter);
+ }
+
+ @Override
-+ public boolean equals(final Object other) {
-+ if (!(other instanceof PooledObjectLinkedOpenHashSet)) {
-+ return false;
-+ }
-+ if (this.referenceCount == 0) {
-+ return other == this;
-+ } else {
-+ if (other == this) {
-+ // Unfortunately we are never equal to our own instance while in use!
-+ return false;
-+ }
-+ return this.hash == ((PooledObjectLinkedOpenHashSet)other).hash && this.set.equals(((PooledObjectLinkedOpenHashSet)other).set);
-+ }
++ protected void addCallback(final T parameter, final int toX, final int toZ) {
++ PositionCountingAreaMap.this.positions.addTo(IntPairUtil.key(toX, toZ), 1);
+ }
+
+ @Override
-+ public String toString() {
-+ return "PooledHashSet: size: " + this.set.size() + ", reference count: " + this.referenceCount + ", hash: " +
-+ this.hashCode() + ", identity: " + System.identityHashCode(this) + " map: " + this.set.toString();
++ protected void removeCallback(final T parameter, final int toX, final int toZ) {
++ final long key = IntPairUtil.key(toX, toZ);
++ if (PositionCountingAreaMap.this.positions.addTo(key, -1) == 1) {
++ PositionCountingAreaMap.this.positions.remove(key);
++ }
+ }
+ }
+}
-diff --git a/src/main/java/com/destroystokyo/paper/util/pooled/PooledObjects.java b/src/main/java/com/destroystokyo/paper/util/pooled/PooledObjects.java
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/SingleUserAreaMap.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/SingleUserAreaMap.java
new file mode 100644
-index 0000000000000000000000000000000000000000..a743703502cea333bd4231b6557de50e8eaf81eb
+index 0000000000000000000000000000000000000000..94689e0342cf95dbedec955d67c95fa07a219678
--- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/pooled/PooledObjects.java
-@@ -0,0 +1,85 @@
-+package com.destroystokyo.paper.util.pooled;
++++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/SingleUserAreaMap.java
+@@ -0,0 +1,248 @@
++package ca.spottedleaf.moonrise.common.misc;
+
-+import io.papermc.paper.util.MCUtil;
-+import org.apache.commons.lang3.mutable.MutableInt;
++import ca.spottedleaf.concurrentutil.util.IntegerUtil;
+
-+import java.util.ArrayDeque;
-+import java.util.function.Consumer;
-+import java.util.function.Supplier;
++public abstract class SingleUserAreaMap<T> {
+
-+public final class PooledObjects<E> {
++ public static final int NOT_SET = Integer.MIN_VALUE;
+
-+ /**
-+ * Wrapper for an object that will be have a cleaner registered for it, and may be automatically returned to pool.
-+ */
-+ public class AutoReleased {
-+ private final E object;
-+ private final Runnable cleaner;
++ private final T parameter;
++ private int lastChunkX = NOT_SET;
++ private int lastChunkZ = NOT_SET;
++ private int distance = NOT_SET;
+
-+ public AutoReleased(E object, Runnable cleaner) {
-+ this.object = object;
-+ this.cleaner = cleaner;
-+ }
++ public SingleUserAreaMap(final T parameter) {
++ this.parameter = parameter;
++ }
++
++ public final T getParameter() {
++ return this.parameter;
++ }
++
++ public final int getLastChunkX() {
++ return this.lastChunkX;
++ }
++
++ public final int getLastChunkZ() {
++ return this.lastChunkZ;
++ }
+
-+ public final E getObject() {
-+ return object;
++ public final int getLastDistance() {
++ return this.distance;
++ }
++
++ /* math sign function except 0 returns 1 */
++ protected static int sign(int val) {
++ return 1 | (val >> (Integer.SIZE - 1));
++ }
++
++ protected abstract void addCallback(final T parameter, final int chunkX, final int chunkZ);
++
++ protected abstract void removeCallback(final T parameter, final int chunkX, final int chunkZ);
++
++ private void addToNew(final T parameter, final int chunkX, final int chunkZ, final int distance) {
++ final int maxX = chunkX + distance;
++ final int maxZ = chunkZ + distance;
++
++ for (int cx = chunkX - distance; cx <= maxX; ++cx) {
++ for (int cz = chunkZ - distance; cz <= maxZ; ++cz) {
++ this.addCallback(parameter, cx, cz);
++ }
+ }
++ }
++
++ private void removeFromOld(final T parameter, final int chunkX, final int chunkZ, final int distance) {
++ final int maxX = chunkX + distance;
++ final int maxZ = chunkZ + distance;
+
-+ public final Runnable getCleaner() {
-+ return cleaner;
++ for (int cx = chunkX - distance; cx <= maxX; ++cx) {
++ for (int cz = chunkZ - distance; cz <= maxZ; ++cz) {
++ this.removeCallback(parameter, cx, cz);
++ }
+ }
+ }
+
-+ public static final PooledObjects<MutableInt> POOLED_MUTABLE_INTEGERS = new PooledObjects<>(MutableInt::new, 1024);
++ public final boolean add(final int chunkX, final int chunkZ, final int distance) {
++ if (distance < 0) {
++ throw new IllegalArgumentException(Integer.toString(distance));
++ }
++ if (this.lastChunkX != NOT_SET) {
++ return false;
++ }
++ this.lastChunkX = chunkX;
++ this.lastChunkZ = chunkZ;
++ this.distance = distance;
+
-+ private final Supplier<E> creator;
-+ private final Consumer<E> releaser;
-+ private final int maxPoolSize;
-+ private final ArrayDeque<E> queue;
++ this.addToNew(this.parameter, chunkX, chunkZ, distance);
+
-+ public PooledObjects(final Supplier<E> creator, int maxPoolSize) {
-+ this(creator, maxPoolSize, null);
++ return true;
+ }
-+ public PooledObjects(final Supplier<E> creator, int maxPoolSize, Consumer<E> releaser) {
-+ if (creator == null) {
-+ throw new NullPointerException("Creator must not be null");
++
++ public final boolean update(final int toX, final int toZ, final int newViewDistance) {
++ if (newViewDistance < 0) {
++ throw new IllegalArgumentException(Integer.toString(newViewDistance));
+ }
-+ if (maxPoolSize <= 0) {
-+ throw new IllegalArgumentException("Max pool size must be greater-than 0");
++ final int fromX = this.lastChunkX;
++ final int fromZ = this.lastChunkZ;
++ final int oldViewDistance = this.distance;
++ if (fromX == NOT_SET) {
++ return false;
+ }
+
-+ this.queue = new ArrayDeque<>(maxPoolSize);
-+ this.maxPoolSize = maxPoolSize;
-+ this.creator = creator;
-+ this.releaser = releaser;
-+ }
++ this.lastChunkX = toX;
++ this.lastChunkZ = toZ;
++ this.distance = newViewDistance;
+
-+ public AutoReleased acquireCleaner(Object holder) {
-+ return acquireCleaner(holder, this::release);
-+ }
++ final T parameter = this.parameter;
+
-+ public AutoReleased acquireCleaner(Object holder, Consumer<E> releaser) {
-+ E resource = acquire();
-+ Runnable cleaner = MCUtil.registerCleaner(holder, resource, releaser);
-+ return new AutoReleased(resource, cleaner);
-+ }
+
-+ public final E acquire() {
-+ E value;
-+ synchronized (queue) {
-+ value = this.queue.pollLast();
++ final int dx = toX - fromX;
++ final int dz = toZ - fromZ;
++
++ final int totalX = IntegerUtil.branchlessAbs(fromX - toX);
++ final int totalZ = IntegerUtil.branchlessAbs(fromZ - toZ);
++
++ if (Math.max(totalX, totalZ) > (2 * Math.max(newViewDistance, oldViewDistance))) {
++ // teleported
++ this.removeFromOld(parameter, fromX, fromZ, oldViewDistance);
++ this.addToNew(parameter, toX, toZ, newViewDistance);
++ return true;
+ }
-+ return value != null ? value : this.creator.get();
-+ }
+
-+ public final void release(final E value) {
-+ if (this.releaser != null) {
-+ this.releaser.accept(value);
++ if (oldViewDistance != newViewDistance) {
++ // remove loop
++
++ final int oldMinX = fromX - oldViewDistance;
++ final int oldMinZ = fromZ - oldViewDistance;
++ final int oldMaxX = fromX + oldViewDistance;
++ final int oldMaxZ = fromZ + oldViewDistance;
++ for (int currX = oldMinX; currX <= oldMaxX; ++currX) {
++ for (int currZ = oldMinZ; currZ <= oldMaxZ; ++currZ) {
++
++ // only remove if we're outside the new view distance...
++ if (Math.max(IntegerUtil.branchlessAbs(currX - toX), IntegerUtil.branchlessAbs(currZ - toZ)) > newViewDistance) {
++ this.removeCallback(parameter, currX, currZ);
++ }
++ }
++ }
++
++ // add loop
++
++ final int newMinX = toX - newViewDistance;
++ final int newMinZ = toZ - newViewDistance;
++ final int newMaxX = toX + newViewDistance;
++ final int newMaxZ = toZ + newViewDistance;
++ for (int currX = newMinX; currX <= newMaxX; ++currX) {
++ for (int currZ = newMinZ; currZ <= newMaxZ; ++currZ) {
++
++ // only add if we're outside the old view distance...
++ if (Math.max(IntegerUtil.branchlessAbs(currX - fromX), IntegerUtil.branchlessAbs(currZ - fromZ)) > oldViewDistance) {
++ this.addCallback(parameter, currX, currZ);
++ }
++ }
++ }
++
++ return true;
+ }
-+ synchronized (this.queue) {
-+ if (queue.size() < this.maxPoolSize) {
-+ this.queue.addLast(value);
++
++ // x axis is width
++ // z axis is height
++ // right refers to the x axis of where we moved
++ // top refers to the z axis of where we moved
++
++ // same view distance
++
++ // used for relative positioning
++ final int up = sign(dz); // 1 if dz >= 0, -1 otherwise
++ final int right = sign(dx); // 1 if dx >= 0, -1 otherwise
++
++ // The area excluded by overlapping the two view distance squares creates four rectangles:
++ // Two on the left, and two on the right. The ones on the left we consider the "removed" section
++ // and on the right the "added" section.
++ // https://i.imgur.com/MrnOBgI.png is a reference image. Note that the outside border is not actually
++ // exclusive to the regions they surround.
++
++ // 4 points of the rectangle
++ int maxX; // exclusive
++ int minX; // inclusive
++ int maxZ; // exclusive
++ int minZ; // inclusive
++
++ if (dx != 0) {
++ // handle right addition
++
++ maxX = toX + (oldViewDistance * right) + right; // exclusive
++ minX = fromX + (oldViewDistance * right) + right; // inclusive
++ maxZ = fromZ + (oldViewDistance * up) + up; // exclusive
++ minZ = toZ - (oldViewDistance * up); // inclusive
++
++ for (int currX = minX; currX != maxX; currX += right) {
++ for (int currZ = minZ; currZ != maxZ; currZ += up) {
++ this.addCallback(parameter, currX, currZ);
++ }
+ }
+ }
++
++ if (dz != 0) {
++ // handle up addition
++
++ maxX = toX + (oldViewDistance * right) + right; // exclusive
++ minX = toX - (oldViewDistance * right); // inclusive
++ maxZ = toZ + (oldViewDistance * up) + up; // exclusive
++ minZ = fromZ + (oldViewDistance * up) + up; // inclusive
++
++ for (int currX = minX; currX != maxX; currX += right) {
++ for (int currZ = minZ; currZ != maxZ; currZ += up) {
++ this.addCallback(parameter, currX, currZ);
++ }
++ }
++ }
++
++ if (dx != 0) {
++ // handle left removal
++
++ maxX = toX - (oldViewDistance * right); // exclusive
++ minX = fromX - (oldViewDistance * right); // inclusive
++ maxZ = fromZ + (oldViewDistance * up) + up; // exclusive
++ minZ = toZ - (oldViewDistance * up); // inclusive
++
++ for (int currX = minX; currX != maxX; currX += right) {
++ for (int currZ = minZ; currZ != maxZ; currZ += up) {
++ this.removeCallback(parameter, currX, currZ);
++ }
++ }
++ }
++
++ if (dz != 0) {
++ // handle down removal
++
++ maxX = fromX + (oldViewDistance * right) + right; // exclusive
++ minX = fromX - (oldViewDistance * right); // inclusive
++ maxZ = toZ - (oldViewDistance * up); // exclusive
++ minZ = fromZ - (oldViewDistance * up); // inclusive
++
++ for (int currX = minX; currX != maxX; currX += right) {
++ for (int currZ = minZ; currZ != maxZ; currZ += up) {
++ this.removeCallback(parameter, currX, currZ);
++ }
++ }
++ }
++
++ return true;
++ }
++
++ public final boolean remove() {
++ final int chunkX = this.lastChunkX;
++ final int chunkZ = this.lastChunkZ;
++ final int distance = this.distance;
++ if (chunkX == NOT_SET) {
++ return false;
++ }
++
++ this.lastChunkX = this.lastChunkZ = this.distance = NOT_SET;
++
++ this.removeFromOld(this.parameter, chunkX, chunkZ, distance);
++
++ return true;
+ }
+}
-diff --git a/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/set/OptimizedSmallEnumSet.java b/src/main/java/ca/spottedleaf/moonrise/common/set/OptimizedSmallEnumSet.java
new file mode 100644
-index 0000000000000000000000000000000000000000..8066e27ff88454cb4bc8075d936e58a067dbe9b4
+index 0000000000000000000000000000000000000000..4123edddc556c47f3f8d83523c125fd2e46b30e2
--- /dev/null
-+++ b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java
-@@ -0,0 +1,71 @@
-+package com.destroystokyo.paper.util.set;
++++ b/src/main/java/ca/spottedleaf/moonrise/common/set/OptimizedSmallEnumSet.java
+@@ -0,0 +1,68 @@
++package ca.spottedleaf.moonrise.common.set;
+
+import java.util.Collection;
+
-+/**
-+ * @author Spottedleaf &lt;[email protected]>
-+ */
+public final class OptimizedSmallEnumSet<E extends Enum<E>> {
+
+ private final Class<E> enumClass;
@@ -1665,7 +3009,7 @@ index 0000000000000000000000000000000000000000..8066e27ff88454cb4bc8075d936e58a0
+ this.enumClass = clazz;
+ }
+
-+ public boolean add(final E element) {
++ public boolean addUnchecked(final E element) {
+ final int ordinal = element.ordinal();
+ final long key = 1L << ordinal;
+
@@ -1675,7 +3019,7 @@ index 0000000000000000000000000000000000000000..8066e27ff88454cb4bc8075d936e58a0
+ return (prev & key) == 0;
+ }
+
-+ public boolean remove(final E element) {
++ public boolean removeUnchecked(final E element) {
+ final int ordinal = element.ordinal();
+ final long key = 1L << ordinal;
+
@@ -1693,7 +3037,7 @@ index 0000000000000000000000000000000000000000..8066e27ff88454cb4bc8075d936e58a0
+ return Long.bitCount(this.backingSet);
+ }
+
-+ public void addAll(final Collection<E> enums) {
++ public void addAllUnchecked(final Collection<E> enums) {
+ for (final E element : enums) {
+ if (element == null) {
+ throw new NullPointerException("Null element");
@@ -1710,63 +3054,38 @@ index 0000000000000000000000000000000000000000..8066e27ff88454cb4bc8075d936e58a0
+ return (other.backingSet & this.backingSet) != 0;
+ }
+
-+ public boolean contains(final E element) {
++ public boolean hasElement(final E element) {
+ return (this.backingSet & (1L << element.ordinal())) != 0;
+ }
+}
-diff --git a/src/main/java/com/mojang/logging/LogUtils.java b/src/main/java/com/mojang/logging/LogUtils.java
-index 46cab7a8c7b87ab01b26074b04f5a02b3907cfc4..49019b4a9bc4e634d54a9b0acaf9229a5c896f85 100644
---- a/src/main/java/com/mojang/logging/LogUtils.java
-+++ b/src/main/java/com/mojang/logging/LogUtils.java
-@@ -61,4 +61,9 @@ public class LogUtils {
- public static Logger getLogger() {
- return LoggerFactory.getLogger(STACK_WALKER.getCallerClass());
- }
-+ // Paper start
-+ public static Logger getClassLogger() {
-+ return LoggerFactory.getLogger(STACK_WALKER.getCallerClass().getSimpleName());
-+ }
-+ // Paper end
- }
-diff --git a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java b/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java
new file mode 100644
-index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783075ae17a
+index 0000000000000000000000000000000000000000..da323a1105347d5cf4b946df10ded78a953236f2
--- /dev/null
-+++ b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
-@@ -0,0 +1,297 @@
-+package io.papermc.paper.chunk.system;
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java
+@@ -0,0 +1,284 @@
++package ca.spottedleaf.moonrise.common.util;
+
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
-+import com.destroystokyo.paper.util.SneakyThrow;
+import com.mojang.logging.LogUtils;
-+import io.papermc.paper.util.CoordinateUtils;
+import net.minecraft.server.level.ChunkHolder;
-+import net.minecraft.server.level.ChunkMap;
-+import net.minecraft.server.level.ChunkResult;
+import net.minecraft.server.level.FullChunkStatus;
+import net.minecraft.server.level.ServerLevel;
+import net.minecraft.server.level.ServerPlayer;
-+import net.minecraft.server.level.TicketType;
+import net.minecraft.world.entity.Entity;
-+import net.minecraft.world.level.ChunkPos;
+import net.minecraft.world.level.chunk.ChunkAccess;
-+import net.minecraft.world.level.chunk.status.ChunkPyramid;
-+import net.minecraft.world.level.chunk.status.ChunkStatus;
+import net.minecraft.world.level.chunk.LevelChunk;
-+import net.minecraft.world.level.chunk.status.ChunkStep;
-+import org.bukkit.Bukkit;
++import net.minecraft.world.level.chunk.status.ChunkStatus;
+import org.slf4j.Logger;
-+import java.util.ArrayList;
+import java.util.List;
-+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
+
+public final class ChunkSystem {
+
+ private static final Logger LOGGER = LogUtils.getLogger();
-+ private static final ChunkStep FULL_CHUNK_STEP = ChunkPyramid.GENERATION_PYRAMID.getStepTo(ChunkStatus.FULL);
++ private static final net.minecraft.world.level.chunk.status.ChunkStep FULL_CHUNK_STEP = net.minecraft.world.level.chunk.status.ChunkPyramid.GENERATION_PYRAMID.getStepTo(ChunkStatus.FULL);
+
-+ public static int getDistance(final ChunkStatus status) {
++ private static int getDistance(final ChunkStatus status) {
+ return FULL_CHUNK_STEP.getAccumulatedRadiusOf(status);
+ }
+
@@ -1802,21 +3121,21 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ });
+ }
+
-+ static final TicketType<Long> CHUNK_LOAD = TicketType.create("chunk_load", Long::compareTo);
++ static final net.minecraft.server.level.TicketType<Long> CHUNK_LOAD = net.minecraft.server.level.TicketType.create("chunk_load", Long::compareTo);
+
+ private static long chunkLoadCounter = 0L;
+ public static void scheduleChunkLoad(final ServerLevel level, final int chunkX, final int chunkZ, final ChunkStatus toStatus,
+ final boolean addTicket, final PrioritisedExecutor.Priority priority, final Consumer<ChunkAccess> onComplete) {
-+ if (!Bukkit.isPrimaryThread()) {
++ if (!org.bukkit.Bukkit.isPrimaryThread()) {
+ scheduleChunkTask(level, chunkX, chunkZ, () -> {
+ scheduleChunkLoad(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
+ }, priority);
+ return;
+ }
+
-+ final int minLevel = 33 + ChunkSystem.getDistance(toStatus);
++ final int minLevel = 33 + getDistance(toStatus);
+ final Long chunkReference = addTicket ? Long.valueOf(++chunkLoadCounter) : null;
-+ final ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ);
++ final net.minecraft.world.level.ChunkPos chunkPos = new net.minecraft.world.level.ChunkPos(chunkX, chunkZ);
+
+ if (addTicket) {
+ level.chunkSource.addTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
@@ -1830,10 +3149,10 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ }
+ } catch (final Throwable thr) {
+ LOGGER.error("Exception handling chunk load callback", thr);
-+ SneakyThrow.sneaky(thr);
++ com.destroystokyo.paper.util.SneakyThrow.sneaky(thr);
+ } finally {
+ if (addTicket) {
-+ level.chunkSource.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, minLevel, chunkPos);
++ level.chunkSource.addTicketAtLevel(net.minecraft.server.level.TicketType.UNKNOWN, chunkPos, minLevel, chunkPos);
+ level.chunkSource.removeTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
+ }
+ }
@@ -1846,14 +3165,14 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ return;
+ }
+
-+ final CompletableFuture<ChunkResult<ChunkAccess>> loadFuture = holder.scheduleChunkGenerationTask(toStatus, level.chunkSource.chunkMap);
++ final java.util.concurrent.CompletableFuture<net.minecraft.server.level.ChunkResult<net.minecraft.world.level.chunk.ChunkAccess>> loadFuture = holder.scheduleChunkGenerationTask(toStatus, level.chunkSource.chunkMap);
+
+ if (loadFuture.isDone()) {
+ loadCallback.accept(loadFuture.join().orElse(null));
+ return;
+ }
+
-+ loadFuture.whenCompleteAsync((final ChunkResult<ChunkAccess> result, final Throwable thr) -> {
++ loadFuture.whenCompleteAsync((final net.minecraft.server.level.ChunkResult<net.minecraft.world.level.chunk.ChunkAccess> result, final Throwable thr) -> {
+ if (thr != null) {
+ loadCallback.accept(null);
+ return;
@@ -1872,7 +3191,7 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ throw new IllegalArgumentException("Cannot wait for INACCESSIBLE status");
+ }
+
-+ if (!Bukkit.isPrimaryThread()) {
++ if (!org.bukkit.Bukkit.isPrimaryThread()) {
+ scheduleChunkTask(level, chunkX, chunkZ, () -> {
+ scheduleTickingState(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
+ }, priority);
@@ -1882,7 +3201,7 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ final int minLevel = 33 - (toStatus.ordinal() - 1);
+ final int radius = toStatus.ordinal() - 1;
+ final Long chunkReference = addTicket ? Long.valueOf(++chunkLoadCounter) : null;
-+ final ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ);
++ final net.minecraft.world.level.ChunkPos chunkPos = new net.minecraft.world.level.ChunkPos(chunkX, chunkZ);
+
+ if (addTicket) {
+ level.chunkSource.addTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
@@ -1896,10 +3215,10 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ }
+ } catch (final Throwable thr) {
+ LOGGER.error("Exception handling chunk load callback", thr);
-+ SneakyThrow.sneaky(thr);
++ com.destroystokyo.paper.util.SneakyThrow.sneaky(thr);
+ } finally {
+ if (addTicket) {
-+ level.chunkSource.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, minLevel, chunkPos);
++ level.chunkSource.addTicketAtLevel(net.minecraft.server.level.TicketType.UNKNOWN, chunkPos, minLevel, chunkPos);
+ level.chunkSource.removeTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
+ }
+ }
@@ -1912,7 +3231,7 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ return;
+ }
+
-+ final CompletableFuture<ChunkResult<LevelChunk>> tickingState;
++ final java.util.concurrent.CompletableFuture<net.minecraft.server.level.ChunkResult<net.minecraft.world.level.chunk.LevelChunk>> tickingState;
+ switch (toStatus) {
+ case FULL: {
+ tickingState = holder.getFullChunkFuture();
@@ -1936,7 +3255,7 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ return;
+ }
+
-+ tickingState.whenCompleteAsync((final ChunkResult<LevelChunk> result, final Throwable thr) -> {
++ tickingState.whenCompleteAsync((final net.minecraft.server.level.ChunkResult<net.minecraft.world.level.chunk.LevelChunk> result, final Throwable thr) -> {
+ if (thr != null) {
+ loadCallback.accept(null);
+ return;
@@ -1948,11 +3267,11 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ }
+
+ public static List<ChunkHolder> getVisibleChunkHolders(final ServerLevel level) {
-+ return new ArrayList<>(level.chunkSource.chunkMap.visibleChunkMap.values());
++ return new java.util.ArrayList<>(level.chunkSource.chunkMap.visibleChunkMap.values());
+ }
+
+ public static List<ChunkHolder> getUpdatingChunkHolders(final ServerLevel level) {
-+ return new ArrayList<>(level.chunkSource.chunkMap.updatingChunkMap.values());
++ return new java.util.ArrayList<>(level.chunkSource.chunkMap.updatingChunkMap.values());
+ }
+
+ public static int getVisibleChunkHolderCount(final ServerLevel level) {
@@ -1967,8 +3286,8 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ return getUpdatingChunkHolderCount(level) != 0;
+ }
+
-+ public static void onEntityPreAdd(final ServerLevel level, final Entity entity) {
-+
++ public static boolean screenEntity(final ServerLevel level, final Entity entity) {
++ return true;
+ }
+
+ public static void onChunkHolderCreate(final ServerLevel level, final ChunkHolder holder) {
@@ -1988,19 +3307,19 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ }
+
+ public static void onChunkTicking(final LevelChunk chunk, final ChunkHolder holder) {
-+ chunk.level.getChunkSource().tickingChunks.add(chunk);
++
+ }
+
+ public static void onChunkNotTicking(final LevelChunk chunk, final ChunkHolder holder) {
-+ chunk.level.getChunkSource().tickingChunks.remove(chunk);
++
+ }
+
+ public static void onChunkEntityTicking(final LevelChunk chunk, final ChunkHolder holder) {
-+ chunk.level.getChunkSource().entityTickingChunks.add(chunk);
++
+ }
+
+ public static void onChunkNotEntityTicking(final LevelChunk chunk, final ChunkHolder holder) {
-+ chunk.level.getChunkSource().entityTickingChunks.remove(chunk);
++
+ }
+
+ public static ChunkHolder getUnloadingChunkHolder(final ServerLevel level, final int chunkX, final int chunkZ) {
@@ -2014,7 +3333,7 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ public static int getLoadViewDistance(final ServerPlayer player) {
+ final ServerLevel level = player.serverLevel();
+ if (level == null) {
-+ return Bukkit.getViewDistance();
++ return org.bukkit.Bukkit.getViewDistance();
+ }
+ return level.chunkSource.chunkMap.getPlayerViewDistance(player);
+ }
@@ -2022,51 +3341,30 @@ index 0000000000000000000000000000000000000000..a79abe9b26f68d573812e91554124783
+ public static int getTickViewDistance(final ServerPlayer player) {
+ final ServerLevel level = player.serverLevel();
+ if (level == null) {
-+ return Bukkit.getSimulationDistance();
++ return org.bukkit.Bukkit.getSimulationDistance();
+ }
+ return level.chunkSource.chunkMap.distanceManager.simulationDistance;
+ }
+
-+ private ChunkSystem() {
-+ throw new RuntimeException();
-+ }
-+}
-diff --git a/src/main/java/io/papermc/paper/util/CachedLists.java b/src/main/java/io/papermc/paper/util/CachedLists.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..be668387f65a633c6ac497fca632a4767a1bf3a2
---- /dev/null
-+++ b/src/main/java/io/papermc/paper/util/CachedLists.java
-@@ -0,0 +1,8 @@
-+package io.papermc.paper.util;
-+
-+public final class CachedLists {
-+
-+ public static void reset() {
-+
-+ }
++ private ChunkSystem() {}
+}
-diff --git a/src/main/java/io/papermc/paper/util/CoordinateUtils.java b/src/main/java/io/papermc/paper/util/CoordinateUtils.java
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/CoordinateUtils.java b/src/main/java/ca/spottedleaf/moonrise/common/util/CoordinateUtils.java
new file mode 100644
-index 0000000000000000000000000000000000000000..413e4b6da027876dbbe8eb78f2568a440f431547
+index 0000000000000000000000000000000000000000..31b92bd48828cbea25b44a9f0f96886347aa1ae6
--- /dev/null
-+++ b/src/main/java/io/papermc/paper/util/CoordinateUtils.java
-@@ -0,0 +1,128 @@
-+package io.papermc.paper.util;
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/CoordinateUtils.java
+@@ -0,0 +1,129 @@
++package ca.spottedleaf.moonrise.common.util;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.core.SectionPos;
+import net.minecraft.util.Mth;
+import net.minecraft.world.entity.Entity;
+import net.minecraft.world.level.ChunkPos;
++import net.minecraft.world.phys.Vec3;
+
+public final class CoordinateUtils {
+
-+ // dx, dz are relative to the target chunk
-+ // dx, dz in [-radius, radius]
-+ public static int getNeighbourMappedIndex(final int dx, final int dz, final int radius) {
-+ return (dx + radius) + (2 * radius + 1)*(dz + radius);
-+ }
-+
+ // the chunk keys are compatible with vanilla
+
+ public static long getChunkKey(final BlockPos pos) {
@@ -2157,282 +3455,497 @@ index 0000000000000000000000000000000000000000..413e4b6da027876dbbe8eb78f2568a44
+ return (int)(key << (Long.SIZE - (SECTION_Z_SHIFT + SECTION_Z_BITS)) >> (Long.SIZE - SECTION_Z_BITS));
+ }
+
-+ // the block coordinates are not necessarily compatible with vanilla's
++ public static int getBlockX(final Vec3 pos) {
++ return Mth.floor(pos.x);
++ }
++
++ public static int getBlockY(final Vec3 pos) {
++ return Mth.floor(pos.y);
++ }
+
-+ public static int getBlockCoordinate(final double blockCoordinate) {
-+ return Mth.floor(blockCoordinate);
++ public static int getBlockZ(final Vec3 pos) {
++ return Mth.floor(pos.z);
+ }
+
-+ public static long getBlockKey(final int x, final int y, final int z) {
-+ return ((long)x & 0x7FFFFFF) | (((long)z & 0x7FFFFFF) << 27) | ((long)y << 54);
++ public static int getChunkX(final Vec3 pos) {
++ return Mth.floor(pos.x) >> 4;
+ }
+
-+ public static long getBlockKey(final BlockPos pos) {
-+ return ((long)pos.getX() & 0x7FFFFFF) | (((long)pos.getZ() & 0x7FFFFFF) << 27) | ((long)pos.getY() << 54);
++ public static int getChunkY(final Vec3 pos) {
++ return Mth.floor(pos.y) >> 4;
+ }
+
-+ public static long getBlockKey(final Entity entity) {
-+ return ((long)entity.getX() & 0x7FFFFFF) | (((long)entity.getZ() & 0x7FFFFFF) << 27) | ((long)entity.getY() << 54);
++ public static int getChunkZ(final Vec3 pos) {
++ return Mth.floor(pos.z) >> 4;
+ }
+
+ private CoordinateUtils() {
+ throw new RuntimeException();
+ }
+}
-diff --git a/src/main/java/io/papermc/paper/util/IntegerUtil.java b/src/main/java/io/papermc/paper/util/IntegerUtil.java
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/FlatBitsetUtil.java b/src/main/java/ca/spottedleaf/moonrise/common/util/FlatBitsetUtil.java
new file mode 100644
-index 0000000000000000000000000000000000000000..16785bd5c0524f6bad0691ca7ecd4514608d2eab
+index 0000000000000000000000000000000000000000..0531f25aaad162386a029d33e68d7c8336b9d5d1
--- /dev/null
-+++ b/src/main/java/io/papermc/paper/util/IntegerUtil.java
-@@ -0,0 +1,242 @@
-+package io.papermc.paper.util;
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/FlatBitsetUtil.java
+@@ -0,0 +1,109 @@
++package ca.spottedleaf.moonrise.common.util;
++
++import java.util.Objects;
++
++public final class FlatBitsetUtil {
++
++ private static final int LOG2_LONG = 6;
++ private static final long ALL_SET = -1L;
++ private static final int BITS_PER_LONG = Long.SIZE;
++
++ // from inclusive
++ // to exclusive
++ public static int firstSet(final long[] bitset, final int from, final int to) {
++ if ((from | to | (to - from)) < 0) {
++ throw new IndexOutOfBoundsException();
++ }
++
++ int bitsetIdx = from >>> LOG2_LONG;
++ int bitIdx = from & ~(BITS_PER_LONG - 1);
++
++ long tmp = bitset[bitsetIdx] & (ALL_SET << from);
++ for (;;) {
++ if (tmp != 0L) {
++ final int ret = bitIdx | Long.numberOfTrailingZeros(tmp);
++ return ret >= to ? -1 : ret;
++ }
++
++ bitIdx += BITS_PER_LONG;
++
++ if (bitIdx >= to) {
++ return -1;
++ }
++
++ tmp = bitset[++bitsetIdx];
++ }
++ }
++
++ // from inclusive
++ // to exclusive
++ public static int firstClear(final long[] bitset, final int from, final int to) {
++ if ((from | to | (to - from)) < 0) {
++ throw new IndexOutOfBoundsException();
++ }
++ // like firstSet, but invert the bitset
++
++ int bitsetIdx = from >>> LOG2_LONG;
++ int bitIdx = from & ~(BITS_PER_LONG - 1);
++
++ long tmp = (~bitset[bitsetIdx]) & (ALL_SET << from);
++ for (;;) {
++ if (tmp != 0L) {
++ final int ret = bitIdx | Long.numberOfTrailingZeros(tmp);
++ return ret >= to ? -1 : ret;
++ }
++
++ bitIdx += BITS_PER_LONG;
++
++ if (bitIdx >= to) {
++ return -1;
++ }
++
++ tmp = ~bitset[++bitsetIdx];
++ }
++ }
++
++ // from inclusive
++ // to exclusive
++ public static void clearRange(final long[] bitset, final int from, int to) {
++ if ((from | to | (to - from)) < 0) {
++ throw new IndexOutOfBoundsException();
++ }
++
++ if (from == to) {
++ return;
++ }
++
++ --to;
++
++ final int fromBitsetIdx = from >>> LOG2_LONG;
++ final int toBitsetIdx = to >>> LOG2_LONG;
++
++ final long keepFirst = ~(ALL_SET << from);
++ final long keepLast = ~(ALL_SET >>> ((BITS_PER_LONG - 1) ^ to));
++
++ Objects.checkFromToIndex(fromBitsetIdx, toBitsetIdx, bitset.length);
++
++ if (fromBitsetIdx == toBitsetIdx) {
++ // special case: need to keep both first and last
++ bitset[fromBitsetIdx] &= (keepFirst | keepLast);
++ } else {
++ bitset[fromBitsetIdx] &= keepFirst;
++
++ for (int i = fromBitsetIdx + 1; i < toBitsetIdx; ++i) {
++ bitset[i] = 0L;
++ }
++
++ bitset[toBitsetIdx] &= keepLast;
++ }
++ }
++
++ // from inclusive
++ // to exclusive
++ public static boolean isRangeSet(final long[] bitset, final int from, final int to) {
++ return firstClear(bitset, from, to) == -1;
++ }
++
++
++ private FlatBitsetUtil() {}
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/JsonUtil.java b/src/main/java/ca/spottedleaf/moonrise/common/util/JsonUtil.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..91efda726b87a8a8f28dee84e31b6a7063752ebd
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/JsonUtil.java
+@@ -0,0 +1,34 @@
++package ca.spottedleaf.moonrise.common.util;
++
++import com.google.gson.JsonElement;
++import com.google.gson.internal.Streams;
++import com.google.gson.stream.JsonWriter;
++import java.io.File;
++import java.io.FileOutputStream;
++import java.io.IOException;
++import java.io.PrintStream;
++import java.io.StringWriter;
++import java.nio.charset.StandardCharsets;
++
++public final class JsonUtil {
++
++ public static void writeJson(final JsonElement element, final File file) throws IOException {
++ final StringWriter stringWriter = new StringWriter();
++ final JsonWriter jsonWriter = new JsonWriter(stringWriter);
++ jsonWriter.setIndent(" ");
++ jsonWriter.setLenient(false);
++ Streams.write(element, jsonWriter);
++
++ final String jsonString = stringWriter.toString();
++
++ final File parent = file.getParentFile();
++ if (parent != null) {
++ parent.mkdirs();
++ }
++ file.createNewFile();
++ try (final PrintStream out = new PrintStream(new FileOutputStream(file), false, StandardCharsets.UTF_8)) {
++ out.print(jsonString);
++ }
++ }
++
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/MixinWorkarounds.java b/src/main/java/ca/spottedleaf/moonrise/common/util/MixinWorkarounds.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..ac6f284ee4469d16c5655328b2488d7612832353
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/MixinWorkarounds.java
+@@ -0,0 +1,10 @@
++package ca.spottedleaf.moonrise.common.util;
++
++public final class MixinWorkarounds {
++
++ // mixins tries to find the owner of the clone() method, which doesn't exist and NPEs
++ public static long[] clone(final long[] values) {
++ return values.clone();
++ }
++
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseCommon.java b/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseCommon.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..3abe0bd2a820352b85306d554bf14a4cf6123091
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseCommon.java
+@@ -0,0 +1,46 @@
++package ca.spottedleaf.moonrise.common.util;
++
++import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedThreadPool;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++import java.io.File;
+
-+public final class IntegerUtil {
++public final class MoonriseCommon {
+
-+ public static final int HIGH_BIT_U32 = Integer.MIN_VALUE;
-+ public static final long HIGH_BIT_U64 = Long.MIN_VALUE;
++ private static final Logger LOGGER = LoggerFactory.getLogger(MoonriseCommon.class);
++
++ // Paper start
++ public static PrioritisedThreadPool WORKER_POOL;
++ public static int WORKER_THREADS;
++ public static void init(io.papermc.paper.configuration.GlobalConfiguration.ChunkSystem chunkSystem) {
++ // Paper end
++ int defaultWorkerThreads = Runtime.getRuntime().availableProcessors() / 2;
++ if (defaultWorkerThreads <= 4) {
++ defaultWorkerThreads = defaultWorkerThreads <= 3 ? 1 : 2;
++ } else {
++ defaultWorkerThreads = defaultWorkerThreads / 2;
++ }
++ defaultWorkerThreads = Integer.getInteger("Paper.WorkerThreadCount", Integer.valueOf(defaultWorkerThreads)); // Paper
+
-+ public static int ceilLog2(final int value) {
-+ return Integer.SIZE - Integer.numberOfLeadingZeros(value - 1); // see doc of numberOfLeadingZeros
++ int workerThreads = chunkSystem.workerThreads; // Paper
++
++ if (workerThreads <= 0) {
++ workerThreads = defaultWorkerThreads;
++ }
++
++ WORKER_POOL = new PrioritisedThreadPool(
++ "Paper Worker Pool", workerThreads, // Paper
++ (final Thread thread, final Integer id) -> {
++ thread.setName("Paper Common Worker #" + id.intValue()); // Paper
++ thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
++ @Override
++ public void uncaughtException(final Thread thread, final Throwable throwable) {
++ LOGGER.error("Uncaught exception in thread " + thread.getName(), throwable);
++ }
++ });
++ }, (long)(20.0e6)); // 20ms
++ WORKER_THREADS = workerThreads;
+ }
+
-+ public static long ceilLog2(final long value) {
-+ return Long.SIZE - Long.numberOfLeadingZeros(value - 1); // see doc of numberOfLeadingZeros
++ private MoonriseCommon() {}
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseConstants.java b/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseConstants.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..1cf32d7d1bbc8a0a3f7cb9024c793f6744199f64
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseConstants.java
+@@ -0,0 +1,9 @@
++package ca.spottedleaf.moonrise.common.util;
++
++public final class MoonriseConstants {
++
++ public static final int MAX_VIEW_DISTANCE = 32;
++
++ private MoonriseConstants() {}
++
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java b/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..7deb341b7e2b4592ae3f88733d6cacf6e58764e4
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
+@@ -0,0 +1,139 @@
++package ca.spottedleaf.moonrise.common.util;
++
++import net.minecraft.core.BlockPos;
++import net.minecraft.server.level.ServerLevel;
++import net.minecraft.world.entity.Entity;
++import net.minecraft.world.level.ChunkPos;
++import net.minecraft.world.phys.AABB;
++import net.minecraft.world.phys.Vec3;
++import org.slf4j.Logger;
++import org.slf4j.LoggerFactory;
++
++import java.util.concurrent.atomic.AtomicInteger;
++
++public class TickThread extends Thread {
++
++ private static final Logger LOGGER = LoggerFactory.getLogger(TickThread.class);
++
++ /**
++ * @deprecated
++ */
++ @Deprecated
++ public static void ensureTickThread(final String reason) {
++ if (!isTickThread()) {
++ LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
++ throw new IllegalStateException(reason);
++ }
+ }
+
-+ public static int floorLog2(final int value) {
-+ // xor is optimized subtract for 2^n -1
-+ // note that (2^n -1) - k = (2^n -1) ^ k for k <= (2^n - 1)
-+ return (Integer.SIZE - 1) ^ Integer.numberOfLeadingZeros(value); // see doc of numberOfLeadingZeros
++ public static void ensureTickThread(final ServerLevel world, final BlockPos pos, final String reason) {
++ if (!isTickThreadFor(world, pos)) {
++ LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
++ throw new IllegalStateException(reason);
++ }
+ }
+
-+ public static int floorLog2(final long value) {
-+ // xor is optimized subtract for 2^n -1
-+ // note that (2^n -1) - k = (2^n -1) ^ k for k <= (2^n - 1)
-+ return (Long.SIZE - 1) ^ Long.numberOfLeadingZeros(value); // see doc of numberOfLeadingZeros
++ public static void ensureTickThread(final ServerLevel world, final ChunkPos pos, final String reason) {
++ if (!isTickThreadFor(world, pos)) {
++ LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
++ throw new IllegalStateException(reason);
++ }
+ }
+
-+ public static int roundCeilLog2(final int value) {
-+ // optimized variant of 1 << (32 - leading(val - 1))
-+ // given
-+ // 1 << n = HIGH_BIT_32 >>> (31 - n) for n [0, 32)
-+ // 1 << (32 - leading(val - 1)) = HIGH_BIT_32 >>> (31 - (32 - leading(val - 1)))
-+ // HIGH_BIT_32 >>> (31 - (32 - leading(val - 1)))
-+ // HIGH_BIT_32 >>> (31 - 32 + leading(val - 1))
-+ // HIGH_BIT_32 >>> (-1 + leading(val - 1))
-+ return HIGH_BIT_U32 >>> (Integer.numberOfLeadingZeros(value - 1) - 1);
++ public static void ensureTickThread(final ServerLevel world, final int chunkX, final int chunkZ, final String reason) {
++ if (!isTickThreadFor(world, chunkX, chunkZ)) {
++ LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
++ throw new IllegalStateException(reason);
++ }
+ }
+
-+ public static long roundCeilLog2(final long value) {
-+ // see logic documented above
-+ return HIGH_BIT_U64 >>> (Long.numberOfLeadingZeros(value - 1) - 1);
++ public static void ensureTickThread(final Entity entity, final String reason) {
++ if (!isTickThreadFor(entity)) {
++ LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
++ throw new IllegalStateException(reason);
++ }
+ }
+
-+ public static int roundFloorLog2(final int value) {
-+ // optimized variant of 1 << (31 - leading(val))
-+ // given
-+ // 1 << n = HIGH_BIT_32 >>> (31 - n) for n [0, 32)
-+ // 1 << (31 - leading(val)) = HIGH_BIT_32 >> (31 - (31 - leading(val)))
-+ // HIGH_BIT_32 >> (31 - (31 - leading(val)))
-+ // HIGH_BIT_32 >> (31 - 31 + leading(val))
-+ return HIGH_BIT_U32 >>> Integer.numberOfLeadingZeros(value);
++ public static void ensureTickThread(final ServerLevel world, final AABB aabb, final String reason) {
++ if (!isTickThreadFor(world, aabb)) {
++ LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
++ throw new IllegalStateException(reason);
++ }
+ }
+
-+ public static long roundFloorLog2(final long value) {
-+ // see logic documented above
-+ return HIGH_BIT_U64 >>> Long.numberOfLeadingZeros(value);
++ public static void ensureTickThread(final ServerLevel world, final double blockX, final double blockZ, final String reason) {
++ if (!isTickThreadFor(world, blockX, blockZ)) {
++ LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
++ throw new IllegalStateException(reason);
++ }
+ }
+
-+ public static boolean isPowerOfTwo(final int n) {
-+ // 2^n has one bit
-+ // note: this rets true for 0 still
-+ return IntegerUtil.getTrailingBit(n) == n;
++ 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();
++
++ public TickThread(final String name) {
++ this(null, name);
+ }
+
-+ public static boolean isPowerOfTwo(final long n) {
-+ // 2^n has one bit
-+ // note: this rets true for 0 still
-+ return IntegerUtil.getTrailingBit(n) == n;
++ public TickThread(final Runnable run, final String name) {
++ this(run, name, ID_GENERATOR.incrementAndGet());
+ }
+
-+ public static int getTrailingBit(final int n) {
-+ return -n & n;
++ private TickThread(final Runnable run, final String name, final int id) {
++ super(run, name);
++ this.id = id;
+ }
+
-+ public static long getTrailingBit(final long n) {
-+ return -n & n;
++ public static TickThread getCurrentTickThread() {
++ return (TickThread)Thread.currentThread();
+ }
+
-+ public static int trailingZeros(final int n) {
-+ return Integer.numberOfTrailingZeros(n);
++ public static boolean isTickThread() {
++ return org.bukkit.Bukkit.isPrimaryThread(); // Paper
+ }
+
-+ public static int trailingZeros(final long n) {
-+ return Long.numberOfTrailingZeros(n);
++ public static boolean isShutdownThread() {
++ return false;
+ }
+
-+ // from hacker's delight (signed division magic value)
-+ public static int getDivisorMultiple(final long numbers) {
-+ return (int)(numbers >>> 32);
++ public static boolean isTickThreadFor(final ServerLevel world, final BlockPos pos) {
++ return isTickThread();
+ }
+
-+ // from hacker's delight (signed division magic value)
-+ public static int getDivisorShift(final long numbers) {
-+ return (int)numbers;
++ public static boolean isTickThreadFor(final ServerLevel world, final ChunkPos pos) {
++ return isTickThread();
+ }
+
-+ // copied from hacker's delight (signed division magic value)
-+ // http://www.hackersdelight.org/hdcodetxt/magic.c.txt
-+ public static long getDivisorNumbers(final int d) {
-+ final int ad = branchlessAbs(d);
++ public static boolean isTickThreadFor(final ServerLevel world, final Vec3 pos) {
++ return isTickThread();
++ }
+
-+ if (ad < 2) {
-+ throw new IllegalArgumentException("|number| must be in [2, 2^31 -1], not: " + d);
-+ }
++ public static boolean isTickThreadFor(final ServerLevel world, final int chunkX, final int chunkZ) {
++ return isTickThread();
++ }
+
-+ final int two31 = 0x80000000;
-+ final long mask = 0xFFFFFFFFL; // mask for enforcing unsigned behaviour
++ public static boolean isTickThreadFor(final ServerLevel world, final AABB aabb) {
++ return isTickThread();
++ }
+
-+ /*
-+ Signed usage:
-+ int number;
-+ long magic = getDivisorNumbers(div);
-+ long mul = magic >>> 32;
-+ int sign = number >> 31;
-+ int result = (int)(((long)number * mul) >>> magic) - sign;
-+ */
-+ /*
-+ Unsigned usage:
-+ int number;
-+ long magic = getDivisorNumbers(div);
-+ long mul = magic >>> 32;
-+ int result = (int)(((long)number * mul) >>> magic);
-+ */
++ public static boolean isTickThreadFor(final ServerLevel world, final double blockX, final double blockZ) {
++ return isTickThread();
++ }
+
-+ int p = 31;
-+
-+ // all these variables are UNSIGNED!
-+ int t = two31 + (d >>> 31);
-+ int anc = t - 1 - (int)((t & mask)%ad);
-+ int q1 = (int)((two31 & mask)/(anc & mask));
-+ int r1 = two31 - q1*anc;
-+ int q2 = (int)((two31 & mask)/(ad & mask));
-+ int r2 = two31 - q2*ad;
-+ int delta;
-+
-+ do {
-+ p = p + 1;
-+ q1 = 2*q1; // Update q1 = 2**p/|nc|.
-+ r1 = 2*r1; // Update r1 = rem(2**p, |nc|).
-+ if ((r1 & mask) >= (anc & mask)) {// (Must be an unsigned comparison here)
-+ q1 = q1 + 1;
-+ r1 = r1 - anc;
-+ }
-+ q2 = 2*q2; // Update q2 = 2**p/|d|.
-+ r2 = 2*r2; // Update r2 = rem(2**p, |d|).
-+ if ((r2 & mask) >= (ad & mask)) {// (Must be an unsigned comparison here)
-+ q2 = q2 + 1;
-+ r2 = r2 - ad;
-+ }
-+ delta = ad - r2;
-+ } while ((q1 & mask) < (delta & mask) || (q1 == delta && r1 == 0));
++ public static boolean isTickThreadFor(final ServerLevel world, final Vec3 position, final Vec3 deltaMovement, final int buffer) {
++ return isTickThread();
++ }
+
-+ int magicNum = q2 + 1;
-+ if (d < 0) {
-+ magicNum = -magicNum;
-+ }
-+ int shift = p;
-+ return ((long)magicNum << 32) | shift;
++ public static boolean isTickThreadFor(final ServerLevel world, final int fromChunkX, final int fromChunkZ, final int toChunkX, final int toChunkZ) {
++ return isTickThread();
+ }
+
-+ public static int branchlessAbs(final int val) {
-+ // -n = -1 ^ n + 1
-+ final int mask = val >> (Integer.SIZE - 1); // -1 if < 0, 0 if >= 0
-+ return (mask ^ val) - mask; // if val < 0, then (0 ^ val) - 0 else (-1 ^ val) + 1
++ public static boolean isTickThreadFor(final ServerLevel world, final int chunkX, final int chunkZ, final int radius) {
++ return isTickThread();
+ }
+
-+ public static long branchlessAbs(final long val) {
-+ // -n = -1 ^ n + 1
-+ final long mask = val >> (Long.SIZE - 1); // -1 if < 0, 0 if >= 0
-+ return (mask ^ val) - mask; // if val < 0, then (0 ^ val) - 0 else (-1 ^ val) + 1
++ public static boolean isTickThreadFor(final Entity entity) {
++ return isTickThread();
+ }
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/WorldUtil.java b/src/main/java/ca/spottedleaf/moonrise/common/util/WorldUtil.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..af9623240ff2d389aa7090623f507720e7dbab7d
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/WorldUtil.java
+@@ -0,0 +1,54 @@
++package ca.spottedleaf.moonrise.common.util;
++
++import net.minecraft.world.level.Level;
++import net.minecraft.world.level.LevelHeightAccessor;
+
-+ //https://github.com/skeeto/hash-prospector for hash functions
++public final class WorldUtil {
++
++ // min, max are inclusive
+
-+ //score = ~590.47984224483832
-+ public static int hash0(int x) {
-+ x *= 0x36935555;
-+ x ^= x >>> 16;
-+ return x;
++ public static int getMaxSection(final LevelHeightAccessor world) {
++ return world.getMaxSection() - 1; // getMaxSection() is exclusive
+ }
+
-+ //score = ~310.01596637036749
-+ public static int hash1(int x) {
-+ x ^= x >>> 15;
-+ x *= 0x356aaaad;
-+ x ^= x >>> 17;
-+ return x;
++ public static int getMinSection(final LevelHeightAccessor world) {
++ return world.getMinSection();
+ }
+
-+ public static int hash2(int x) {
-+ x ^= x >>> 16;
-+ x *= 0x7feb352d;
-+ x ^= x >>> 15;
-+ x *= 0x846ca68b;
-+ x ^= x >>> 16;
-+ return x;
++ public static int getMaxLightSection(final LevelHeightAccessor world) {
++ return getMaxSection(world) + 1;
+ }
+
-+ public static int hash3(int x) {
-+ x ^= x >>> 17;
-+ x *= 0xed5ad4bb;
-+ x ^= x >>> 11;
-+ x *= 0xac4c1b51;
-+ x ^= x >>> 15;
-+ x *= 0x31848bab;
-+ x ^= x >>> 14;
-+ return x;
++ public static int getMinLightSection(final LevelHeightAccessor world) {
++ return getMinSection(world) - 1;
+ }
+
-+ //score = ~365.79959673201887
-+ public static long hash1(long x) {
-+ x ^= x >>> 27;
-+ x *= 0xb24924b71d2d354bL;
-+ x ^= x >>> 28;
-+ return x;
++
++
++ public static int getTotalSections(final LevelHeightAccessor world) {
++ return getMaxSection(world) - getMinSection(world) + 1;
+ }
+
-+ //h2 hash
-+ public static long hash2(long x) {
-+ x ^= x >>> 32;
-+ x *= 0xd6e8feb86659fd93L;
-+ x ^= x >>> 32;
-+ x *= 0xd6e8feb86659fd93L;
-+ x ^= x >>> 32;
-+ return x;
++ public static int getTotalLightSections(final LevelHeightAccessor world) {
++ return getMaxLightSection(world) - getMinLightSection(world) + 1;
+ }
+
-+ public static long hash3(long x) {
-+ x ^= x >>> 45;
-+ x *= 0xc161abe5704b6c79L;
-+ x ^= x >>> 41;
-+ x *= 0xe3e5389aedbc90f7L;
-+ x ^= x >>> 56;
-+ x *= 0x1f9aba75a52db073L;
-+ x ^= x >>> 53;
-+ return x;
++ public static int getMinBlockY(final LevelHeightAccessor world) {
++ return getMinSection(world) << 4;
+ }
+
-+ private IntegerUtil() {
++ public static int getMaxBlockY(final LevelHeightAccessor world) {
++ return (getMaxSection(world) << 4) | 15;
++ }
++
++ public static String getWorldName(final Level world) {
++ if (world == null) {
++ return "null world";
++ }
++ return world.getWorld().getName(); // Paper
++ }
++
++ private WorldUtil() {
+ throw new RuntimeException();
+ }
+}
+diff --git a/src/main/java/com/mojang/logging/LogUtils.java b/src/main/java/com/mojang/logging/LogUtils.java
+index 46cab7a8c7b87ab01b26074b04f5a02b3907cfc4..49019b4a9bc4e634d54a9b0acaf9229a5c896f85 100644
+--- a/src/main/java/com/mojang/logging/LogUtils.java
++++ b/src/main/java/com/mojang/logging/LogUtils.java
+@@ -61,4 +61,9 @@ public class LogUtils {
+ public static Logger getLogger() {
+ return LoggerFactory.getLogger(STACK_WALKER.getCallerClass());
+ }
++ // Paper start
++ public static Logger getClassLogger() {
++ return LoggerFactory.getLogger(STACK_WALKER.getCallerClass().getSimpleName());
++ }
++ // Paper end
+ }
diff --git a/src/main/java/io/papermc/paper/util/IntervalledCounter.java b/src/main/java/io/papermc/paper/util/IntervalledCounter.java
new file mode 100644
-index 0000000000000000000000000000000000000000..c90acc3bde887b9c8f8d49fcc3195657c721bc14
+index 0000000000000000000000000000000000000000..197224e31175252d8438a8df585bbb65f2288d7f
--- /dev/null
+++ b/src/main/java/io/papermc/paper/util/IntervalledCounter.java
-@@ -0,0 +1,128 @@
+@@ -0,0 +1,129 @@
+package io.papermc.paper.util;
+
+public final class IntervalledCounter {
@@ -2536,6 +4049,7 @@ index 0000000000000000000000000000000000000000..c90acc3bde887b9c8f8d49fcc3195657
+ } else {
+ // ordered from [head, length)
+ // then followed by [0, tail)
++
+ System.arraycopy(oldElements, head, newElements, 0, oldElements.length - head);
+ System.arraycopy(oldElements, 0, newElements, oldElements.length - head, tail);
+
@@ -3147,845 +4661,6 @@ index 0000000000000000000000000000000000000000..f7114d5b8f2f93f62883e24da29afaf9
+ return foundFrame.orElse(null);
+ }
+}
-diff --git a/src/main/java/io/papermc/paper/util/WorldUtil.java b/src/main/java/io/papermc/paper/util/WorldUtil.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..67bb91fcfb532a919954cd9d7733d09a6c3fec35
---- /dev/null
-+++ b/src/main/java/io/papermc/paper/util/WorldUtil.java
-@@ -0,0 +1,46 @@
-+package io.papermc.paper.util;
-+
-+import net.minecraft.world.level.LevelHeightAccessor;
-+
-+public final class WorldUtil {
-+
-+ // min, max are inclusive
-+
-+ public static int getMaxSection(final LevelHeightAccessor world) {
-+ return world.getMaxSection() - 1; // getMaxSection() is exclusive
-+ }
-+
-+ public static int getMinSection(final LevelHeightAccessor world) {
-+ return world.getMinSection();
-+ }
-+
-+ public static int getMaxLightSection(final LevelHeightAccessor world) {
-+ return getMaxSection(world) + 1;
-+ }
-+
-+ public static int getMinLightSection(final LevelHeightAccessor world) {
-+ return getMinSection(world) - 1;
-+ }
-+
-+
-+
-+ public static int getTotalSections(final LevelHeightAccessor world) {
-+ return getMaxSection(world) - getMinSection(world) + 1;
-+ }
-+
-+ public static int getTotalLightSections(final LevelHeightAccessor world) {
-+ return getMaxLightSection(world) - getMinLightSection(world) + 1;
-+ }
-+
-+ public static int getMinBlockY(final LevelHeightAccessor world) {
-+ return getMinSection(world) << 4;
-+ }
-+
-+ public static int getMaxBlockY(final LevelHeightAccessor world) {
-+ return (getMaxSection(world) << 4) | 15;
-+ }
-+
-+ private WorldUtil() {
-+ throw new RuntimeException();
-+ }
-+}
-diff --git a/src/main/java/io/papermc/paper/util/maplist/IteratorSafeOrderedReferenceSet.java b/src/main/java/io/papermc/paper/util/maplist/IteratorSafeOrderedReferenceSet.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..0fd814f1d65c111266a2b20f86561839a4cef755
---- /dev/null
-+++ b/src/main/java/io/papermc/paper/util/maplist/IteratorSafeOrderedReferenceSet.java
-@@ -0,0 +1,334 @@
-+package io.papermc.paper.util.maplist;
-+
-+import it.unimi.dsi.fastutil.objects.Reference2IntLinkedOpenHashMap;
-+import it.unimi.dsi.fastutil.objects.Reference2IntMap;
-+import org.bukkit.Bukkit;
-+import java.util.Arrays;
-+import java.util.NoSuchElementException;
-+
-+public final class IteratorSafeOrderedReferenceSet<E> {
-+
-+ public static final int ITERATOR_FLAG_SEE_ADDITIONS = 1 << 0;
-+
-+ protected final Reference2IntLinkedOpenHashMap<E> indexMap;
-+ protected int firstInvalidIndex = -1;
-+
-+ /* list impl */
-+ protected E[] listElements;
-+ protected int listSize;
-+
-+ protected final double maxFragFactor;
-+
-+ protected int iteratorCount;
-+
-+ private final boolean threadRestricted;
-+
-+ public IteratorSafeOrderedReferenceSet() {
-+ this(16, 0.75f, 16, 0.2);
-+ }
-+
-+ public IteratorSafeOrderedReferenceSet(final boolean threadRestricted) {
-+ this(16, 0.75f, 16, 0.2, threadRestricted);
-+ }
-+
-+ public IteratorSafeOrderedReferenceSet(final int setCapacity, final float setLoadFactor, final int arrayCapacity,
-+ final double maxFragFactor) {
-+ this(setCapacity, setLoadFactor, arrayCapacity, maxFragFactor, false);
-+ }
-+ public IteratorSafeOrderedReferenceSet(final int setCapacity, final float setLoadFactor, final int arrayCapacity,
-+ final double maxFragFactor, final boolean threadRestricted) {
-+ this.indexMap = new Reference2IntLinkedOpenHashMap<>(setCapacity, setLoadFactor);
-+ this.indexMap.defaultReturnValue(-1);
-+ this.maxFragFactor = maxFragFactor;
-+ this.listElements = (E[])new Object[arrayCapacity];
-+ this.threadRestricted = threadRestricted;
-+ }
-+
-+ /*
-+ public void check() {
-+ int iterated = 0;
-+ ReferenceOpenHashSet<E> check = new ReferenceOpenHashSet<>();
-+ if (this.listElements != null) {
-+ for (int i = 0; i < this.listSize; ++i) {
-+ Object obj = this.listElements[i];
-+ if (obj != null) {
-+ iterated++;
-+ if (!check.add((E)obj)) {
-+ throw new IllegalStateException("contains duplicate");
-+ }
-+ if (!this.contains((E)obj)) {
-+ throw new IllegalStateException("desync");
-+ }
-+ }
-+ }
-+ }
-+
-+ if (iterated != this.size()) {
-+ throw new IllegalStateException("Size is mismatched! Got " + iterated + ", expected " + this.size());
-+ }
-+
-+ check.clear();
-+ iterated = 0;
-+ for (final java.util.Iterator<E> iterator = this.unsafeIterator(IteratorSafeOrderedReferenceSet.ITERATOR_FLAG_SEE_ADDITIONS); iterator.hasNext();) {
-+ final E element = iterator.next();
-+ iterated++;
-+ if (!check.add(element)) {
-+ throw new IllegalStateException("contains duplicate (iterator is wrong)");
-+ }
-+ if (!this.contains(element)) {
-+ throw new IllegalStateException("desync (iterator is wrong)");
-+ }
-+ }
-+
-+ if (iterated != this.size()) {
-+ throw new IllegalStateException("Size is mismatched! (iterator is wrong) Got " + iterated + ", expected " + this.size());
-+ }
-+ }
-+ */
-+
-+ protected final boolean allowSafeIteration() {
-+ return !this.threadRestricted || Bukkit.isPrimaryThread();
-+ }
-+
-+ protected final double getFragFactor() {
-+ return 1.0 - ((double)this.indexMap.size() / (double)this.listSize);
-+ }
-+
-+ public int createRawIterator() {
-+ if (this.allowSafeIteration()) {
-+ ++this.iteratorCount;
-+ }
-+ if (this.indexMap.isEmpty()) {
-+ return -1;
-+ } else {
-+ return this.firstInvalidIndex == 0 ? this.indexMap.getInt(this.indexMap.firstKey()) : 0;
-+ }
-+ }
-+
-+ public int advanceRawIterator(final int index) {
-+ final E[] elements = this.listElements;
-+ int ret = index + 1;
-+ for (int len = this.listSize; ret < len; ++ret) {
-+ if (elements[ret] != null) {
-+ return ret;
-+ }
-+ }
-+
-+ return -1;
-+ }
-+
-+ public void finishRawIterator() {
-+ if (this.allowSafeIteration() && --this.iteratorCount == 0) {
-+ if (this.getFragFactor() >= this.maxFragFactor) {
-+ this.defrag();
-+ }
-+ }
-+ }
-+
-+ public boolean remove(final E element) {
-+ final int index = this.indexMap.removeInt(element);
-+ if (index >= 0) {
-+ if (this.firstInvalidIndex < 0 || index < this.firstInvalidIndex) {
-+ this.firstInvalidIndex = index;
-+ }
-+ if (this.listElements[index] != element) {
-+ throw new IllegalStateException();
-+ }
-+ this.listElements[index] = null;
-+ if (this.allowSafeIteration() && this.iteratorCount == 0 && this.getFragFactor() >= this.maxFragFactor) {
-+ this.defrag();
-+ }
-+ //this.check();
-+ return true;
-+ }
-+ return false;
-+ }
-+
-+ public boolean contains(final E element) {
-+ return this.indexMap.containsKey(element);
-+ }
-+
-+ public boolean add(final E element) {
-+ final int listSize = this.listSize;
-+
-+ final int previous = this.indexMap.putIfAbsent(element, listSize);
-+ if (previous != -1) {
-+ return false;
-+ }
-+
-+ if (listSize >= this.listElements.length) {
-+ this.listElements = Arrays.copyOf(this.listElements, listSize * 2);
-+ }
-+ this.listElements[listSize] = element;
-+ this.listSize = listSize + 1;
-+
-+ //this.check();
-+ return true;
-+ }
-+
-+ protected void defrag() {
-+ if (this.firstInvalidIndex < 0) {
-+ return; // nothing to do
-+ }
-+
-+ if (this.indexMap.isEmpty()) {
-+ Arrays.fill(this.listElements, 0, this.listSize, null);
-+ this.listSize = 0;
-+ this.firstInvalidIndex = -1;
-+ //this.check();
-+ return;
-+ }
-+
-+ final E[] backingArray = this.listElements;
-+
-+ int lastValidIndex;
-+ java.util.Iterator<Reference2IntMap.Entry<E>> iterator;
-+
-+ if (this.firstInvalidIndex == 0) {
-+ iterator = this.indexMap.reference2IntEntrySet().fastIterator();
-+ lastValidIndex = 0;
-+ } else {
-+ lastValidIndex = this.firstInvalidIndex;
-+ final E key = backingArray[lastValidIndex - 1];
-+ iterator = this.indexMap.reference2IntEntrySet().fastIterator(new Reference2IntMap.Entry<E>() {
-+ @Override
-+ public int getIntValue() {
-+ throw new UnsupportedOperationException();
-+ }
-+
-+ @Override
-+ public int setValue(int i) {
-+ throw new UnsupportedOperationException();
-+ }
-+
-+ @Override
-+ public E getKey() {
-+ return key;
-+ }
-+ });
-+ }
-+
-+ while (iterator.hasNext()) {
-+ final Reference2IntMap.Entry<E> entry = iterator.next();
-+
-+ final int newIndex = lastValidIndex++;
-+ backingArray[newIndex] = entry.getKey();
-+ entry.setValue(newIndex);
-+ }
-+
-+ // cleanup end
-+ Arrays.fill(backingArray, lastValidIndex, this.listSize, null);
-+ this.listSize = lastValidIndex;
-+ this.firstInvalidIndex = -1;
-+ //this.check();
-+ }
-+
-+ public E rawGet(final int index) {
-+ return this.listElements[index];
-+ }
-+
-+ public int size() {
-+ // always returns the correct amount - listSize can be different
-+ return this.indexMap.size();
-+ }
-+
-+ public IteratorSafeOrderedReferenceSet.Iterator<E> iterator() {
-+ return this.iterator(0);
-+ }
-+
-+ public IteratorSafeOrderedReferenceSet.Iterator<E> iterator(final int flags) {
-+ if (this.allowSafeIteration()) {
-+ ++this.iteratorCount;
-+ }
-+ return new BaseIterator<>(this, true, (flags & ITERATOR_FLAG_SEE_ADDITIONS) != 0 ? Integer.MAX_VALUE : this.listSize);
-+ }
-+
-+ public java.util.Iterator<E> unsafeIterator() {
-+ return this.unsafeIterator(0);
-+ }
-+ public java.util.Iterator<E> unsafeIterator(final int flags) {
-+ return new BaseIterator<>(this, false, (flags & ITERATOR_FLAG_SEE_ADDITIONS) != 0 ? Integer.MAX_VALUE : this.listSize);
-+ }
-+
-+ public static interface Iterator<E> extends java.util.Iterator<E> {
-+
-+ public void finishedIterating();
-+
-+ }
-+
-+ protected static final class BaseIterator<E> implements IteratorSafeOrderedReferenceSet.Iterator<E> {
-+
-+ protected final IteratorSafeOrderedReferenceSet<E> set;
-+ protected final boolean canFinish;
-+ protected final int maxIndex;
-+ protected int nextIndex;
-+ protected E pendingValue;
-+ protected boolean finished;
-+ protected E lastReturned;
-+
-+ protected BaseIterator(final IteratorSafeOrderedReferenceSet<E> set, final boolean canFinish, final int maxIndex) {
-+ this.set = set;
-+ this.canFinish = canFinish;
-+ this.maxIndex = maxIndex;
-+ }
-+
-+ @Override
-+ public boolean hasNext() {
-+ if (this.finished) {
-+ return false;
-+ }
-+ if (this.pendingValue != null) {
-+ return true;
-+ }
-+
-+ final E[] elements = this.set.listElements;
-+ int index, len;
-+ for (index = this.nextIndex, len = Math.min(this.maxIndex, this.set.listSize); index < len; ++index) {
-+ final E element = elements[index];
-+ if (element != null) {
-+ this.pendingValue = element;
-+ this.nextIndex = index + 1;
-+ return true;
-+ }
-+ }
-+
-+ this.nextIndex = index;
-+ return false;
-+ }
-+
-+ @Override
-+ public E next() {
-+ if (!this.hasNext()) {
-+ throw new NoSuchElementException();
-+ }
-+ final E ret = this.pendingValue;
-+
-+ this.pendingValue = null;
-+ this.lastReturned = ret;
-+
-+ return ret;
-+ }
-+
-+ @Override
-+ public void remove() {
-+ final E lastReturned = this.lastReturned;
-+ if (lastReturned == null) {
-+ throw new IllegalStateException();
-+ }
-+ this.lastReturned = null;
-+ this.set.remove(lastReturned);
-+ }
-+
-+ @Override
-+ public void finishedIterating() {
-+ if (this.finished || !this.canFinish) {
-+ throw new IllegalStateException();
-+ }
-+ this.lastReturned = null;
-+ this.finished = true;
-+ if (this.set.allowSafeIteration()) {
-+ this.set.finishRawIterator();
-+ }
-+ }
-+ }
-+}
-diff --git a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..c3ce8a42dddd76b7189ad5685b23f9d9f8ccadb3
---- /dev/null
-+++ b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
-@@ -0,0 +1,203 @@
-+package io.papermc.paper.util.player;
-+
-+import com.destroystokyo.paper.util.maplist.ReferenceList;
-+import io.papermc.paper.chunk.system.ChunkSystem;
-+import io.papermc.paper.util.CoordinateUtils;
-+import it.unimi.dsi.fastutil.longs.Long2ReferenceOpenHashMap;
-+import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
-+import net.minecraft.core.BlockPos;
-+import net.minecraft.server.level.ServerLevel;
-+import net.minecraft.server.level.ServerPlayer;
-+import net.minecraft.world.level.ChunkPos;
-+
-+public final class NearbyPlayers {
-+
-+ public static enum NearbyMapType {
-+ GENERAL,
-+ GENERAL_SMALL,
-+ GENERAL_REALLY_SMALL,
-+ TICK_VIEW_DISTANCE,
-+ VIEW_DISTANCE;
-+ }
-+
-+ private static final NearbyMapType[] MOB_TYPES = NearbyMapType.values();
-+ public static final int TOTAL_MAP_TYPES = MOB_TYPES.length;
-+
-+ private static final int GENERAL_AREA_VIEW_DISTANCE = 33;
-+ private static final int GENERAL_SMALL_VIEW_DISTANCE = 10;
-+ private static final int GENERAL_REALLY_SMALL_VIEW_DISTANCE = 3;
-+
-+ public static final int GENERAL_AREA_VIEW_DISTANCE_BLOCKS = (GENERAL_AREA_VIEW_DISTANCE << 4);
-+ public static final int GENERAL_SMALL_AREA_VIEW_DISTANCE_BLOCKS = (GENERAL_SMALL_VIEW_DISTANCE << 4);
-+ public static final int GENERAL_REALLY_SMALL_AREA_VIEW_DISTANCE_BLOCKS = (GENERAL_REALLY_SMALL_VIEW_DISTANCE << 4);
-+
-+ private final ServerLevel world;
-+ private final Reference2ReferenceOpenHashMap<ServerPlayer, TrackedPlayer[]> players = new Reference2ReferenceOpenHashMap<>();
-+ private final Long2ReferenceOpenHashMap<TrackedChunk> byChunk = new Long2ReferenceOpenHashMap<>();
-+
-+ public NearbyPlayers(final ServerLevel world) {
-+ this.world = world;
-+ }
-+
-+ public void addPlayer(final ServerPlayer player) {
-+ final TrackedPlayer[] newTrackers = new TrackedPlayer[TOTAL_MAP_TYPES];
-+ if (this.players.putIfAbsent(player, newTrackers) != null) {
-+ throw new IllegalStateException("Already have player " + player);
-+ }
-+
-+ final ChunkPos chunk = player.chunkPosition();
-+
-+ for (int i = 0; i < TOTAL_MAP_TYPES; ++i) {
-+ // use 0 for default, will be updated by tickPlayer
-+ (newTrackers[i] = new TrackedPlayer(player, MOB_TYPES[i])).add(chunk.x, chunk.z, 0);
-+ }
-+
-+ // update view distances
-+ this.tickPlayer(player);
-+ }
-+
-+ public void removePlayer(final ServerPlayer player) {
-+ final TrackedPlayer[] players = this.players.remove(player);
-+ if (players == null) {
-+ return; // May be called during teleportation before the player is actually placed
-+ }
-+
-+ for (final TrackedPlayer tracker : players) {
-+ tracker.remove();
-+ }
-+ }
-+
-+ public void tickPlayer(final ServerPlayer player) {
-+ final TrackedPlayer[] players = this.players.get(player);
-+ if (players == null) {
-+ throw new IllegalStateException("Don't have player " + player);
-+ }
-+
-+ final ChunkPos chunk = player.chunkPosition();
-+
-+ players[NearbyMapType.GENERAL.ordinal()].update(chunk.x, chunk.z, GENERAL_AREA_VIEW_DISTANCE);
-+ players[NearbyMapType.GENERAL_SMALL.ordinal()].update(chunk.x, chunk.z, GENERAL_SMALL_VIEW_DISTANCE);
-+ players[NearbyMapType.GENERAL_REALLY_SMALL.ordinal()].update(chunk.x, chunk.z, GENERAL_REALLY_SMALL_VIEW_DISTANCE);
-+ players[NearbyMapType.TICK_VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, ChunkSystem.getTickViewDistance(player));
-+ players[NearbyMapType.VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, ChunkSystem.getLoadViewDistance(player));
-+ }
-+
-+ public TrackedChunk getChunk(final ChunkPos pos) {
-+ return this.byChunk.get(CoordinateUtils.getChunkKey(pos));
-+ }
-+
-+ public TrackedChunk getChunk(final BlockPos pos) {
-+ return this.byChunk.get(CoordinateUtils.getChunkKey(pos));
-+ }
-+
-+ public ReferenceList<ServerPlayer> getPlayers(final BlockPos pos, final NearbyMapType type) {
-+ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(pos));
-+
-+ return chunk == null ? null : chunk.players[type.ordinal()];
-+ }
-+
-+ public ReferenceList<ServerPlayer> getPlayers(final ChunkPos pos, final NearbyMapType type) {
-+ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(pos));
-+
-+ return chunk == null ? null : chunk.players[type.ordinal()];
-+ }
-+
-+ public ReferenceList<ServerPlayer> getPlayersByChunk(final int chunkX, final int chunkZ, final NearbyMapType type) {
-+ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
-+
-+ return chunk == null ? null : chunk.players[type.ordinal()];
-+ }
-+
-+ public ReferenceList<ServerPlayer> getPlayersByBlock(final int blockX, final int blockZ, final NearbyMapType type) {
-+ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(blockX >> 4, blockZ >> 4));
-+
-+ return chunk == null ? null : chunk.players[type.ordinal()];
-+ }
-+
-+ public static final class TrackedChunk {
-+
-+ public final ReferenceList<ServerPlayer>[] players = new ReferenceList[TOTAL_MAP_TYPES];
-+ private int nonEmptyLists;
-+ private int updateCount;
-+
-+ public boolean isEmpty() {
-+ return this.nonEmptyLists == 0;
-+ }
-+
-+ public int getUpdateCount() {
-+ return this.updateCount;
-+ }
-+
-+ public ReferenceList<ServerPlayer> getPlayers(final NearbyMapType type) {
-+ return this.players[type.ordinal()];
-+ }
-+
-+ public void addPlayer(final ServerPlayer player, final NearbyMapType type) {
-+ ++this.updateCount;
-+ final int idx = type.ordinal();
-+ final ReferenceList<ServerPlayer> list = this.players[idx];
-+ if (list == null) {
-+ ++this.nonEmptyLists;
-+ (this.players[idx] = new ReferenceList<>()).add(player);
-+ return;
-+ }
-+
-+ if (!list.add(player)) {
-+ throw new IllegalStateException("Already contains player " + player);
-+ }
-+ }
-+
-+ public void removePlayer(final ServerPlayer player, final NearbyMapType type) {
-+ ++this.updateCount;
-+ final int idx = type.ordinal();
-+ final ReferenceList<ServerPlayer> list = this.players[idx];
-+ if (list == null) {
-+ throw new IllegalStateException("Does not contain player " + player);
-+ }
-+
-+ if (!list.remove(player)) {
-+ throw new IllegalStateException("Does not contain player " + player);
-+ }
-+
-+ if (list.size() == 0) {
-+ this.players[idx] = null;
-+ --this.nonEmptyLists;
-+ }
-+ }
-+ }
-+
-+ private final class TrackedPlayer extends SingleUserAreaMap<ServerPlayer> {
-+
-+ final NearbyMapType type;
-+
-+ public TrackedPlayer(final ServerPlayer player, final NearbyMapType type) {
-+ super(player);
-+ this.type = type;
-+ }
-+
-+ @Override
-+ protected void addCallback(final ServerPlayer parameter, final int chunkX, final int chunkZ) {
-+ final long chunkKey = CoordinateUtils.getChunkKey(chunkX, chunkZ);
-+
-+ NearbyPlayers.this.byChunk.computeIfAbsent(chunkKey, (final long keyInMap) -> {
-+ return new TrackedChunk();
-+ }).addPlayer(parameter, this.type);
-+ }
-+
-+ @Override
-+ protected void removeCallback(final ServerPlayer parameter, final int chunkX, final int chunkZ) {
-+ final long chunkKey = CoordinateUtils.getChunkKey(chunkX, chunkZ);
-+
-+ final TrackedChunk chunk = NearbyPlayers.this.byChunk.get(chunkKey);
-+ if (chunk == null) {
-+ throw new IllegalStateException("Chunk should exist at " + new ChunkPos(chunkKey));
-+ }
-+
-+ chunk.removePlayer(parameter, this.type);
-+
-+ if (chunk.isEmpty()) {
-+ NearbyPlayers.this.byChunk.remove(chunkKey);
-+ }
-+ }
-+ }
-+}
-diff --git a/src/main/java/io/papermc/paper/util/player/SingleUserAreaMap.java b/src/main/java/io/papermc/paper/util/player/SingleUserAreaMap.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..d603887f4d0464f4463172fd79bcd5298d54983e
---- /dev/null
-+++ b/src/main/java/io/papermc/paper/util/player/SingleUserAreaMap.java
-@@ -0,0 +1,232 @@
-+package io.papermc.paper.util.player;
-+
-+import io.papermc.paper.util.IntegerUtil;
-+
-+public abstract class SingleUserAreaMap<T> {
-+
-+ private static final int NOT_SET = Integer.MIN_VALUE;
-+
-+ private final T parameter;
-+ private int lastChunkX = NOT_SET;
-+ private int lastChunkZ = NOT_SET;
-+ private int distance = NOT_SET;
-+
-+ public SingleUserAreaMap(final T parameter) {
-+ this.parameter = parameter;
-+ }
-+
-+ /* math sign function except 0 returns 1 */
-+ protected static int sign(int val) {
-+ return 1 | (val >> (Integer.SIZE - 1));
-+ }
-+
-+ protected abstract void addCallback(final T parameter, final int chunkX, final int chunkZ);
-+
-+ protected abstract void removeCallback(final T parameter, final int chunkX, final int chunkZ);
-+
-+ private void addToNew(final T parameter, final int chunkX, final int chunkZ, final int distance) {
-+ final int maxX = chunkX + distance;
-+ final int maxZ = chunkZ + distance;
-+
-+ for (int cx = chunkX - distance; cx <= maxX; ++cx) {
-+ for (int cz = chunkZ - distance; cz <= maxZ; ++cz) {
-+ this.addCallback(parameter, cx, cz);
-+ }
-+ }
-+ }
-+
-+ private void removeFromOld(final T parameter, final int chunkX, final int chunkZ, final int distance) {
-+ final int maxX = chunkX + distance;
-+ final int maxZ = chunkZ + distance;
-+
-+ for (int cx = chunkX - distance; cx <= maxX; ++cx) {
-+ for (int cz = chunkZ - distance; cz <= maxZ; ++cz) {
-+ this.removeCallback(parameter, cx, cz);
-+ }
-+ }
-+ }
-+
-+ public final boolean add(final int chunkX, final int chunkZ, final int distance) {
-+ if (distance < 0) {
-+ throw new IllegalArgumentException(Integer.toString(distance));
-+ }
-+ if (this.lastChunkX != NOT_SET) {
-+ return false;
-+ }
-+ this.lastChunkX = chunkX;
-+ this.lastChunkZ = chunkZ;
-+ this.distance = distance;
-+
-+ this.addToNew(this.parameter, chunkX, chunkZ, distance);
-+
-+ return true;
-+ }
-+
-+ public final boolean update(final int toX, final int toZ, final int newViewDistance) {
-+ if (newViewDistance < 0) {
-+ throw new IllegalArgumentException(Integer.toString(newViewDistance));
-+ }
-+ final int fromX = this.lastChunkX;
-+ final int fromZ = this.lastChunkZ;
-+ final int oldViewDistance = this.distance;
-+ if (fromX == NOT_SET) {
-+ return false;
-+ }
-+
-+ this.lastChunkX = toX;
-+ this.lastChunkZ = toZ;
-+ this.distance = newViewDistance;
-+
-+ final T parameter = this.parameter;
-+
-+
-+ final int dx = toX - fromX;
-+ final int dz = toZ - fromZ;
-+
-+ final int totalX = IntegerUtil.branchlessAbs(fromX - toX);
-+ final int totalZ = IntegerUtil.branchlessAbs(fromZ - toZ);
-+
-+ if (Math.max(totalX, totalZ) > (2 * Math.max(newViewDistance, oldViewDistance))) {
-+ // teleported?
-+ this.removeFromOld(parameter, fromX, fromZ, oldViewDistance);
-+ this.addToNew(parameter, toX, toZ, newViewDistance);
-+ return true;
-+ }
-+
-+ if (oldViewDistance != newViewDistance) {
-+ // remove loop
-+
-+ final int oldMinX = fromX - oldViewDistance;
-+ final int oldMinZ = fromZ - oldViewDistance;
-+ final int oldMaxX = fromX + oldViewDistance;
-+ final int oldMaxZ = fromZ + oldViewDistance;
-+ for (int currX = oldMinX; currX <= oldMaxX; ++currX) {
-+ for (int currZ = oldMinZ; currZ <= oldMaxZ; ++currZ) {
-+
-+ // only remove if we're outside the new view distance...
-+ if (Math.max(IntegerUtil.branchlessAbs(currX - toX), IntegerUtil.branchlessAbs(currZ - toZ)) > newViewDistance) {
-+ this.removeCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ // add loop
-+
-+ final int newMinX = toX - newViewDistance;
-+ final int newMinZ = toZ - newViewDistance;
-+ final int newMaxX = toX + newViewDistance;
-+ final int newMaxZ = toZ + newViewDistance;
-+ for (int currX = newMinX; currX <= newMaxX; ++currX) {
-+ for (int currZ = newMinZ; currZ <= newMaxZ; ++currZ) {
-+
-+ // only add if we're outside the old view distance...
-+ if (Math.max(IntegerUtil.branchlessAbs(currX - fromX), IntegerUtil.branchlessAbs(currZ - fromZ)) > oldViewDistance) {
-+ this.addCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ return true;
-+ }
-+
-+ // x axis is width
-+ // z axis is height
-+ // right refers to the x axis of where we moved
-+ // top refers to the z axis of where we moved
-+
-+ // same view distance
-+
-+ // used for relative positioning
-+ final int up = sign(dz); // 1 if dz >= 0, -1 otherwise
-+ final int right = sign(dx); // 1 if dx >= 0, -1 otherwise
-+
-+ // The area excluded by overlapping the two view distance squares creates four rectangles:
-+ // Two on the left, and two on the right. The ones on the left we consider the "removed" section
-+ // and on the right the "added" section.
-+ // https://i.imgur.com/MrnOBgI.png is a reference image. Note that the outside border is not actually
-+ // exclusive to the regions they surround.
-+
-+ // 4 points of the rectangle
-+ int maxX; // exclusive
-+ int minX; // inclusive
-+ int maxZ; // exclusive
-+ int minZ; // inclusive
-+
-+ if (dx != 0) {
-+ // handle right addition
-+
-+ maxX = toX + (oldViewDistance * right) + right; // exclusive
-+ minX = fromX + (oldViewDistance * right) + right; // inclusive
-+ maxZ = fromZ + (oldViewDistance * up) + up; // exclusive
-+ minZ = toZ - (oldViewDistance * up); // inclusive
-+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.addCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ if (dz != 0) {
-+ // handle up addition
-+
-+ maxX = toX + (oldViewDistance * right) + right; // exclusive
-+ minX = toX - (oldViewDistance * right); // inclusive
-+ maxZ = toZ + (oldViewDistance * up) + up; // exclusive
-+ minZ = fromZ + (oldViewDistance * up) + up; // inclusive
-+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.addCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ if (dx != 0) {
-+ // handle left removal
-+
-+ maxX = toX - (oldViewDistance * right); // exclusive
-+ minX = fromX - (oldViewDistance * right); // inclusive
-+ maxZ = fromZ + (oldViewDistance * up) + up; // exclusive
-+ minZ = toZ - (oldViewDistance * up); // inclusive
-+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.removeCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ if (dz != 0) {
-+ // handle down removal
-+
-+ maxX = fromX + (oldViewDistance * right) + right; // exclusive
-+ minX = fromX - (oldViewDistance * right); // inclusive
-+ maxZ = toZ - (oldViewDistance * up); // exclusive
-+ minZ = fromZ - (oldViewDistance * up); // inclusive
-+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.removeCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ return true;
-+ }
-+
-+ public final boolean remove() {
-+ final int chunkX = this.lastChunkX;
-+ final int chunkZ = this.lastChunkZ;
-+ final int distance = this.distance;
-+ if (chunkX == NOT_SET) {
-+ return false;
-+ }
-+
-+ this.lastChunkX = this.lastChunkZ = this.distance = NOT_SET;
-+
-+ this.removeFromOld(this.parameter, chunkX, chunkZ, distance);
-+
-+ return true;
-+ }
-+}
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 5135cd504ec5864a4603c004e748947a7d88d2b4..396f368a7e21a7c7b1630b4e20cdbc452c4b0f84 100644
--- a/src/main/java/net/minecraft/Util.java
@@ -4124,7 +4799,7 @@ index 3e5a85a7ad6149b04622c254fbc2e174896a4128..3f662692ed4846e026a9d48595e7b3b2
+
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 40adb6117b9e0d5f70103113202a07715e403e2a..9eb987f9d86396d6b7e9d4f3834bea3326640ac7 100644
+index 40adb6117b9e0d5f70103113202a07715e403e2a..cef1761cdaf3e456695f2de61f4295fb99361914 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
@@ -4153,17 +4828,16 @@ index 40adb6117b9e0d5f70103113202a07715e403e2a..9eb987f9d86396d6b7e9d4f3834bea33
if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 )
{
long curTime = Util.getMillis();
-@@ -1337,7 +1342,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1337,7 +1342,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.debug("Autosave finished");
SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
}
-
-+ io.papermc.paper.util.CachedLists.reset(); // Paper
this.profiler.push("tallying");
long j = Util.getNanos() - i;
int k = this.tickCount % 100;
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
-index f40a2f348c45a29168ca3d4eef07b5b628060bee..c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029 100644
+index f40a2f348c45a29168ca3d4eef07b5b628060bee..d0866b2c2f729b6c251eaade3758e94de4d05d6d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -37,9 +37,9 @@ public class ChunkHolder extends GenerationChunkHolder {
@@ -4288,7 +4962,7 @@ index f40a2f348c45a29168ca3d4eef07b5b628060bee..c643bb0daa5cd264fd6ebab7acf0a2bd
+ chunkResult.ifSuccess(chunk -> {
+ if (ChunkHolder.this.fullChunkCreateCount == expectCreateCount) {
+ ChunkHolder.this.isFullChunkReady = true;
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkBorder(chunk, this);
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkBorder(chunk, this);
+ }
+ });
+ });
@@ -4299,7 +4973,7 @@ index f40a2f348c45a29168ca3d4eef07b5b628060bee..c643bb0daa5cd264fd6ebab7acf0a2bd
if (flag && !flag1) {
+ // Paper start
+ if (this.isFullChunkReady) {
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkNotBorder(this.fullChunkFuture.join().orElseThrow(IllegalStateException::new), this); // Paper
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkNotBorder(this.fullChunkFuture.join().orElseThrow(IllegalStateException::new), this); // Paper
+ }
+ // Paper end
this.fullChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK);
@@ -4314,7 +4988,7 @@ index f40a2f348c45a29168ca3d4eef07b5b628060bee..c643bb0daa5cd264fd6ebab7acf0a2bd
+ chunkResult.ifSuccess(chunk -> {
+ // note: Here is a very good place to add callbacks to logic waiting on this.
+ ChunkHolder.this.isTickingReady = true;
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkTicking(chunk, this);
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkTicking(chunk, this);
+ });
+ });
+ // Paper end
@@ -4325,7 +4999,7 @@ index f40a2f348c45a29168ca3d4eef07b5b628060bee..c643bb0daa5cd264fd6ebab7acf0a2bd
- this.tickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK);
+ // Paper start
+ if (this.isTickingReady) {
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkNotTicking(this.tickingChunkFuture.join().orElseThrow(IllegalStateException::new), this); // Paper
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkNotTicking(this.tickingChunkFuture.join().orElseThrow(IllegalStateException::new), this); // Paper
+ }
+ // Paper end
+ this.tickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); this.isTickingReady = false; // Paper - cache chunk ticking stage
@@ -4340,7 +5014,7 @@ index f40a2f348c45a29168ca3d4eef07b5b628060bee..c643bb0daa5cd264fd6ebab7acf0a2bd
+ this.entityTickingChunkFuture.thenAccept(chunkResult -> {
+ chunkResult.ifSuccess(chunk -> {
+ ChunkHolder.this.isEntityTickingReady = true;
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkEntityTicking(chunk, this);
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkEntityTicking(chunk, this);
+ });
+ });
+ // Paper end
@@ -4351,7 +5025,7 @@ index f40a2f348c45a29168ca3d4eef07b5b628060bee..c643bb0daa5cd264fd6ebab7acf0a2bd
- this.entityTickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK);
+ // Paper start
+ if (this.isEntityTickingReady) {
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkNotEntityTicking(this.entityTickingChunkFuture.join().orElseThrow(IllegalStateException::new), this);
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkNotEntityTicking(this.entityTickingChunkFuture.join().orElseThrow(IllegalStateException::new), this);
+ }
+ // Paper end
+ this.entityTickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); this.isEntityTickingReady = false; // Paper - cache chunk ticking stage
@@ -4378,62 +5052,27 @@ index f40a2f348c45a29168ca3d4eef07b5b628060bee..c643bb0daa5cd264fd6ebab7acf0a2bd
+ // 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 5b920beb39dad8d392b4e5e12a89880720e41942..d3caadb3e884d7d0468daf5eff9abd6629ac4b49 100644
+index 5b920beb39dad8d392b4e5e12a89880720e41942..6751e403595170b22abf100a27f97251edcb2125 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -170,6 +170,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -170,6 +170,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
};
// CraftBukkit end
-+ // Paper start - distance maps
-+ private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
-+
-+ void addPlayerToDistanceMaps(ServerPlayer player) {
-+ int chunkX = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getX());
-+ int chunkZ = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getZ());
-+ // Note: players need to be explicitly added to distance maps before they can be updated
-+ this.nearbyPlayers.addPlayer(player);
-+ }
-+
-+ void removePlayerFromDistanceMaps(ServerPlayer player) {
-+ int chunkX = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getX());
-+ int chunkZ = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getZ());
-+ // Note: players need to be explicitly added to distance maps before they can be updated
-+ this.nearbyPlayers.removePlayer(player);
-+ }
-+
-+ void updateMaps(ServerPlayer player) {
-+ int chunkX = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getX());
-+ int chunkZ = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getZ());
-+ // Note: players need to be explicitly added to distance maps before they can be updated
-+ this.nearbyPlayers.tickPlayer(player);
-+ }
-+ // Paper end
+ // Paper start
+ public final ChunkHolder getUnloadingChunkHolder(int chunkX, int chunkZ) {
-+ return this.pendingUnloads.get(io.papermc.paper.util.CoordinateUtils.getChunkKey(chunkX, chunkZ));
++ return this.pendingUnloads.get(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkKey(chunkX, chunkZ));
+ }
-+ public final io.papermc.paper.util.player.NearbyPlayers nearbyPlayers;
+ // Paper end
+
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(new RegionStorageInfo(session.getLevelId(), world.dimension(), "chunk"), session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync);
this.visibleChunkMap = this.updatingChunkMap.clone();
-@@ -221,8 +252,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- this.poiManager = new PoiManager(new RegionStorageInfo(session.getLevelId(), world.dimension(), "poi"), path.resolve("poi"), dataFixer, dsync, iregistrycustom, world.getServer(), world);
- this.setServerViewDistance(viewDistance);
+@@ -223,6 +229,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine, this.mainThreadMailbox);
-+ // Paper start
-+ 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 start
+ public int getMobCountNear(final ServerPlayer player, final net.minecraft.world.entity.MobCategory mobCategory) {
+ return -1;
+ }
@@ -4442,24 +5081,24 @@ index 5b920beb39dad8d392b4e5e12a89880720e41942..d3caadb3e884d7d0468daf5eff9abd66
protected ChunkGenerator generator() {
return this.worldGenContext.generator();
}
-@@ -378,9 +423,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -378,9 +390,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
};
stringbuilder.append("Updating:").append(System.lineSeparator());
- this.updatingChunkMap.values().forEach(consumer);
-+ io.papermc.paper.chunk.system.ChunkSystem.getUpdatingChunkHolders(this.level).forEach(consumer); // Paper
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.getUpdatingChunkHolders(this.level).forEach(consumer); // Paper
stringbuilder.append("Visible:").append(System.lineSeparator());
- this.visibleChunkMap.values().forEach(consumer);
-+ io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).forEach(consumer); // Paper
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.level).forEach(consumer); // Paper
CrashReport crashreport = CrashReport.forThrowable(exception, "Chunk loading");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Chunk loading");
-@@ -422,8 +467,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -422,8 +434,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);
+ // Paper start
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderCreate(this.level, holder);
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkHolderCreate(this.level, holder);
+ // Paper end
}
@@ -4469,34 +5108,34 @@ index 5b920beb39dad8d392b4e5e12a89880720e41942..d3caadb3e884d7d0468daf5eff9abd66
this.updatingChunkMap.put(pos, holder);
this.modified = true;
}
-@@ -445,7 +496,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -445,7 +463,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
protected void saveAllChunks(boolean flush) {
if (flush) {
- List<ChunkHolder> list = this.visibleChunkMap.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).toList();
-+ List<ChunkHolder> list = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).toList(); // Paper
++ List<ChunkHolder> list = ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.level).stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).toList(); // Paper
MutableBoolean mutableboolean = new MutableBoolean();
do {
-@@ -468,7 +519,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -468,7 +486,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
});
this.flushWorker();
} else {
- this.visibleChunkMap.values().forEach(this::saveChunkIfNeeded);
-+ io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).forEach(this::saveChunkIfNeeded);
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.level).forEach(this::saveChunkIfNeeded);
}
}
-@@ -487,7 +538,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -487,7 +505,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public boolean hasWork() {
- return this.lightEngine.hasLightWork() || !this.pendingUnloads.isEmpty() || !this.updatingChunkMap.isEmpty() || this.poiManager.hasWork() || !this.toDrop.isEmpty() || !this.unloadQueue.isEmpty() || this.queueSorter.hasWork() || this.distanceManager.hasTickets();
-+ return this.lightEngine.hasLightWork() || !this.pendingUnloads.isEmpty() || io.papermc.paper.chunk.system.ChunkSystem.hasAnyChunkHolders(this.level) || this.poiManager.hasWork() || !this.toDrop.isEmpty() || !this.unloadQueue.isEmpty() || this.queueSorter.hasWork() || this.distanceManager.hasTickets(); // Paper
++ return this.lightEngine.hasLightWork() || !this.pendingUnloads.isEmpty() || ca.spottedleaf.moonrise.common.util.ChunkSystem.hasAnyChunkHolders(this.level) || this.poiManager.hasWork() || !this.toDrop.isEmpty() || !this.unloadQueue.isEmpty() || this.queueSorter.hasWork() || this.distanceManager.hasTickets(); // Paper
}
private void processUnloads(BooleanSupplier shouldKeepTicking) {
-@@ -504,6 +555,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -504,6 +522,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
this.updatingChunkMap.remove(j);
@@ -4504,16 +5143,16 @@ index 5b920beb39dad8d392b4e5e12a89880720e41942..d3caadb3e884d7d0468daf5eff9abd66
this.pendingUnloads.put(j, playerchunk);
this.modified = true;
++i;
-@@ -523,7 +575,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -523,7 +542,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
int l = 0;
- ObjectIterator<ChunkHolder> objectiterator = this.visibleChunkMap.values().iterator();
-+ Iterator<ChunkHolder> objectiterator = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper
++ Iterator<ChunkHolder> objectiterator = ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper
while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) {
if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) {
-@@ -541,7 +593,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -541,7 +560,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else {
ChunkAccess ichunkaccess = holder.getLatestChunk();
@@ -4521,23 +5160,23 @@ index 5b920beb39dad8d392b4e5e12a89880720e41942..d3caadb3e884d7d0468daf5eff9abd66
+ // Paper start
+ boolean removed;
+ if ((removed = this.pendingUnloads.remove(pos, holder)) && ichunkaccess != null) {
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderDelete(this.level, holder);
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkHolderDelete(this.level, holder);
+ // Paper end
LevelChunk chunk;
if (ichunkaccess instanceof LevelChunk) {
-@@ -559,7 +615,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -559,7 +582,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());
- }
+ } else if (removed) { // Paper start
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderDelete(this.level, holder);
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkHolderDelete(this.level, holder);
+ } // Paper end
}
};
-@@ -896,7 +954,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -896,7 +921,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -4546,7 +5185,7 @@ index 5b920beb39dad8d392b4e5e12a89880720e41942..d3caadb3e884d7d0468daf5eff9abd66
int j = Mth.clamp(watchDistance, 2, 32);
if (j != this.serverViewDistance) {
-@@ -913,7 +971,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -913,7 +938,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
@@ -4555,28 +5194,28 @@ index 5b920beb39dad8d392b4e5e12a89880720e41942..d3caadb3e884d7d0468daf5eff9abd66
return Mth.clamp(player.requestedViewDistance(), 2, this.serverViewDistance);
}
-@@ -942,7 +1000,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -942,7 +967,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public int size() {
- return this.visibleChunkMap.size();
-+ return io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolderCount(this.level); // Paper
++ return ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolderCount(this.level); // Paper
}
public DistanceManager getDistanceManager() {
-@@ -950,19 +1008,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -950,19 +975,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected Iterable<ChunkHolder> getChunks() {
- return Iterables.unmodifiableIterable(this.visibleChunkMap.values());
-+ return Iterables.unmodifiableIterable(io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level)); // Paper
++ return Iterables.unmodifiableIterable(ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.level)); // Paper
}
void dumpChunks(Writer writer) throws IOException {
CsvOutput csvwriter = CsvOutput.builder().addColumn("x").addColumn("z").addColumn("level").addColumn("in_memory").addColumn("status").addColumn("full_status").addColumn("accessible_ready").addColumn("ticking_ready").addColumn("entity_ticking_ready").addColumn("ticket").addColumn("spawning").addColumn("block_entity_count").addColumn("ticking_ticket").addColumn("ticking_level").addColumn("block_ticks").addColumn("fluid_ticks").build(writer);
TickingTracker tickingtracker = this.distanceManager.tickingTracker();
- ObjectBidirectionalIterator objectbidirectionaliterator = this.visibleChunkMap.long2ObjectEntrySet().iterator();
-+ Iterator<ChunkHolder> objectbidirectionaliterator = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper
++ Iterator<ChunkHolder> objectbidirectionaliterator = ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper
while (objectbidirectionaliterator.hasNext()) {
- Entry<ChunkHolder> entry = (Entry) objectbidirectionaliterator.next();
@@ -4589,31 +5228,7 @@ index 5b920beb39dad8d392b4e5e12a89880720e41942..d3caadb3e884d7d0468daf5eff9abd66
Optional<ChunkAccess> optional = Optional.ofNullable(playerchunk.getLatestChunk());
Optional<LevelChunk> optional1 = optional.flatMap((ichunkaccess) -> {
return ichunkaccess instanceof LevelChunk ? Optional.of((LevelChunk) ichunkaccess) : Optional.empty();
-@@ -1083,6 +1141,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
-
- player.setChunkTrackingView(ChunkTrackingView.EMPTY);
- this.updateChunkTracking(player);
-+ this.addPlayerToDistanceMaps(player); // Paper - distance maps
- } else {
- SectionPos sectionposition = player.getLastSectionPos();
-
-@@ -1091,6 +1150,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- this.distanceManager.removePlayer(sectionposition, player);
- }
-
-+ this.removePlayerFromDistanceMaps(player); // Paper - distance maps
- this.applyChunkTrackingView(player, ChunkTrackingView.EMPTY);
- }
-
-@@ -1142,6 +1202,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- this.updateChunkTracking(player);
- }
-
-+ this.updateMaps(player); // Paper - distance maps
- }
-
- private void updateChunkTracking(ServerPlayer player) {
-@@ -1385,10 +1446,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1385,10 +1410,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
});
}
@@ -4659,7 +5274,7 @@ index b6cc33943fe7e4667944f3e6f868b3033ea9ca18..27065ffc5473c518acee3a3096b83fac
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 d39268911ed7c4d60ee6a82178be23245aae58c4..e9f53f57c363a32106880ea9aad0ccf5a7342509 100644
+index d39268911ed7c4d60ee6a82178be23245aae58c4..cf94dd9ddcc1eabcf3fd336e70720f4ed3e52175 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -48,6 +48,7 @@ import net.minecraft.world.level.storage.LevelStorageSource;
@@ -4670,20 +5285,18 @@ index d39268911ed7c4d60ee6a82178be23245aae58c4..e9f53f57c363a32106880ea9aad0ccf5
private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
private final DistanceManager distanceManager;
final ServerLevel level;
-@@ -66,6 +67,12 @@ public class ServerChunkCache extends ChunkSource {
+@@ -66,6 +67,10 @@ 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);
+ private final ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable<net.minecraft.world.level.chunk.LevelChunk> fullChunks = new ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable<>();
+ long chunkFutureAwaitCounter;
+ // 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;
-@@ -91,6 +98,54 @@ public class ServerChunkCache extends ChunkSource {
+@@ -91,6 +96,54 @@ public class ServerChunkCache extends ChunkSource {
return chunk.getFullChunkNow() != null;
}
// CraftBukkit end
@@ -4738,7 +5351,7 @@ index d39268911ed7c4d60ee6a82178be23245aae58c4..e9f53f57c363a32106880ea9aad0ccf5
@Override
public ThreadedLevelLightEngine getLightEngine() {
-@@ -286,7 +341,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -286,7 +339,7 @@ public class ServerChunkCache extends ChunkSource {
return this.mainThreadProcessor.pollTask();
}
@@ -4747,7 +5360,7 @@ index d39268911ed7c4d60ee6a82178be23245aae58c4..e9f53f57c363a32106880ea9aad0ccf5
boolean flag = this.distanceManager.runAllUpdates(this.chunkMap);
boolean flag1 = this.chunkMap.promoteChunkMap();
-@@ -299,6 +354,12 @@ public class ServerChunkCache extends ChunkSource {
+@@ -299,6 +352,12 @@ public class ServerChunkCache extends ChunkSource {
}
}
@@ -4761,7 +5374,7 @@ index d39268911ed7c4d60ee6a82178be23245aae58c4..e9f53f57c363a32106880ea9aad0ccf5
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 9d11fcb3df12182ae00ce73f7e30091fd199a341..eea8bafd98e3a8d82b3216488537ab898cc4ae7a 100644
+index 9d11fcb3df12182ae00ce73f7e30091fd199a341..4c39d9e0466240b5cd459ee649a22fe3a72bf9f0 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -236,6 +236,98 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -4852,7 +5465,7 @@ index 9d11fcb3df12182ae00ce73f7e30091fd199a341..eea8bafd98e3a8d82b3216488537ab89
+
+ for (int cx = minChunkX; cx <= maxChunkX; ++cx) {
+ for (int cz = minChunkZ; cz <= maxChunkZ; ++cz) {
-+ io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.scheduleChunkLoad(
+ this, cx, cz, net.minecraft.world.level.chunk.status.ChunkStatus.FULL, true, priority, consumer
+ );
+ }
@@ -4864,27 +5477,17 @@ index 9d11fcb3df12182ae00ce73f7e30091fd199a341..eea8bafd98e3a8d82b3216488537ab89
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index defe0b30964613cbae5195485aafff21d73ff18e..684dfbcdd4d000ac918c0f77a60c9abf9b30d3a4 100644
+index defe0b30964613cbae5195485aafff21d73ff18e..8d535d96252068fd2a1608600ce29d5d16690fec 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -280,6 +280,8 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -280,6 +280,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
public boolean sentListPacket = false;
public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent
// CraftBukkit end
+ public boolean isRealPlayer; // Paper
-+ public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
-@@ -349,6 +351,8 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
- this.updateOptions(clientOptions);
- this.object = null;
-
-+ this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
-+
- // CraftBukkit start
- this.displayName = this.getScoreboardName();
- this.bukkitPickUpLoot = true;
diff --git a/src/main/java/net/minecraft/server/level/TicketType.java b/src/main/java/net/minecraft/server/level/TicketType.java
index 045b754b5b70bbd1e7732ad2142dfadd6cc2305c..f56e5c0f53f9b52a9247b9be9265b949494fc924 100644
--- a/src/main/java/net/minecraft/server/level/TicketType.java
@@ -5517,7 +6120,7 @@ index ae16b014abd52ee10d523fb003cce166b846b222..7f302405a88766c2112539d24d3dd2e5
public BlockState getBlockState(BlockPos pos) {
int i = pos.getY();
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
-index 34933c5324126f9afdc5cba9dea997ace8f01806..219062cff8a05c765b092f1525043d9d9a1153ae 100644
+index 34933c5324126f9afdc5cba9dea997ace8f01806..1cfc906317f07a44f06a4adf021c44e34a2f1d07 100644
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
@@ -91,6 +91,18 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@@ -5529,8 +6132,8 @@ index 34933c5324126f9afdc5cba9dea997ace8f01806..219062cff8a05c765b092f1525043d9d
+ // I don't want to know why this is a generic type.
+ Entity entityCasted = (Entity)entity;
+ boolean wasRemoved = entityCasted.isRemoved();
-+ io.papermc.paper.chunk.system.ChunkSystem.onEntityPreAdd((net.minecraft.server.level.ServerLevel) entityCasted.level(), entityCasted);
-+ if (!wasRemoved && entityCasted.isRemoved()) {
++ boolean screened = ca.spottedleaf.moonrise.common.util.ChunkSystem.screenEntity((net.minecraft.server.level.ServerLevel)entityCasted.level(), entityCasted);
++ if ((!wasRemoved && entityCasted.isRemoved()) || !screened) {
+ // removed by callback
+ return false;
+ }
@@ -5554,7 +6157,7 @@ index fe0f57dbeecc4b5a0c81863f33e41d11eb60943a..9babfd8e6c847ea26863be6243f17fc2
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 508419378c88ba8688edbd5142d9d8ba52396507..a59eebb89d11788b999d1e5cb4fd2f4e55e023ab 100644
+index 508419378c88ba8688edbd5142d9d8ba52396507..69c62699e3412f2730e3db65f196099d77698980 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -252,8 +252,8 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -5563,7 +6166,7 @@ index 508419378c88ba8688edbd5142d9d8ba52396507..a59eebb89d11788b999d1e5cb4fd2f4e
public Chunk[] getLoadedChunks() {
- Long2ObjectLinkedOpenHashMap<ChunkHolder> chunks = this.world.getChunkSource().chunkMap.visibleChunkMap;
- return chunks.values().stream().map(ChunkHolder::getFullChunkNow).filter(Objects::nonNull).map(CraftChunk::new).toArray(Chunk[]::new);
-+ List<ChunkHolder> chunks = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.world); // Paper
++ List<ChunkHolder> chunks = ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.world); // Paper
+ return chunks.stream().map(ChunkHolder::getFullChunkNow).filter(Objects::nonNull).map(CraftChunk::new).toArray(Chunk[]::new);
}
@@ -5599,7 +6202,7 @@ index 508419378c88ba8688edbd5142d9d8ba52396507..a59eebb89d11788b999d1e5cb4fd2f4e
+
+ java.util.concurrent.CompletableFuture<Chunk> ret = new java.util.concurrent.CompletableFuture<>();
+
-+ io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> {
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> {
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> {
+ net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk)c;
+ ret.complete(chunk == null ? null : new CraftChunk(chunk));
@@ -5634,7 +6237,7 @@ index 508419378c88ba8688edbd5142d9d8ba52396507..a59eebb89d11788b999d1e5cb4fd2f4e
+ // 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 e130d0aa64d0caaa7760d8de4b1f989523f9de20..45108559bb2e4ae9d33aed5d92b72cbe5c17f553 100644
+index e130d0aa64d0caaa7760d8de4b1f989523f9de20..9ca244b69995552df63fb5d4e3d6961b585bcc47 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2420,4 +2420,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -5644,7 +6247,7 @@ index e130d0aa64d0caaa7760d8de4b1f989523f9de20..45108559bb2e4ae9d33aed5d92b72cbe
+
+ @Override
+ public int getViewDistance() {
-+ return io.papermc.paper.chunk.system.ChunkSystem.getLoadViewDistance(this.getHandle());
++ return ca.spottedleaf.moonrise.common.util.ChunkSystem.getLoadViewDistance(this.getHandle()) - 1;
+ }
+
+ @Override
@@ -5654,7 +6257,7 @@ index e130d0aa64d0caaa7760d8de4b1f989523f9de20..45108559bb2e4ae9d33aed5d92b72cbe
+
+ @Override
+ public int getSimulationDistance() {
-+ return io.papermc.paper.chunk.system.ChunkSystem.getTickViewDistance(this.getHandle());
++ return ca.spottedleaf.moonrise.common.util.ChunkSystem.getTickViewDistance(this.getHandle());
+ }
+
+ @Override
@@ -5664,7 +6267,7 @@ index e130d0aa64d0caaa7760d8de4b1f989523f9de20..45108559bb2e4ae9d33aed5d92b72cbe
+
+ @Override
+ public int getSendViewDistance() {
-+ return io.papermc.paper.chunk.system.ChunkSystem.getSendViewDistance(this.getHandle());
++ return ca.spottedleaf.moonrise.common.util.ChunkSystem.getSendViewDistance(this.getHandle());
+ }
+
+ @Override
diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch
index fff8643fbd..d636c142bd 100644
--- a/patches/server/0010-Adventure.patch
+++ b/patches/server/0010-Adventure.patch
@@ -2606,7 +2606,7 @@ index bb97fdb9aa6167083442a928276ebe4225a586ef..5d1758086ed4fce5b36a5b31df44ccea
@Override
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 9eb987f9d86396d6b7e9d4f3834bea3326640ac7..25d6be308be03815301cfbefdc4199c898f7b9c0 100644
+index cef1761cdaf3e456695f2de61f4295fb99361914..e0b2d474e8d6f2d573d2c1f63e68ba931ecf4eb6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -201,6 +201,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot
@@ -2627,7 +2627,7 @@ index 9eb987f9d86396d6b7e9d4f3834bea3326640ac7..25d6be308be03815301cfbefdc4199c8
private int playerIdleTimeout;
private final long[] tickTimesNanos;
private long aggregatedTickTimesNanos;
-@@ -1397,7 +1397,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1396,7 +1396,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private ServerStatus buildServerStatus() {
ServerStatus.Players serverping_serverpingplayersample = this.buildPlayerStatus();
@@ -2636,7 +2636,7 @@ index 9eb987f9d86396d6b7e9d4f3834bea3326640ac7..25d6be308be03815301cfbefdc4199c8
}
private ServerStatus.Players buildPlayerStatus() {
-@@ -1429,6 +1429,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1428,6 +1428,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
SpigotTimings.schedulerTimer.startTiming(); // Spigot
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
SpigotTimings.schedulerTimer.stopTiming(); // Spigot
@@ -2644,7 +2644,7 @@ index 9eb987f9d86396d6b7e9d4f3834bea3326640ac7..25d6be308be03815301cfbefdc4199c8
this.profiler.push("commandFunctions");
SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot
this.getFunctions().tick();
-@@ -1800,10 +1801,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1799,10 +1800,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override
public String getMotd() {
@@ -2666,7 +2666,7 @@ index 9eb987f9d86396d6b7e9d4f3834bea3326640ac7..25d6be308be03815301cfbefdc4199c8
this.motd = motd;
}
-@@ -2565,23 +2576,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2564,23 +2575,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) {
@@ -2699,7 +2699,7 @@ index 9eb987f9d86396d6b7e9d4f3834bea3326640ac7..25d6be308be03815301cfbefdc4199c8
public boolean logIPs() {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 684dfbcdd4d000ac918c0f77a60c9abf9b30d3a4..200993e8c482442a2c7ae4d9551d04708178bb24 100644
+index 8d535d96252068fd2a1608600ce29d5d16690fec..a2833b879b7613856706223f6b6e1ceae760f3b3 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -171,6 +171,7 @@ import net.minecraft.world.item.trading.MerchantOffers;
@@ -2726,7 +2726,7 @@ index 684dfbcdd4d000ac918c0f77a60c9abf9b30d3a4..200993e8c482442a2c7ae4d9551d0470
public Component listName;
public org.bukkit.Location compassTarget;
public int newExp = 0;
-@@ -355,6 +358,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -352,6 +355,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
// CraftBukkit start
this.displayName = this.getScoreboardName();
@@ -2734,7 +2734,7 @@ index 684dfbcdd4d000ac918c0f77a60c9abf9b30d3a4..200993e8c482442a2c7ae4d9551d0470
this.bukkitPickUpLoot = true;
this.maxHealthCache = this.getMaxHealth();
}
-@@ -912,22 +916,17 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -909,22 +913,17 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
String deathmessage = defaultMessage.getString();
this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel
@@ -2761,7 +2761,7 @@ index 684dfbcdd4d000ac918c0f77a60c9abf9b30d3a4..200993e8c482442a2c7ae4d9551d0470
this.connection.send(new ClientboundPlayerCombatKillPacket(this.getId(), ichatbasecomponent), PacketSendListener.exceptionallySend(() -> {
boolean flag1 = true;
-@@ -2027,8 +2026,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2024,8 +2023,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
public void sendChatMessage(OutgoingChatMessage message, boolean filterMaskEnabled, ChatType.Bound params) {
@@ -2776,7 +2776,7 @@ index 684dfbcdd4d000ac918c0f77a60c9abf9b30d3a4..200993e8c482442a2c7ae4d9551d0470
}
}
-@@ -2055,6 +2059,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2052,6 +2056,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
// CraftBukkit end
this.language = clientOptions.language();
@@ -3553,7 +3553,7 @@ index cbdb1a56a97150c164515a4ce6d3ba06428bf321..b214e7b302abbfe1641485a05f1371ac
public URI getUrl() {
return this.handle.link();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index a59eebb89d11788b999d1e5cb4fd2f4e55e023ab..1e8d93d81b7a391bbd1e9926ff35a68d4c563f0f 100644
+index 69c62699e3412f2730e3db65f196099d77698980..4878a1b085a83dd4a8ffdc86250b8fb4fbac5192 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -162,6 +162,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -4147,7 +4147,7 @@ index 55945b83a5426b352bad9507cc9e94afb1278032..9ea1537408ff2d790747b6e5a681d917
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 45108559bb2e4ae9d33aed5d92b72cbe5c17f553..859f3eb2d616156b0efaa70ee03e357e6f0760f3 100644
+index 834b2a3ab2cccbd50686a1a0ca999685638b2a95..2b6912514ab39c26338c6ac580a8d1f33f3df61f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -388,14 +388,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch
index 35237b2e07..2b8cd780b7 100644
--- a/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch
+++ b/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch
@@ -260,7 +260,7 @@ index 8323f135d6bf2e1f12525e05094ffa3f2420e7e1..a143ea1e58464a3122fbd8ccafe417bd
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 25d6be308be03815301cfbefdc4199c898f7b9c0..b67cb9b027c33494f0ed3c6c6ac354a5c79fbf47 100644
+index e0b2d474e8d6f2d573d2c1f63e68ba931ecf4eb6..91800791427e9362baf68ca3cffda5bfa58de2b8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -154,7 +154,7 @@ import com.mojang.serialization.Dynamic;
@@ -308,7 +308,7 @@ index 25d6be308be03815301cfbefdc4199c898f7b9c0..b67cb9b027c33494f0ed3c6c6ac354a5
} catch (Exception ignored) {
}
// CraftBukkit end
-@@ -1659,7 +1662,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1658,7 +1661,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override
public void sendSystemMessage(Component message) {
@@ -423,7 +423,7 @@ index 0e3ff653211b0210f8679b475d5f62eecbdfd946..7eb94216cc556ad4c6c76ffab0ca8186
@Override
public PluginCommand getPluginCommand(String name) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 985b77911d03bc60a0210b796e901f31e2676268..9de87edb75947382fda114df883fb4b31c1a7141 100644
+index 0736cf0b5ea327e73a457b55c9c0c4bb82d4c6e9..3a198718cd4b0d87398f0a54275aad1f419be8b3 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -13,7 +13,6 @@ import java.util.logging.Logger;
diff --git a/patches/server/0023-Timings-v2.patch b/patches/server/0023-Timings-v2.patch
index 5b034492d8..d69eca330f 100644
--- a/patches/server/0023-Timings-v2.patch
+++ b/patches/server/0023-Timings-v2.patch
@@ -714,7 +714,7 @@ index f7197f1347251a37dd0f6d9ffa2f09bc3a4e1233..d0d36a57ec4896bcb74970f8fb24d8f3
} catch (Exception exception) {
if (exception instanceof ReportedException) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index cde2e181bf1aaf92f1e96b00e03b7b001a06e6b3..a720743149f9d1f90eda3b7b928b9d25d8c8f553 100644
+index 5a4cdbc4b92a48c614564e4e421f05a9eb5b072b..d76dae9ce9022308b316080ac48b7030d674cc6b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -196,7 +196,7 @@ import org.bukkit.craftbukkit.Main;
@@ -787,7 +787,7 @@ index cde2e181bf1aaf92f1e96b00e03b7b001a06e6b3..a720743149f9d1f90eda3b7b928b9d25
++this.tickCount;
this.tickRateManager.tick();
this.tickChildren(shouldKeepTicking);
-@@ -1339,15 +1360,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1339,14 +1360,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.autosavePeriod > 0 && this.ticksUntilAutosave <= 0) {
this.ticksUntilAutosave = this.autosavePeriod;
// CraftBukkit end
@@ -799,7 +799,6 @@ index cde2e181bf1aaf92f1e96b00e03b7b001a06e6b3..a720743149f9d1f90eda3b7b928b9d25
MinecraftServer.LOGGER.debug("Autosave finished");
- SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
}
- io.papermc.paper.util.CachedLists.reset(); // Paper
+ // Paper start - move executeAll() into full server tick timing
+ try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
+ this.runAllTasks();
@@ -808,7 +807,7 @@ index cde2e181bf1aaf92f1e96b00e03b7b001a06e6b3..a720743149f9d1f90eda3b7b928b9d25
this.profiler.push("tallying");
long j = Util.getNanos() - i;
int k = this.tickCount % 100;
-@@ -1359,8 +1383,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1358,8 +1382,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.logTickMethodTime(i);
this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -818,7 +817,7 @@ index cde2e181bf1aaf92f1e96b00e03b7b001a06e6b3..a720743149f9d1f90eda3b7b928b9d25
}
private void logTickMethodTime(long tickStartTime) {
-@@ -1431,26 +1454,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1430,26 +1453,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
entityplayer.connection.suspendFlushing();
});
@@ -852,7 +851,7 @@ index cde2e181bf1aaf92f1e96b00e03b7b001a06e6b3..a720743149f9d1f90eda3b7b928b9d25
// Send time updates to everyone, it will get the right time from the world the player is in.
if (this.tickCount % 20 == 0) {
for (int i = 0; i < this.getPlayerList().players.size(); ++i) {
-@@ -1458,7 +1481,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1457,7 +1480,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level().getGameTime(), entityplayer.getPlayerTime(), entityplayer.level().getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time
}
}
@@ -861,7 +860,7 @@ index cde2e181bf1aaf92f1e96b00e03b7b001a06e6b3..a720743149f9d1f90eda3b7b928b9d25
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
-@@ -1494,24 +1517,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1493,24 +1516,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
this.profiler.popPush("connection");
@@ -978,7 +977,7 @@ index d38ecbc208c34509eaf77751ac45d9ef51a5dce8..b51c3f8c485496734ea58c15377a1215
// 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 d3caadb3e884d7d0468daf5eff9abd6629ac4b49..a7de9d6bbbd0b3d60b1d49e116c388b1846f33e4 100644
+index 6751e403595170b22abf100a27f97251edcb2125..93bd3c633f83c96a7028a97eee3a732489d01b06 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 @@
@@ -992,7 +991,7 @@ index d3caadb3e884d7d0468daf5eff9abd6629ac4b49..a7de9d6bbbd0b3d60b1d49e116c388b1
import com.google.common.collect.Lists;
import com.google.common.collect.Queues;
import com.google.common.collect.Sets;
-@@ -1336,6 +1338,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1300,6 +1302,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();
@@ -1000,7 +999,7 @@ index d3caadb3e884d7d0468daf5eff9abd6629ac4b49..a7de9d6bbbd0b3d60b1d49e116c388b1
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
-@@ -1360,14 +1363,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1324,14 +1327,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker.serverEntity.sendChanges();
}
}
@@ -1019,10 +1018,10 @@ index d3caadb3e884d7d0468daf5eff9abd6629ac4b49..a7de9d6bbbd0b3d60b1d49e116c388b1
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index e9f53f57c363a32106880ea9aad0ccf5a7342509..0ff45d4ce6ae0b7feac53c7a9f361f6454f8b7c3 100644
+index cf94dd9ddcc1eabcf3fd336e70720f4ed3e52175..e0c8b89767087cba34fc3c3809db4c386dacb193 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -197,13 +197,15 @@ public class ServerChunkCache extends ChunkSource {
+@@ -195,13 +195,15 @@ public class ServerChunkCache extends ChunkSource {
}
gameprofilerfiller.incrementCounter("getChunkCacheMiss");
@@ -1040,7 +1039,7 @@ index e9f53f57c363a32106880ea9aad0ccf5a7342509..0ff45d4ce6ae0b7feac53c7a9f361f64
ChunkResult<ChunkAccess> chunkresult = (ChunkResult) completablefuture.join();
ChunkAccess ichunkaccess1 = (ChunkAccess) chunkresult.orElse(null); // CraftBukkit - decompile error
-@@ -368,7 +370,9 @@ public class ServerChunkCache extends ChunkSource {
+@@ -366,7 +368,9 @@ public class ServerChunkCache extends ChunkSource {
public void save(boolean flush) {
this.runDistanceManagerUpdates();
@@ -1050,7 +1049,7 @@ index e9f53f57c363a32106880ea9aad0ccf5a7342509..0ff45d4ce6ae0b7feac53c7a9f361f64
}
@Override
-@@ -410,10 +414,10 @@ public class ServerChunkCache extends ChunkSource {
+@@ -408,10 +412,10 @@ public class ServerChunkCache extends ChunkSource {
this.level.timings.doChunkMap.stopTiming(); // Spigot
this.level.getProfiler().popPush("chunks");
if (tickChunks) {
@@ -1063,7 +1062,7 @@ index e9f53f57c363a32106880ea9aad0ccf5a7342509..0ff45d4ce6ae0b7feac53c7a9f361f64
}
this.level.timings.doChunkUnload.startTiming(); // Spigot
-@@ -436,6 +440,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -434,6 +438,7 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.push("filteringLoadedChunks");
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
Iterator iterator = this.chunkMap.getChunks().iterator();
@@ -1071,7 +1070,7 @@ index e9f53f57c363a32106880ea9aad0ccf5a7342509..0ff45d4ce6ae0b7feac53c7a9f361f64
while (iterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
-@@ -448,8 +453,10 @@ public class ServerChunkCache extends ChunkSource {
+@@ -446,8 +451,10 @@ public class ServerChunkCache extends ChunkSource {
if (this.level.tickRateManager().runsNormally()) {
gameprofilerfiller.popPush("naturalSpawnCount");
@@ -1082,7 +1081,7 @@ index e9f53f57c363a32106880ea9aad0ccf5a7342509..0ff45d4ce6ae0b7feac53c7a9f361f64
this.lastSpawnState = spawnercreature_d;
gameprofilerfiller.popPush("spawnAndTick");
-@@ -472,22 +479,25 @@ public class ServerChunkCache extends ChunkSource {
+@@ -470,22 +477,25 @@ public class ServerChunkCache extends ChunkSource {
}
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
@@ -1111,7 +1110,7 @@ index e9f53f57c363a32106880ea9aad0ccf5a7342509..0ff45d4ce6ae0b7feac53c7a9f361f64
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 eea8bafd98e3a8d82b3216488537ab898cc4ae7a..9675d91e4e7ed46147c3f7a11dd65122fe998dc2 100644
+index 4c39d9e0466240b5cd459ee649a22fe3a72bf9f0..eb98bb1bd76869fd76b34885223c8e57a04e0c51 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 @@
@@ -1805,7 +1804,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 859f3eb2d616156b0efaa70ee03e357e6f0760f3..a02e5c967d9dfcd507e1019d28ed3735945f9613 100644
+index 2b6912514ab39c26338c6ac580a8d1f33f3df61f..eb633256f353ddaee5098d11f0e5f50d7e5a26cd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2782,6 +2782,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0024-Add-TickThread.patch b/patches/server/0024-Add-TickThread.patch
deleted file mode 100644
index bf8c922243..0000000000
--- a/patches/server/0024-Add-TickThread.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Spottedleaf <[email protected]>
-Date: Sun, 3 Mar 2019 20:53:18 -0800
-Subject: [PATCH] Add TickThread
-
-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..73e83d56a340f0c7dcb8ff737d621003e72c6de4
---- /dev/null
-+++ b/src/main/java/io/papermc/paper/util/TickThread.java
-@@ -0,0 +1,83 @@
-+package io.papermc.paper.util;
-+
-+import net.minecraft.server.MinecraftServer;
-+import net.minecraft.server.level.ServerLevel;
-+import net.minecraft.world.entity.Entity;
-+import org.bukkit.Bukkit;
-+import java.util.concurrent.atomic.AtomicInteger;
-+
-+public final class TickThread extends Thread {
-+
-+ public static final boolean STRICT_THREAD_CHECKS = Boolean.getBoolean("paper.strict-thread-checks");
-+
-+ static {
-+ if (STRICT_THREAD_CHECKS) {
-+ MinecraftServer.LOGGER.warn("Strict thread checks enabled - performance may suffer");
-+ }
-+ }
-+
-+ public static void softEnsureTickThread(final String reason) {
-+ if (!STRICT_THREAD_CHECKS) {
-+ return;
-+ }
-+ ensureTickThread(reason);
-+ }
-+
-+ public static void ensureTickThread(final String reason) {
-+ if (!isTickThread()) {
-+ MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
-+ throw new IllegalStateException(reason);
-+ }
-+ }
-+
-+ public static void ensureTickThread(final ServerLevel world, final int chunkX, final int chunkZ, final String reason) {
-+ if (!isTickThreadFor(world, chunkX, chunkZ)) {
-+ MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
-+ throw new IllegalStateException(reason);
-+ }
-+ }
-+
-+ public static void ensureTickThread(final Entity entity, final String reason) {
-+ if (!isTickThreadFor(entity)) {
-+ MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
-+ throw new IllegalStateException(reason);
-+ }
-+ }
-+
-+ 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();
-+
-+ public TickThread(final String name) {
-+ this(null, name);
-+ }
-+
-+ public TickThread(final Runnable run, final String name) {
-+ this(run, name, ID_GENERATOR.incrementAndGet());
-+ }
-+
-+ private TickThread(final Runnable run, final String name, final int id) {
-+ super(run, name);
-+ this.id = id;
-+ }
-+
-+ public static TickThread getCurrentTickThread() {
-+ return (TickThread) Thread.currentThread();
-+ }
-+
-+ public static boolean isTickThread() {
-+ return Bukkit.isPrimaryThread();
-+ }
-+
-+ public static boolean isTickThreadFor(final ServerLevel world, final int chunkX, final int chunkZ) {
-+ 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 isTickThread();
-+ }
-+}
-diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java
-index bbf0d9d9c44fe8d7add2f978994ec129420814c7..78669fa035b7537ff7e533cf32aaf2995625424f 100644
---- a/src/main/java/org/spigotmc/AsyncCatcher.java
-+++ b/src/main/java/org/spigotmc/AsyncCatcher.java
-@@ -9,7 +9,7 @@ public class AsyncCatcher
-
- public static void catchOp(String reason)
- {
-- if ( AsyncCatcher.enabled && Thread.currentThread() != MinecraftServer.getServer().serverThread )
-+ if ( (AsyncCatcher.enabled || io.papermc.paper.util.TickThread.STRICT_THREAD_CHECKS) && Thread.currentThread() != MinecraftServer.getServer().serverThread ) // Paper
- {
- throw new IllegalStateException( "Asynchronous " + reason + "!" );
- }
diff --git a/patches/server/0025-Further-improve-server-tick-loop.patch b/patches/server/0024-Further-improve-server-tick-loop.patch
index 0fc8d093bf..5b2ddf7282 100644
--- a/patches/server/0025-Further-improve-server-tick-loop.patch
+++ b/patches/server/0024-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 a720743149f9d1f90eda3b7b928b9d25d8c8f553..c09f3dc29c86fef9edfe7831776a77fc73e52210 100644
+index d76dae9ce9022308b316080ac48b7030d674cc6b..e9d56d75b7c648f04d3a56942b2866090c570129 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/0026-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0025-Add-command-line-option-to-load-extra-plugin-jars-no.patch
index 0f009842b0..4dd76e3e71 100644
--- a/patches/server/0026-Add-command-line-option-to-load-extra-plugin-jars-no.patch
+++ b/patches/server/0025-Add-command-line-option-to-load-extra-plugin-jars-no.patch
@@ -47,7 +47,7 @@ index 1cb6c21741408ff4628864b52341965dfbfa5711..a2f784b28c0d974ee45d61d6a3a0096d
if (type == PluginLoadOrder.STARTUP) {
this.helpMap.clear();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 9de87edb75947382fda114df883fb4b31c1a7141..bc664b090e16ed27ba795c204dc5639679e6eee8 100644
+index 3a198718cd4b0d87398f0a54275aad1f419be8b3..bd21da04390e486731a260f8fb0c70921320198e 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -160,6 +160,12 @@ public class Main {
diff --git a/patches/server/0027-Support-components-in-ItemMeta.patch b/patches/server/0026-Support-components-in-ItemMeta.patch
index 4d78040952..beae574f9a 100644
--- a/patches/server/0027-Support-components-in-ItemMeta.patch
+++ b/patches/server/0026-Support-components-in-ItemMeta.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Support components in ItemMeta
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index 9ecbdd50aa2eb7851ce1716946fa31e5db8765b4..f13c703a0acafec7e6772f83ae4f5fda988cd15f 100644
+index 86a5e4f7b2a0d50d0a58d88e10a277cfbd09bf9d..46e1fabf85cc0d92f79a7adf24e5724dc1dc08a9 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -969,11 +969,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
diff --git a/patches/server/0028-Configurable-cactus-bamboo-and-reed-growth-height.patch b/patches/server/0027-Configurable-cactus-bamboo-and-reed-growth-height.patch
index d25f48a93d..d25f48a93d 100644
--- a/patches/server/0028-Configurable-cactus-bamboo-and-reed-growth-height.patch
+++ b/patches/server/0027-Configurable-cactus-bamboo-and-reed-growth-height.patch
diff --git a/patches/server/0029-Configurable-baby-zombie-movement-speed.patch b/patches/server/0028-Configurable-baby-zombie-movement-speed.patch
index a55a0a3944..a55a0a3944 100644
--- a/patches/server/0029-Configurable-baby-zombie-movement-speed.patch
+++ b/patches/server/0028-Configurable-baby-zombie-movement-speed.patch
diff --git a/patches/server/0030-Configurable-fishing-time-ranges.patch b/patches/server/0029-Configurable-fishing-time-ranges.patch
index 90d886761f..90d886761f 100644
--- a/patches/server/0030-Configurable-fishing-time-ranges.patch
+++ b/patches/server/0029-Configurable-fishing-time-ranges.patch
diff --git a/patches/server/0031-Allow-nerfed-mobs-to-jump.patch b/patches/server/0030-Allow-nerfed-mobs-to-jump.patch
index 1c95173e39..1c95173e39 100644
--- a/patches/server/0031-Allow-nerfed-mobs-to-jump.patch
+++ b/patches/server/0030-Allow-nerfed-mobs-to-jump.patch
diff --git a/patches/server/0032-Add-configurable-entity-despawn-distances.patch b/patches/server/0031-Add-configurable-entity-despawn-distances.patch
index 348a1c4e40..348a1c4e40 100644
--- a/patches/server/0032-Add-configurable-entity-despawn-distances.patch
+++ b/patches/server/0031-Add-configurable-entity-despawn-distances.patch
diff --git a/patches/server/0033-Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/0032-Drop-falling-block-and-tnt-entities-at-the-specified.patch
index ce9c290891..ce9c290891 100644
--- a/patches/server/0033-Drop-falling-block-and-tnt-entities-at-the-specified.patch
+++ b/patches/server/0032-Drop-falling-block-and-tnt-entities-at-the-specified.patch
diff --git a/patches/server/0034-Expose-server-build-information.patch b/patches/server/0033-Expose-server-build-information.patch
index 985fec1d8b..a6ae932964 100644
--- a/patches/server/0034-Expose-server-build-information.patch
+++ b/patches/server/0033-Expose-server-build-information.patch
@@ -472,7 +472,7 @@ index 0000000000000000000000000000000000000000..790bad0494454ca12ee152e3de6da3da
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index c09f3dc29c86fef9edfe7831776a77fc73e52210..6f5b04a59fa1173bfdea2c59a9c13ca3710abb0c 100644
+index e9d56d75b7c648f04d3a56942b2866090c570129..57ec168bac3727feb734e28cebc680328c1c4aec 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -43,7 +43,6 @@ import java.util.Set;
@@ -492,7 +492,7 @@ index c09f3dc29c86fef9edfe7831776a77fc73e52210..6f5b04a59fa1173bfdea2c59a9c13ca3
import org.bukkit.event.server.ServerLoadEvent;
// CraftBukkit end
-@@ -1703,7 +1700,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1702,7 +1699,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {
diff --git a/patches/server/0035-Player-affects-spawning-API.patch b/patches/server/0034-Player-affects-spawning-API.patch
index 2658310aaf..10b2ecdde8 100644
--- a/patches/server/0035-Player-affects-spawning-API.patch
+++ b/patches/server/0034-Player-affects-spawning-API.patch
@@ -135,7 +135,7 @@ index f38f62e777d88a783e1e3b7e1a48da921cc67cf4..77ae7882a08441d9a80b50492be5e484
for (Player player : this.players()) {
if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index a02e5c967d9dfcd507e1019d28ed3735945f9613..69b4e27c6939f5a20276922714601b02d2832517 100644
+index eb633256f353ddaee5098d11f0e5f50d7e5a26cd..4cc6b3162cea049134f194ed84a7552830cb85af 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2425,6 +2425,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0036-Only-refresh-abilities-if-needed.patch b/patches/server/0035-Only-refresh-abilities-if-needed.patch
index 4408550aa7..3af5f88628 100644
--- a/patches/server/0036-Only-refresh-abilities-if-needed.patch
+++ b/patches/server/0035-Only-refresh-abilities-if-needed.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Only refresh abilities if needed
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 69b4e27c6939f5a20276922714601b02d2832517..54ccf79ce6a9ca6c7ad63adb8b1bc32c1b373800 100644
+index 4cc6b3162cea049134f194ed84a7552830cb85af..c2be21491183f5f113dbfc71a7e0ccd195679296 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2093,12 +2093,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0037-Entity-Origin-API.patch b/patches/server/0036-Entity-Origin-API.patch
index 794f99dd69..eaf335d0d3 100644
--- a/patches/server/0037-Entity-Origin-API.patch
+++ b/patches/server/0036-Entity-Origin-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 9675d91e4e7ed46147c3f7a11dd65122fe998dc2..711318ddc706e72dbd8cea1c541058c881086f21 100644
+index eb98bb1bd76869fd76b34885223c8e57a04e0c51..754045e71f180862fa57fd1c97e5d7deb1d788e6 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2141,6 +2141,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0038-Prevent-block-entity-and-entity-crashes.patch b/patches/server/0037-Prevent-block-entity-and-entity-crashes.patch
index 8c0b53d52b..8c0b53d52b 100644
--- a/patches/server/0038-Prevent-block-entity-and-entity-crashes.patch
+++ b/patches/server/0037-Prevent-block-entity-and-entity-crashes.patch
diff --git a/patches/server/0039-Configurable-top-of-nether-void-damage.patch b/patches/server/0038-Configurable-top-of-nether-void-damage.patch
index 8a30b0f3c3..8a30b0f3c3 100644
--- a/patches/server/0039-Configurable-top-of-nether-void-damage.patch
+++ b/patches/server/0038-Configurable-top-of-nether-void-damage.patch
diff --git a/patches/server/0040-Check-online-mode-before-converting-and-renaming-pla.patch b/patches/server/0039-Check-online-mode-before-converting-and-renaming-pla.patch
index f89cf885a5..f89cf885a5 100644
--- a/patches/server/0040-Check-online-mode-before-converting-and-renaming-pla.patch
+++ b/patches/server/0039-Check-online-mode-before-converting-and-renaming-pla.patch
diff --git a/patches/server/0041-Add-more-entities-to-activation-range-ignore-list.patch b/patches/server/0040-Add-more-entities-to-activation-range-ignore-list.patch
index c402bdafa2..c402bdafa2 100644
--- a/patches/server/0041-Add-more-entities-to-activation-range-ignore-list.patch
+++ b/patches/server/0040-Add-more-entities-to-activation-range-ignore-list.patch
diff --git a/patches/server/0042-Configurable-end-credits.patch b/patches/server/0041-Configurable-end-credits.patch
index 2ec0a7d4e3..d60869efaa 100644
--- a/patches/server/0042-Configurable-end-credits.patch
+++ b/patches/server/0041-Configurable-end-credits.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Configurable end credits
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index dc92e1cd0a10ec4e6b4ad6145d5fc0a4ef199365..9f38010f247694e1014c9c93bfcf46d103d8fd20 100644
+index a2833b879b7613856706223f6b6e1ceae760f3b3..6ecb91a21059f3821f6ac5b1be04c933ceee260e 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1164,6 +1164,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1161,6 +1161,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.unRide();
this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
if (!this.wonGame) {
diff --git a/patches/server/0043-Fix-lag-from-explosions-processing-dead-entities.patch b/patches/server/0042-Fix-lag-from-explosions-processing-dead-entities.patch
index ae3fb7c15b..ae3fb7c15b 100644
--- a/patches/server/0043-Fix-lag-from-explosions-processing-dead-entities.patch
+++ b/patches/server/0042-Fix-lag-from-explosions-processing-dead-entities.patch
diff --git a/patches/server/0044-Optimize-explosions.patch b/patches/server/0043-Optimize-explosions.patch
index 600d98a0a6..471cec8d25 100644
--- a/patches/server/0044-Optimize-explosions.patch
+++ b/patches/server/0043-Optimize-explosions.patch
@@ -10,10 +10,10 @@ This patch adds a per-tick cache that is used for storing and retrieving
an entity's exposure during an explosion.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 6f5b04a59fa1173bfdea2c59a9c13ca3710abb0c..0b666bbe75a97a8e1e6153533416d156adb64a0a 100644
+index 57ec168bac3727feb734e28cebc680328c1c4aec..4f1204661e345462c08cc66e3a8851033f186268 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1574,6 +1574,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1573,6 +1573,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop();
this.profiler.pop();
diff --git a/patches/server/0045-Disable-explosion-knockback.patch b/patches/server/0044-Disable-explosion-knockback.patch
index 233aa30581..233aa30581 100644
--- a/patches/server/0045-Disable-explosion-knockback.patch
+++ b/patches/server/0044-Disable-explosion-knockback.patch
diff --git a/patches/server/0046-Disable-thunder.patch b/patches/server/0045-Disable-thunder.patch
index 3dea5304a7..de88451538 100644
--- a/patches/server/0046-Disable-thunder.patch
+++ b/patches/server/0045-Disable-thunder.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Disable thunder
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 711318ddc706e72dbd8cea1c541058c881086f21..ff80e95bf91b8f0e60dfc1183dd9fba2dba2719d 100644
+index 754045e71f180862fa57fd1c97e5d7deb1d788e6..aca595551c90d5515309c9c82ad6ffcfa1d680c8 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -616,7 +616,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0047-Disable-ice-and-snow.patch b/patches/server/0046-Disable-ice-and-snow.patch
index f693d7666f..ae60e5cb8c 100644
--- a/patches/server/0047-Disable-ice-and-snow.patch
+++ b/patches/server/0046-Disable-ice-and-snow.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Disable ice and snow
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index ff80e95bf91b8f0e60dfc1183dd9fba2dba2719d..d0788c4223891117c042aa4243e6804b4ed33aea 100644
+index aca595551c90d5515309c9c82ad6ffcfa1d680c8..6d89dc22e28a9c3557d9972be0935d75719e7f7d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -646,11 +646,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0048-Configurable-mob-spawner-tick-rate.patch b/patches/server/0047-Configurable-mob-spawner-tick-rate.patch
index deb1ddde3f..deb1ddde3f 100644
--- a/patches/server/0048-Configurable-mob-spawner-tick-rate.patch
+++ b/patches/server/0047-Configurable-mob-spawner-tick-rate.patch
diff --git a/patches/server/0049-Use-null-Locale-by-default.patch b/patches/server/0048-Use-null-Locale-by-default.patch
index dd2e7cabdc..f6b64470b2 100644
--- a/patches/server/0049-Use-null-Locale-by-default.patch
+++ b/patches/server/0048-Use-null-Locale-by-default.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Use null Locale by default
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 05103127d0ae220d3a27ba2bfbaa13d80ef7df7b..a9ab5b98296fe6d28d9087a7f171a0c110bc42e6 100644
+index 6ecb91a21059f3821f6ac5b1be04c933ceee260e..eb1027c6bb90b5fe249cc4cd11c735a0d217ac0e 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -236,7 +236,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@@ -17,7 +17,7 @@ index 05103127d0ae220d3a27ba2bfbaa13d80ef7df7b..a9ab5b98296fe6d28d9087a7f171a0c1
public java.util.Locale adventure$locale = java.util.Locale.US; // Paper
@Nullable
private Vec3 startingToFallPosition;
-@@ -293,7 +293,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -292,7 +292,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.lastActionTime = Util.getMillis();
this.recipeBook = new ServerRecipeBook();
this.requestedViewDistance = 2;
@@ -26,7 +26,7 @@ index 05103127d0ae220d3a27ba2bfbaa13d80ef7df7b..a9ab5b98296fe6d28d9087a7f171a0c1
this.lastSectionPos = SectionPos.of(0, 0, 0);
this.chunkTrackingView = ChunkTrackingView.EMPTY;
this.respawnDimension = Level.OVERWORLD;
-@@ -2054,7 +2054,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2051,7 +2051,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), this.getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT);
this.server.server.getPluginManager().callEvent(event);
}
@@ -36,7 +36,7 @@ index 05103127d0ae220d3a27ba2bfbaa13d80ef7df7b..a9ab5b98296fe6d28d9087a7f171a0c1
this.server.server.getPluginManager().callEvent(event);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 54ccf79ce6a9ca6c7ad63adb8b1bc32c1b373800..98fc35c1da6bec0fd50d2a68cbd095aaca66d91f 100644
+index c2be21491183f5f113dbfc71a7e0ccd195679296..8a674fe0ceadf278d7b9a525e71b519f8be72289 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2423,7 +2423,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0050-Add-BeaconEffectEvent.patch b/patches/server/0049-Add-BeaconEffectEvent.patch
index f26dbf1ae4..f26dbf1ae4 100644
--- a/patches/server/0050-Add-BeaconEffectEvent.patch
+++ b/patches/server/0049-Add-BeaconEffectEvent.patch
diff --git a/patches/server/0051-Configurable-container-update-tick-rate.patch b/patches/server/0050-Configurable-container-update-tick-rate.patch
index 6859c0534d..bc233ac419 100644
--- a/patches/server/0051-Configurable-container-update-tick-rate.patch
+++ b/patches/server/0050-Configurable-container-update-tick-rate.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable container update tick rate
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 1115655b1e8090c52840e85b75265da881bbc713..70f0f4daff27754aefcadb84387bb3054cc66a8e 100644
+index eb1027c6bb90b5fe249cc4cd11c735a0d217ac0e..e9fe09f77aacc0b7b13e95d4d04d94fdfa2181c3 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -267,6 +267,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@@ -16,7 +16,7 @@ index 1115655b1e8090c52840e85b75265da881bbc713..70f0f4daff27754aefcadb84387bb305
// CraftBukkit start
public CraftPlayer.TransferCookieConnection transferCookieConnection;
-@@ -698,7 +699,12 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -695,7 +696,12 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
--this.invulnerableTime;
}
diff --git a/patches/server/0052-Use-UserCache-for-player-heads.patch b/patches/server/0051-Use-UserCache-for-player-heads.patch
index e0b11bcf11..e0b11bcf11 100644
--- a/patches/server/0052-Use-UserCache-for-player-heads.patch
+++ b/patches/server/0051-Use-UserCache-for-player-heads.patch
diff --git a/patches/server/0053-Disable-spigot-tick-limiters.patch b/patches/server/0052-Disable-spigot-tick-limiters.patch
index 2e19fda1e1..2e19fda1e1 100644
--- a/patches/server/0053-Disable-spigot-tick-limiters.patch
+++ b/patches/server/0052-Disable-spigot-tick-limiters.patch
diff --git a/patches/server/0054-Fix-spawn-location-event-changing-location.patch b/patches/server/0053-Fix-spawn-location-event-changing-location.patch
index e9256b2783..e9256b2783 100644
--- a/patches/server/0054-Fix-spawn-location-event-changing-location.patch
+++ b/patches/server/0053-Fix-spawn-location-event-changing-location.patch
diff --git a/patches/server/0055-Configurable-Disabling-Cat-Chest-Detection.patch b/patches/server/0054-Configurable-Disabling-Cat-Chest-Detection.patch
index 232eb8f5f4..232eb8f5f4 100644
--- a/patches/server/0055-Configurable-Disabling-Cat-Chest-Detection.patch
+++ b/patches/server/0054-Configurable-Disabling-Cat-Chest-Detection.patch
diff --git a/patches/server/0056-Improve-Player-chat-API-handling.patch b/patches/server/0055-Improve-Player-chat-API-handling.patch
index c0799ae48f..f42881ee3d 100644
--- a/patches/server/0056-Improve-Player-chat-API-handling.patch
+++ b/patches/server/0055-Improve-Player-chat-API-handling.patch
@@ -53,7 +53,7 @@ index 7c97ec4aa57562a8383a40e493eaa8a3697208bb..78193f0d66c2755ed238824bcd24ced9
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 4079cf3d515718a18b41333fbdc96d0c8f56648a..5a8597eac762d311ee8e09f64392e41aee1f13bc 100644
+index 8a674fe0ceadf278d7b9a525e71b519f8be72289..68df6270f7d08cde78235749950e05bf60c1641c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -546,7 +546,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0057-All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/0056-All-chunks-are-slime-spawn-chunks-toggle.patch
index 3cded231dd..3cded231dd 100644
--- a/patches/server/0057-All-chunks-are-slime-spawn-chunks-toggle.patch
+++ b/patches/server/0056-All-chunks-are-slime-spawn-chunks-toggle.patch
diff --git a/patches/server/0058-Expose-server-CommandMap.patch b/patches/server/0057-Expose-server-CommandMap.patch
index 7ef3e6c199..7ef3e6c199 100644
--- a/patches/server/0058-Expose-server-CommandMap.patch
+++ b/patches/server/0057-Expose-server-CommandMap.patch
diff --git a/patches/server/0059-Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/0058-Be-a-bit-more-informative-in-maxHealth-exception.patch
index 489c881a1a..489c881a1a 100644
--- a/patches/server/0059-Be-a-bit-more-informative-in-maxHealth-exception.patch
+++ b/patches/server/0058-Be-a-bit-more-informative-in-maxHealth-exception.patch
diff --git a/patches/server/0060-Player-Tab-List-and-Title-APIs.patch b/patches/server/0059-Player-Tab-List-and-Title-APIs.patch
index 37dd1bc254..db2fa88567 100644
--- a/patches/server/0060-Player-Tab-List-and-Title-APIs.patch
+++ b/patches/server/0059-Player-Tab-List-and-Title-APIs.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 5a8597eac762d311ee8e09f64392e41aee1f13bc..bbc8f648fc8287d84a8948947e1321a47417fefa 100644
+index 68df6270f7d08cde78235749950e05bf60c1641c..ef3f1d00a595fd1fb7297d7ab96e791acbcbbed6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -386,6 +386,98 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0061-Add-configurable-portal-search-radius.patch b/patches/server/0060-Add-configurable-portal-search-radius.patch
index 4a5099223d..4a5099223d 100644
--- a/patches/server/0061-Add-configurable-portal-search-radius.patch
+++ b/patches/server/0060-Add-configurable-portal-search-radius.patch
diff --git a/patches/server/0062-Add-velocity-warnings.patch b/patches/server/0061-Add-velocity-warnings.patch
index 996e71c322..996e71c322 100644
--- a/patches/server/0062-Add-velocity-warnings.patch
+++ b/patches/server/0061-Add-velocity-warnings.patch
diff --git a/patches/server/0063-Add-exception-reporting-event.patch b/patches/server/0062-Add-exception-reporting-event.patch
index 83206d2117..83206d2117 100644
--- a/patches/server/0063-Add-exception-reporting-event.patch
+++ b/patches/server/0062-Add-exception-reporting-event.patch
diff --git a/patches/server/0064-Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/0063-Disable-Scoreboards-for-non-players-by-default.patch
index ba39658f01..ba39658f01 100644
--- a/patches/server/0064-Disable-Scoreboards-for-non-players-by-default.patch
+++ b/patches/server/0063-Disable-Scoreboards-for-non-players-by-default.patch
diff --git a/patches/server/0065-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/0064-Add-methods-for-working-with-arrows-stuck-in-living-.patch
index ddf3e716bc..ddf3e716bc 100644
--- a/patches/server/0065-Add-methods-for-working-with-arrows-stuck-in-living-.patch
+++ b/patches/server/0064-Add-methods-for-working-with-arrows-stuck-in-living-.patch
diff --git a/patches/server/0066-Chunk-Save-Reattempt.patch b/patches/server/0065-Chunk-Save-Reattempt.patch
index 120ee75594..120ee75594 100644
--- a/patches/server/0066-Chunk-Save-Reattempt.patch
+++ b/patches/server/0065-Chunk-Save-Reattempt.patch
diff --git a/patches/server/0067-Complete-resource-pack-API.patch b/patches/server/0066-Complete-resource-pack-API.patch
index 4128d8d8d1..02e8bb2c5d 100644
--- a/patches/server/0067-Complete-resource-pack-API.patch
+++ b/patches/server/0066-Complete-resource-pack-API.patch
@@ -22,7 +22,7 @@ index 678f12679985c6fa9effe8beec306d95d5e0bdac..8520f0f2b4b4e758b2e2fae206b7fd81
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 699248ae7c8e2b018a279ac023a0175a8af10714..f0ec24cf686fa7e1a025c8f9c8c6722f77c29e14 100644
+index ef3f1d00a595fd1fb7297d7ab96e791acbcbbed6..174c86a7213ecf3c8dc03aeaf55c56a4c4ce55ad 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -208,6 +208,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0068-Default-loading-permissions.yml-before-plugins.patch b/patches/server/0067-Default-loading-permissions.yml-before-plugins.patch
index a91fdb27be..a91fdb27be 100644
--- a/patches/server/0068-Default-loading-permissions.yml-before-plugins.patch
+++ b/patches/server/0067-Default-loading-permissions.yml-before-plugins.patch
diff --git a/patches/server/0069-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0068-Allow-Reloading-of-Custom-Permissions.patch
index 296e4348f3..296e4348f3 100644
--- a/patches/server/0069-Allow-Reloading-of-Custom-Permissions.patch
+++ b/patches/server/0068-Allow-Reloading-of-Custom-Permissions.patch
diff --git a/patches/server/0070-Remove-Metadata-on-reload.patch b/patches/server/0069-Remove-Metadata-on-reload.patch
index deda8cd6e0..deda8cd6e0 100644
--- a/patches/server/0070-Remove-Metadata-on-reload.patch
+++ b/patches/server/0069-Remove-Metadata-on-reload.patch
diff --git a/patches/server/0071-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0070-Handle-Item-Meta-Inconsistencies.patch
index 2788e0342e..2788e0342e 100644
--- a/patches/server/0071-Handle-Item-Meta-Inconsistencies.patch
+++ b/patches/server/0070-Handle-Item-Meta-Inconsistencies.patch
diff --git a/patches/server/0072-Configurable-Non-Player-Arrow-Despawn-Rate.patch b/patches/server/0071-Configurable-Non-Player-Arrow-Despawn-Rate.patch
index e1e0b3df9c..e1e0b3df9c 100644
--- a/patches/server/0072-Configurable-Non-Player-Arrow-Despawn-Rate.patch
+++ b/patches/server/0071-Configurable-Non-Player-Arrow-Despawn-Rate.patch
diff --git a/patches/server/0073-Add-World-Util-Methods.patch b/patches/server/0072-Add-World-Util-Methods.patch
index 163fce5769..163fce5769 100644
--- a/patches/server/0073-Add-World-Util-Methods.patch
+++ b/patches/server/0072-Add-World-Util-Methods.patch
diff --git a/patches/server/0074-Custom-replacement-for-eaten-items.patch b/patches/server/0073-Custom-replacement-for-eaten-items.patch
index ad90d60cf5..ad90d60cf5 100644
--- a/patches/server/0074-Custom-replacement-for-eaten-items.patch
+++ b/patches/server/0073-Custom-replacement-for-eaten-items.patch
diff --git a/patches/server/0075-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0074-handle-NaN-health-absorb-values-and-repair-bad-data.patch
index 90809277ff..1d38bc8302 100644
--- a/patches/server/0075-handle-NaN-health-absorb-values-and-repair-bad-data.patch
+++ b/patches/server/0074-handle-NaN-health-absorb-values-and-repair-bad-data.patch
@@ -44,7 +44,7 @@ index e7b308ba4a253b270aebebd19e2671514c5357ca..fae7c493c9be741f019fc49f45a59976
protected void internalSetAbsorptionAmount(float absorptionAmount) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index f0ec24cf686fa7e1a025c8f9c8c6722f77c29e14..8a30e4d7b6542de3e6bea37cc2a6cbabd2bb9555 100644
+index 174c86a7213ecf3c8dc03aeaf55c56a4c4ce55ad..c399264ccffe646be10b3f13ebe0c0103d97f62c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2338,6 +2338,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0076-Use-a-Shared-Random-for-Entities.patch b/patches/server/0075-Use-a-Shared-Random-for-Entities.patch
index 0dc711a42b..0dc711a42b 100644
--- a/patches/server/0076-Use-a-Shared-Random-for-Entities.patch
+++ b/patches/server/0075-Use-a-Shared-Random-for-Entities.patch
diff --git a/patches/server/0077-Configurable-spawn-chances-for-skeleton-horses.patch b/patches/server/0076-Configurable-spawn-chances-for-skeleton-horses.patch
index 7e876a2d49..5d75479206 100644
--- a/patches/server/0077-Configurable-spawn-chances-for-skeleton-horses.patch
+++ b/patches/server/0076-Configurable-spawn-chances-for-skeleton-horses.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable spawn chances for skeleton horses
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index d0788c4223891117c042aa4243e6804b4ed33aea..df60bfc7555326f079082199b940b0c4b4248cfc 100644
+index 6d89dc22e28a9c3557d9972be0935d75719e7f7d..de1708e5d39561115d2825eea4a5f6e1f1f4e5b8 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -621,7 +621,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0078-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
index cea7703900..ed44e0fd8c 100644
--- a/patches/server/0078-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
+++ b/patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 0b666bbe75a97a8e1e6153533416d156adb64a0a..c38f932fe1c22dbe9b2583aab43ae879e4e5d4ad 100644
+index 4f1204661e345462c08cc66e3a8851033f186268..a37f11633663e07652274707b29a849e518511c5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1545,6 +1545,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1544,6 +1544,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
@@ -18,7 +18,7 @@ index 0b666bbe75a97a8e1e6153533416d156adb64a0a..c38f932fe1c22dbe9b2583aab43ae879
this.profiler.push(() -> {
String s = String.valueOf(worldserver);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index df60bfc7555326f079082199b940b0c4b4248cfc..35bcdbfd7f17c4e2260c199e9848c4d361b61944 100644
+index de1708e5d39561115d2825eea4a5f6e1f1f4e5b8..1e5b42fc3903b14537d232c8adbbaf79078d8d8e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -227,6 +227,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0079-Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/0078-Entity-AddTo-RemoveFrom-World-Events.patch
index 9a833e6f86..83aad502c3 100644
--- a/patches/server/0079-Entity-AddTo-RemoveFrom-World-Events.patch
+++ b/patches/server/0078-Entity-AddTo-RemoveFrom-World-Events.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 35bcdbfd7f17c4e2260c199e9848c4d361b61944..43dbcfb5900b301950be68db48487af2a95748a3 100644
+index 1e5b42fc3903b14537d232c8adbbaf79078d8d8e..e6cf145fa7a2968c70e9e467e3927fd38e199e06 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2153,6 +2153,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0080-Configurable-Chunk-Inhabited-Time.patch b/patches/server/0079-Configurable-Chunk-Inhabited-Time.patch
index 9eb058e669..9eb058e669 100644
--- a/patches/server/0080-Configurable-Chunk-Inhabited-Time.patch
+++ b/patches/server/0079-Configurable-Chunk-Inhabited-Time.patch
diff --git a/patches/server/0081-EntityPathfindEvent.patch b/patches/server/0080-EntityPathfindEvent.patch
index e29cff85e6..e29cff85e6 100644
--- a/patches/server/0081-EntityPathfindEvent.patch
+++ b/patches/server/0080-EntityPathfindEvent.patch
diff --git a/patches/server/0082-Sanitise-RegionFileCache-and-make-configurable.patch b/patches/server/0081-Sanitise-RegionFileCache-and-make-configurable.patch
index 2693eaeb7c..2693eaeb7c 100644
--- a/patches/server/0082-Sanitise-RegionFileCache-and-make-configurable.patch
+++ b/patches/server/0081-Sanitise-RegionFileCache-and-make-configurable.patch
diff --git a/patches/server/0083-Do-not-load-chunks-for-Pathfinding.patch b/patches/server/0082-Do-not-load-chunks-for-Pathfinding.patch
index 76cfe02b0f..76cfe02b0f 100644
--- a/patches/server/0083-Do-not-load-chunks-for-Pathfinding.patch
+++ b/patches/server/0082-Do-not-load-chunks-for-Pathfinding.patch
diff --git a/patches/server/0084-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch
index cde1e3ce52..cde1e3ce52 100644
--- a/patches/server/0084-Add-PlayerUseUnknownEntityEvent.patch
+++ b/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch
diff --git a/patches/server/0085-Configurable-random-tick-rates-for-blocks.patch b/patches/server/0084-Configurable-random-tick-rates-for-blocks.patch
index c936bd291e..c936bd291e 100644
--- a/patches/server/0085-Configurable-random-tick-rates-for-blocks.patch
+++ b/patches/server/0084-Configurable-random-tick-rates-for-blocks.patch
diff --git a/patches/server/0086-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/patches/server/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
index dd26a7381c..ab40c40da1 100644
--- a/patches/server/0086-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
+++ b/patches/server/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 43dbcfb5900b301950be68db48487af2a95748a3..2d27b92b02611d883a84a694280364d3a7ddcb09 100644
+index e6cf145fa7a2968c70e9e467e3927fd38e199e06..223f8d9be5d73e296f5815db7123b95c3b345162 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1389,6 +1389,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0087-Optimize-DataBits.patch b/patches/server/0086-Optimize-DataBits.patch
index fa5c0b02f0..fa5c0b02f0 100644
--- a/patches/server/0087-Optimize-DataBits.patch
+++ b/patches/server/0086-Optimize-DataBits.patch
diff --git a/patches/server/0088-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/patches/server/0087-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch
index 4a2793dc00..4a2793dc00 100644
--- a/patches/server/0088-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch
+++ b/patches/server/0087-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch
diff --git a/patches/server/0089-Configurable-Player-Collision.patch b/patches/server/0088-Configurable-Player-Collision.patch
index f64375d8bd..719e6bb654 100644
--- a/patches/server/0089-Configurable-Player-Collision.patch
+++ b/patches/server/0088-Configurable-Player-Collision.patch
@@ -18,7 +18,7 @@ index 9a1a961eabd4362c171da78c6be82c867f3696a4..1d0c473442b5c72245c356054440323e
ComponentSerialization.TRUSTED_STREAM_CODEC.encode(buf, this.playerPrefix);
ComponentSerialization.TRUSTED_STREAM_CODEC.encode(buf, this.playerSuffix);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index c38f932fe1c22dbe9b2583aab43ae879e4e5d4ad..785e033064ac8067baba2b471797ca34cf323825 100644
+index a37f11633663e07652274707b29a849e518511c5..6dec7884fdd15eb8f32e8831ed0f3a92af710472 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -640,6 +640,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0090-Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/patches/server/0089-Add-handshake-event-to-allow-plugins-to-handle-clien.patch
index 33ef52f088..33ef52f088 100644
--- a/patches/server/0090-Add-handshake-event-to-allow-plugins-to-handle-clien.patch
+++ b/patches/server/0089-Add-handshake-event-to-allow-plugins-to-handle-clien.patch
diff --git a/patches/server/0091-Configurable-RCON-IP-address.patch b/patches/server/0090-Configurable-RCON-IP-address.patch
index 96c8df2d2c..96c8df2d2c 100644
--- a/patches/server/0091-Configurable-RCON-IP-address.patch
+++ b/patches/server/0090-Configurable-RCON-IP-address.patch
diff --git a/patches/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch b/patches/server/0091-EntityRegainHealthEvent-isFastRegen-API.patch
index bc89e73539..bc89e73539 100644
--- a/patches/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch
+++ b/patches/server/0091-EntityRegainHealthEvent-isFastRegen-API.patch
diff --git a/patches/server/0093-Add-ability-to-configure-frosted_ice-properties.patch b/patches/server/0092-Add-ability-to-configure-frosted_ice-properties.patch
index 5470fbc9ab..5470fbc9ab 100644
--- a/patches/server/0093-Add-ability-to-configure-frosted_ice-properties.patch
+++ b/patches/server/0092-Add-ability-to-configure-frosted_ice-properties.patch
diff --git a/patches/server/0094-remove-null-possibility-for-getServer-singleton.patch b/patches/server/0093-remove-null-possibility-for-getServer-singleton.patch
index 22d8b6a7c0..e16888eaab 100644
--- a/patches/server/0094-remove-null-possibility-for-getServer-singleton.patch
+++ b/patches/server/0093-remove-null-possibility-for-getServer-singleton.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 785e033064ac8067baba2b471797ca34cf323825..75de08945200289b715d80f27adcfe2d22f42fbd 100644
+index 6dec7884fdd15eb8f32e8831ed0f3a92af710472..d8f2fe077e35fd6c70e0ba50945006819f50586f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -197,6 +197,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
@@ -25,7 +25,7 @@ index 785e033064ac8067baba2b471797ca34cf323825..75de08945200289b715d80f27adcfe2d
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
this.profiler = this.metricsRecorder.getProfiler();
this.onMetricsRecordingStopped = (methodprofilerresults) -> {
-@@ -2549,9 +2551,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2548,9 +2550,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return false;
}
diff --git a/patches/server/0095-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch b/patches/server/0094-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch
index bb493d5a5f..bb493d5a5f 100644
--- a/patches/server/0095-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch
+++ b/patches/server/0094-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch
diff --git a/patches/server/0096-LootTable-API-and-replenishable-lootables.patch b/patches/server/0095-LootTable-API-and-replenishable-lootables.patch
index 99c0f7a6b1..99c0f7a6b1 100644
--- a/patches/server/0096-LootTable-API-and-replenishable-lootables.patch
+++ b/patches/server/0095-LootTable-API-and-replenishable-lootables.patch
diff --git a/patches/server/0097-System-property-for-disabling-watchdoge.patch b/patches/server/0096-System-property-for-disabling-watchdoge.patch
index 4a35e21392..4a35e21392 100644
--- a/patches/server/0097-System-property-for-disabling-watchdoge.patch
+++ b/patches/server/0096-System-property-for-disabling-watchdoge.patch
diff --git a/patches/server/0098-Async-GameProfileCache-saving.patch b/patches/server/0097-Async-GameProfileCache-saving.patch
index b140bba3f6..b352f836bd 100644
--- a/patches/server/0098-Async-GameProfileCache-saving.patch
+++ b/patches/server/0097-Async-GameProfileCache-saving.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Async GameProfileCache saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 75de08945200289b715d80f27adcfe2d22f42fbd..451b6fef2c13a35eb00370fccd92581c97810137 100644
+index d8f2fe077e35fd6c70e0ba50945006819f50586f..d566d64c6c3bd97ac4b4f80bdf1b1bd5a381ef55 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -999,7 +999,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0099-Optional-TNT-doesn-t-move-in-water.patch b/patches/server/0098-Optional-TNT-doesn-t-move-in-water.patch
index fa8cfc97f6..fa8cfc97f6 100644
--- a/patches/server/0099-Optional-TNT-doesn-t-move-in-water.patch
+++ b/patches/server/0098-Optional-TNT-doesn-t-move-in-water.patch
diff --git a/patches/server/0100-Faster-redstone-torch-rapid-clock-removal.patch b/patches/server/0099-Faster-redstone-torch-rapid-clock-removal.patch
index 18322dc88f..18322dc88f 100644
--- a/patches/server/0100-Faster-redstone-torch-rapid-clock-removal.patch
+++ b/patches/server/0099-Faster-redstone-torch-rapid-clock-removal.patch
diff --git a/patches/server/0101-Add-server-name-parameter.patch b/patches/server/0100-Add-server-name-parameter.patch
index 74018176e7..5ff9f1d961 100644
--- a/patches/server/0101-Add-server-name-parameter.patch
+++ b/patches/server/0100-Add-server-name-parameter.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add server-name parameter
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 9dc72b01092783c436bc1fa8ce29ff7cdaa39b19..9515a6f72b54bc8926f10182143b2aa9b684a341 100644
+index 14f63c179428bee61d3b931ea309f4c94b89a6cc..75a3c7ed5500f0451c9c1efdfc3cb809445c8acf 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -168,6 +168,14 @@ public class Main {
diff --git a/patches/server/0102-Fix-global-sound-handling.patch b/patches/server/0101-Fix-global-sound-handling.patch
index d975a405a4..f1855116cb 100644
--- a/patches/server/0102-Fix-global-sound-handling.patch
+++ b/patches/server/0101-Fix-global-sound-handling.patch
@@ -11,7 +11,7 @@ Co-authored-by: lexikiq <[email protected]>
Co-authored-by: Aikar <[email protected]>
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 2d27b92b02611d883a84a694280364d3a7ddcb09..7c835a9328b1ba8426663ed3e9575fcd35a0f748 100644
+index 223f8d9be5d73e296f5815db7123b95c3b345162..d728afbe1d6882f1ace4ead9d87f4b7d2af43ba2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1322,7 +1322,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0103-Avoid-blocking-on-Network-Manager-creation.patch b/patches/server/0102-Avoid-blocking-on-Network-Manager-creation.patch
index 1c6ee84de8..1c6ee84de8 100644
--- a/patches/server/0103-Avoid-blocking-on-Network-Manager-creation.patch
+++ b/patches/server/0102-Avoid-blocking-on-Network-Manager-creation.patch
diff --git a/patches/server/0104-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/patches/server/0103-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
index 82dc93463f..82dc93463f 100644
--- a/patches/server/0104-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
+++ b/patches/server/0103-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
diff --git a/patches/server/0105-Add-setting-for-proxy-online-mode-status.patch b/patches/server/0104-Add-setting-for-proxy-online-mode-status.patch
index 015bfd3442..015bfd3442 100644
--- a/patches/server/0105-Add-setting-for-proxy-online-mode-status.patch
+++ b/patches/server/0104-Add-setting-for-proxy-online-mode-status.patch
diff --git a/patches/server/0106-Optimise-BlockState-s-hashCode-equals.patch b/patches/server/0105-Optimise-BlockState-s-hashCode-equals.patch
index 348097f8ce..348097f8ce 100644
--- a/patches/server/0106-Optimise-BlockState-s-hashCode-equals.patch
+++ b/patches/server/0105-Optimise-BlockState-s-hashCode-equals.patch
diff --git a/patches/server/0107-Configurable-packet-in-spam-threshold.patch b/patches/server/0106-Configurable-packet-in-spam-threshold.patch
index 65d911de77..65d911de77 100644
--- a/patches/server/0107-Configurable-packet-in-spam-threshold.patch
+++ b/patches/server/0106-Configurable-packet-in-spam-threshold.patch
diff --git a/patches/server/0108-Configurable-flying-kick-messages.patch b/patches/server/0107-Configurable-flying-kick-messages.patch
index 7a80c997cc..7a80c997cc 100644
--- a/patches/server/0108-Configurable-flying-kick-messages.patch
+++ b/patches/server/0107-Configurable-flying-kick-messages.patch
diff --git a/patches/server/0109-Add-EntityZapEvent.patch b/patches/server/0108-Add-EntityZapEvent.patch
index 0e80811908..0e80811908 100644
--- a/patches/server/0109-Add-EntityZapEvent.patch
+++ b/patches/server/0108-Add-EntityZapEvent.patch
diff --git a/patches/server/0110-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch b/patches/server/0109-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch
index 00673bc0e7..00673bc0e7 100644
--- a/patches/server/0110-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch
+++ b/patches/server/0109-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch
diff --git a/patches/server/0111-Cache-user-authenticator-threads.patch b/patches/server/0110-Cache-user-authenticator-threads.patch
index 27f8fcc1fd..27f8fcc1fd 100644
--- a/patches/server/0111-Cache-user-authenticator-threads.patch
+++ b/patches/server/0110-Cache-user-authenticator-threads.patch
diff --git a/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch b/patches/server/0111-Allow-Reloading-of-Command-Aliases.patch
index 96763d0e3f..96763d0e3f 100644
--- a/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch
+++ b/patches/server/0111-Allow-Reloading-of-Command-Aliases.patch
diff --git a/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch b/patches/server/0112-Add-source-to-PlayerExpChangeEvent.patch
index b739ee3351..b739ee3351 100644
--- a/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch
+++ b/patches/server/0112-Add-source-to-PlayerExpChangeEvent.patch
diff --git a/patches/server/0114-Add-ProjectileCollideEvent.patch b/patches/server/0113-Add-ProjectileCollideEvent.patch
index df432de74e..df432de74e 100644
--- a/patches/server/0114-Add-ProjectileCollideEvent.patch
+++ b/patches/server/0113-Add-ProjectileCollideEvent.patch
diff --git a/patches/server/0115-Prevent-Pathfinding-out-of-World-Border.patch b/patches/server/0114-Prevent-Pathfinding-out-of-World-Border.patch
index ce3053228d..ce3053228d 100644
--- a/patches/server/0115-Prevent-Pathfinding-out-of-World-Border.patch
+++ b/patches/server/0114-Prevent-Pathfinding-out-of-World-Border.patch
diff --git a/patches/server/0116-Optimize-Level.hasChunkAt-BlockPosition-Z.patch b/patches/server/0115-Optimize-Level.hasChunkAt-BlockPosition-Z.patch
index ee46f05dc0..ee46f05dc0 100644
--- a/patches/server/0116-Optimize-Level.hasChunkAt-BlockPosition-Z.patch
+++ b/patches/server/0115-Optimize-Level.hasChunkAt-BlockPosition-Z.patch
diff --git a/patches/server/0117-Bound-Treasure-Maps-to-World-Border.patch b/patches/server/0116-Bound-Treasure-Maps-to-World-Border.patch
index b4596cd20b..b4596cd20b 100644
--- a/patches/server/0117-Bound-Treasure-Maps-to-World-Border.patch
+++ b/patches/server/0116-Bound-Treasure-Maps-to-World-Border.patch
diff --git a/patches/server/0118-Configurable-Cartographer-Treasure-Maps.patch b/patches/server/0117-Configurable-Cartographer-Treasure-Maps.patch
index a93dd268ae..a93dd268ae 100644
--- a/patches/server/0118-Configurable-Cartographer-Treasure-Maps.patch
+++ b/patches/server/0117-Configurable-Cartographer-Treasure-Maps.patch
diff --git a/patches/server/0119-Add-API-methods-to-control-if-armor-stands-can-move.patch b/patches/server/0118-Add-API-methods-to-control-if-armor-stands-can-move.patch
index ace73cb969..ace73cb969 100644
--- a/patches/server/0119-Add-API-methods-to-control-if-armor-stands-can-move.patch
+++ b/patches/server/0118-Add-API-methods-to-control-if-armor-stands-can-move.patch
diff --git a/patches/server/0120-String-based-Action-Bar-API.patch b/patches/server/0119-String-based-Action-Bar-API.patch
index e77bad7174..b4a1ec6598 100644
--- a/patches/server/0120-String-based-Action-Bar-API.patch
+++ b/patches/server/0119-String-based-Action-Bar-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] String based Action Bar API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index a2c09546434ef8b8d8e304b83d902efd5fc36a70..935815a532725e391465baf6764224dec8d0bc9b 100644
+index c399264ccffe646be10b3f13ebe0c0103d97f62c..d471e9370fdbcbce5357e52e8ea2a10c196cd33d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -388,6 +388,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0121-Properly-fix-item-duplication-bug.patch b/patches/server/0120-Properly-fix-item-duplication-bug.patch
index 86782af8c7..7a9b41d7f1 100644
--- a/patches/server/0121-Properly-fix-item-duplication-bug.patch
+++ b/patches/server/0120-Properly-fix-item-duplication-bug.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug
Credit to prplz for figuring out the real issue
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index ac4b66a4aa9e2f186ed5ff3c7d41a01152a9d283..e7b39f06707a62d26af7e183413e0301501d2ce0 100644
+index e9fe09f77aacc0b7b13e95d4d04d94fdfa2181c3..269cfe7aa87cf4a73ee2faca142c83e4d10a98c7 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2630,7 +2630,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2627,7 +2627,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@Override
public boolean isImmobile() {
diff --git a/patches/server/0122-Firework-API-s.patch b/patches/server/0121-Firework-API-s.patch
index c86538a2cf..c86538a2cf 100644
--- a/patches/server/0122-Firework-API-s.patch
+++ b/patches/server/0121-Firework-API-s.patch
diff --git a/patches/server/0123-PlayerTeleportEndGatewayEvent.patch b/patches/server/0122-PlayerTeleportEndGatewayEvent.patch
index 6b7a9ec94f..3a00fbf930 100644
--- a/patches/server/0123-PlayerTeleportEndGatewayEvent.patch
+++ b/patches/server/0122-PlayerTeleportEndGatewayEvent.patch
@@ -7,10 +7,10 @@ Allows you to access the Gateway being used in a teleport event
Fix the offset used for player teleportation
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index dae729c39e5d3fefc8188069e81f33066746c4a6..3ae34c67fe3dd8b30d24f1a31102f0a071c1703d 100644
+index 269cfe7aa87cf4a73ee2faca142c83e4d10a98c7..dd2a359eda0ab3aaf5a94e00a1675bae424bd860 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1195,11 +1195,22 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1192,11 +1192,22 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
ResourceKey<LevelStem> resourcekey = worldserver1.getTypeKey();
if (worldserver != null && worldserver.dimension() == worldserver1.dimension()) { // CraftBukkit
diff --git a/patches/server/0124-Provide-E-TE-Chunk-count-stat-methods.patch b/patches/server/0123-Provide-E-TE-Chunk-count-stat-methods.patch
index afc98a061a..f1025e5537 100644
--- a/patches/server/0124-Provide-E-TE-Chunk-count-stat-methods.patch
+++ b/patches/server/0123-Provide-E-TE-Chunk-count-stat-methods.patch
@@ -20,7 +20,7 @@ index 03b0720c6ebf1a876d56d18a941e0a06ed26dbf0..4fcbea7b8b12be10157da0c1f35c06e4
private final List<TickingBlockEntity> pendingBlockEntityTickers = Lists.newArrayList();
private boolean tickingBlockEntities;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 1e8d93d81b7a391bbd1e9926ff35a68d4c563f0f..2794a7996147fce5533877a47cd1e7b6f7e7576f 100644
+index 4878a1b085a83dd4a8ffdc86250b8fb4fbac5192..1b7660a2d003bfb19ef80ba8066b6417f85328ec 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -164,6 +164,56 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -43,7 +43,7 @@ index 1e8d93d81b7a391bbd1e9926ff35a68d4c563f0f..2794a7996147fce5533877a47cd1e7b6
+ public int getTileEntityCount() {
+ // We don't use the full world tile entity list, so we must iterate chunks
+ int size = 0;
-+ for (ChunkHolder playerchunk : io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.world)) {
++ for (ChunkHolder playerchunk : ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.world)) {
+ net.minecraft.world.level.chunk.LevelChunk chunk = playerchunk.getTickingChunk();
+ if (chunk == null) {
+ continue;
@@ -62,7 +62,7 @@ index 1e8d93d81b7a391bbd1e9926ff35a68d4c563f0f..2794a7996147fce5533877a47cd1e7b6
+ public int getChunkCount() {
+ int ret = 0;
+
-+ for (ChunkHolder chunkHolder : io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.world)) {
++ for (ChunkHolder chunkHolder : ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.world)) {
+ if (chunkHolder.getTickingChunk() != null) {
+ ++ret;
+ }
diff --git a/patches/server/0125-Enforce-Sync-Player-Saves.patch b/patches/server/0124-Enforce-Sync-Player-Saves.patch
index 5211b4bc78..5211b4bc78 100644
--- a/patches/server/0125-Enforce-Sync-Player-Saves.patch
+++ b/patches/server/0124-Enforce-Sync-Player-Saves.patch
diff --git a/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/0125-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
index 68a1c8b37a..68a1c8b37a 100644
--- a/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
+++ b/patches/server/0125-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
diff --git a/patches/server/0127-Cap-Entity-Collisions.patch b/patches/server/0126-Cap-Entity-Collisions.patch
index 8feda191fe..8feda191fe 100644
--- a/patches/server/0127-Cap-Entity-Collisions.patch
+++ b/patches/server/0126-Cap-Entity-Collisions.patch
diff --git a/patches/server/0128-Remove-CraftScheduler-Async-Task-Debugger.patch b/patches/server/0127-Remove-CraftScheduler-Async-Task-Debugger.patch
index 721f748db6..721f748db6 100644
--- a/patches/server/0128-Remove-CraftScheduler-Async-Task-Debugger.patch
+++ b/patches/server/0127-Remove-CraftScheduler-Async-Task-Debugger.patch
diff --git a/patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/0128-Properly-handle-async-calls-to-restart-the-server.patch
index 37a92c3e71..602cf5d4bb 100644
--- a/patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch
+++ b/patches/server/0128-Properly-handle-async-calls-to-restart-the-server.patch
@@ -30,7 +30,7 @@ will have plugins and worlds saving to the disk has a high potential to result
in corruption/dataloss.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 451b6fef2c13a35eb00370fccd92581c97810137..6c46ce47d1460dcd9b387f02a09d85048a45b049 100644
+index d566d64c6c3bd97ac4b4f80bdf1b1bd5a381ef55..e464349a46eab23eb5b8d4d31f577d78532b3ce1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -242,6 +242,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/patches/server/0129-Add-option-to-make-parrots-stay-on-shoulders-despite.patch
index 20b540764e..20b540764e 100644
--- a/patches/server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch
+++ b/patches/server/0129-Add-option-to-make-parrots-stay-on-shoulders-despite.patch
diff --git a/patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0130-Add-configuration-option-to-prevent-player-names-fro.patch
index 205e5d6964..205e5d6964 100644
--- a/patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch
+++ b/patches/server/0130-Add-configuration-option-to-prevent-player-names-fro.patch
diff --git a/patches/server/0132-provide-a-configurable-option-to-disable-creeper-lin.patch b/patches/server/0131-provide-a-configurable-option-to-disable-creeper-lin.patch
index c9bce539cf..8c1151fd1b 100644
--- a/patches/server/0132-provide-a-configurable-option-to-disable-creeper-lin.patch
+++ b/patches/server/0131-provide-a-configurable-option-to-disable-creeper-lin.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] provide a configurable option to disable creeper lingering
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
-index 0b7e329505ecb9064a56b23171ae823e00b146c2..0ac3cff0bc159169c644d8f770671c55775c5fdb 100644
+index 976de2547f654bec58f53a4eff54df5176e815aa..39486215ac080220a6018a35a8437092dbc8fe9d 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
@@ -287,7 +287,7 @@ public class Creeper extends Monster implements PowerableMob {
diff --git a/patches/server/0133-Item-canEntityPickup.patch b/patches/server/0132-Item-canEntityPickup.patch
index 1bb47aa9ca..1bb47aa9ca 100644
--- a/patches/server/0133-Item-canEntityPickup.patch
+++ b/patches/server/0132-Item-canEntityPickup.patch
diff --git a/patches/server/0134-PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/server/0133-PlayerPickupItemEvent-setFlyAtPlayer.patch
index 282fdd4f1e..282fdd4f1e 100644
--- a/patches/server/0134-PlayerPickupItemEvent-setFlyAtPlayer.patch
+++ b/patches/server/0133-PlayerPickupItemEvent-setFlyAtPlayer.patch
diff --git a/patches/server/0135-PlayerAttemptPickupItemEvent.patch b/patches/server/0134-PlayerAttemptPickupItemEvent.patch
index 50726dbd17..50726dbd17 100644
--- a/patches/server/0135-PlayerAttemptPickupItemEvent.patch
+++ b/patches/server/0134-PlayerAttemptPickupItemEvent.patch
diff --git a/patches/server/0136-Do-not-submit-profile-lookups-to-worldgen-threads.patch b/patches/server/0135-Do-not-submit-profile-lookups-to-worldgen-threads.patch
index 57ef5ff7bb..57ef5ff7bb 100644
--- a/patches/server/0136-Do-not-submit-profile-lookups-to-worldgen-threads.patch
+++ b/patches/server/0135-Do-not-submit-profile-lookups-to-worldgen-threads.patch
diff --git a/patches/server/0137-Basic-PlayerProfile-API.patch b/patches/server/0136-Basic-PlayerProfile-API.patch
index 5cddffd5d6..5cddffd5d6 100644
--- a/patches/server/0137-Basic-PlayerProfile-API.patch
+++ b/patches/server/0136-Basic-PlayerProfile-API.patch
diff --git a/patches/server/0138-Add-UnknownCommandEvent.patch b/patches/server/0137-Add-UnknownCommandEvent.patch
index 487c1c0cf0..487c1c0cf0 100644
--- a/patches/server/0138-Add-UnknownCommandEvent.patch
+++ b/patches/server/0137-Add-UnknownCommandEvent.patch
diff --git a/patches/server/0139-Shoulder-Entities-Release-API.patch b/patches/server/0138-Shoulder-Entities-Release-API.patch
index b0762a4548..b0762a4548 100644
--- a/patches/server/0139-Shoulder-Entities-Release-API.patch
+++ b/patches/server/0138-Shoulder-Entities-Release-API.patch
diff --git a/patches/server/0140-Profile-Lookup-Events.patch b/patches/server/0139-Profile-Lookup-Events.patch
index 8a3c9a944e..8a3c9a944e 100644
--- a/patches/server/0140-Profile-Lookup-Events.patch
+++ b/patches/server/0139-Profile-Lookup-Events.patch
diff --git a/patches/server/0141-Block-player-logins-during-server-shutdown.patch b/patches/server/0140-Block-player-logins-during-server-shutdown.patch
index 0dc0c7b69b..0dc0c7b69b 100644
--- a/patches/server/0141-Block-player-logins-during-server-shutdown.patch
+++ b/patches/server/0140-Block-player-logins-during-server-shutdown.patch
diff --git a/patches/server/0142-Entity-fromMobSpawner.patch b/patches/server/0141-Entity-fromMobSpawner.patch
index 0f1ce9369a..0f1ce9369a 100644
--- a/patches/server/0142-Entity-fromMobSpawner.patch
+++ b/patches/server/0141-Entity-fromMobSpawner.patch
diff --git a/patches/server/0143-Improve-the-Saddle-API-for-Horses.patch b/patches/server/0142-Improve-the-Saddle-API-for-Horses.patch
index ddf19f0208..ddf19f0208 100644
--- a/patches/server/0143-Improve-the-Saddle-API-for-Horses.patch
+++ b/patches/server/0142-Improve-the-Saddle-API-for-Horses.patch
diff --git a/patches/server/0144-ensureServerConversions-API.patch b/patches/server/0143-ensureServerConversions-API.patch
index ba8fe15e57..ba8fe15e57 100644
--- a/patches/server/0144-ensureServerConversions-API.patch
+++ b/patches/server/0143-ensureServerConversions-API.patch
diff --git a/patches/server/0145-Implement-getI18NDisplayName.patch b/patches/server/0144-Implement-getI18NDisplayName.patch
index 6dfc69b23c..6dfc69b23c 100644
--- a/patches/server/0145-Implement-getI18NDisplayName.patch
+++ b/patches/server/0144-Implement-getI18NDisplayName.patch
diff --git a/patches/server/0146-ProfileWhitelistVerifyEvent.patch b/patches/server/0145-ProfileWhitelistVerifyEvent.patch
index fc614a6bf3..fc614a6bf3 100644
--- a/patches/server/0146-ProfileWhitelistVerifyEvent.patch
+++ b/patches/server/0145-ProfileWhitelistVerifyEvent.patch
diff --git a/patches/server/0147-Fix-this-stupid-bullshit.patch b/patches/server/0146-Fix-this-stupid-bullshit.patch
index 06f8ccc1c5..06f8ccc1c5 100644
--- a/patches/server/0147-Fix-this-stupid-bullshit.patch
+++ b/patches/server/0146-Fix-this-stupid-bullshit.patch
diff --git a/patches/server/0148-LivingEntity-setKiller.patch b/patches/server/0147-LivingEntity-setKiller.patch
index f1c2b7065a..f1c2b7065a 100644
--- a/patches/server/0148-LivingEntity-setKiller.patch
+++ b/patches/server/0147-LivingEntity-setKiller.patch
diff --git a/patches/server/0149-Ocelot-despawns-should-honor-nametags-and-leash.patch b/patches/server/0148-Ocelot-despawns-should-honor-nametags-and-leash.patch
index a61d1533c3..a61d1533c3 100644
--- a/patches/server/0149-Ocelot-despawns-should-honor-nametags-and-leash.patch
+++ b/patches/server/0148-Ocelot-despawns-should-honor-nametags-and-leash.patch
diff --git a/patches/server/0150-Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/patches/server/0149-Reset-spawner-timer-when-spawner-event-is-cancelled.patch
index 129e8461dc..129e8461dc 100644
--- a/patches/server/0150-Reset-spawner-timer-when-spawner-event-is-cancelled.patch
+++ b/patches/server/0149-Reset-spawner-timer-when-spawner-event-is-cancelled.patch
diff --git a/patches/server/0151-Allow-specifying-a-custom-authentication-servers-dow.patch b/patches/server/0150-Allow-specifying-a-custom-authentication-servers-dow.patch
index adf56dbfaf..adf56dbfaf 100644
--- a/patches/server/0151-Allow-specifying-a-custom-authentication-servers-dow.patch
+++ b/patches/server/0150-Allow-specifying-a-custom-authentication-servers-dow.patch
diff --git a/patches/server/0152-Add-PlayerJumpEvent.patch b/patches/server/0151-Add-PlayerJumpEvent.patch
index 2e506e2c59..2e506e2c59 100644
--- a/patches/server/0152-Add-PlayerJumpEvent.patch
+++ b/patches/server/0151-Add-PlayerJumpEvent.patch
diff --git a/patches/server/0153-handle-ServerboundKeepAlivePacket-async.patch b/patches/server/0152-handle-ServerboundKeepAlivePacket-async.patch
index 4bf90ddb29..4bf90ddb29 100644
--- a/patches/server/0153-handle-ServerboundKeepAlivePacket-async.patch
+++ b/patches/server/0152-handle-ServerboundKeepAlivePacket-async.patch
diff --git a/patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch b/patches/server/0153-Expose-client-protocol-version-and-virtual-host.patch
index 81db745b82..08669dde95 100644
--- a/patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch
+++ b/patches/server/0153-Expose-client-protocol-version-and-virtual-host.patch
@@ -90,7 +90,7 @@ index 7ae4279768b70a4fdc8f4438898871a17c8fe402..582bbb376c75ab5bf737f3015ce8ad45
private void beginLogin(ClientIntentionPacket packet, boolean transfer) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 935815a532725e391465baf6764224dec8d0bc9b..9eddc3ac16645e0a01cc5c2decc8e53f08e7e3dc 100644
+index d471e9370fdbcbce5357e52e8ea2a10c196cd33d..f53504221e660bfe86220a8cc1ae28750794f0cf 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -334,6 +334,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0155-revert-serverside-behavior-of-keepalives.patch b/patches/server/0154-revert-serverside-behavior-of-keepalives.patch
index 349786b31a..349786b31a 100644
--- a/patches/server/0155-revert-serverside-behavior-of-keepalives.patch
+++ b/patches/server/0154-revert-serverside-behavior-of-keepalives.patch
diff --git a/patches/server/0156-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/patches/server/0155-Send-attack-SoundEffects-only-to-players-who-can-see.patch
index f4f07b3245..f4f07b3245 100644
--- a/patches/server/0156-Send-attack-SoundEffects-only-to-players-who-can-see.patch
+++ b/patches/server/0155-Send-attack-SoundEffects-only-to-players-who-can-see.patch
diff --git a/patches/server/0157-Add-PlayerArmorChangeEvent.patch b/patches/server/0156-Add-PlayerArmorChangeEvent.patch
index d9478284f8..d9478284f8 100644
--- a/patches/server/0157-Add-PlayerArmorChangeEvent.patch
+++ b/patches/server/0156-Add-PlayerArmorChangeEvent.patch
diff --git a/patches/server/0158-Prevent-logins-from-being-processed-when-the-player-.patch b/patches/server/0157-Prevent-logins-from-being-processed-when-the-player-.patch
index d98153e8db..d98153e8db 100644
--- a/patches/server/0158-Prevent-logins-from-being-processed-when-the-player-.patch
+++ b/patches/server/0157-Prevent-logins-from-being-processed-when-the-player-.patch
diff --git a/patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch b/patches/server/0158-Fix-MC-117075-Block-entity-unload-lag-spike.patch
index 88b000fa9f..88b000fa9f 100644
--- a/patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch
+++ b/patches/server/0158-Fix-MC-117075-Block-entity-unload-lag-spike.patch
diff --git a/patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch b/patches/server/0159-use-CB-BlockState-implementations-for-captured-block.patch
index eb8b3bd4dc..eb8b3bd4dc 100644
--- a/patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch
+++ b/patches/server/0159-use-CB-BlockState-implementations-for-captured-block.patch
diff --git a/patches/server/0161-API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/0160-API-to-get-a-BlockState-without-a-snapshot.patch
index c7fd071747..c7fd071747 100644
--- a/patches/server/0161-API-to-get-a-BlockState-without-a-snapshot.patch
+++ b/patches/server/0160-API-to-get-a-BlockState-without-a-snapshot.patch
diff --git a/patches/server/0162-AsyncTabCompleteEvent.patch b/patches/server/0161-AsyncTabCompleteEvent.patch
index a7c60ca71e..a7c60ca71e 100644
--- a/patches/server/0162-AsyncTabCompleteEvent.patch
+++ b/patches/server/0161-AsyncTabCompleteEvent.patch
diff --git a/patches/server/0163-PlayerPickupExperienceEvent.patch b/patches/server/0162-PlayerPickupExperienceEvent.patch
index 591fd50b02..591fd50b02 100644
--- a/patches/server/0163-PlayerPickupExperienceEvent.patch
+++ b/patches/server/0162-PlayerPickupExperienceEvent.patch
diff --git a/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch b/patches/server/0163-Ability-to-apply-mending-to-XP-API.patch
index 5b73d571fb..aacf03b700 100644
--- a/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch
+++ b/patches/server/0163-Ability-to-apply-mending-to-XP-API.patch
@@ -14,7 +14,7 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I
public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 8d2c795d8898cd32611366b972b35d132c22eca7..f85711a2ff57498f385da7da9b77ec130aff116b 100644
+index f53504221e660bfe86220a8cc1ae28750794f0cf..93550342c6f181b7622f5d649cd3e5075a464e55 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1638,7 +1638,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0164-PlayerNaturallySpawnCreaturesEvent.patch
index e9b4dead15..df2733cf6d 100644
--- a/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch
+++ b/patches/server/0164-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 a7de9d6bbbd0b3d60b1d49e116c388b1846f33e4..767e3aed729b630d67a702d5e5bda02e9865e6e1 100644
+index 93bd3c633f83c96a7028a97eee3a732489d01b06..fdd1b0a02eb90d39ad3324808d088705ab5651c0 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1074,7 +1074,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1041,7 +1041,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 a7de9d6bbbd0b3d60b1d49e116c388b1846f33e4..767e3aed729b630d67a702d5e5bda02e
// Spigot end
if (!this.distanceManager.hasPlayersNearby(chunkcoordintpair.toLong())) {
return false;
-@@ -1089,6 +1091,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1056,6 +1058,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
entityplayer = (ServerPlayer) iterator.next();
@@ -40,10 +40,10 @@ index a7de9d6bbbd0b3d60b1d49e116c388b1846f33e4..767e3aed729b630d67a702d5e5bda02e
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 0ff45d4ce6ae0b7feac53c7a9f361f6454f8b7c3..035c33b1e1be4f41e5cbe09bf6c3abd617258cad 100644
+index e0c8b89767087cba34fc3c3809db4c386dacb193..a939bad7da9c852827a2d67d9ace5d0df4911a31 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -463,6 +463,15 @@ public class ServerChunkCache extends ChunkSource {
+@@ -461,6 +461,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);
@@ -60,13 +60,13 @@ index 0ff45d4ce6ae0b7feac53c7a9f361f6454f8b7c3..035c33b1e1be4f41e5cbe09bf6c3abd6
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();
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 3ae34c67fe3dd8b30d24f1a31102f0a071c1703d..809a4f403695240b507528fb8fa3f7d390f86349 100644
+index dd2a359eda0ab3aaf5a94e00a1675bae424bd860..db3f5a774daa0750cdcc0c2c47d1bd4fd2900dd9 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -286,6 +286,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -285,6 +285,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+ public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent
// CraftBukkit end
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
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
diff --git a/patches/server/0166-Add-setPlayerProfile-API-for-Skulls.patch b/patches/server/0165-Add-setPlayerProfile-API-for-Skulls.patch
index 108aa16286..d8b7b10015 100644
--- a/patches/server/0166-Add-setPlayerProfile-API-for-Skulls.patch
+++ b/patches/server/0165-Add-setPlayerProfile-API-for-Skulls.patch
@@ -7,7 +7,7 @@ This allows you to create already filled textures on Skulls to avoid texture loo
which commonly cause rate limit issues with Mojang API
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
-index aa965ea05fb364e9cfc4bbf4241a47c3400355b0..45ac1d9193c3a0dc397d6e7ccfccec896fa78a13 100644
+index 08838e17979b59555adc242ccdd7af7cbf11f9d6..23374a104510025fd8f882361a29825d0bec6ee0 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
@@ -98,7 +98,22 @@ public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implemen
diff --git a/patches/server/0167-PreCreatureSpawnEvent.patch b/patches/server/0166-PreCreatureSpawnEvent.patch
index 0f4459f539..0f4459f539 100644
--- a/patches/server/0167-PreCreatureSpawnEvent.patch
+++ b/patches/server/0166-PreCreatureSpawnEvent.patch
diff --git a/patches/server/0168-Fill-Profile-Property-Events.patch b/patches/server/0167-Fill-Profile-Property-Events.patch
index 4a73aa80a3..4a73aa80a3 100644
--- a/patches/server/0168-Fill-Profile-Property-Events.patch
+++ b/patches/server/0167-Fill-Profile-Property-Events.patch
diff --git a/patches/server/0169-Add-PlayerAdvancementCriterionGrantEvent.patch b/patches/server/0168-Add-PlayerAdvancementCriterionGrantEvent.patch
index ddac15d311..ddac15d311 100644
--- a/patches/server/0169-Add-PlayerAdvancementCriterionGrantEvent.patch
+++ b/patches/server/0168-Add-PlayerAdvancementCriterionGrantEvent.patch
diff --git a/patches/server/0170-Add-ArmorStand-Item-Meta.patch b/patches/server/0169-Add-ArmorStand-Item-Meta.patch
index b6aa22ecaf..b6aa22ecaf 100644
--- a/patches/server/0170-Add-ArmorStand-Item-Meta.patch
+++ b/patches/server/0169-Add-ArmorStand-Item-Meta.patch
diff --git a/patches/server/0171-Extend-Player-Interact-cancellation.patch b/patches/server/0170-Extend-Player-Interact-cancellation.patch
index 0317d6e0e4..0317d6e0e4 100644
--- a/patches/server/0171-Extend-Player-Interact-cancellation.patch
+++ b/patches/server/0170-Extend-Player-Interact-cancellation.patch
diff --git a/patches/server/0172-Tameable-getOwnerUniqueId-API.patch b/patches/server/0171-Tameable-getOwnerUniqueId-API.patch
index 8ef9a7ad54..8ef9a7ad54 100644
--- a/patches/server/0172-Tameable-getOwnerUniqueId-API.patch
+++ b/patches/server/0171-Tameable-getOwnerUniqueId-API.patch
diff --git a/patches/server/0173-Toggleable-player-crits.patch b/patches/server/0172-Toggleable-player-crits.patch
index 03d3f5c4f1..03d3f5c4f1 100644
--- a/patches/server/0173-Toggleable-player-crits.patch
+++ b/patches/server/0172-Toggleable-player-crits.patch
diff --git a/patches/server/0174-Disable-Explicit-Network-Manager-Flushing.patch b/patches/server/0173-Disable-Explicit-Network-Manager-Flushing.patch
index 583fa8e586..583fa8e586 100644
--- a/patches/server/0174-Disable-Explicit-Network-Manager-Flushing.patch
+++ b/patches/server/0173-Disable-Explicit-Network-Manager-Flushing.patch
diff --git a/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch b/patches/server/0174-Implement-extended-PaperServerListPingEvent.patch
index 4ca3384be1..f39816c85d 100644
--- a/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch
+++ b/patches/server/0174-Implement-extended-PaperServerListPingEvent.patch
@@ -162,7 +162,7 @@ index 0000000000000000000000000000000000000000..874dcbefea469440a9028ddc399a37c9
+
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 6c46ce47d1460dcd9b387f02a09d85048a45b049..f71b1c2497594b592bcc51be9fa6a6d8fe8e819b 100644
+index e464349a46eab23eb5b8d4d31f577d78532b3ce1..7f4c9ba88c2d33c2cc23e406a616f9eb35d738ce 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -3,6 +3,9 @@ package net.minecraft.server;
@@ -175,7 +175,7 @@ index 6c46ce47d1460dcd9b387f02a09d85048a45b049..f71b1c2497594b592bcc51be9fa6a6d8
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
-@@ -1518,7 +1521,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1517,7 +1520,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.hidesOnlinePlayers()) {
return new ServerStatus.Players(i, list.size(), List.of());
} else {
@@ -185,7 +185,7 @@ index 6c46ce47d1460dcd9b387f02a09d85048a45b049..f71b1c2497594b592bcc51be9fa6a6d8
int k = Mth.nextInt(this.random, 0, list.size() - j);
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
-index 71540687b4212702cdaaad5fd4815fb3eb97ddd6..385457c7151f7e636e1ea2e38ef983f4f532b9b5 100644
+index f08700abb005f487aca95c0457c09cefa9a81be2..532f09089b8d6798999cf3f83e852df7479e450e 100644
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
@@ -49,6 +49,8 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
diff --git a/patches/server/0176-Add-more-fields-to-AsyncPreLoginEvent.patch b/patches/server/0175-Add-more-fields-to-AsyncPreLoginEvent.patch
index 4e9f640751..4e9f640751 100644
--- a/patches/server/0176-Add-more-fields-to-AsyncPreLoginEvent.patch
+++ b/patches/server/0175-Add-more-fields-to-AsyncPreLoginEvent.patch
diff --git a/patches/server/0177-Player.setPlayerProfile-API.patch b/patches/server/0176-Player.setPlayerProfile-API.patch
index 38ad4142e9..043dd1a255 100644
--- a/patches/server/0177-Player.setPlayerProfile-API.patch
+++ b/patches/server/0176-Player.setPlayerProfile-API.patch
@@ -77,7 +77,7 @@ index 818df09e9245b5d89b4180b1eaa51470b7539341..461656e1cb095243bfe7a9ee2906e5b0
public Server getServer() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index f85711a2ff57498f385da7da9b77ec130aff116b..f7534be64cdbf1342b523ef2ab0627f597983e0d 100644
+index 93550342c6f181b7622f5d649cd3e5075a464e55..19f644442eb7ae352d655d5e62f47f261b7b1b0a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -249,11 +249,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0178-getPlayerUniqueId-API.patch b/patches/server/0177-getPlayerUniqueId-API.patch
index e5fe109dd6..e5fe109dd6 100644
--- a/patches/server/0178-getPlayerUniqueId-API.patch
+++ b/patches/server/0177-getPlayerUniqueId-API.patch
diff --git a/patches/server/0179-Improved-Async-Task-Scheduler.patch b/patches/server/0178-Improved-Async-Task-Scheduler.patch
index 3ce3a754e3..3ce3a754e3 100644
--- a/patches/server/0179-Improved-Async-Task-Scheduler.patch
+++ b/patches/server/0178-Improved-Async-Task-Scheduler.patch
diff --git a/patches/server/0180-Make-legacy-ping-handler-more-reliable.patch b/patches/server/0179-Make-legacy-ping-handler-more-reliable.patch
index e9431bd1eb..e9431bd1eb 100644
--- a/patches/server/0180-Make-legacy-ping-handler-more-reliable.patch
+++ b/patches/server/0179-Make-legacy-ping-handler-more-reliable.patch
diff --git a/patches/server/0181-Call-PaperServerListPingEvent-for-legacy-pings.patch b/patches/server/0180-Call-PaperServerListPingEvent-for-legacy-pings.patch
index 5265180dd5..5265180dd5 100644
--- a/patches/server/0181-Call-PaperServerListPingEvent-for-legacy-pings.patch
+++ b/patches/server/0180-Call-PaperServerListPingEvent-for-legacy-pings.patch
diff --git a/patches/server/0182-Flag-to-disable-the-channel-limit.patch b/patches/server/0181-Flag-to-disable-the-channel-limit.patch
index 61d82fcade..fa388c8eb7 100644
--- a/patches/server/0182-Flag-to-disable-the-channel-limit.patch
+++ b/patches/server/0181-Flag-to-disable-the-channel-limit.patch
@@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs.
provide an optional flag to disable this check, at your own risk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index f7534be64cdbf1342b523ef2ab0627f597983e0d..24928a1e12ecedaaa634be0ab5425ee77b0f6556 100644
+index 19f644442eb7ae352d655d5e62f47f261b7b1b0a..db79201906e231b13c6f237193c3e8597bce9106 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -209,6 +209,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0183-Add-openSign-method-to-HumanEntity.patch b/patches/server/0182-Add-openSign-method-to-HumanEntity.patch
index 83658d2f8b..83658d2f8b 100644
--- a/patches/server/0183-Add-openSign-method-to-HumanEntity.patch
+++ b/patches/server/0182-Add-openSign-method-to-HumanEntity.patch
diff --git a/patches/server/0184-Configurable-sprint-interruption-on-attack.patch b/patches/server/0183-Configurable-sprint-interruption-on-attack.patch
index 65dd42f5eb..65dd42f5eb 100644
--- a/patches/server/0184-Configurable-sprint-interruption-on-attack.patch
+++ b/patches/server/0183-Configurable-sprint-interruption-on-attack.patch
diff --git a/patches/server/0185-EndermanEscapeEvent.patch b/patches/server/0184-EndermanEscapeEvent.patch
index 9a4685f868..9a4685f868 100644
--- a/patches/server/0185-EndermanEscapeEvent.patch
+++ b/patches/server/0184-EndermanEscapeEvent.patch
diff --git a/patches/server/0186-Enderman.teleportRandomly.patch b/patches/server/0185-Enderman.teleportRandomly.patch
index aeb2e69493..aeb2e69493 100644
--- a/patches/server/0186-Enderman.teleportRandomly.patch
+++ b/patches/server/0185-Enderman.teleportRandomly.patch
diff --git a/patches/server/0187-Block-Enderpearl-Travel-Exploit.patch b/patches/server/0186-Block-Enderpearl-Travel-Exploit.patch
index e76023350e..c538b3c38a 100644
--- a/patches/server/0187-Block-Enderpearl-Travel-Exploit.patch
+++ b/patches/server/0186-Block-Enderpearl-Travel-Exploit.patch
@@ -16,7 +16,7 @@ public net.minecraft.world.entity.projectile.Projectile cachedOwner
public net.minecraft.world.entity.projectile.Projectile ownerUUID
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 7c835a9328b1ba8426663ed3e9575fcd35a0f748..6107b880612e88d96527ff8ea029875882fb19a1 100644
+index d728afbe1d6882f1ace4ead9d87f4b7d2af43ba2..7c6b094de5e29cb2663e8a7072a27d7adbceb4b2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2111,6 +2111,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch b/patches/server/0187-Expand-World.spawnParticle-API-and-add-Builder.patch
index 02b852e5ae..d98048d69b 100644
--- a/patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch
+++ b/patches/server/0187-Expand-World.spawnParticle-API-and-add-Builder.patch
@@ -10,7 +10,7 @@ Adds an option to control the force mode of the particle.
This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 6107b880612e88d96527ff8ea029875882fb19a1..5bf18ab5c397b32d880ea1827f62945d8d0e80ce 100644
+index 7c6b094de5e29cb2663e8a7072a27d7adbceb4b2..1fac100819e59d00f50e530d3a4157b56d966dba 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1508,12 +1508,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -34,7 +34,7 @@ index 6107b880612e88d96527ff8ea029875882fb19a1..5bf18ab5c397b32d880ea1827f62945d
if (this.sendParticles(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 2794a7996147fce5533877a47cd1e7b6f7e7576f..14fe2bf55b1d00c1f79a1dbbbd6d22bf30ecc277 100644
+index 1b7660a2d003bfb19ef80ba8066b6417f85328ec..3c00eaf52ab04d1396f226cc074d9dd013c57027 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1982,8 +1982,19 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0189-Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/patches/server/0188-Fix-exploit-that-allowed-colored-signs-to-be-created.patch
index 5f4980ec04..5f4980ec04 100644
--- a/patches/server/0189-Fix-exploit-that-allowed-colored-signs-to-be-created.patch
+++ b/patches/server/0188-Fix-exploit-that-allowed-colored-signs-to-be-created.patch
diff --git a/patches/server/0190-EndermanAttackPlayerEvent.patch b/patches/server/0189-EndermanAttackPlayerEvent.patch
index a4e97fbce3..a4e97fbce3 100644
--- a/patches/server/0190-EndermanAttackPlayerEvent.patch
+++ b/patches/server/0189-EndermanAttackPlayerEvent.patch
diff --git a/patches/server/0191-WitchConsumePotionEvent.patch b/patches/server/0190-WitchConsumePotionEvent.patch
index fead120a99..fead120a99 100644
--- a/patches/server/0191-WitchConsumePotionEvent.patch
+++ b/patches/server/0190-WitchConsumePotionEvent.patch
diff --git a/patches/server/0192-WitchThrowPotionEvent.patch b/patches/server/0191-WitchThrowPotionEvent.patch
index d6be87ca72..d6be87ca72 100644
--- a/patches/server/0192-WitchThrowPotionEvent.patch
+++ b/patches/server/0191-WitchThrowPotionEvent.patch
diff --git a/patches/server/0193-WitchReadyPotionEvent.patch b/patches/server/0192-WitchReadyPotionEvent.patch
index 6581d99e31..6581d99e31 100644
--- a/patches/server/0193-WitchReadyPotionEvent.patch
+++ b/patches/server/0192-WitchReadyPotionEvent.patch
diff --git a/patches/server/0194-ItemStack-getMaxItemUseDuration.patch b/patches/server/0193-ItemStack-getMaxItemUseDuration.patch
index 7bd4cd1c1b..7bd4cd1c1b 100644
--- a/patches/server/0194-ItemStack-getMaxItemUseDuration.patch
+++ b/patches/server/0193-ItemStack-getMaxItemUseDuration.patch
diff --git a/patches/server/0195-Add-EntityTeleportEndGatewayEvent.patch b/patches/server/0194-Add-EntityTeleportEndGatewayEvent.patch
index 56df3551ea..56df3551ea 100644
--- a/patches/server/0195-Add-EntityTeleportEndGatewayEvent.patch
+++ b/patches/server/0194-Add-EntityTeleportEndGatewayEvent.patch
diff --git a/patches/server/0196-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch b/patches/server/0195-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch
index 5b57f10fdc..100c67ec88 100644
--- a/patches/server/0196-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch
+++ b/patches/server/0195-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event
Otherwise the creeper infinite explodes
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
-index 0ac3cff0bc159169c644d8f770671c55775c5fdb..c3f59f4a2190327340df71c1283be490557a0a58 100644
+index 39486215ac080220a6018a35a8437092dbc8fe9d..95df4ac539ec284654c53d39955870a46478c27d 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
@@ -278,6 +278,7 @@ public class Creeper extends Monster implements PowerableMob {
diff --git a/patches/server/0197-Fix-CraftEntity-hashCode.patch b/patches/server/0196-Fix-CraftEntity-hashCode.patch
index 56dcc01026..56dcc01026 100644
--- a/patches/server/0197-Fix-CraftEntity-hashCode.patch
+++ b/patches/server/0196-Fix-CraftEntity-hashCode.patch
diff --git a/patches/server/0198-Configurable-LootPool-luck-formula.patch b/patches/server/0197-Configurable-LootPool-luck-formula.patch
index 33c95e3339..33c95e3339 100644
--- a/patches/server/0198-Configurable-LootPool-luck-formula.patch
+++ b/patches/server/0197-Configurable-LootPool-luck-formula.patch
diff --git a/patches/server/0199-Print-Error-details-when-failing-to-save-player-data.patch b/patches/server/0198-Print-Error-details-when-failing-to-save-player-data.patch
index 19f2e71553..19f2e71553 100644
--- a/patches/server/0199-Print-Error-details-when-failing-to-save-player-data.patch
+++ b/patches/server/0198-Print-Error-details-when-failing-to-save-player-data.patch
diff --git a/patches/server/0200-Make-shield-blocking-delay-configurable.patch b/patches/server/0199-Make-shield-blocking-delay-configurable.patch
index 9468400c10..9468400c10 100644
--- a/patches/server/0200-Make-shield-blocking-delay-configurable.patch
+++ b/patches/server/0199-Make-shield-blocking-delay-configurable.patch
diff --git a/patches/server/0201-Improve-EntityShootBowEvent.patch b/patches/server/0200-Improve-EntityShootBowEvent.patch
index cf16054262..cf16054262 100644
--- a/patches/server/0201-Improve-EntityShootBowEvent.patch
+++ b/patches/server/0200-Improve-EntityShootBowEvent.patch
diff --git a/patches/server/0202-PlayerReadyArrowEvent.patch b/patches/server/0201-PlayerReadyArrowEvent.patch
index 37f2fbca4e..37f2fbca4e 100644
--- a/patches/server/0202-PlayerReadyArrowEvent.patch
+++ b/patches/server/0201-PlayerReadyArrowEvent.patch
diff --git a/patches/server/0203-Add-entity-knockback-events.patch b/patches/server/0202-Add-entity-knockback-events.patch
index c87dbadcd6..c87dbadcd6 100644
--- a/patches/server/0203-Add-entity-knockback-events.patch
+++ b/patches/server/0202-Add-entity-knockback-events.patch
diff --git a/patches/server/0204-Expand-Explosions-API.patch b/patches/server/0203-Expand-Explosions-API.patch
index 7ca263daee..eb56a95124 100644
--- a/patches/server/0204-Expand-Explosions-API.patch
+++ b/patches/server/0203-Expand-Explosions-API.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 14fe2bf55b1d00c1f79a1dbbbd6d22bf30ecc277..ad9d5cdedd234e48ec319b3c2e854a3c87a9c6bd 100644
+index 3c00eaf52ab04d1396f226cc074d9dd013c57027..b2a1f7e6576757d02a0369c42d4526ca3ac3d775 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -789,6 +789,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0205-LivingEntity-Active-Item-API.patch b/patches/server/0204-LivingEntity-Active-Item-API.patch
index a39708f120..a39708f120 100644
--- a/patches/server/0205-LivingEntity-Active-Item-API.patch
+++ b/patches/server/0204-LivingEntity-Active-Item-API.patch
diff --git a/patches/server/0206-RangedEntity-API.patch b/patches/server/0205-RangedEntity-API.patch
index 2b548743e2..2b548743e2 100644
--- a/patches/server/0206-RangedEntity-API.patch
+++ b/patches/server/0205-RangedEntity-API.patch
diff --git a/patches/server/0207-Add-config-to-disable-ender-dragon-legacy-check.patch b/patches/server/0206-Add-config-to-disable-ender-dragon-legacy-check.patch
index c9acef0191..c9acef0191 100644
--- a/patches/server/0207-Add-config-to-disable-ender-dragon-legacy-check.patch
+++ b/patches/server/0206-Add-config-to-disable-ender-dragon-legacy-check.patch
diff --git a/patches/server/0208-Implement-World.getEntity-UUID-API.patch b/patches/server/0207-Implement-World.getEntity-UUID-API.patch
index 71c159151e..315b2e7ac4 100644
--- a/patches/server/0208-Implement-World.getEntity-UUID-API.patch
+++ b/patches/server/0207-Implement-World.getEntity-UUID-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Implement World.getEntity(UUID) API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index ad9d5cdedd234e48ec319b3c2e854a3c87a9c6bd..0f009c32e95e567b9f22f16fbba0c57d4b227ab6 100644
+index b2a1f7e6576757d02a0369c42d4526ca3ac3d775..281fa67cb5c95e6016c7220c0ef912bbfd28cd9f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1125,6 +1125,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0209-InventoryCloseEvent-Reason-API.patch b/patches/server/0208-InventoryCloseEvent-Reason-API.patch
index 9a7d5952e6..684e64a5c9 100644
--- a/patches/server/0209-InventoryCloseEvent-Reason-API.patch
+++ b/patches/server/0208-InventoryCloseEvent-Reason-API.patch
@@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 5bf18ab5c397b32d880ea1827f62945d8d0e80ce..ce6be7aed7b392c3e0c851f3f6e1e216bccceaf5 100644
+index 1fac100819e59d00f50e530d3a4157b56d966dba..4f777c9d8c3052f68bc0465c8a7386b8fb486c83 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1239,7 +1239,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -29,10 +29,10 @@ index 5bf18ab5c397b32d880ea1827f62945d8d0e80ce..ce6be7aed7b392c3e0c851f3f6e1e216
}
// 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 2e66315859c9374ae77288c35aaddf56d60cf0a2..7c00c4244233cee313127c1e8c06ef9288d5b9b1 100644
+index db3f5a774daa0750cdcc0c2c47d1bd4fd2900dd9..00a1a570e9f7abf97a25b4bab2b7532d3dad7912 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -707,7 +707,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -704,7 +704,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
// Paper end - Configurable container update tick rate
if (!this.level().isClientSide && !this.containerMenu.stillValid(this)) {
@@ -41,7 +41,7 @@ index 2e66315859c9374ae77288c35aaddf56d60cf0a2..7c00c4244233cee313127c1e8c06ef92
this.containerMenu = this.inventoryMenu;
}
-@@ -927,7 +927,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -924,7 +924,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
// SPIGOT-943 - only call if they have an inventory open
if (this.containerMenu != this.inventoryMenu) {
@@ -50,7 +50,7 @@ index 2e66315859c9374ae77288c35aaddf56d60cf0a2..7c00c4244233cee313127c1e8c06ef92
}
net.kyori.adventure.text.Component deathMessage = event.deathMessage() != null ? event.deathMessage() : net.kyori.adventure.text.Component.empty(); // Paper - Adventure
-@@ -1594,7 +1594,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1591,7 +1591,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
// CraftBukkit end
if (this.containerMenu != this.inventoryMenu) {
@@ -59,7 +59,7 @@ index 2e66315859c9374ae77288c35aaddf56d60cf0a2..7c00c4244233cee313127c1e8c06ef92
}
// this.nextContainerCounter(); // CraftBukkit - moved up
-@@ -1624,7 +1624,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1621,7 +1621,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@Override
public void closeContainer() {
@@ -165,7 +165,7 @@ index 2e02fc22a889c9c8010ae8bff1b59a13219ae014..703bb1bb42b1668c04824489fd2f3490
@Override
public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 24928a1e12ecedaaa634be0ab5425ee77b0f6556..62c9f17fc4eeb5d26bfbeabad53016d959198393 100644
+index db79201906e231b13c6f237193c3e8597bce9106..7ad63581c7c78a7d8b78be2e95002550b3b2c222 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1273,7 +1273,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0210-Vex-get-setSummoner-API.patch b/patches/server/0209-Vex-get-setSummoner-API.patch
index 9c014ff1fc..9c014ff1fc 100644
--- a/patches/server/0210-Vex-get-setSummoner-API.patch
+++ b/patches/server/0209-Vex-get-setSummoner-API.patch
diff --git a/patches/server/0211-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/patches/server/0210-Refresh-player-inventory-when-cancelling-PlayerInter.patch
index ebc80323b4..ebc80323b4 100644
--- a/patches/server/0211-Refresh-player-inventory-when-cancelling-PlayerInter.patch
+++ b/patches/server/0210-Refresh-player-inventory-when-cancelling-PlayerInter.patch
diff --git a/patches/server/0212-add-more-information-to-Entity.toString.patch b/patches/server/0211-add-more-information-to-Entity.toString.patch
index 3fcefb7c59..3fcefb7c59 100644
--- a/patches/server/0212-add-more-information-to-Entity.toString.patch
+++ b/patches/server/0211-add-more-information-to-Entity.toString.patch
diff --git a/patches/server/0213-EnderDragon-Events.patch b/patches/server/0212-EnderDragon-Events.patch
index 73e0d7b169..73e0d7b169 100644
--- a/patches/server/0213-EnderDragon-Events.patch
+++ b/patches/server/0212-EnderDragon-Events.patch
diff --git a/patches/server/0214-PlayerElytraBoostEvent.patch b/patches/server/0213-PlayerElytraBoostEvent.patch
index 0581d2cd0a..0581d2cd0a 100644
--- a/patches/server/0214-PlayerElytraBoostEvent.patch
+++ b/patches/server/0213-PlayerElytraBoostEvent.patch
diff --git a/patches/server/0215-PlayerLaunchProjectileEvent.patch b/patches/server/0214-PlayerLaunchProjectileEvent.patch
index be34c111d3..be34c111d3 100644
--- a/patches/server/0215-PlayerLaunchProjectileEvent.patch
+++ b/patches/server/0214-PlayerLaunchProjectileEvent.patch
diff --git a/patches/server/0216-Improve-BlockPosition-inlining.patch b/patches/server/0215-Improve-BlockPosition-inlining.patch
index 469c5f7390..469c5f7390 100644
--- a/patches/server/0216-Improve-BlockPosition-inlining.patch
+++ b/patches/server/0215-Improve-BlockPosition-inlining.patch
diff --git a/patches/server/0217-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/patches/server/0216-Option-to-prevent-armor-stands-from-doing-entity-loo.patch
index 474a50ce86..474a50ce86 100644
--- a/patches/server/0217-Option-to-prevent-armor-stands-from-doing-entity-loo.patch
+++ b/patches/server/0216-Option-to-prevent-armor-stands-from-doing-entity-loo.patch
diff --git a/patches/server/0218-Vanished-players-don-t-have-rights.patch b/patches/server/0217-Vanished-players-don-t-have-rights.patch
index fc55caf3e7..fc55caf3e7 100644
--- a/patches/server/0218-Vanished-players-don-t-have-rights.patch
+++ b/patches/server/0217-Vanished-players-don-t-have-rights.patch
diff --git a/patches/server/0219-Allow-disabling-armor-stand-ticking.patch b/patches/server/0218-Allow-disabling-armor-stand-ticking.patch
index bf0bbc008e..bf0bbc008e 100644
--- a/patches/server/0219-Allow-disabling-armor-stand-ticking.patch
+++ b/patches/server/0218-Allow-disabling-armor-stand-ticking.patch
diff --git a/patches/server/0220-SkeletonHorse-Additions.patch b/patches/server/0219-SkeletonHorse-Additions.patch
index 3d2b910a9b..3d2b910a9b 100644
--- a/patches/server/0220-SkeletonHorse-Additions.patch
+++ b/patches/server/0219-SkeletonHorse-Additions.patch
diff --git a/patches/server/0221-Expand-ArmorStand-API.patch b/patches/server/0220-Expand-ArmorStand-API.patch
index d68ca34219..d68ca34219 100644
--- a/patches/server/0221-Expand-ArmorStand-API.patch
+++ b/patches/server/0220-Expand-ArmorStand-API.patch
diff --git a/patches/server/0222-AnvilDamageEvent.patch b/patches/server/0221-AnvilDamageEvent.patch
index 6fca9fbf25..6fca9fbf25 100644
--- a/patches/server/0222-AnvilDamageEvent.patch
+++ b/patches/server/0221-AnvilDamageEvent.patch
diff --git a/patches/server/0223-Add-TNTPrimeEvent.patch b/patches/server/0222-Add-TNTPrimeEvent.patch
index cbeaf2b4f1..cbeaf2b4f1 100644
--- a/patches/server/0223-Add-TNTPrimeEvent.patch
+++ b/patches/server/0222-Add-TNTPrimeEvent.patch
diff --git a/patches/server/0224-Break-up-and-make-tab-spam-limits-configurable.patch b/patches/server/0223-Break-up-and-make-tab-spam-limits-configurable.patch
index 43418bc01d..43418bc01d 100644
--- a/patches/server/0224-Break-up-and-make-tab-spam-limits-configurable.patch
+++ b/patches/server/0223-Break-up-and-make-tab-spam-limits-configurable.patch
diff --git a/patches/server/0225-Fix-NBT-type-issues.patch b/patches/server/0224-Fix-NBT-type-issues.patch
index 7444db91d2..7444db91d2 100644
--- a/patches/server/0225-Fix-NBT-type-issues.patch
+++ b/patches/server/0224-Fix-NBT-type-issues.patch
diff --git a/patches/server/0226-Remove-unnecessary-itemmeta-handling.patch b/patches/server/0225-Remove-unnecessary-itemmeta-handling.patch
index 6a2f490da8..6a2f490da8 100644
--- a/patches/server/0226-Remove-unnecessary-itemmeta-handling.patch
+++ b/patches/server/0225-Remove-unnecessary-itemmeta-handling.patch
diff --git a/patches/server/0227-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/0226-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
index 2e6cd0dafe..dcfb0130df 100644
--- a/patches/server/0227-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
+++ b/patches/server/0226-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 767e3aed729b630d67a702d5e5bda02e9865e6e1..27eaeea3f0719167d89e39b0b60f91ad9cc9f64e 100644
+index fdd1b0a02eb90d39ad3324808d088705ab5651c0..bdaef11e9f8a78c7777b6a98fcca881c8f253bda 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1294,6 +1294,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1258,6 +1258,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 767e3aed729b630d67a702d5e5bda02e9865e6e1..27eaeea3f0719167d89e39b0b60f91ad
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
playerchunkmap_entitytracker.updatePlayers(this.level.players());
if (entity instanceof ServerPlayer) {
-@@ -1334,7 +1335,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1298,7 +1299,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.broadcastRemoved();
}
@@ -26,7 +26,7 @@ index 767e3aed729b630d67a702d5e5bda02e9865e6e1..27eaeea3f0719167d89e39b0b60f91ad
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 ce6be7aed7b392c3e0c851f3f6e1e216bccceaf5..b151506b96a51c74ba408cb555a4d38507b2f8c1 100644
+index 4f777c9d8c3052f68bc0465c8a7386b8fb486c83..e9d08662c065d04a67918f0aa2cd4fde5798f2a6 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1201,6 +1201,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0228-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0227-Add-Early-Warning-Feature-to-WatchDog.patch
index 545fb80f1b..c10cbb4250 100644
--- a/patches/server/0228-Add-Early-Warning-Feature-to-WatchDog.patch
+++ b/patches/server/0227-Add-Early-Warning-Feature-to-WatchDog.patch
@@ -9,7 +9,7 @@ thread dumps at an interval until the point of crash.
This will help diagnose what was going on in that time before the crash.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index f71b1c2497594b592bcc51be9fa6a6d8fe8e819b..6a97ab5e8a435e67df77b1d0480ccb397314ee05 100644
+index 7f4c9ba88c2d33c2cc23e406a616f9eb35d738ce..5d429b707383e6620a0d83f23d7a8694ecc70735 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1108,6 +1108,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0229-Use-ConcurrentHashMap-in-JsonList.patch b/patches/server/0228-Use-ConcurrentHashMap-in-JsonList.patch
index 06ff8bd2a0..06ff8bd2a0 100644
--- a/patches/server/0229-Use-ConcurrentHashMap-in-JsonList.patch
+++ b/patches/server/0228-Use-ConcurrentHashMap-in-JsonList.patch
diff --git a/patches/server/0230-Use-a-Queue-for-Queueing-Commands.patch b/patches/server/0229-Use-a-Queue-for-Queueing-Commands.patch
index eee2655478..eee2655478 100644
--- a/patches/server/0230-Use-a-Queue-for-Queueing-Commands.patch
+++ b/patches/server/0229-Use-a-Queue-for-Queueing-Commands.patch
diff --git a/patches/server/0231-Ability-to-get-block-entities-from-a-chunk-without-s.patch b/patches/server/0230-Ability-to-get-block-entities-from-a-chunk-without-s.patch
index 8ecb7597f5..8ecb7597f5 100644
--- a/patches/server/0231-Ability-to-get-block-entities-from-a-chunk-without-s.patch
+++ b/patches/server/0230-Ability-to-get-block-entities-from-a-chunk-without-s.patch
diff --git a/patches/server/0232-Optimize-BlockPosition-helper-methods.patch b/patches/server/0231-Optimize-BlockPosition-helper-methods.patch
index b5729f8949..b5729f8949 100644
--- a/patches/server/0232-Optimize-BlockPosition-helper-methods.patch
+++ b/patches/server/0231-Optimize-BlockPosition-helper-methods.patch
diff --git a/patches/server/0233-Restore-vanilla-default-mob-spawn-range-and-water-an.patch b/patches/server/0232-Restore-vanilla-default-mob-spawn-range-and-water-an.patch
index 0ed98b85c4..0ed98b85c4 100644
--- a/patches/server/0233-Restore-vanilla-default-mob-spawn-range-and-water-an.patch
+++ b/patches/server/0232-Restore-vanilla-default-mob-spawn-range-and-water-an.patch
diff --git a/patches/server/0234-Slime-Pathfinder-Events.patch b/patches/server/0233-Slime-Pathfinder-Events.patch
index 3cbd43d550..3cbd43d550 100644
--- a/patches/server/0234-Slime-Pathfinder-Events.patch
+++ b/patches/server/0233-Slime-Pathfinder-Events.patch
diff --git a/patches/server/0235-Configurable-speed-for-water-flowing-over-lava.patch b/patches/server/0234-Configurable-speed-for-water-flowing-over-lava.patch
index fafdd583ab..fafdd583ab 100644
--- a/patches/server/0235-Configurable-speed-for-water-flowing-over-lava.patch
+++ b/patches/server/0234-Configurable-speed-for-water-flowing-over-lava.patch
diff --git a/patches/server/0236-Optimize-CraftBlockData-Creation.patch b/patches/server/0235-Optimize-CraftBlockData-Creation.patch
index 8f037e052a..8f037e052a 100644
--- a/patches/server/0236-Optimize-CraftBlockData-Creation.patch
+++ b/patches/server/0235-Optimize-CraftBlockData-Creation.patch
diff --git a/patches/server/0237-Optimize-MappedRegistry.patch b/patches/server/0236-Optimize-MappedRegistry.patch
index 17c68f31d7..17c68f31d7 100644
--- a/patches/server/0237-Optimize-MappedRegistry.patch
+++ b/patches/server/0236-Optimize-MappedRegistry.patch
diff --git a/patches/server/0238-Add-PhantomPreSpawnEvent.patch b/patches/server/0237-Add-PhantomPreSpawnEvent.patch
index 42c7ae9133..42c7ae9133 100644
--- a/patches/server/0238-Add-PhantomPreSpawnEvent.patch
+++ b/patches/server/0237-Add-PhantomPreSpawnEvent.patch
diff --git a/patches/server/0239-Add-More-Creeper-API.patch b/patches/server/0238-Add-More-Creeper-API.patch
index 931f2b6158..931f2b6158 100644
--- a/patches/server/0239-Add-More-Creeper-API.patch
+++ b/patches/server/0238-Add-More-Creeper-API.patch
diff --git a/patches/server/0240-Inventory-removeItemAnySlot.patch b/patches/server/0239-Inventory-removeItemAnySlot.patch
index 1316343a0a..1316343a0a 100644
--- a/patches/server/0240-Inventory-removeItemAnySlot.patch
+++ b/patches/server/0239-Inventory-removeItemAnySlot.patch
diff --git a/patches/server/0241-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/patches/server/0240-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch
index 51e8f0ca18..911ca5db1f 100644
--- a/patches/server/0241-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch
+++ b/patches/server/0240-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 0f009c32e95e567b9f22f16fbba0c57d4b227ab6..6bb69da5f20cdb7a77329b248ad8d981e4011d7c 100644
+index 281fa67cb5c95e6016c7220c0ef912bbfd28cd9f..333e3109d19c867e8a74f20693952bdb3df804e4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -432,7 +432,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0242-Add-ray-tracing-methods-to-LivingEntity.patch b/patches/server/0241-Add-ray-tracing-methods-to-LivingEntity.patch
index f490695366..f490695366 100644
--- a/patches/server/0242-Add-ray-tracing-methods-to-LivingEntity.patch
+++ b/patches/server/0241-Add-ray-tracing-methods-to-LivingEntity.patch
diff --git a/patches/server/0243-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0242-Expose-attack-cooldown-methods-for-Player.patch
index aa32d93194..56a5662d56 100644
--- a/patches/server/0243-Expose-attack-cooldown-methods-for-Player.patch
+++ b/patches/server/0242-Expose-attack-cooldown-methods-for-Player.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 62c9f17fc4eeb5d26bfbeabad53016d959198393..e55a8171ba65e1ca499ba3c6aaab9a63702fc298 100644
+index 7ad63581c7c78a7d8b78be2e95002550b3b2c222..597594409b4d1fadf4ae1c3a7156421e70989d97 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2980,6 +2980,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0244-Improve-death-events.patch b/patches/server/0243-Improve-death-events.patch
index b4d51a0bb0..13a1d5d493 100644
--- a/patches/server/0244-Improve-death-events.patch
+++ b/patches/server/0243-Improve-death-events.patch
@@ -19,7 +19,7 @@ public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sou
public net.minecraft.world.entity.LivingEntity getSoundVolume()F
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 7c00c4244233cee313127c1e8c06ef9288d5b9b1..91cc0488c37f60035d99aa310d99d5b8377dbafe 100644
+index 00a1a570e9f7abf97a25b4bab2b7532d3dad7912..0706dd82cfdb6808ef61149b2a8d8be971f19be9 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -268,6 +268,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@@ -33,7 +33,7 @@ index 7c00c4244233cee313127c1e8c06ef9288d5b9b1..91cc0488c37f60035d99aa310d99d5b8
// CraftBukkit start
public CraftPlayer.TransferCookieConnection transferCookieConnection;
-@@ -896,7 +900,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -893,7 +897,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@Override
public void die(DamageSource damageSource) {
@@ -42,7 +42,7 @@ index 7c00c4244233cee313127c1e8c06ef9288d5b9b1..91cc0488c37f60035d99aa310d99d5b8
boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
// CraftBukkit start - fire PlayerDeathEvent
if (this.isRemoved()) {
-@@ -924,6 +928,16 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -921,6 +925,16 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
String deathmessage = defaultMessage.getString();
this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, damageSource, loot, PaperAdventure.asAdventure(defaultMessage), keepInventory); // Paper - Adventure
@@ -59,7 +59,7 @@ index 7c00c4244233cee313127c1e8c06ef9288d5b9b1..91cc0488c37f60035d99aa310d99d5b8
// SPIGOT-943 - only call if they have an inventory open
if (this.containerMenu != this.inventoryMenu) {
-@@ -1072,8 +1086,17 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1069,8 +1083,17 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
}
}
@@ -423,7 +423,7 @@ index ee3902cbada46ffb78c42dbf6f00c859546c76e1..92bb0c63330ad3a4cb13b2dc65502071
// CraftBukkit end
this.gameEvent(GameEvent.ENTITY_DIE);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index e55a8171ba65e1ca499ba3c6aaab9a63702fc298..ebb465cbc60d09d0087d2545ebd3b455bf5216de 100644
+index 597594409b4d1fadf4ae1c3a7156421e70989d97..2d1e0e92e6d98a9cf597c3717c36ea5a337577c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2517,7 +2517,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0245-Allow-chests-to-be-placed-with-NBT-data.patch b/patches/server/0244-Allow-chests-to-be-placed-with-NBT-data.patch
index 7bb901ef2e..7bb901ef2e 100644
--- a/patches/server/0245-Allow-chests-to-be-placed-with-NBT-data.patch
+++ b/patches/server/0244-Allow-chests-to-be-placed-with-NBT-data.patch
diff --git a/patches/server/0246-Mob-Pathfinding-API.patch b/patches/server/0245-Mob-Pathfinding-API.patch
index 7cf9f7d7fa..7cf9f7d7fa 100644
--- a/patches/server/0246-Mob-Pathfinding-API.patch
+++ b/patches/server/0245-Mob-Pathfinding-API.patch
diff --git a/patches/server/0247-Prevent-various-interactions-from-causing-chunk-load.patch b/patches/server/0246-Prevent-various-interactions-from-causing-chunk-load.patch
index 01a574e73c..01a574e73c 100644
--- a/patches/server/0247-Prevent-various-interactions-from-causing-chunk-load.patch
+++ b/patches/server/0246-Prevent-various-interactions-from-causing-chunk-load.patch
diff --git a/patches/server/0248-Prevent-mob-spawning-from-loading-generating-chunks.patch b/patches/server/0247-Prevent-mob-spawning-from-loading-generating-chunks.patch
index 1ca48ef5a8..1ca48ef5a8 100644
--- a/patches/server/0248-Prevent-mob-spawning-from-loading-generating-chunks.patch
+++ b/patches/server/0247-Prevent-mob-spawning-from-loading-generating-chunks.patch
diff --git a/patches/server/0249-Implement-furnace-cook-speed-multiplier-API.patch b/patches/server/0248-Implement-furnace-cook-speed-multiplier-API.patch
index 24067a522f..24067a522f 100644
--- a/patches/server/0249-Implement-furnace-cook-speed-multiplier-API.patch
+++ b/patches/server/0248-Implement-furnace-cook-speed-multiplier-API.patch
diff --git a/patches/server/0250-Honor-EntityAgeable.ageLock.patch b/patches/server/0249-Honor-EntityAgeable.ageLock.patch
index e1922af42f..1522ccc882 100644
--- a/patches/server/0250-Honor-EntityAgeable.ageLock.patch
+++ b/patches/server/0249-Honor-EntityAgeable.ageLock.patch
@@ -17,7 +17,7 @@ index f07cf6d91e0cbad80c3c630c0d505820e701ce81..3dc3609d13a7b823d15384d1c385b68e
int k = j;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
-index be91618d84be4a77b2f8a13e9b4024b5892c25e0..344b18127d3e8c7408a162cc85287382bdfdda9a 100644
+index 4ee7a4e5637fe36eb50e8ec9186d72d1253bfd98..b345403cdf5b2828f99708fef65136594a3331c3 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
@@ -446,6 +446,7 @@ public class BeehiveBlockEntity extends BlockEntity {
diff --git a/patches/server/0251-Configurable-connection-throttle-kick-message.patch b/patches/server/0250-Configurable-connection-throttle-kick-message.patch
index ed8fbcb06d..ed8fbcb06d 100644
--- a/patches/server/0251-Configurable-connection-throttle-kick-message.patch
+++ b/patches/server/0250-Configurable-connection-throttle-kick-message.patch
diff --git a/patches/server/0252-Prevent-chunk-loading-from-Fluid-Flowing.patch b/patches/server/0251-Prevent-chunk-loading-from-Fluid-Flowing.patch
index 50c82e5d54..50c82e5d54 100644
--- a/patches/server/0252-Prevent-chunk-loading-from-Fluid-Flowing.patch
+++ b/patches/server/0251-Prevent-chunk-loading-from-Fluid-Flowing.patch
diff --git a/patches/server/0253-PreSpawnerSpawnEvent.patch b/patches/server/0252-PreSpawnerSpawnEvent.patch
index 3512bab510..3512bab510 100644
--- a/patches/server/0253-PreSpawnerSpawnEvent.patch
+++ b/patches/server/0252-PreSpawnerSpawnEvent.patch
diff --git a/patches/server/0254-Add-LivingEntity-getTargetEntity.patch b/patches/server/0253-Add-LivingEntity-getTargetEntity.patch
index f75a1b66aa..f75a1b66aa 100644
--- a/patches/server/0254-Add-LivingEntity-getTargetEntity.patch
+++ b/patches/server/0253-Add-LivingEntity-getTargetEntity.patch
diff --git a/patches/server/0255-Add-sun-related-API.patch b/patches/server/0254-Add-sun-related-API.patch
index f49649147c..01cd62209b 100644
--- a/patches/server/0255-Add-sun-related-API.patch
+++ b/patches/server/0254-Add-sun-related-API.patch
@@ -7,7 +7,7 @@ Subject: [PATCH] Add sun related API
public net.minecraft.world.entity.Mob isSunBurnTick()Z
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 6bb69da5f20cdb7a77329b248ad8d981e4011d7c..eafb186d158c6cf26b97b1982597bde377396172 100644
+index 333e3109d19c867e8a74f20693952bdb3df804e4..20bb365b188c7081123db87186f0e1a999758817 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -756,6 +756,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0256-Turtle-API.patch b/patches/server/0255-Turtle-API.patch
index efd6b79262..efd6b79262 100644
--- a/patches/server/0256-Turtle-API.patch
+++ b/patches/server/0255-Turtle-API.patch
diff --git a/patches/server/0257-Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/0256-Call-player-spectator-target-events-and-improve-impl.patch
index 6ffec5ffc7..802153b657 100644
--- a/patches/server/0257-Call-player-spectator-target-events-and-improve-impl.patch
+++ b/patches/server/0256-Call-player-spectator-target-events-and-improve-impl.patch
@@ -19,10 +19,10 @@ spectate the target entity.
Co-authored-by: Spottedleaf <[email protected]>
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 5bf3f2faac0af6bddfd2ecb423a13cdf0dd1af1b..2fd93f715bd69fb0217939c87f7872720a9adb7c 100644
+index 0706dd82cfdb6808ef61149b2a8d8be971f19be9..ae9d058e9450f59bb6a03ebc6fffed8a0b3ebee8 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2185,6 +2185,21 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2182,6 +2182,21 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.camera = (Entity) (entity == null ? this : entity);
if (entity1 != this.camera) {
diff --git a/patches/server/0258-Add-more-Witch-API.patch b/patches/server/0257-Add-more-Witch-API.patch
index ead3a185c6..ead3a185c6 100644
--- a/patches/server/0258-Add-more-Witch-API.patch
+++ b/patches/server/0257-Add-more-Witch-API.patch
diff --git a/patches/server/0259-Check-Drowned-for-Villager-Aggression-Config.patch b/patches/server/0258-Check-Drowned-for-Villager-Aggression-Config.patch
index efafeb919c..efafeb919c 100644
--- a/patches/server/0259-Check-Drowned-for-Villager-Aggression-Config.patch
+++ b/patches/server/0258-Check-Drowned-for-Villager-Aggression-Config.patch
diff --git a/patches/server/0260-Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/0259-Add-option-to-prevent-players-from-moving-into-unloa.patch
index bcd7e3f8f6..bcd7e3f8f6 100644
--- a/patches/server/0260-Add-option-to-prevent-players-from-moving-into-unloa.patch
+++ b/patches/server/0259-Add-option-to-prevent-players-from-moving-into-unloa.patch
diff --git a/patches/server/0261-Reset-players-airTicks-on-respawn.patch b/patches/server/0260-Reset-players-airTicks-on-respawn.patch
index c7bda44c48..c14f0e7188 100644
--- a/patches/server/0261-Reset-players-airTicks-on-respawn.patch
+++ b/patches/server/0260-Reset-players-airTicks-on-respawn.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Reset players airTicks on respawn
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 099e740df4966be29a52ea1398bfc7f531d4fb9d..1056286007e1c16c6fce3df7918a082a545f92b5 100644
+index ae9d058e9450f59bb6a03ebc6fffed8a0b3ebee8..dad9d89d77001d2c84fbae7a8a4a4312cc5953dc 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2706,6 +2706,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2703,6 +2703,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.setHealth(this.getMaxHealth());
this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset
diff --git a/patches/server/0262-Don-t-sleep-after-profile-lookups-if-not-needed.patch b/patches/server/0261-Don-t-sleep-after-profile-lookups-if-not-needed.patch
index d871ee76b6..d871ee76b6 100644
--- a/patches/server/0262-Don-t-sleep-after-profile-lookups-if-not-needed.patch
+++ b/patches/server/0261-Don-t-sleep-after-profile-lookups-if-not-needed.patch
diff --git a/patches/server/0263-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/0262-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
index 9ea7802386..278b5c5f14 100644
--- a/patches/server/0263-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
+++ b/patches/server/0262-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
@@ -92,7 +92,7 @@ index 54562fa04d14a937451ea7aa9d80194f2c31b471..4cf88f6d815d60cfbf8e4ecf9d96d0cf
return executorService;
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 6a97ab5e8a435e67df77b1d0480ccb397314ee05..c8b5714ad87b501fdf820ae2ad8e6a4bdef82651 100644
+index 5d429b707383e6620a0d83f23d7a8694ecc70735..995ee6b2af01a14d61a031008dd05518668a98ae 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -323,6 +323,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0264-Optimize-World-Time-Updates.patch b/patches/server/0263-Optimize-World-Time-Updates.patch
index a0210bfae8..1ce97af599 100644
--- a/patches/server/0264-Optimize-World-Time-Updates.patch
+++ b/patches/server/0263-Optimize-World-Time-Updates.patch
@@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet
object for every player unless they have per-player time enabled.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index c8b5714ad87b501fdf820ae2ad8e6a4bdef82651..2e96a4c61f9053c20060e9f45a313a6135ea4f16 100644
+index 995ee6b2af01a14d61a031008dd05518668a98ae..0b266d3855723752d7789340f5d98ea106a97722 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1563,12 +1563,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1562,12 +1562,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
// Send time updates to everyone, it will get the right time from the world the player is in.
diff --git a/patches/server/0265-Restore-custom-InventoryHolder-support.patch b/patches/server/0264-Restore-custom-InventoryHolder-support.patch
index 4fa1d8fac1..4fa1d8fac1 100644
--- a/patches/server/0265-Restore-custom-InventoryHolder-support.patch
+++ b/patches/server/0264-Restore-custom-InventoryHolder-support.patch
diff --git a/patches/server/0266-Fix-SpongeAbsortEvent-handling.patch b/patches/server/0265-Fix-SpongeAbsortEvent-handling.patch
index be21ac2045..be21ac2045 100644
--- a/patches/server/0266-Fix-SpongeAbsortEvent-handling.patch
+++ b/patches/server/0265-Fix-SpongeAbsortEvent-handling.patch
diff --git a/patches/server/0267-Don-t-allow-digging-into-unloaded-chunks.patch b/patches/server/0266-Don-t-allow-digging-into-unloaded-chunks.patch
index 1e6c4cb7c2..1e6c4cb7c2 100644
--- a/patches/server/0267-Don-t-allow-digging-into-unloaded-chunks.patch
+++ b/patches/server/0266-Don-t-allow-digging-into-unloaded-chunks.patch
diff --git a/patches/server/0268-Make-the-default-permission-message-configurable.patch b/patches/server/0267-Make-the-default-permission-message-configurable.patch
index 43730fa5bf..43730fa5bf 100644
--- a/patches/server/0268-Make-the-default-permission-message-configurable.patch
+++ b/patches/server/0267-Make-the-default-permission-message-configurable.patch
diff --git a/patches/server/0269-force-entity-dismount-during-teleportation.patch b/patches/server/0268-force-entity-dismount-during-teleportation.patch
index 4c2464296c..2df826f1e9 100644
--- a/patches/server/0269-force-entity-dismount-during-teleportation.patch
+++ b/patches/server/0268-force-entity-dismount-during-teleportation.patch
@@ -20,10 +20,10 @@ this is going to be the best soultion all around.
Improvements/suggestions welcome!
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 1056286007e1c16c6fce3df7918a082a545f92b5..8f3980afc38caf2eda927440957f3e0bb0f2ef66 100644
+index dad9d89d77001d2c84fbae7a8a4a4312cc5953dc..ae7a5e65b9183338ce5ed44807a493ce1f3e8c93 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2525,9 +2525,15 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2522,9 +2522,15 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@Override
public void stopRiding() {
diff --git a/patches/server/0270-Add-more-Zombie-API.patch b/patches/server/0269-Add-more-Zombie-API.patch
index 4c7955b4ae..4c7955b4ae 100644
--- a/patches/server/0270-Add-more-Zombie-API.patch
+++ b/patches/server/0269-Add-more-Zombie-API.patch
diff --git a/patches/server/0271-Book-Size-Limits.patch b/patches/server/0270-Book-Size-Limits.patch
index 5fd23a7c1e..5fd23a7c1e 100644
--- a/patches/server/0271-Book-Size-Limits.patch
+++ b/patches/server/0270-Book-Size-Limits.patch
diff --git a/patches/server/0272-Add-PlayerConnectionCloseEvent.patch b/patches/server/0271-Add-PlayerConnectionCloseEvent.patch
index 5c63a589af..5c63a589af 100644
--- a/patches/server/0272-Add-PlayerConnectionCloseEvent.patch
+++ b/patches/server/0271-Add-PlayerConnectionCloseEvent.patch
diff --git a/patches/server/0273-Replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0272-Replace-OfflinePlayer-getLastPlayed.patch
index e3974e72e1..2b770b9d53 100644
--- a/patches/server/0273-Replace-OfflinePlayer-getLastPlayed.patch
+++ b/patches/server/0272-Replace-OfflinePlayer-getLastPlayed.patch
@@ -16,7 +16,7 @@ intent to remove) and replace it with two new methods, clearly named and
documented as to their purpose.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 8f3980afc38caf2eda927440957f3e0bb0f2ef66..4e8ef3dfde97f40d2c2163e2e811b2ae77bae14e 100644
+index ae7a5e65b9183338ce5ed44807a493ce1f3e8c93..cc57c09a38c265040505f17dd0113ab648522490 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -268,6 +268,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@@ -106,7 +106,7 @@ index 461656e1cb095243bfe7a9ee2906e5b00574ae78..411b280ac3e27e72091db813c0c9b69b
public Location getLastDeathLocation() {
if (this.getData().contains("LastDeathLocation", 10)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index ebb465cbc60d09d0087d2545ebd3b455bf5216de..3ca09d5eb1e97cbd11cab34aa8600b2c92237517 100644
+index 2d1e0e92e6d98a9cf597c3717c36ea5a337577c3..2974f806ef677376ee2b53fccb6ca83151bb8451 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -210,6 +210,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0274-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/patches/server/0273-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
index 62828ec736..b8251d8c4e 100644
--- a/patches/server/0274-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
+++ b/patches/server/0273-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index c75fed2aafc91fbfaed91f5337a5189a1dbb5341..ecfc5f59fcc3b256929a7d93972bf63272734a5d 100644
+index cc57c09a38c265040505f17dd0113ab648522490..647cec024d90014a6928d3889f6d1b24d5a4a4de 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1836,6 +1836,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1833,6 +1833,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
public void disconnect() {
this.disconnected = true;
this.ejectPassengers();
diff --git a/patches/server/0275-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch b/patches/server/0274-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch
index 7dd2139e2c..674772b619 100644
--- a/patches/server/0275-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch
+++ b/patches/server/0274-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch
@@ -8,7 +8,7 @@ We just add a check to ensure that the CraftPlayer's handle
is a ServerPlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index d649fd886faf0d4d989362c4ef0e9c50247c280f..a32a3e8aa5108f28f7bda637c50627afb59f7598 100644
+index 2974f806ef677376ee2b53fccb6ca83151bb8451..80a9a4df9b1114f932badd847238c7a0a1a00941 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -224,8 +224,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0276-BlockDestroyEvent.patch b/patches/server/0275-BlockDestroyEvent.patch
index 27911d5058..27911d5058 100644
--- a/patches/server/0276-BlockDestroyEvent.patch
+++ b/patches/server/0275-BlockDestroyEvent.patch
diff --git a/patches/server/0277-Async-command-map-building.patch b/patches/server/0276-Async-command-map-building.patch
index d6ee248a00..4a9cc54166 100644
--- a/patches/server/0277-Async-command-map-building.patch
+++ b/patches/server/0276-Async-command-map-building.patch
@@ -53,7 +53,7 @@ index 72756ef14b8ec8afd80313b9f6aaf76722cb18cf..a05aea8561ac102476ee1b3068942b09
event.getPlayer().getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 2e96a4c61f9053c20060e9f45a313a6135ea4f16..df5b553b8d1525f14dbb88ea86e1bf9d9c9e6950 100644
+index 0b266d3855723752d7789340f5d98ea106a97722..bd882ebb8e24de671518bf6b12f9ee4bc3f35128 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -931,6 +931,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0278-Brigadier-Mojang-API.patch b/patches/server/0277-Brigadier-Mojang-API.patch
index a9bc0d2666..a9bc0d2666 100644
--- a/patches/server/0278-Brigadier-Mojang-API.patch
+++ b/patches/server/0277-Brigadier-Mojang-API.patch
diff --git a/patches/server/0279-Improve-exact-choice-recipe-ingredients.patch b/patches/server/0278-Improve-exact-choice-recipe-ingredients.patch
index 3f924dd8b8..3f924dd8b8 100644
--- a/patches/server/0279-Improve-exact-choice-recipe-ingredients.patch
+++ b/patches/server/0278-Improve-exact-choice-recipe-ingredients.patch
diff --git a/patches/server/0280-Limit-Client-Sign-length-more.patch b/patches/server/0279-Limit-Client-Sign-length-more.patch
index 20e898577a..20e898577a 100644
--- a/patches/server/0280-Limit-Client-Sign-length-more.patch
+++ b/patches/server/0279-Limit-Client-Sign-length-more.patch
diff --git a/patches/server/0281-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/patches/server/0280-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch
index 02a8030115..02a8030115 100644
--- a/patches/server/0281-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch
+++ b/patches/server/0280-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch
diff --git a/patches/server/0282-Fixes-and-additions-to-the-spawn-reason-API.patch b/patches/server/0281-Fixes-and-additions-to-the-spawn-reason-API.patch
index 0ef27fbf20..e910254cef 100644
--- a/patches/server/0282-Fixes-and-additions-to-the-spawn-reason-API.patch
+++ b/patches/server/0281-Fixes-and-additions-to-the-spawn-reason-API.patch
@@ -26,7 +26,7 @@ index bf72cf288ade52ee8cc41ca978f368b3ad575951..798999be50d26be357ef3c6d5b9383ce
});
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index b151506b96a51c74ba408cb555a4d38507b2f8c1..bbcee9d8dbf17085b11bb5e38eb37271c51219ba 100644
+index e9d08662c065d04a67918f0aa2cd4fde5798f2a6..a6a21def1ae0d35fa106da6242c49a0928e4eda5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1207,6 +1207,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0283-Fire-event-on-GS4-query.patch b/patches/server/0282-Fire-event-on-GS4-query.patch
index 6468ff12c1..6468ff12c1 100644
--- a/patches/server/0283-Fire-event-on-GS4-query.patch
+++ b/patches/server/0282-Fire-event-on-GS4-query.patch
diff --git a/patches/server/0284-Add-PlayerPostRespawnEvent.patch b/patches/server/0283-Add-PlayerPostRespawnEvent.patch
index 2babd115c1..2babd115c1 100644
--- a/patches/server/0284-Add-PlayerPostRespawnEvent.patch
+++ b/patches/server/0283-Add-PlayerPostRespawnEvent.patch
diff --git a/patches/server/0285-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/patches/server/0284-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch
index f6592c8703..f6592c8703 100644
--- a/patches/server/0285-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch
+++ b/patches/server/0284-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch
diff --git a/patches/server/0286-Server-Tick-Events.patch b/patches/server/0285-Server-Tick-Events.patch
index 7478aa71ac..afbd125410 100644
--- a/patches/server/0286-Server-Tick-Events.patch
+++ b/patches/server/0285-Server-Tick-Events.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Server Tick Events
Fires event at start and end of a server tick
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index df5b553b8d1525f14dbb88ea86e1bf9d9c9e6950..ee86f2cb71b2c8dc85c27635efca3666de7a3cbe 100644
+index bd882ebb8e24de671518bf6b12f9ee4bc3f35128..3ffb330a16797c04694f73b0cd9f5b38a07641b4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1435,6 +1435,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -17,7 +17,7 @@ index df5b553b8d1525f14dbb88ea86e1bf9d9c9e6950..ee86f2cb71b2c8dc85c27635efca3666
++this.tickCount;
this.tickRateManager.tick();
-@@ -1461,6 +1462,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1460,6 +1461,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.runAllTasks();
}
// Paper end
diff --git a/patches/server/0287-PlayerDeathEvent-getItemsToKeep.patch b/patches/server/0286-PlayerDeathEvent-getItemsToKeep.patch
index 94743e1b6c..3297d978bb 100644
--- a/patches/server/0287-PlayerDeathEvent-getItemsToKeep.patch
+++ b/patches/server/0286-PlayerDeathEvent-getItemsToKeep.patch
@@ -11,10 +11,10 @@ Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
public net.minecraft.world.entity.player.Inventory compartments
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index ecfc5f59fcc3b256929a7d93972bf63272734a5d..b7419b254295b3b2575ce2c6b5e53b1f3f9a3c41 100644
+index 647cec024d90014a6928d3889f6d1b24d5a4a4de..2bc6228057e01bf197e8b6e58ae6389f2d19ffe5 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -899,6 +899,46 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -896,6 +896,46 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
});
}
@@ -61,7 +61,7 @@ index ecfc5f59fcc3b256929a7d93972bf63272734a5d..b7419b254295b3b2575ce2c6b5e53b1f
@Override
public void die(DamageSource damageSource) {
// this.gameEvent(GameEvent.ENTITY_DIE); // Paper - move below event cancellation check
-@@ -983,7 +1023,12 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -980,7 +1020,12 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.dropExperience(damageSource.getEntity());
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
if (!event.getKeepInventory()) {
diff --git a/patches/server/0288-Optimize-Captured-BlockEntity-Lookup.patch b/patches/server/0287-Optimize-Captured-BlockEntity-Lookup.patch
index 24aead6840..24aead6840 100644
--- a/patches/server/0288-Optimize-Captured-BlockEntity-Lookup.patch
+++ b/patches/server/0287-Optimize-Captured-BlockEntity-Lookup.patch
diff --git a/patches/server/0289-Mob-Spawner-API-Enhancements.patch b/patches/server/0288-Mob-Spawner-API-Enhancements.patch
index 9f35b91c5a..9f35b91c5a 100644
--- a/patches/server/0289-Mob-Spawner-API-Enhancements.patch
+++ b/patches/server/0288-Mob-Spawner-API-Enhancements.patch
diff --git a/patches/server/0290-Fix-CB-call-to-changed-postToMainThread-method.patch b/patches/server/0289-Fix-CB-call-to-changed-postToMainThread-method.patch
index 06263e3eef..06263e3eef 100644
--- a/patches/server/0290-Fix-CB-call-to-changed-postToMainThread-method.patch
+++ b/patches/server/0289-Fix-CB-call-to-changed-postToMainThread-method.patch
diff --git a/patches/server/0291-Fix-sounds-when-item-frames-are-modified-MC-123450.patch b/patches/server/0290-Fix-sounds-when-item-frames-are-modified-MC-123450.patch
index 83a7d7d541..83a7d7d541 100644
--- a/patches/server/0291-Fix-sounds-when-item-frames-are-modified-MC-123450.patch
+++ b/patches/server/0290-Fix-sounds-when-item-frames-are-modified-MC-123450.patch
diff --git a/patches/server/0292-Implement-CraftBlockSoundGroup.patch b/patches/server/0291-Implement-CraftBlockSoundGroup.patch
index 9bf16806b3..9bf16806b3 100644
--- a/patches/server/0292-Implement-CraftBlockSoundGroup.patch
+++ b/patches/server/0291-Implement-CraftBlockSoundGroup.patch
diff --git a/patches/server/0293-Expose-the-internal-current-tick.patch b/patches/server/0292-Expose-the-internal-current-tick.patch
index ba742dfb40..ba742dfb40 100644
--- a/patches/server/0293-Expose-the-internal-current-tick.patch
+++ b/patches/server/0292-Expose-the-internal-current-tick.patch
diff --git a/patches/server/0294-Show-blockstate-location-if-we-failed-to-read-it.patch b/patches/server/0293-Show-blockstate-location-if-we-failed-to-read-it.patch
index 35f4f6c443..35f4f6c443 100644
--- a/patches/server/0294-Show-blockstate-location-if-we-failed-to-read-it.patch
+++ b/patches/server/0293-Show-blockstate-location-if-we-failed-to-read-it.patch
diff --git a/patches/server/0295-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch b/patches/server/0294-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch
index cb2e502f71..cb2e502f71 100644
--- a/patches/server/0295-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch
+++ b/patches/server/0294-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch
diff --git a/patches/server/0296-Configurable-projectile-relative-velocity.patch b/patches/server/0295-Configurable-projectile-relative-velocity.patch
index 9406e01b81..9406e01b81 100644
--- a/patches/server/0296-Configurable-projectile-relative-velocity.patch
+++ b/patches/server/0295-Configurable-projectile-relative-velocity.patch
diff --git a/patches/server/0297-offset-item-frame-ticking.patch b/patches/server/0296-offset-item-frame-ticking.patch
index 3db1ffe305..3db1ffe305 100644
--- a/patches/server/0297-offset-item-frame-ticking.patch
+++ b/patches/server/0296-offset-item-frame-ticking.patch
diff --git a/patches/server/0298-Prevent-consuming-the-wrong-itemstack.patch b/patches/server/0297-Prevent-consuming-the-wrong-itemstack.patch
index cb2edff807..cb2edff807 100644
--- a/patches/server/0298-Prevent-consuming-the-wrong-itemstack.patch
+++ b/patches/server/0297-Prevent-consuming-the-wrong-itemstack.patch
diff --git a/patches/server/0299-Dont-send-unnecessary-sign-update.patch b/patches/server/0298-Dont-send-unnecessary-sign-update.patch
index afca8562db..afca8562db 100644
--- a/patches/server/0299-Dont-send-unnecessary-sign-update.patch
+++ b/patches/server/0298-Dont-send-unnecessary-sign-update.patch
diff --git a/patches/server/0300-Add-option-to-disable-pillager-patrols.patch b/patches/server/0299-Add-option-to-disable-pillager-patrols.patch
index 3021a1f6c8..3021a1f6c8 100644
--- a/patches/server/0300-Add-option-to-disable-pillager-patrols.patch
+++ b/patches/server/0299-Add-option-to-disable-pillager-patrols.patch
diff --git a/patches/server/0301-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch b/patches/server/0300-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch
index 82277a287f..82277a287f 100644
--- a/patches/server/0301-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch
+++ b/patches/server/0300-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch
diff --git a/patches/server/0302-MC-145656-Fix-Follow-Range-Initial-Target.patch b/patches/server/0301-MC-145656-Fix-Follow-Range-Initial-Target.patch
index 528cf153ea..528cf153ea 100644
--- a/patches/server/0302-MC-145656-Fix-Follow-Range-Initial-Target.patch
+++ b/patches/server/0301-MC-145656-Fix-Follow-Range-Initial-Target.patch
diff --git a/patches/server/0303-Duplicate-UUID-Resolve-Option.patch b/patches/server/0302-Duplicate-UUID-Resolve-Option.patch
index 0139752e8e..0139752e8e 100644
--- a/patches/server/0303-Duplicate-UUID-Resolve-Option.patch
+++ b/patches/server/0302-Duplicate-UUID-Resolve-Option.patch
diff --git a/patches/server/0304-PlayerDeathEvent-shouldDropExperience.patch b/patches/server/0303-PlayerDeathEvent-shouldDropExperience.patch
index bdbb0dc0b0..4de1db2237 100644
--- a/patches/server/0304-PlayerDeathEvent-shouldDropExperience.patch
+++ b/patches/server/0303-PlayerDeathEvent-shouldDropExperience.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] PlayerDeathEvent#shouldDropExperience
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index b7419b254295b3b2575ce2c6b5e53b1f3f9a3c41..4fe3106379d693e9a61306f284ebab5a4fe68ae5 100644
+index 2bc6228057e01bf197e8b6e58ae6389f2d19ffe5..46b82351b61e82cd301843bd6a05846181eac6d8 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1020,7 +1020,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1017,7 +1017,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.tellNeutralMobsThatIDied();
}
// SPIGOT-5478 must be called manually now
diff --git a/patches/server/0305-Prevent-bees-loading-chunks-checking-hive-position.patch b/patches/server/0304-Prevent-bees-loading-chunks-checking-hive-position.patch
index e933516d42..e933516d42 100644
--- a/patches/server/0305-Prevent-bees-loading-chunks-checking-hive-position.patch
+++ b/patches/server/0304-Prevent-bees-loading-chunks-checking-hive-position.patch
diff --git a/patches/server/0306-Don-t-load-Chunks-from-Hoppers-and-other-things.patch b/patches/server/0305-Don-t-load-Chunks-from-Hoppers-and-other-things.patch
index 3b189be4e4..3b189be4e4 100644
--- a/patches/server/0306-Don-t-load-Chunks-from-Hoppers-and-other-things.patch
+++ b/patches/server/0305-Don-t-load-Chunks-from-Hoppers-and-other-things.patch
diff --git a/patches/server/0307-Optimise-EntityGetter-getPlayerByUUID.patch b/patches/server/0306-Optimise-EntityGetter-getPlayerByUUID.patch
index ad34491f92..6ffcd9f3c3 100644
--- a/patches/server/0307-Optimise-EntityGetter-getPlayerByUUID.patch
+++ b/patches/server/0306-Optimise-EntityGetter-getPlayerByUUID.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Optimise EntityGetter#getPlayerByUUID
Use the PlayerList map instead of iterating over all players
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index bbcee9d8dbf17085b11bb5e38eb37271c51219ba..ccb72d13cce7db74a6754498bab41a017a469418 100644
+index a6a21def1ae0d35fa106da6242c49a0928e4eda5..c85d5b941b5cb1c37cd2619d419006c5956f6eaf 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -330,6 +330,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0308-Fix-items-not-falling-correctly.patch b/patches/server/0307-Fix-items-not-falling-correctly.patch
index aaff528185..aaff528185 100644
--- a/patches/server/0308-Fix-items-not-falling-correctly.patch
+++ b/patches/server/0307-Fix-items-not-falling-correctly.patch
diff --git a/patches/server/0309-Optimize-call-to-getFluid-for-explosions.patch b/patches/server/0308-Optimize-call-to-getFluid-for-explosions.patch
index 7c2fe736a6..7c2fe736a6 100644
--- a/patches/server/0309-Optimize-call-to-getFluid-for-explosions.patch
+++ b/patches/server/0308-Optimize-call-to-getFluid-for-explosions.patch
diff --git a/patches/server/0310-Guard-against-serializing-mismatching-chunk-coordina.patch b/patches/server/0309-Guard-against-serializing-mismatching-chunk-coordina.patch
index 6752b44617..6752b44617 100644
--- a/patches/server/0310-Guard-against-serializing-mismatching-chunk-coordina.patch
+++ b/patches/server/0309-Guard-against-serializing-mismatching-chunk-coordina.patch
diff --git a/patches/server/0311-Alternative-item-despawn-rate.patch b/patches/server/0310-Alternative-item-despawn-rate.patch
index 5f9a648f99..5f9a648f99 100644
--- a/patches/server/0311-Alternative-item-despawn-rate.patch
+++ b/patches/server/0310-Alternative-item-despawn-rate.patch
diff --git a/patches/server/0312-Tracking-Range-Improvements.patch b/patches/server/0311-Tracking-Range-Improvements.patch
index ee9860cefa..4755a6d3d5 100644
--- a/patches/server/0312-Tracking-Range-Improvements.patch
+++ b/patches/server/0311-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 27eaeea3f0719167d89e39b0b60f91ad9cc9f64e..5b62b6ebfc1b2a9d4673953c20b12a97c50ef3a5 100644
+index bdaef11e9f8a78c7777b6a98fcca881c8f253bda..d969d761c12b5c335037eb74b603061ac1d918c2 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1586,6 +1586,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1550,6 +1550,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
int j = entity.getType().clientTrackingRange() * 16;
diff --git a/patches/server/0313-Bees-get-gravity-in-void.-Fixes-MC-167279.patch b/patches/server/0312-Bees-get-gravity-in-void.-Fixes-MC-167279.patch
index 9ea731b674..9ea731b674 100644
--- a/patches/server/0313-Bees-get-gravity-in-void.-Fixes-MC-167279.patch
+++ b/patches/server/0312-Bees-get-gravity-in-void.-Fixes-MC-167279.patch
diff --git a/patches/server/0314-Improve-Block-breakNaturally-API.patch b/patches/server/0313-Improve-Block-breakNaturally-API.patch
index b478ee5bb4..b478ee5bb4 100644
--- a/patches/server/0314-Improve-Block-breakNaturally-API.patch
+++ b/patches/server/0313-Improve-Block-breakNaturally-API.patch
diff --git a/patches/server/0315-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/patches/server/0314-Optimise-getChunkAt-calls-for-loaded-chunks.patch
index 6089b2b613..d1fed5285f 100644
--- a/patches/server/0315-Optimise-getChunkAt-calls-for-loaded-chunks.patch
+++ b/patches/server/0314-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 035c33b1e1be4f41e5cbe09bf6c3abd617258cad..097a333487d646c773349cde3cd08026986fd038 100644
+index a939bad7da9c852827a2d67d9ace5d0df4911a31..1049452baaf0381ffbf15b30da956c2a1994da35 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -181,6 +181,12 @@ public class ServerChunkCache extends ChunkSource {
+@@ -179,6 +179,12 @@ public class ServerChunkCache extends ChunkSource {
return this.getChunk(x, z, leastStatus, create);
}, this.mainThreadProcessor).join();
} else {
@@ -23,7 +23,7 @@ index 035c33b1e1be4f41e5cbe09bf6c3abd617258cad..097a333487d646c773349cde3cd08026
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
gameprofilerfiller.incrementCounter("getChunk");
-@@ -224,33 +230,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -222,33 +228,7 @@ public class ServerChunkCache extends ChunkSource {
if (Thread.currentThread() != this.mainThread) {
return null;
} else {
diff --git a/patches/server/0316-Add-debug-for-sync-chunk-loads.patch b/patches/server/0315-Add-debug-for-sync-chunk-loads.patch
index 2398618fb3..e995b41d89 100644
--- a/patches/server/0316-Add-debug-for-sync-chunk-loads.patch
+++ b/patches/server/0315-Add-debug-for-sync-chunk-loads.patch
@@ -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 097a333487d646c773349cde3cd08026986fd038..be9604a0f267558c95125852d86761a2f175732a 100644
+index 1049452baaf0381ffbf15b30da956c2a1994da35..60f678c26fb5144386d8697ddfd5b6d841563b6f 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -208,6 +208,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -206,6 +206,7 @@ public class ServerChunkCache extends ChunkSource {
Objects.requireNonNull(completablefuture);
if (!completablefuture.isDone()) { // Paper
@@ -312,7 +312,7 @@ index 097a333487d646c773349cde3cd08026986fd038..be9604a0f267558c95125852d86761a2
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 ccb72d13cce7db74a6754498bab41a017a469418..33cb58e7298e7900dbcd37dbdb21de83bfca6a26 100644
+index c85d5b941b5cb1c37cd2619d419006c5956f6eaf..f1fa4cb11f69e248dd55b8aa69f5d07268f182a1 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -422,6 +422,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0317-Improve-java-version-check.patch b/patches/server/0316-Improve-java-version-check.patch
index df50b64ab2..4bd8947722 100644
--- a/patches/server/0317-Improve-java-version-check.patch
+++ b/patches/server/0316-Improve-java-version-check.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Improve java version check
Co-Authored-By: MiniDigger <[email protected]>
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index faa228698c7dd60bde0f3767cc27957ece04b8be..f3bce016e729d553aaa6185470bbf4317f94352b 100644
+index 8245b38d37b4cee6f4e7b61d7af40a18e54a3f43..e226eda5efc0e45e59cb5f6251ed008b67d5299a 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -203,23 +203,27 @@ public class Main {
diff --git a/patches/server/0318-Add-ThrownEggHatchEvent.patch b/patches/server/0317-Add-ThrownEggHatchEvent.patch
index 21fd12f380..21fd12f380 100644
--- a/patches/server/0318-Add-ThrownEggHatchEvent.patch
+++ b/patches/server/0317-Add-ThrownEggHatchEvent.patch
diff --git a/patches/server/0319-Entity-Jump-API.patch b/patches/server/0318-Entity-Jump-API.patch
index 20e546b1d6..20e546b1d6 100644
--- a/patches/server/0319-Entity-Jump-API.patch
+++ b/patches/server/0318-Entity-Jump-API.patch
diff --git a/patches/server/0320-Add-option-to-nerf-pigmen-from-nether-portals.patch b/patches/server/0319-Add-option-to-nerf-pigmen-from-nether-portals.patch
index 0662982e05..0662982e05 100644
--- a/patches/server/0320-Add-option-to-nerf-pigmen-from-nether-portals.patch
+++ b/patches/server/0319-Add-option-to-nerf-pigmen-from-nether-portals.patch
diff --git a/patches/server/0321-Make-the-GUI-graph-fancier.patch b/patches/server/0320-Make-the-GUI-graph-fancier.patch
index 9e79ca7b91..9e79ca7b91 100644
--- a/patches/server/0321-Make-the-GUI-graph-fancier.patch
+++ b/patches/server/0320-Make-the-GUI-graph-fancier.patch
diff --git a/patches/server/0322-add-hand-to-BlockMultiPlaceEvent.patch b/patches/server/0321-add-hand-to-BlockMultiPlaceEvent.patch
index 3247f38cb9..3247f38cb9 100644
--- a/patches/server/0322-add-hand-to-BlockMultiPlaceEvent.patch
+++ b/patches/server/0321-add-hand-to-BlockMultiPlaceEvent.patch
diff --git a/patches/server/0323-Validate-tripwire-hook-placement-before-update.patch b/patches/server/0322-Validate-tripwire-hook-placement-before-update.patch
index bc1125b169..bc1125b169 100644
--- a/patches/server/0323-Validate-tripwire-hook-placement-before-update.patch
+++ b/patches/server/0322-Validate-tripwire-hook-placement-before-update.patch
diff --git a/patches/server/0324-Add-option-to-allow-iron-golems-to-spawn-in-air.patch b/patches/server/0323-Add-option-to-allow-iron-golems-to-spawn-in-air.patch
index 75d1d9c02b..75d1d9c02b 100644
--- a/patches/server/0324-Add-option-to-allow-iron-golems-to-spawn-in-air.patch
+++ b/patches/server/0323-Add-option-to-allow-iron-golems-to-spawn-in-air.patch
diff --git a/patches/server/0325-Configurable-chance-of-villager-zombie-infection.patch b/patches/server/0324-Configurable-chance-of-villager-zombie-infection.patch
index 217787cdc9..217787cdc9 100644
--- a/patches/server/0325-Configurable-chance-of-villager-zombie-infection.patch
+++ b/patches/server/0324-Configurable-chance-of-villager-zombie-infection.patch
diff --git a/patches/server/0326-Optimise-Chunk-getFluid.patch b/patches/server/0325-Optimise-Chunk-getFluid.patch
index 0e2e9cccd5..0e2e9cccd5 100644
--- a/patches/server/0326-Optimise-Chunk-getFluid.patch
+++ b/patches/server/0325-Optimise-Chunk-getFluid.patch
diff --git a/patches/server/0327-Set-spigots-verbose-world-setting-to-false-by-def.patch b/patches/server/0326-Set-spigots-verbose-world-setting-to-false-by-def.patch
index d6e5084490..d6e5084490 100644
--- a/patches/server/0327-Set-spigots-verbose-world-setting-to-false-by-def.patch
+++ b/patches/server/0326-Set-spigots-verbose-world-setting-to-false-by-def.patch
diff --git a/patches/server/0328-Add-tick-times-API-and-mspt-command.patch b/patches/server/0327-Add-tick-times-API-and-mspt-command.patch
index 53ce864287..e076e69dde 100644
--- a/patches/server/0328-Add-tick-times-API-and-mspt-command.patch
+++ b/patches/server/0327-Add-tick-times-API-and-mspt-command.patch
@@ -125,7 +125,7 @@ index 72f2e81b9905a0d57ed8e2a88578f62d5235c456..7b58b2d6297800c2dcdbf7539e5ab8e7
public static void registerCommands(final MinecraftServer server) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index ee86f2cb71b2c8dc85c27635efca3666de7a3cbe..1e6546637c5c2ddf4aacc7a3ea8623ce55059203 100644
+index 3ffb330a16797c04694f73b0cd9f5b38a07641b4..ff73167bfe210305491e35f18adc2755d3651a85 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -258,6 +258,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -140,7 +140,7 @@ index ee86f2cb71b2c8dc85c27635efca3666de7a3cbe..1e6546637c5c2ddf4aacc7a3ea8623ce
@Nullable
private KeyPair keyPair;
@Nullable
-@@ -1475,6 +1480,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1474,6 +1479,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.aggregatedTickTimesNanos += j;
this.tickTimesNanos[k] = j;
this.smoothedTickTimeMillis = this.smoothedTickTimeMillis * 0.8F + (float) j / (float) TimeUtil.NANOSECONDS_PER_MILLISECOND * 0.19999999F;
@@ -152,7 +152,7 @@ index ee86f2cb71b2c8dc85c27635efca3666de7a3cbe..1e6546637c5c2ddf4aacc7a3ea8623ce
this.logTickMethodTime(i);
this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot
-@@ -2858,4 +2868,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2857,4 +2867,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) {
}
diff --git a/patches/server/0329-Expose-MinecraftServer-isRunning.patch b/patches/server/0328-Expose-MinecraftServer-isRunning.patch
index 03228c7907..03228c7907 100644
--- a/patches/server/0329-Expose-MinecraftServer-isRunning.patch
+++ b/patches/server/0328-Expose-MinecraftServer-isRunning.patch
diff --git a/patches/server/0330-Add-Raw-Byte-ItemStack-Serialization.patch b/patches/server/0329-Add-Raw-Byte-ItemStack-Serialization.patch
index 800948f497..800948f497 100644
--- a/patches/server/0330-Add-Raw-Byte-ItemStack-Serialization.patch
+++ b/patches/server/0329-Add-Raw-Byte-ItemStack-Serialization.patch
diff --git a/patches/server/0331-Pillager-patrol-spawn-settings-and-per-player-option.patch b/patches/server/0330-Pillager-patrol-spawn-settings-and-per-player-option.patch
index c60a1ef7ce..0a9d50c533 100644
--- a/patches/server/0331-Pillager-patrol-spawn-settings-and-per-player-option.patch
+++ b/patches/server/0330-Pillager-patrol-spawn-settings-and-per-player-option.patch
@@ -10,7 +10,7 @@ When not per player it will use the Vanilla mechanic of one delay per
world and the world age for the start day.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 4fe3106379d693e9a61306f284ebab5a4fe68ae5..6a385b5cb5baf94b1340e0029df7dcd908e5f702 100644
+index 46b82351b61e82cd301843bd6a05846181eac6d8..7e60da3249e44b333ea3d22ddee706b270dd9c61 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -269,6 +269,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
diff --git a/patches/server/0332-Remote-Connections-shouldn-t-hold-up-shutdown.patch b/patches/server/0331-Remote-Connections-shouldn-t-hold-up-shutdown.patch
index fb2f7c6706..fb2f7c6706 100644
--- a/patches/server/0332-Remote-Connections-shouldn-t-hold-up-shutdown.patch
+++ b/patches/server/0331-Remote-Connections-shouldn-t-hold-up-shutdown.patch
diff --git a/patches/server/0333-Do-not-allow-bees-to-load-chunks-for-beehives.patch b/patches/server/0332-Do-not-allow-bees-to-load-chunks-for-beehives.patch
index f361af6e50..f361af6e50 100644
--- a/patches/server/0333-Do-not-allow-bees-to-load-chunks-for-beehives.patch
+++ b/patches/server/0332-Do-not-allow-bees-to-load-chunks-for-beehives.patch
diff --git a/patches/server/0334-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/patches/server/0333-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
index c037677373..c873a7ea27 100644
--- a/patches/server/0334-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
+++ b/patches/server/0333-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 5b62b6ebfc1b2a9d4673953c20b12a97c50ef3a5..02ea2b2d5463909663bb599b6ca57198b8513456 100644
+index d969d761c12b5c335037eb74b603061ac1d918c2..fd50b43197bf3a92e838023de31b7acd8a257b8e 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1281,6 +1281,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1245,6 +1245,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 5b62b6ebfc1b2a9d4673953c20b12a97c50ef3a5..02ea2b2d5463909663bb599b6ca57198
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 33cb58e7298e7900dbcd37dbdb21de83bfca6a26..a87782c3cb0a751f532feda0b827d7c7eac163e1 100644
+index f1fa4cb11f69e248dd55b8aa69f5d07268f182a1..89e05d9316b012a5c8103682ff9dbeae757f4f57 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2149,7 +2149,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0335-Don-t-tick-dead-players.patch b/patches/server/0334-Don-t-tick-dead-players.patch
index 27ce527eee..ea38303ab0 100644
--- a/patches/server/0335-Don-t-tick-dead-players.patch
+++ b/patches/server/0334-Don-t-tick-dead-players.patch
@@ -7,10 +7,10 @@ Causes sync chunk loads and who knows what all else.
This is safe because Spectators are skipped in unloaded chunks too in vanilla.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 6a385b5cb5baf94b1340e0029df7dcd908e5f702..588fcfb614299eeebef081d2dd005f1a8a00153b 100644
+index 7e60da3249e44b333ea3d22ddee706b270dd9c61..6075e536f09875e577cea7caff70d6a417470254 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -767,7 +767,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -764,7 +764,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
public void doTick() {
try {
diff --git a/patches/server/0336-Dead-Player-s-shouldn-t-be-able-to-move.patch b/patches/server/0335-Dead-Player-s-shouldn-t-be-able-to-move.patch
index d10a5a50c4..d10a5a50c4 100644
--- a/patches/server/0336-Dead-Player-s-shouldn-t-be-able-to-move.patch
+++ b/patches/server/0335-Dead-Player-s-shouldn-t-be-able-to-move.patch
diff --git a/patches/server/0337-Don-t-move-existing-players-to-world-spawn.patch b/patches/server/0336-Don-t-move-existing-players-to-world-spawn.patch
index e8fef02c0f..a557384e1c 100644
--- a/patches/server/0337-Don-t-move-existing-players-to-world-spawn.patch
+++ b/patches/server/0336-Don-t-move-existing-players-to-world-spawn.patch
@@ -13,10 +13,10 @@ By skipping this, we avoid potential for a large spike on server start.
public net.minecraft.server.level.ServerPlayer fudgeSpawnLocation(Lnet/minecraft/server/level/ServerLevel;)V
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 588fcfb614299eeebef081d2dd005f1a8a00153b..8dff4fb382639e4db9c80bbdfbc69167aa7996a1 100644
+index 6075e536f09875e577cea7caff70d6a417470254..a9c1aa9e382b0864386030a66158b53d12026a00 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -358,7 +358,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -357,7 +357,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.server = server;
this.stats = server.getPlayerList().getPlayerStats(this);
this.advancements = server.getPlayerList().getPlayerAdvancements(this);
@@ -25,7 +25,7 @@ index 588fcfb614299eeebef081d2dd005f1a8a00153b..8dff4fb382639e4db9c80bbdfbc69167
this.updateOptions(clientOptions);
this.object = null;
-@@ -630,7 +630,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -627,7 +627,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
position = Vec3.atCenterOf(world.getSharedSpawnPos());
}
this.setLevel(world);
diff --git a/patches/server/0338-Optimize-Pathfinding.patch b/patches/server/0337-Optimize-Pathfinding.patch
index 281988ce37..281988ce37 100644
--- a/patches/server/0338-Optimize-Pathfinding.patch
+++ b/patches/server/0337-Optimize-Pathfinding.patch
diff --git a/patches/server/0339-Reduce-Either-Optional-allocation.patch b/patches/server/0338-Reduce-Either-Optional-allocation.patch
index d42e0ac184..d42e0ac184 100644
--- a/patches/server/0339-Reduce-Either-Optional-allocation.patch
+++ b/patches/server/0338-Reduce-Either-Optional-allocation.patch
diff --git a/patches/server/0340-Reduce-memory-footprint-of-CompoundTag.patch b/patches/server/0339-Reduce-memory-footprint-of-CompoundTag.patch
index 55111ab6e8..55111ab6e8 100644
--- a/patches/server/0340-Reduce-memory-footprint-of-CompoundTag.patch
+++ b/patches/server/0339-Reduce-memory-footprint-of-CompoundTag.patch
diff --git a/patches/server/0341-Prevent-opening-inventories-when-frozen.patch b/patches/server/0340-Prevent-opening-inventories-when-frozen.patch
index 5969f96e51..133a70b2d7 100644
--- a/patches/server/0341-Prevent-opening-inventories-when-frozen.patch
+++ b/patches/server/0340-Prevent-opening-inventories-when-frozen.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Prevent opening inventories when frozen
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index fb72ce049aeb49ee59cd07e074e61bb31591c252..b4089878f7f8cd32cea7741b72be5bb5218f3032 100644
+index a9c1aa9e382b0864386030a66158b53d12026a00..2d31cd0924ad44534418ec084507c19f49d95f24 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -712,7 +712,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -709,7 +709,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
containerUpdateDelay = this.level().paperConfig().tickRates.containerUpdate;
}
// Paper end - Configurable container update tick rate
@@ -17,7 +17,7 @@ index fb72ce049aeb49ee59cd07e074e61bb31591c252..b4089878f7f8cd32cea7741b72be5bb5
this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper - Inventory close reason
this.containerMenu = this.inventoryMenu;
}
-@@ -1637,7 +1637,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1634,7 +1634,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
} else {
// CraftBukkit start
this.containerMenu = container;
diff --git a/patches/server/0342-Don-t-run-entity-collision-code-if-not-needed.patch b/patches/server/0341-Don-t-run-entity-collision-code-if-not-needed.patch
index ce9cc70a02..ce9cc70a02 100644
--- a/patches/server/0342-Don-t-run-entity-collision-code-if-not-needed.patch
+++ b/patches/server/0341-Don-t-run-entity-collision-code-if-not-needed.patch
diff --git a/patches/server/0343-Implement-Player-Client-Options-API.patch b/patches/server/0342-Implement-Player-Client-Options-API.patch
index 1778c7d21e..6470ba2e4a 100644
--- a/patches/server/0343-Implement-Player-Client-Options-API.patch
+++ b/patches/server/0342-Implement-Player-Client-Options-API.patch
@@ -87,10 +87,10 @@ index 0000000000000000000000000000000000000000..b6f4400df3d8ec7e06a996de54f8cabb
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 1e780b73fac4d686444ff3a009cf33318068d8d1..8554ee1636416d9fb1aee2051e4a4d08b0c6d636 100644
+index 2d31cd0924ad44534418ec084507c19f49d95f24..15df50a36138f29ae278cf1f1f531ad949f4a93e 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -359,7 +359,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -358,7 +358,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.stats = server.getPlayerList().getPlayerStats(this);
this.advancements = server.getPlayerList().getPlayerAdvancements(this);
// this.moveTo(this.adjustSpawnLocation(world, world.getSharedSpawnPos()).getBottomCenter(), 0.0F, 0.0F); // Paper - Don't move existing players to world spawn
@@ -98,8 +98,8 @@ index 1e780b73fac4d686444ff3a009cf33318068d8d1..8554ee1636416d9fb1aee2051e4a4d08
+ this.updateOptionsNoEvents(clientOptions); // Paper - don't call options events on login
this.object = null;
- this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
-@@ -2149,7 +2149,23 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+ // CraftBukkit start
+@@ -2146,7 +2146,23 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
}
@@ -123,7 +123,7 @@ index 1e780b73fac4d686444ff3a009cf33318068d8d1..8554ee1636416d9fb1aee2051e4a4d08
// CraftBukkit start
if (this.getMainArm() != clientOptions.mainHand()) {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), this.getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT);
-@@ -2160,6 +2176,11 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2157,6 +2173,11 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.server.server.getPluginManager().callEvent(event);
}
// CraftBukkit end
@@ -136,7 +136,7 @@ index 1e780b73fac4d686444ff3a009cf33318068d8d1..8554ee1636416d9fb1aee2051e4a4d08
this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper
this.requestedViewDistance = clientOptions.viewDistance();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index a32a3e8aa5108f28f7bda637c50627afb59f7598..8865dabc729af78fcc306d48e754c54f80dfb2e4 100644
+index 80a9a4df9b1114f932badd847238c7a0a1a00941..a0835efca3bef35c434b716ceccd05c801d2f240 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -653,6 +653,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0344-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch b/patches/server/0343-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch
index 8ac2ea013d..8ac2ea013d 100644
--- a/patches/server/0344-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch
+++ b/patches/server/0343-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch
diff --git a/patches/server/0345-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch b/patches/server/0344-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch
index 08456c3e37..0c65900b36 100644
--- a/patches/server/0345-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch
+++ b/patches/server/0344-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 02ea2b2d5463909663bb599b6ca57198b8513456..37bfe3d315210462ed69bb1cb161604e9eb85c36 100644
+index fd50b43197bf3a92e838023de31b7acd8a257b8e..161792d0226dbb50e9f5ab5c0fe42cc73f44c2a8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1288,6 +1288,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1252,6 +1252,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return;
}
// Paper end - ignore and warn about illegal addEntity calls instead of crashing server
@@ -43,7 +43,7 @@ index 02ea2b2d5463909663bb599b6ca57198b8513456..37bfe3d315210462ed69bb1cb161604e
EntityType<?> entitytypes = entity.getType();
int i = entitytypes.clientTrackingRange() * 16;
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 8554ee1636416d9fb1aee2051e4a4d08b0c6d636..9cba3ac95318f1a4b680b541ce5d825fc5c4ad02 100644
+index 15df50a36138f29ae278cf1f1f531ad949f4a93e..b43a32989bd9c05f26da97634149350b311ad820 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -288,6 +288,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
diff --git a/patches/server/0346-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/patches/server/0345-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch
index 112ee6f5a2..112ee6f5a2 100644
--- a/patches/server/0346-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch
+++ b/patches/server/0345-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch
diff --git a/patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch b/patches/server/0346-Add-PlayerAttackEntityCooldownResetEvent.patch
index be9e57b2e3..be9e57b2e3 100644
--- a/patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch
+++ b/patches/server/0346-Add-PlayerAttackEntityCooldownResetEvent.patch
diff --git a/patches/server/0348-Don-t-fire-BlockFade-on-worldgen-threads.patch b/patches/server/0347-Don-t-fire-BlockFade-on-worldgen-threads.patch
index 8a262c1f35..8a262c1f35 100644
--- a/patches/server/0348-Don-t-fire-BlockFade-on-worldgen-threads.patch
+++ b/patches/server/0347-Don-t-fire-BlockFade-on-worldgen-threads.patch
diff --git a/patches/server/0349-Add-phantom-creative-and-insomniac-controls.patch b/patches/server/0348-Add-phantom-creative-and-insomniac-controls.patch
index 9a012509be..9a012509be 100644
--- a/patches/server/0349-Add-phantom-creative-and-insomniac-controls.patch
+++ b/patches/server/0348-Add-phantom-creative-and-insomniac-controls.patch
diff --git a/patches/server/0350-Fix-item-duplication-and-teleport-issues.patch b/patches/server/0349-Fix-item-duplication-and-teleport-issues.patch
index 5c2cede8f5..5c2cede8f5 100644
--- a/patches/server/0350-Fix-item-duplication-and-teleport-issues.patch
+++ b/patches/server/0349-Fix-item-duplication-and-teleport-issues.patch
diff --git a/patches/server/0351-Villager-Restocks-API.patch b/patches/server/0350-Villager-Restocks-API.patch
index 75b7928672..75b7928672 100644
--- a/patches/server/0351-Villager-Restocks-API.patch
+++ b/patches/server/0350-Villager-Restocks-API.patch
diff --git a/patches/server/0352-Validate-PickItem-Packet-and-kick-for-invalid.patch b/patches/server/0351-Validate-PickItem-Packet-and-kick-for-invalid.patch
index 7f0081b049..7f0081b049 100644
--- a/patches/server/0352-Validate-PickItem-Packet-and-kick-for-invalid.patch
+++ b/patches/server/0351-Validate-PickItem-Packet-and-kick-for-invalid.patch
diff --git a/patches/server/0353-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch b/patches/server/0352-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch
index 44bd324f68..a52cf1acdb 100644
--- a/patches/server/0353-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch
+++ b/patches/server/0352-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch
@@ -17,7 +17,7 @@ keeping long lived large direct buffers in cache.
Set system properly at server startup if not set already to help protect from this.
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index f3bce016e729d553aaa6185470bbf4317f94352b..02243b69cca7255588b43dab57e1c9ca4c3ca87f 100644
+index e226eda5efc0e45e59cb5f6251ed008b67d5299a..b9b93a4e20eed028b76eab4dcb9610ae05f22faf 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -27,6 +27,7 @@ public class Main {
diff --git a/patches/server/0354-misc-debugging-dumps.patch b/patches/server/0353-misc-debugging-dumps.patch
index 5959f30078..55771587f6 100644
--- a/patches/server/0354-misc-debugging-dumps.patch
+++ b/patches/server/0353-misc-debugging-dumps.patch
@@ -49,7 +49,7 @@ index e25fc35716aff1d1805884b18f67b0eb33d8c05c..8ca9ac8eff9d605baa878ca24e165ac5
StackTraceElement[] astacktraceelement = exception.getStackTrace();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 1e6546637c5c2ddf4aacc7a3ea8623ce55059203..af83b1c762239fe7c8c11d3904f30504b0a1ca67 100644
+index ff73167bfe210305491e35f18adc2755d3651a85..1088a91ee131d1c303961557d8fb90101c2d8d3b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -916,6 +916,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0355-Prevent-teleporting-dead-entities.patch b/patches/server/0354-Prevent-teleporting-dead-entities.patch
index 70302fe34b..70302fe34b 100644
--- a/patches/server/0355-Prevent-teleporting-dead-entities.patch
+++ b/patches/server/0354-Prevent-teleporting-dead-entities.patch
diff --git a/patches/server/0356-Implement-Mob-Goal-API.patch b/patches/server/0355-Implement-Mob-Goal-API.patch
index a3c40fa19b..8d8480e111 100644
--- a/patches/server/0356-Implement-Mob-Goal-API.patch
+++ b/patches/server/0355-Implement-Mob-Goal-API.patch
@@ -18,14 +18,13 @@ index e7c00486bd831578008c02fcda13f3a555e6a2f1..688e901b75e95941e0101cc7d0c4effa
testImplementation("org.mockito:mockito-core:5.11.0")
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
new file mode 100644
-index 0000000000000000000000000000000000000000..3f8cca8027051694cb0440373e75f418f73edf87
+index 0000000000000000000000000000000000000000..c99eafab2103c7f5bca7ffba68a10bd853df055f
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
-@@ -0,0 +1,378 @@
+@@ -0,0 +1,377 @@
+package com.destroystokyo.paper.entity.ai;
+
+import com.destroystokyo.paper.entity.RangedEntity;
-+import com.destroystokyo.paper.util.set.OptimizedSmallEnumSet;
+import com.google.common.collect.BiMap;
+import com.google.common.collect.HashBiMap;
+import io.papermc.paper.util.ObfHelper;
@@ -316,7 +315,7 @@ index 0000000000000000000000000000000000000000..3f8cca8027051694cb0440373e75f418
+ public static EnumSet<GoalType> vanillaToPaper(Goal goal) {
+ EnumSet<GoalType> goals = EnumSet.noneOf(GoalType.class);
+ for (GoalType type : GoalType.values()) {
-+ if (goal.getFlags().contains(paperToVanilla(type))) {
++ if (goal.getFlags().hasElement(paperToVanilla(type))) {
+ goals.add(type);
+ }
+ }
@@ -402,7 +401,7 @@ index 0000000000000000000000000000000000000000..3f8cca8027051694cb0440373e75f418
+}
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/PaperCustomGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/PaperCustomGoal.java
new file mode 100644
-index 0000000000000000000000000000000000000000..b5f75ad725f5933db8f0688b2c0b27d620919241
+index 0000000000000000000000000000000000000000..26c745dd9ccdfdd5c5039f2acc5201b9b91fb274
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/PaperCustomGoal.java
@@ -0,0 +1,53 @@
@@ -422,7 +421,7 @@ index 0000000000000000000000000000000000000000..b5f75ad725f5933db8f0688b2c0b27d6
+
+ this.setFlags(MobGoalHelper.paperToVanilla(handle.getTypes()));
+ if (this.getFlags().size() == 0) {
-+ this.getFlags().add(Flag.UNKNOWN_BEHAVIOR);
++ this.getFlags().addUnchecked(Flag.UNKNOWN_BEHAVIOR);
+ }
+ }
+
@@ -461,7 +460,7 @@ index 0000000000000000000000000000000000000000..b5f75ad725f5933db8f0688b2c0b27d6
+}
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java b/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java
new file mode 100644
-index 0000000000000000000000000000000000000000..30ed9ffd6a65914d7545636150a09327aba047c3
+index 0000000000000000000000000000000000000000..24c30e8a462c59829ab2bd9ee52a1b248550d8ab
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/PaperMobGoals.java
@@ -0,0 +1,224 @@
@@ -584,7 +583,7 @@ index 0000000000000000000000000000000000000000..30ed9ffd6a65914d7545636150a09327
+ CraftMob craftMob = (CraftMob) mob;
+ Set<Goal<T>> goals = new HashSet<>();
+ for (WrappedGoal item : getHandle(craftMob, type).getAvailableGoals()) {
-+ if (!item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type))) {
++ if (!item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type))) {
+ continue;
+ }
+
@@ -607,7 +606,7 @@ index 0000000000000000000000000000000000000000..30ed9ffd6a65914d7545636150a09327
+ continue;
+ }
+ for (WrappedGoal item : getHandle(craftMob, internalType).getAvailableGoals()) {
-+ if (item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type))) {
++ if (item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type))) {
+ continue;
+ }
+
@@ -637,7 +636,7 @@ index 0000000000000000000000000000000000000000..30ed9ffd6a65914d7545636150a09327
+ Set<Goal<T>> goals = new HashSet<>();
+ getHandle(craftMob, type).getAvailableGoals()
+ .stream().filter(WrappedGoal::isRunning)
-+ .filter(item -> item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type)))
++ .filter(item -> item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type)))
+ .forEach(item -> {
+ if (item.getGoal() instanceof PaperCustomGoal) {
+ //noinspection unchecked
@@ -660,7 +659,7 @@ index 0000000000000000000000000000000000000000..30ed9ffd6a65914d7545636150a09327
+ getHandle(craftMob, internalType).getAvailableGoals()
+ .stream()
+ .filter(WrappedGoal::isRunning)
-+ .filter(item -> !item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type)))
++ .filter(item -> !item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type)))
+ .forEach(item -> {
+ if (item.getGoal() instanceof PaperCustomGoal) {
+ //noinspection unchecked
diff --git a/patches/server/0357-Add-villager-reputation-API.patch b/patches/server/0356-Add-villager-reputation-API.patch
index 5043e90bdc..5043e90bdc 100644
--- a/patches/server/0357-Add-villager-reputation-API.patch
+++ b/patches/server/0356-Add-villager-reputation-API.patch
diff --git a/patches/server/0358-ExperienceOrb-merging-stacking-API-and-fixes.patch b/patches/server/0357-ExperienceOrb-merging-stacking-API-and-fixes.patch
index 4686e1475f..4686e1475f 100644
--- a/patches/server/0358-ExperienceOrb-merging-stacking-API-and-fixes.patch
+++ b/patches/server/0357-ExperienceOrb-merging-stacking-API-and-fixes.patch
diff --git a/patches/server/0359-Fix-PotionEffect-ignores-icon-flag.patch b/patches/server/0358-Fix-PotionEffect-ignores-icon-flag.patch
index 59845e22d4..59845e22d4 100644
--- a/patches/server/0359-Fix-PotionEffect-ignores-icon-flag.patch
+++ b/patches/server/0358-Fix-PotionEffect-ignores-icon-flag.patch
diff --git a/patches/server/0360-Potential-bed-API.patch b/patches/server/0359-Potential-bed-API.patch
index 34470bcfc1..9b500674e0 100644
--- a/patches/server/0360-Potential-bed-API.patch
+++ b/patches/server/0359-Potential-bed-API.patch
@@ -8,7 +8,7 @@ Adds a new method to fetch the location of a player's bed without generating any
getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-index eb2d39d408e7f46a8f047a2b0d76981f24e1320a..bbd3f0981eb95348ef12c9af8fa1712c022ed869 100644
+index b55919a0e61a36697c95599dba17dbe2b788fd2a..084938fa2ffa7ee462766bf03f8e2b4c0fd4bf6b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -12,6 +12,7 @@ import net.minecraft.nbt.CompoundTag;
diff --git a/patches/server/0361-Wait-for-Async-Tasks-during-shutdown.patch b/patches/server/0360-Wait-for-Async-Tasks-during-shutdown.patch
index e7c0b4c6b0..f978f93066 100644
--- a/patches/server/0361-Wait-for-Async-Tasks-during-shutdown.patch
+++ b/patches/server/0360-Wait-for-Async-Tasks-during-shutdown.patch
@@ -10,7 +10,7 @@ Adds a 5 second grace period for any async tasks to finish and warns
if any are still running after that delay just as reload does.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index af83b1c762239fe7c8c11d3904f30504b0a1ca67..badd42d84b6367f6926bcff0ec8426fb6402ae80 100644
+index 1088a91ee131d1c303961557d8fb90101c2d8d3b..2d25ba18d3db4b3eea8bd30812656f1ade4c2a67 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -943,6 +943,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0362-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch b/patches/server/0361-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch
index dfe8e5260b..dfe8e5260b 100644
--- a/patches/server/0362-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch
+++ b/patches/server/0361-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch
diff --git a/patches/server/0363-Add-option-for-console-having-all-permissions.patch b/patches/server/0362-Add-option-for-console-having-all-permissions.patch
index ace91d22dd..ace91d22dd 100644
--- a/patches/server/0363-Add-option-for-console-having-all-permissions.patch
+++ b/patches/server/0362-Add-option-for-console-having-all-permissions.patch
diff --git a/patches/server/0364-Fix-villager-trading-demand-MC-163962.patch b/patches/server/0363-Fix-villager-trading-demand-MC-163962.patch
index bd7b6c4273..bd7b6c4273 100644
--- a/patches/server/0364-Fix-villager-trading-demand-MC-163962.patch
+++ b/patches/server/0363-Fix-villager-trading-demand-MC-163962.patch
diff --git a/patches/server/0365-Maps-shouldn-t-load-chunks.patch b/patches/server/0364-Maps-shouldn-t-load-chunks.patch
index 3bc3299f81..3bc3299f81 100644
--- a/patches/server/0365-Maps-shouldn-t-load-chunks.patch
+++ b/patches/server/0364-Maps-shouldn-t-load-chunks.patch
diff --git a/patches/server/0366-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch b/patches/server/0365-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch
index 27672e59d7..27672e59d7 100644
--- a/patches/server/0366-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch
+++ b/patches/server/0365-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch
diff --git a/patches/server/0367-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch b/patches/server/0366-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch
index 4175cae3b0..4175cae3b0 100644
--- a/patches/server/0367-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch
+++ b/patches/server/0366-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch
diff --git a/patches/server/0368-Fix-piston-physics-inconsistency-MC-188840.patch b/patches/server/0367-Fix-piston-physics-inconsistency-MC-188840.patch
index 44f85960c4..44f85960c4 100644
--- a/patches/server/0368-Fix-piston-physics-inconsistency-MC-188840.patch
+++ b/patches/server/0367-Fix-piston-physics-inconsistency-MC-188840.patch
diff --git a/patches/server/0369-Fix-missing-chunks-due-to-integer-overflow.patch b/patches/server/0368-Fix-missing-chunks-due-to-integer-overflow.patch
index e7af97469b..e7af97469b 100644
--- a/patches/server/0369-Fix-missing-chunks-due-to-integer-overflow.patch
+++ b/patches/server/0368-Fix-missing-chunks-due-to-integer-overflow.patch
diff --git a/patches/server/0370-Prevent-position-desync-causing-tp-exploit.patch b/patches/server/0369-Prevent-position-desync-causing-tp-exploit.patch
index 7fcd84e1b6..7fcd84e1b6 100644
--- a/patches/server/0370-Prevent-position-desync-causing-tp-exploit.patch
+++ b/patches/server/0369-Prevent-position-desync-causing-tp-exploit.patch
diff --git a/patches/server/0371-Inventory-getHolder-method-without-block-snapshot.patch b/patches/server/0370-Inventory-getHolder-method-without-block-snapshot.patch
index b30d42bf56..b30d42bf56 100644
--- a/patches/server/0371-Inventory-getHolder-method-without-block-snapshot.patch
+++ b/patches/server/0370-Inventory-getHolder-method-without-block-snapshot.patch
diff --git a/patches/server/0372-Add-PlayerRecipeBookClickEvent.patch b/patches/server/0371-Add-PlayerRecipeBookClickEvent.patch
index eab3672167..eab3672167 100644
--- a/patches/server/0372-Add-PlayerRecipeBookClickEvent.patch
+++ b/patches/server/0371-Add-PlayerRecipeBookClickEvent.patch
diff --git a/patches/server/0373-Hide-sync-chunk-writes-behind-flag.patch b/patches/server/0372-Hide-sync-chunk-writes-behind-flag.patch
index e8889b31d8..e8889b31d8 100644
--- a/patches/server/0373-Hide-sync-chunk-writes-behind-flag.patch
+++ b/patches/server/0372-Hide-sync-chunk-writes-behind-flag.patch
diff --git a/patches/server/0374-Add-permission-for-command-blocks.patch b/patches/server/0373-Add-permission-for-command-blocks.patch
index 8f73a21aea..8f73a21aea 100644
--- a/patches/server/0374-Add-permission-for-command-blocks.patch
+++ b/patches/server/0373-Add-permission-for-command-blocks.patch
diff --git a/patches/server/0375-Ensure-Entity-position-and-AABB-are-never-invalid.patch b/patches/server/0374-Ensure-Entity-position-and-AABB-are-never-invalid.patch
index 9d035ae577..9d035ae577 100644
--- a/patches/server/0375-Ensure-Entity-position-and-AABB-are-never-invalid.patch
+++ b/patches/server/0374-Ensure-Entity-position-and-AABB-are-never-invalid.patch
diff --git a/patches/server/0376-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
index 2ee047cbd9..8fee1b0a24 100644
--- a/patches/server/0376-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
+++ b/patches/server/0375-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
@@ -8,7 +8,7 @@ makes it so that the server keeps the last difficulty used instead
of restoring the server.properties every single load.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index badd42d84b6367f6926bcff0ec8426fb6402ae80..331ed639496a73dbfdde795b6d6154a9c8ea78b4 100644
+index 2d25ba18d3db4b3eea8bd30812656f1ade4c2a67..6c9026cf224cf9dc75a5f61f1c051e640d1887ed 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -837,7 +837,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -20,7 +20,7 @@ index badd42d84b6367f6926bcff0ec8426fb6402ae80..331ed639496a73dbfdde795b6d6154a9
this.forceTicks = false;
// CraftBukkit end
-@@ -1849,11 +1849,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1848,11 +1848,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
@@ -40,7 +40,7 @@ index badd42d84b6367f6926bcff0ec8426fb6402ae80..331ed639496a73dbfdde795b6d6154a9
}
}
-@@ -1867,7 +1870,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1866,7 +1869,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
@@ -104,7 +104,7 @@ index 118708bd917518333359ce1407e1e26e4ec6a180..9e8de1efa2fc42a8ffb3c29579be48a4
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 eafb186d158c6cf26b97b1982597bde377396172..990669917cd990d16f9699b085c9ff041c1f77b4 100644
+index 20bb365b188c7081123db87186f0e1a999758817..a381688de78f5a78980b660f9765f839413a6c65 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1165,7 +1165,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0377-Paper-dumpitem-command.patch b/patches/server/0376-Paper-dumpitem-command.patch
index 088efe087c..088efe087c 100644
--- a/patches/server/0377-Paper-dumpitem-command.patch
+++ b/patches/server/0376-Paper-dumpitem-command.patch
diff --git a/patches/server/0378-Improve-Legacy-Component-serialization-size.patch b/patches/server/0377-Improve-Legacy-Component-serialization-size.patch
index 4ee643286d..5a1da5d1f0 100644
--- a/patches/server/0378-Improve-Legacy-Component-serialization-size.patch
+++ b/patches/server/0377-Improve-Legacy-Component-serialization-size.patch
@@ -7,7 +7,7 @@ Don't constantly send format: false for all formatting options when parent alrea
has it false
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
-index 5a9ddf71dc186c537a23083ac59434fb446a2140..70f207f016959402ff3cba9de924f906fea28110 100644
+index 1b552b3f05ac7fc44450de4b1ec78907a0f62424..3a550f2bd1366ae89c69a0527404b0449e6d9cf7 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
@@ -48,6 +48,7 @@ public final class CraftChatMessage {
diff --git a/patches/server/0379-Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/patches/server/0378-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
index 2f4252de8c..1cd2186d19 100644
--- a/patches/server/0379-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
+++ b/patches/server/0378-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
@@ -44,7 +44,7 @@ index 9e8de1efa2fc42a8ffb3c29579be48a4b5b97fca..010ab9cdf3dbe9b89b58744f37b33a23
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 990669917cd990d16f9699b085c9ff041c1f77b4..e085fd750aa8823ca6a3bab9b6e5c5b8338021bb 100644
+index a381688de78f5a78980b660f9765f839413a6c65..6e01013228798f9682624e912618500f0d4fa485 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -266,7 +266,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -94,7 +94,7 @@ index 990669917cd990d16f9699b085c9ff041c1f77b4..e085fd750aa8823ca6a3bab9b6e5c5b8
}
@@ -2241,6 +2253,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
- io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> {
+ ca.spottedleaf.moonrise.common.util.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> {
net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> {
net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk)c;
+ if (chunk != null) this.addTicket(x, z); // Paper
diff --git a/patches/server/0380-Add-BlockStateMeta-clearBlockState.patch b/patches/server/0379-Add-BlockStateMeta-clearBlockState.patch
index 802f698e6f..802f698e6f 100644
--- a/patches/server/0380-Add-BlockStateMeta-clearBlockState.patch
+++ b/patches/server/0379-Add-BlockStateMeta-clearBlockState.patch
diff --git a/patches/server/0381-Convert-legacy-attributes-in-Item-Meta.patch b/patches/server/0380-Convert-legacy-attributes-in-Item-Meta.patch
index 94ddf33189..b929596c4e 100644
--- a/patches/server/0381-Convert-legacy-attributes-in-Item-Meta.patch
+++ b/patches/server/0380-Convert-legacy-attributes-in-Item-Meta.patch
@@ -30,7 +30,7 @@ index de40e522960469b98f987bd688489740446d9f85..5678d2007d5adf45dec0638c5dd848b6
public CraftAttributeMap(AttributeMap handle) {
this.handle = handle;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index 38596695282157e3ff0a53a1185d211268854c15..24ebc5841ed16129c0e9305da6cf1d8fb67d42ec 100644
+index 69be26f8f47854f39cfed0559d944ef4f983c0f3..0b87cfbdf039ee5bc017d2b1783c7c4853047952 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -695,7 +695,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
diff --git a/patches/server/0382-Do-not-accept-invalid-client-settings.patch b/patches/server/0381-Do-not-accept-invalid-client-settings.patch
index 5c428d433e..5c428d433e 100644
--- a/patches/server/0382-Do-not-accept-invalid-client-settings.patch
+++ b/patches/server/0381-Do-not-accept-invalid-client-settings.patch
diff --git a/patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch b/patches/server/0382-Improve-fix-EntityTargetLivingEntityEvent.patch
index 29703174a1..29703174a1 100644
--- a/patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch
+++ b/patches/server/0382-Improve-fix-EntityTargetLivingEntityEvent.patch
diff --git a/patches/server/0384-Add-entity-liquid-API.patch b/patches/server/0383-Add-entity-liquid-API.patch
index 51765a7f3a..51765a7f3a 100644
--- a/patches/server/0384-Add-entity-liquid-API.patch
+++ b/patches/server/0383-Add-entity-liquid-API.patch
diff --git a/patches/server/0385-Add-PrepareResultEvent.patch b/patches/server/0384-Add-PrepareResultEvent.patch
index 962fe95587..962fe95587 100644
--- a/patches/server/0385-Add-PrepareResultEvent.patch
+++ b/patches/server/0384-Add-PrepareResultEvent.patch
diff --git a/patches/server/0386-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/0385-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch
index 0603020790..0603020790 100644
--- a/patches/server/0386-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch
+++ b/patches/server/0385-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch
diff --git a/patches/server/0387-Fix-arrows-never-despawning-MC-125757.patch b/patches/server/0386-Fix-arrows-never-despawning-MC-125757.patch
index dbcb4ce450..dbcb4ce450 100644
--- a/patches/server/0387-Fix-arrows-never-despawning-MC-125757.patch
+++ b/patches/server/0386-Fix-arrows-never-despawning-MC-125757.patch
diff --git a/patches/server/0388-Thread-Safe-Vanilla-Command-permission-checking.patch b/patches/server/0387-Thread-Safe-Vanilla-Command-permission-checking.patch
index a210e43dce..a210e43dce 100644
--- a/patches/server/0388-Thread-Safe-Vanilla-Command-permission-checking.patch
+++ b/patches/server/0387-Thread-Safe-Vanilla-Command-permission-checking.patch
diff --git a/patches/server/0389-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/patches/server/0388-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch
index fe347fabc4..fe347fabc4 100644
--- a/patches/server/0389-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch
+++ b/patches/server/0388-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch
diff --git a/patches/server/0390-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/0389-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch
index df26348fac..df26348fac 100644
--- a/patches/server/0390-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch
+++ b/patches/server/0389-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch
diff --git a/patches/server/0391-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/patches/server/0390-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch
index 5f0bca47b3..5f0bca47b3 100644
--- a/patches/server/0391-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch
+++ b/patches/server/0390-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch
diff --git a/patches/server/0392-Optimize-NetworkManager-Exception-Handling.patch b/patches/server/0391-Optimize-NetworkManager-Exception-Handling.patch
index 8626e3b900..8626e3b900 100644
--- a/patches/server/0392-Optimize-NetworkManager-Exception-Handling.patch
+++ b/patches/server/0391-Optimize-NetworkManager-Exception-Handling.patch
diff --git a/patches/server/0393-Fix-some-rails-connecting-improperly.patch b/patches/server/0392-Fix-some-rails-connecting-improperly.patch
index 4f5cd86538..4f5cd86538 100644
--- a/patches/server/0393-Fix-some-rails-connecting-improperly.patch
+++ b/patches/server/0392-Fix-some-rails-connecting-improperly.patch
diff --git a/patches/server/0394-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch b/patches/server/0393-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch
index 75cd32bb83..75cd32bb83 100644
--- a/patches/server/0394-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch
+++ b/patches/server/0393-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch
diff --git a/patches/server/0395-Brand-support.patch b/patches/server/0394-Brand-support.patch
index 24c2290fe4..b5c888a819 100644
--- a/patches/server/0395-Brand-support.patch
+++ b/patches/server/0394-Brand-support.patch
@@ -5,12 +5,12 @@ 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 d4e933b8d0f2352ac035b99fc386e6fe6d7f6651..4e76d4cacf688bce9d00eaff5ea601dbf16493e9 100644
+index b43a32989bd9c05f26da97634149350b311ad820..16dca5bcb7b1cbecec9be88c60240f3abe43ffdb 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -294,6 +294,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -293,6 +293,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+ // CraftBukkit end
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
+ public @Nullable String clientBrandName = null; // Paper - Brand support
@@ -57,7 +57,7 @@ index 2d1fad00ee084841618f0da8113c7aac8c0e2b0d..a3c67bdc2c08b3550534f37d15b0db90
} 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 aa549021a1676d0aa0aa7c9f1b0bf0bb800385a4..1febe581fbbc3accbf8fdbf086fba427cefdd3e9 100644
+index a0835efca3bef35c434b716ceccd05c801d2f240..99799563942693ae36188092d76054fdff97d4ca 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3139,6 +3139,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0396-Add-playPickupItemAnimation-to-LivingEntity.patch b/patches/server/0395-Add-playPickupItemAnimation-to-LivingEntity.patch
index 0fcb956c33..0fcb956c33 100644
--- a/patches/server/0396-Add-playPickupItemAnimation-to-LivingEntity.patch
+++ b/patches/server/0395-Add-playPickupItemAnimation-to-LivingEntity.patch
diff --git a/patches/server/0397-Don-t-require-FACING-data.patch b/patches/server/0396-Don-t-require-FACING-data.patch
index 2cec1e5276..2cec1e5276 100644
--- a/patches/server/0397-Don-t-require-FACING-data.patch
+++ b/patches/server/0396-Don-t-require-FACING-data.patch
diff --git a/patches/server/0398-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0397-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
index 48ef428173..37342b6ffe 100644
--- a/patches/server/0398-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
+++ b/patches/server/0397-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
@@ -5,7 +5,7 @@ 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 a87782c3cb0a751f532feda0b827d7c7eac163e1..2c70df4d6ba8188ef7e1ab30b70bcfaa1a660eca 100644
+index 89e05d9316b012a5c8103682ff9dbeae757f4f57..9114ba1742a4fc8683848d431fa92046a85fe871 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1666,7 +1666,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -19,7 +19,7 @@ index a87782c3cb0a751f532feda0b827d7c7eac163e1..2c70df4d6ba8188ef7e1ab30b70bcfaa
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index e085fd750aa8823ca6a3bab9b6e5c5b8338021bb..009be0baf925245ff8fa3d849f4233fb952f881e 100644
+index 6e01013228798f9682624e912618500f0d4fa485..5ae307f9343ffea39c286992459a6c8069d9fb86 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -246,12 +246,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0399-Add-moon-phase-API.patch b/patches/server/0398-Add-moon-phase-API.patch
index 539ccca6de..539ccca6de 100644
--- a/patches/server/0399-Add-moon-phase-API.patch
+++ b/patches/server/0398-Add-moon-phase-API.patch
diff --git a/patches/server/0400-Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/server/0399-Do-not-let-the-server-load-chunks-from-newer-version.patch
index 9ada63fcdf..9ada63fcdf 100644
--- a/patches/server/0400-Do-not-let-the-server-load-chunks-from-newer-version.patch
+++ b/patches/server/0399-Do-not-let-the-server-load-chunks-from-newer-version.patch
diff --git a/patches/server/0401-Prevent-headless-pistons-from-being-created.patch b/patches/server/0400-Prevent-headless-pistons-from-being-created.patch
index e375acc68a..e375acc68a 100644
--- a/patches/server/0401-Prevent-headless-pistons-from-being-created.patch
+++ b/patches/server/0400-Prevent-headless-pistons-from-being-created.patch
diff --git a/patches/server/0402-Add-BellRingEvent.patch b/patches/server/0401-Add-BellRingEvent.patch
index 6b974f5db0..6b974f5db0 100644
--- a/patches/server/0402-Add-BellRingEvent.patch
+++ b/patches/server/0401-Add-BellRingEvent.patch
diff --git a/patches/server/0403-Add-zombie-targets-turtle-egg-config.patch b/patches/server/0402-Add-zombie-targets-turtle-egg-config.patch
index 56529e1fd4..56529e1fd4 100644
--- a/patches/server/0403-Add-zombie-targets-turtle-egg-config.patch
+++ b/patches/server/0402-Add-zombie-targets-turtle-egg-config.patch
diff --git a/patches/server/0404-Buffer-joins-to-world.patch b/patches/server/0403-Buffer-joins-to-world.patch
index 2e31ea4385..2e31ea4385 100644
--- a/patches/server/0404-Buffer-joins-to-world.patch
+++ b/patches/server/0403-Buffer-joins-to-world.patch
diff --git a/patches/server/0405-Fix-hex-colors-not-working-in-some-kick-messages.patch b/patches/server/0404-Fix-hex-colors-not-working-in-some-kick-messages.patch
index f6f865ab1a..f6f865ab1a 100644
--- a/patches/server/0405-Fix-hex-colors-not-working-in-some-kick-messages.patch
+++ b/patches/server/0404-Fix-hex-colors-not-working-in-some-kick-messages.patch
diff --git a/patches/server/0406-PortalCreateEvent-needs-to-know-its-entity.patch b/patches/server/0405-PortalCreateEvent-needs-to-know-its-entity.patch
index 97b795bec5..97b795bec5 100644
--- a/patches/server/0406-PortalCreateEvent-needs-to-know-its-entity.patch
+++ b/patches/server/0405-PortalCreateEvent-needs-to-know-its-entity.patch
diff --git a/patches/server/0407-Add-more-Evoker-API.patch b/patches/server/0406-Add-more-Evoker-API.patch
index f44eceff55..f44eceff55 100644
--- a/patches/server/0407-Add-more-Evoker-API.patch
+++ b/patches/server/0406-Add-more-Evoker-API.patch
diff --git a/patches/server/0408-Add-methods-to-get-translation-keys.patch b/patches/server/0407-Add-methods-to-get-translation-keys.patch
index cae11912b6..cae11912b6 100644
--- a/patches/server/0408-Add-methods-to-get-translation-keys.patch
+++ b/patches/server/0407-Add-methods-to-get-translation-keys.patch
diff --git a/patches/server/0409-Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/0408-Create-HoverEvent-from-ItemStack-Entity.patch
index 081d6c07e5..081d6c07e5 100644
--- a/patches/server/0409-Create-HoverEvent-from-ItemStack-Entity.patch
+++ b/patches/server/0408-Create-HoverEvent-from-ItemStack-Entity.patch
diff --git a/patches/server/0410-Cache-block-data-strings.patch b/patches/server/0409-Cache-block-data-strings.patch
index c73022bfec..28a1635b20 100644
--- a/patches/server/0410-Cache-block-data-strings.patch
+++ b/patches/server/0409-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 331ed639496a73dbfdde795b6d6154a9c8ea78b4..5b7f2b2993844cbcc13742f69b0521832d1970da 100644
+index 6c9026cf224cf9dc75a5f61f1c051e640d1887ed..b9ba0033542bae48678e0321fbe0633a711291a5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2148,6 +2148,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2147,6 +2147,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/0411-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/0410-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch
index fe536a1eab..fe536a1eab 100644
--- a/patches/server/0411-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch
+++ b/patches/server/0410-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch
diff --git a/patches/server/0412-Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/0411-Add-additional-open-container-api-to-HumanEntity.patch
index be29dd6b1c..be29dd6b1c 100644
--- a/patches/server/0412-Add-additional-open-container-api-to-HumanEntity.patch
+++ b/patches/server/0411-Add-additional-open-container-api-to-HumanEntity.patch
diff --git a/patches/server/0413-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch b/patches/server/0412-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch
index 9a0c6f1492..9a0c6f1492 100644
--- a/patches/server/0413-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch
+++ b/patches/server/0412-Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch
diff --git a/patches/server/0414-Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/0413-Extend-block-drop-capture-to-capture-all-items-added.patch
index 9531e0f695..9cb478d120 100644
--- a/patches/server/0414-Extend-block-drop-capture-to-capture-all-items-added.patch
+++ b/patches/server/0413-Extend-block-drop-capture-to-capture-all-items-added.patch
@@ -6,7 +6,7 @@ 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 2c70df4d6ba8188ef7e1ab30b70bcfaa1a660eca..c9dad47ef14e0a021685fab710c920419611d151 100644
+index 9114ba1742a4fc8683848d431fa92046a85fe871..c60967b7833a23cff0305219b02b308d92448109 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1228,6 +1228,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0415-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0414-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch
index 31a4396f92..31a4396f92 100644
--- a/patches/server/0415-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch
+++ b/patches/server/0414-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch
diff --git a/patches/server/0416-Lazily-track-plugin-scoreboards-by-default.patch b/patches/server/0415-Lazily-track-plugin-scoreboards-by-default.patch
index 28ae9df043..28ae9df043 100644
--- a/patches/server/0416-Lazily-track-plugin-scoreboards-by-default.patch
+++ b/patches/server/0415-Lazily-track-plugin-scoreboards-by-default.patch
diff --git a/patches/server/0417-Entity-isTicking.patch b/patches/server/0416-Entity-isTicking.patch
index c00b5f821b..c00b5f821b 100644
--- a/patches/server/0417-Entity-isTicking.patch
+++ b/patches/server/0416-Entity-isTicking.patch
diff --git a/patches/server/0418-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/0417-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch
index 91a6325196..18a0880395 100644
--- a/patches/server/0418-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch
+++ b/patches/server/0417-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 5b7f2b2993844cbcc13742f69b0521832d1970da..e39cfc9750bf1d3f20abb3a2e9d46fa51ccdc248 100644
+index b9ba0033542bae48678e0321fbe0633a711291a5..055172644d6a3c30b512262fcba940610161b8d7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2273,13 +2273,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2272,13 +2272,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/0419-Fix-Concurrency-issue-in-ShufflingList.patch b/patches/server/0418-Fix-Concurrency-issue-in-ShufflingList.patch
index f04a40e1ac..f04a40e1ac 100644
--- a/patches/server/0419-Fix-Concurrency-issue-in-ShufflingList.patch
+++ b/patches/server/0418-Fix-Concurrency-issue-in-ShufflingList.patch
diff --git a/patches/server/0420-Reset-Ender-Crystals-on-Dragon-Spawn.patch b/patches/server/0419-Reset-Ender-Crystals-on-Dragon-Spawn.patch
index f727c2200f..f727c2200f 100644
--- a/patches/server/0420-Reset-Ender-Crystals-on-Dragon-Spawn.patch
+++ b/patches/server/0419-Reset-Ender-Crystals-on-Dragon-Spawn.patch
diff --git a/patches/server/0421-Fix-for-large-move-vectors-crashing-server.patch b/patches/server/0420-Fix-for-large-move-vectors-crashing-server.patch
index e987725d68..e987725d68 100644
--- a/patches/server/0421-Fix-for-large-move-vectors-crashing-server.patch
+++ b/patches/server/0420-Fix-for-large-move-vectors-crashing-server.patch
diff --git a/patches/server/0422-Optimise-getType-calls.patch b/patches/server/0421-Optimise-getType-calls.patch
index 1b14b0202b..1b14b0202b 100644
--- a/patches/server/0422-Optimise-getType-calls.patch
+++ b/patches/server/0421-Optimise-getType-calls.patch
diff --git a/patches/server/0423-Villager-resetOffers.patch b/patches/server/0422-Villager-resetOffers.patch
index 77f071ec77..77f071ec77 100644
--- a/patches/server/0423-Villager-resetOffers.patch
+++ b/patches/server/0422-Villager-resetOffers.patch
diff --git a/patches/server/0424-Retain-block-place-order-when-capturing-blockstates.patch b/patches/server/0423-Retain-block-place-order-when-capturing-blockstates.patch
index e7d46e41eb..e7d46e41eb 100644
--- a/patches/server/0424-Retain-block-place-order-when-capturing-blockstates.patch
+++ b/patches/server/0423-Retain-block-place-order-when-capturing-blockstates.patch
diff --git a/patches/server/0425-Fix-item-locations-dropped-from-campfires.patch b/patches/server/0424-Fix-item-locations-dropped-from-campfires.patch
index 26a43eb186..26a43eb186 100644
--- a/patches/server/0425-Fix-item-locations-dropped-from-campfires.patch
+++ b/patches/server/0424-Fix-item-locations-dropped-from-campfires.patch
diff --git a/patches/server/0426-Fix-bell-block-entity-memory-leak.patch b/patches/server/0425-Fix-bell-block-entity-memory-leak.patch
index 5343b073cd..5343b073cd 100644
--- a/patches/server/0426-Fix-bell-block-entity-memory-leak.patch
+++ b/patches/server/0425-Fix-bell-block-entity-memory-leak.patch
diff --git a/patches/server/0427-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch b/patches/server/0426-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch
index 6ab78855c4..6ab78855c4 100644
--- a/patches/server/0427-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch
+++ b/patches/server/0426-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch
diff --git a/patches/server/0428-Add-getOfflinePlayerIfCached-String.patch b/patches/server/0427-Add-getOfflinePlayerIfCached-String.patch
index 88f95ee405..88f95ee405 100644
--- a/patches/server/0428-Add-getOfflinePlayerIfCached-String.patch
+++ b/patches/server/0427-Add-getOfflinePlayerIfCached-String.patch
diff --git a/patches/server/0429-Add-ignore-discounts-API.patch b/patches/server/0428-Add-ignore-discounts-API.patch
index 5a2d4be36b..5a2d4be36b 100644
--- a/patches/server/0429-Add-ignore-discounts-API.patch
+++ b/patches/server/0428-Add-ignore-discounts-API.patch
diff --git a/patches/server/0430-Toggle-for-removing-existing-dragon.patch b/patches/server/0429-Toggle-for-removing-existing-dragon.patch
index 1bfa511969..1bfa511969 100644
--- a/patches/server/0430-Toggle-for-removing-existing-dragon.patch
+++ b/patches/server/0429-Toggle-for-removing-existing-dragon.patch
diff --git a/patches/server/0431-Fix-client-lag-on-advancement-loading.patch b/patches/server/0430-Fix-client-lag-on-advancement-loading.patch
index ded2b5101b..ded2b5101b 100644
--- a/patches/server/0431-Fix-client-lag-on-advancement-loading.patch
+++ b/patches/server/0430-Fix-client-lag-on-advancement-loading.patch
diff --git a/patches/server/0432-Item-no-age-no-player-pickup.patch b/patches/server/0431-Item-no-age-no-player-pickup.patch
index 1fffbaf558..1fffbaf558 100644
--- a/patches/server/0432-Item-no-age-no-player-pickup.patch
+++ b/patches/server/0431-Item-no-age-no-player-pickup.patch
diff --git a/patches/server/0433-Beacon-API-custom-effect-ranges.patch b/patches/server/0432-Beacon-API-custom-effect-ranges.patch
index b80f1772cd..b80f1772cd 100644
--- a/patches/server/0433-Beacon-API-custom-effect-ranges.patch
+++ b/patches/server/0432-Beacon-API-custom-effect-ranges.patch
diff --git a/patches/server/0434-Add-API-for-quit-reason.patch b/patches/server/0433-Add-API-for-quit-reason.patch
index 06966acb33..802ce77913 100644
--- a/patches/server/0434-Add-API-for-quit-reason.patch
+++ b/patches/server/0433-Add-API-for-quit-reason.patch
@@ -28,11 +28,11 @@ index 134810ac91d828d67759cd1ed56f11b71e292917..ba41646a5edb57c4d9766df08bbc5701
Connection.LOGGER.debug("Failed to sent packet", throwable);
if (this.getSending() == PacketFlow.CLIENTBOUND) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 4998643920b8314737832ad15431b794e1aa6df0..62dbdc56d5529800d7a424040eb6821e9d527255 100644
+index 16dca5bcb7b1cbecec9be88c60240f3abe43ffdb..406dc0516f53fdc779fa611637bca304f5cef2f5 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -295,6 +295,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
- public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
+@@ -294,6 +294,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+ public boolean isRealPlayer; // Paper
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
public @Nullable String clientBrandName = null; // Paper - Brand support
+ 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
diff --git a/patches/server/0435-Add-Wandering-Trader-spawn-rate-config-options.patch b/patches/server/0434-Add-Wandering-Trader-spawn-rate-config-options.patch
index 98525387d7..98525387d7 100644
--- a/patches/server/0435-Add-Wandering-Trader-spawn-rate-config-options.patch
+++ b/patches/server/0434-Add-Wandering-Trader-spawn-rate-config-options.patch
diff --git a/patches/server/0436-Add-Destroy-Speed-API.patch b/patches/server/0435-Add-Destroy-Speed-API.patch
index 43e752ecb5..43e752ecb5 100644
--- a/patches/server/0436-Add-Destroy-Speed-API.patch
+++ b/patches/server/0435-Add-Destroy-Speed-API.patch
diff --git a/patches/server/0437-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0436-Fix-Player-spawnParticle-x-y-z-precision-loss.patch
index 83724b282d..60ac65b823 100644
--- a/patches/server/0437-Fix-Player-spawnParticle-x-y-z-precision-loss.patch
+++ b/patches/server/0436-Fix-Player-spawnParticle-x-y-z-precision-loss.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 1febe581fbbc3accbf8fdbf086fba427cefdd3e9..533bb2da5ed226a31f0534f17048afa2d99e36ee 100644
+index 99799563942693ae36188092d76054fdff97d4ca..766242aa6930b37630be77e421b4b5675c5feb0d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2707,7 +2707,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0438-Add-LivingEntity-clearActiveItem.patch b/patches/server/0437-Add-LivingEntity-clearActiveItem.patch
index a5b17788b8..a5b17788b8 100644
--- a/patches/server/0438-Add-LivingEntity-clearActiveItem.patch
+++ b/patches/server/0437-Add-LivingEntity-clearActiveItem.patch
diff --git a/patches/server/0439-Add-PlayerItemCooldownEvent.patch b/patches/server/0438-Add-PlayerItemCooldownEvent.patch
index 4b90903dd2..4b90903dd2 100644
--- a/patches/server/0439-Add-PlayerItemCooldownEvent.patch
+++ b/patches/server/0438-Add-PlayerItemCooldownEvent.patch
diff --git a/patches/server/0440-Significantly-improve-performance-of-the-end-generat.patch b/patches/server/0439-Significantly-improve-performance-of-the-end-generat.patch
index ed3ee50bc9..ed3ee50bc9 100644
--- a/patches/server/0440-Significantly-improve-performance-of-the-end-generat.patch
+++ b/patches/server/0439-Significantly-improve-performance-of-the-end-generat.patch
diff --git a/patches/server/0441-More-lightning-API.patch b/patches/server/0440-More-lightning-API.patch
index 967871902a..967871902a 100644
--- a/patches/server/0441-More-lightning-API.patch
+++ b/patches/server/0440-More-lightning-API.patch
diff --git a/patches/server/0442-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0441-Climbing-should-not-bypass-cramming-gamerule.patch
index db770d8d73..db770d8d73 100644
--- a/patches/server/0442-Climbing-should-not-bypass-cramming-gamerule.patch
+++ b/patches/server/0441-Climbing-should-not-bypass-cramming-gamerule.patch
diff --git a/patches/server/0443-Add-missing-default-perms-for-commands.patch b/patches/server/0442-Add-missing-default-perms-for-commands.patch
index d49628ee32..d49628ee32 100644
--- a/patches/server/0443-Add-missing-default-perms-for-commands.patch
+++ b/patches/server/0442-Add-missing-default-perms-for-commands.patch
diff --git a/patches/server/0444-Add-PlayerShearBlockEvent.patch b/patches/server/0443-Add-PlayerShearBlockEvent.patch
index c659b655c0..c659b655c0 100644
--- a/patches/server/0444-Add-PlayerShearBlockEvent.patch
+++ b/patches/server/0443-Add-PlayerShearBlockEvent.patch
diff --git a/patches/server/0445-Limit-recipe-packets.patch b/patches/server/0444-Limit-recipe-packets.patch
index f880991f70..f880991f70 100644
--- a/patches/server/0445-Limit-recipe-packets.patch
+++ b/patches/server/0444-Limit-recipe-packets.patch
diff --git a/patches/server/0446-Fix-CraftSound-backwards-compatibility.patch b/patches/server/0445-Fix-CraftSound-backwards-compatibility.patch
index 9ca7f86992..9ca7f86992 100644
--- a/patches/server/0446-Fix-CraftSound-backwards-compatibility.patch
+++ b/patches/server/0445-Fix-CraftSound-backwards-compatibility.patch
diff --git a/patches/server/0447-Player-Chunk-Load-Unload-Events.patch b/patches/server/0446-Player-Chunk-Load-Unload-Events.patch
index 0fee853cd3..0fee853cd3 100644
--- a/patches/server/0447-Player-Chunk-Load-Unload-Events.patch
+++ b/patches/server/0446-Player-Chunk-Load-Unload-Events.patch
diff --git a/patches/server/0448-Optimize-Dynamic-get-Missing-Keys.patch b/patches/server/0447-Optimize-Dynamic-get-Missing-Keys.patch
index e8bbac8b76..e8bbac8b76 100644
--- a/patches/server/0448-Optimize-Dynamic-get-Missing-Keys.patch
+++ b/patches/server/0447-Optimize-Dynamic-get-Missing-Keys.patch
diff --git a/patches/server/0449-Expose-LivingEntity-hurt-direction.patch b/patches/server/0448-Expose-LivingEntity-hurt-direction.patch
index f43a7b04aa..f43a7b04aa 100644
--- a/patches/server/0449-Expose-LivingEntity-hurt-direction.patch
+++ b/patches/server/0448-Expose-LivingEntity-hurt-direction.patch
diff --git a/patches/server/0450-Add-OBSTRUCTED-reason-to-BedEnterResult.patch b/patches/server/0449-Add-OBSTRUCTED-reason-to-BedEnterResult.patch
index decc5ee07c..decc5ee07c 100644
--- a/patches/server/0450-Add-OBSTRUCTED-reason-to-BedEnterResult.patch
+++ b/patches/server/0449-Add-OBSTRUCTED-reason-to-BedEnterResult.patch
diff --git a/patches/server/0451-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch b/patches/server/0450-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch
index 4186b39237..4186b39237 100644
--- a/patches/server/0451-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch
+++ b/patches/server/0450-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch
diff --git a/patches/server/0452-Add-TargetHitEvent.patch b/patches/server/0451-Add-TargetHitEvent.patch
index 816c525fd2..816c525fd2 100644
--- a/patches/server/0452-Add-TargetHitEvent.patch
+++ b/patches/server/0451-Add-TargetHitEvent.patch
diff --git a/patches/server/0453-MC-4-Fix-item-position-desync.patch b/patches/server/0452-MC-4-Fix-item-position-desync.patch
index c549036daa..c549036daa 100644
--- a/patches/server/0453-MC-4-Fix-item-position-desync.patch
+++ b/patches/server/0452-MC-4-Fix-item-position-desync.patch
diff --git a/patches/server/0454-Additional-Block-Material-API.patch b/patches/server/0453-Additional-Block-Material-API.patch
index 81728edf48..81728edf48 100644
--- a/patches/server/0454-Additional-Block-Material-API.patch
+++ b/patches/server/0453-Additional-Block-Material-API.patch
diff --git a/patches/server/0455-Fix-harming-potion-dupe.patch b/patches/server/0454-Fix-harming-potion-dupe.patch
index b184bf641c..b184bf641c 100644
--- a/patches/server/0455-Fix-harming-potion-dupe.patch
+++ b/patches/server/0454-Fix-harming-potion-dupe.patch
diff --git a/patches/server/0456-API-to-get-Material-from-Boats-and-Minecarts.patch b/patches/server/0455-API-to-get-Material-from-Boats-and-Minecarts.patch
index 9bcb17ad14..9bcb17ad14 100644
--- a/patches/server/0456-API-to-get-Material-from-Boats-and-Minecarts.patch
+++ b/patches/server/0455-API-to-get-Material-from-Boats-and-Minecarts.patch
diff --git a/patches/server/0457-Allow-disabling-mob-spawner-spawn-egg-transformation.patch b/patches/server/0456-Allow-disabling-mob-spawner-spawn-egg-transformation.patch
index da8441444c..da8441444c 100644
--- a/patches/server/0457-Allow-disabling-mob-spawner-spawn-egg-transformation.patch
+++ b/patches/server/0456-Allow-disabling-mob-spawner-spawn-egg-transformation.patch
diff --git a/patches/server/0458-Fix-Not-a-string-Map-Conversion-spam.patch b/patches/server/0457-Fix-Not-a-string-Map-Conversion-spam.patch
index 5b2328afe8..5b2328afe8 100644
--- a/patches/server/0458-Fix-Not-a-string-Map-Conversion-spam.patch
+++ b/patches/server/0457-Fix-Not-a-string-Map-Conversion-spam.patch
diff --git a/patches/server/0459-Add-PlayerFlowerPotManipulateEvent.patch b/patches/server/0458-Add-PlayerFlowerPotManipulateEvent.patch
index 8b61833059..8b61833059 100644
--- a/patches/server/0459-Add-PlayerFlowerPotManipulateEvent.patch
+++ b/patches/server/0458-Add-PlayerFlowerPotManipulateEvent.patch
diff --git a/patches/server/0460-Fix-interact-event-not-being-called-sometimes.patch b/patches/server/0459-Fix-interact-event-not-being-called-sometimes.patch
index 50b8b7414c..50b8b7414c 100644
--- a/patches/server/0460-Fix-interact-event-not-being-called-sometimes.patch
+++ b/patches/server/0459-Fix-interact-event-not-being-called-sometimes.patch
diff --git a/patches/server/0461-Zombie-API-breaking-doors.patch b/patches/server/0460-Zombie-API-breaking-doors.patch
index 50bb6965cf..50bb6965cf 100644
--- a/patches/server/0461-Zombie-API-breaking-doors.patch
+++ b/patches/server/0460-Zombie-API-breaking-doors.patch
diff --git a/patches/server/0462-Fix-nerfed-slime-when-splitting.patch b/patches/server/0461-Fix-nerfed-slime-when-splitting.patch
index a32a88f5ad..a32a88f5ad 100644
--- a/patches/server/0462-Fix-nerfed-slime-when-splitting.patch
+++ b/patches/server/0461-Fix-nerfed-slime-when-splitting.patch
diff --git a/patches/server/0463-Add-EntityLoadCrossbowEvent.patch b/patches/server/0462-Add-EntityLoadCrossbowEvent.patch
index a2f95139f8..a2f95139f8 100644
--- a/patches/server/0463-Add-EntityLoadCrossbowEvent.patch
+++ b/patches/server/0462-Add-EntityLoadCrossbowEvent.patch
diff --git a/patches/server/0464-Add-WorldGameRuleChangeEvent.patch b/patches/server/0463-Add-WorldGameRuleChangeEvent.patch
index 40dab3d535..737b50a1b8 100644
--- a/patches/server/0464-Add-WorldGameRuleChangeEvent.patch
+++ b/patches/server/0463-Add-WorldGameRuleChangeEvent.patch
@@ -64,7 +64,7 @@ index 0b46ad360be919e4aeb0ffc0eebae9fe712fb861..51e560d7856f230c5aa2dc32706c3a49
public int get() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 009be0baf925245ff8fa3d849f4233fb952f881e..c1125b0db7449a6d61e7b0a4e7c5d30917744b5d 100644
+index 5ae307f9343ffea39c286992459a6c8069d9fb86..08124dd65d1f950bdec8fcb55d2553c601b30a66 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1885,8 +1885,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0465-Add-ServerResourcesReloadedEvent.patch b/patches/server/0464-Add-ServerResourcesReloadedEvent.patch
index bfc98bc7e5..8996d46e70 100644
--- a/patches/server/0465-Add-ServerResourcesReloadedEvent.patch
+++ b/patches/server/0464-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 e39cfc9750bf1d3f20abb3a2e9d46fa51ccdc248..3511b578f137c94ed562690901952e81e6f90ee5 100644
+index 055172644d6a3c30b512262fcba940610161b8d7..84028b8ad189407f89fbdd63d3e185c86335b596 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2117,7 +2117,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2116,7 +2116,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return this.functionManager;
}
@@ -22,7 +22,7 @@ index e39cfc9750bf1d3f20abb3a2e9d46fa51ccdc248..3511b578f137c94ed562690901952e81
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error
PackRepository resourcepackrepository = this.packRepository;
-@@ -2149,6 +2155,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2148,6 +2154,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/0466-Add-world-settings-for-mobs-picking-up-loot.patch b/patches/server/0465-Add-world-settings-for-mobs-picking-up-loot.patch
index a6e23dc931..a6e23dc931 100644
--- a/patches/server/0466-Add-world-settings-for-mobs-picking-up-loot.patch
+++ b/patches/server/0465-Add-world-settings-for-mobs-picking-up-loot.patch
diff --git a/patches/server/0467-Add-BlockFailedDispenseEvent.patch b/patches/server/0466-Add-BlockFailedDispenseEvent.patch
index 9558081db4..9558081db4 100644
--- a/patches/server/0467-Add-BlockFailedDispenseEvent.patch
+++ b/patches/server/0466-Add-BlockFailedDispenseEvent.patch
diff --git a/patches/server/0468-Add-PlayerLecternPageChangeEvent.patch b/patches/server/0467-Add-PlayerLecternPageChangeEvent.patch
index 2e62d2becf..2e62d2becf 100644
--- a/patches/server/0468-Add-PlayerLecternPageChangeEvent.patch
+++ b/patches/server/0467-Add-PlayerLecternPageChangeEvent.patch
diff --git a/patches/server/0469-Add-PlayerLoomPatternSelectEvent.patch b/patches/server/0468-Add-PlayerLoomPatternSelectEvent.patch
index 4d74c20681..4d74c20681 100644
--- a/patches/server/0469-Add-PlayerLoomPatternSelectEvent.patch
+++ b/patches/server/0468-Add-PlayerLoomPatternSelectEvent.patch
diff --git a/patches/server/0470-Configurable-door-breaking-difficulty.patch b/patches/server/0469-Configurable-door-breaking-difficulty.patch
index 679bb5f5e7..679bb5f5e7 100644
--- a/patches/server/0470-Configurable-door-breaking-difficulty.patch
+++ b/patches/server/0469-Configurable-door-breaking-difficulty.patch
diff --git a/patches/server/0471-Empty-commands-shall-not-be-dispatched.patch b/patches/server/0470-Empty-commands-shall-not-be-dispatched.patch
index f58be08904..f58be08904 100644
--- a/patches/server/0471-Empty-commands-shall-not-be-dispatched.patch
+++ b/patches/server/0470-Empty-commands-shall-not-be-dispatched.patch
diff --git a/patches/server/0472-Remove-stale-POIs.patch b/patches/server/0471-Remove-stale-POIs.patch
index 221b65719b..02c2f1843b 100644
--- a/patches/server/0472-Remove-stale-POIs.patch
+++ b/patches/server/0471-Remove-stale-POIs.patch
@@ -5,7 +5,7 @@ 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 c9dad47ef14e0a021685fab710c920419611d151..deabbf30a550ff1835530257177b8f47e4710414 100644
+index c60967b7833a23cff0305219b02b308d92448109..373560fc82e491e6c8b755fecfe78d49a2fc3e2f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1741,6 +1741,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0473-Fix-villager-boat-exploit.patch b/patches/server/0472-Fix-villager-boat-exploit.patch
index 8f9249892b..8f9249892b 100644
--- a/patches/server/0473-Fix-villager-boat-exploit.patch
+++ b/patches/server/0472-Fix-villager-boat-exploit.patch
diff --git a/patches/server/0474-Add-sendOpLevel-API.patch b/patches/server/0473-Add-sendOpLevel-API.patch
index ad4f27d640..25dff52343 100644
--- a/patches/server/0474-Add-sendOpLevel-API.patch
+++ b/patches/server/0473-Add-sendOpLevel-API.patch
@@ -32,7 +32,7 @@ index 846132dad557b04a3d52184cfb1c0dd35673f8c6..5100b2d00452f97849239ca32164eed4
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 803a1d9350276c44eef622436cc4026460436ae7..6924bf3fad82cd055523af835a83aa0ca3490625 100644
+index 766242aa6930b37630be77e421b4b5675c5feb0d..7652da85170cd5a64d1b443430b85c388e2939a9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -677,6 +677,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0475-Add-RegistryAccess-for-managing-Registries.patch b/patches/server/0474-Add-RegistryAccess-for-managing-Registries.patch
index 5a0885dc09..5a0885dc09 100644
--- a/patches/server/0475-Add-RegistryAccess-for-managing-Registries.patch
+++ b/patches/server/0474-Add-RegistryAccess-for-managing-Registries.patch
diff --git a/patches/server/0476-Add-StructuresLocateEvent.patch b/patches/server/0475-Add-StructuresLocateEvent.patch
index d8c688e2ae..d8c688e2ae 100644
--- a/patches/server/0476-Add-StructuresLocateEvent.patch
+++ b/patches/server/0475-Add-StructuresLocateEvent.patch
diff --git a/patches/server/0477-Collision-option-for-requiring-a-player-participant.patch b/patches/server/0476-Collision-option-for-requiring-a-player-participant.patch
index f4afe60f9f..f4afe60f9f 100644
--- a/patches/server/0477-Collision-option-for-requiring-a-player-participant.patch
+++ b/patches/server/0476-Collision-option-for-requiring-a-player-participant.patch
diff --git a/patches/server/0478-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch b/patches/server/0477-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch
index 265be53faf..265be53faf 100644
--- a/patches/server/0478-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch
+++ b/patches/server/0477-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch
diff --git a/patches/server/0479-Return-chat-component-with-empty-text-instead-of-thr.patch b/patches/server/0478-Return-chat-component-with-empty-text-instead-of-thr.patch
index 4dea2ddeed..4dea2ddeed 100644
--- a/patches/server/0479-Return-chat-component-with-empty-text-instead-of-thr.patch
+++ b/patches/server/0478-Return-chat-component-with-empty-text-instead-of-thr.patch
diff --git a/patches/server/0480-Make-schedule-command-per-world.patch b/patches/server/0479-Make-schedule-command-per-world.patch
index 2d8f63ad1e..2d8f63ad1e 100644
--- a/patches/server/0480-Make-schedule-command-per-world.patch
+++ b/patches/server/0479-Make-schedule-command-per-world.patch
diff --git a/patches/server/0481-Configurable-max-leash-distance.patch b/patches/server/0480-Configurable-max-leash-distance.patch
index 404169cae8..404169cae8 100644
--- a/patches/server/0481-Configurable-max-leash-distance.patch
+++ b/patches/server/0480-Configurable-max-leash-distance.patch
diff --git a/patches/server/0482-Add-BlockPreDispenseEvent.patch b/patches/server/0481-Add-BlockPreDispenseEvent.patch
index c177a17c48..c177a17c48 100644
--- a/patches/server/0482-Add-BlockPreDispenseEvent.patch
+++ b/patches/server/0481-Add-BlockPreDispenseEvent.patch
diff --git a/patches/server/0483-Add-PlayerChangeBeaconEffectEvent.patch b/patches/server/0482-Add-PlayerChangeBeaconEffectEvent.patch
index b3444419ee..b3444419ee 100644
--- a/patches/server/0483-Add-PlayerChangeBeaconEffectEvent.patch
+++ b/patches/server/0482-Add-PlayerChangeBeaconEffectEvent.patch
diff --git a/patches/server/0484-Add-toggle-for-always-placing-the-dragon-egg.patch b/patches/server/0483-Add-toggle-for-always-placing-the-dragon-egg.patch
index 2576990e24..2576990e24 100644
--- a/patches/server/0484-Add-toggle-for-always-placing-the-dragon-egg.patch
+++ b/patches/server/0483-Add-toggle-for-always-placing-the-dragon-egg.patch
diff --git a/patches/server/0485-Add-PlayerStonecutterRecipeSelectEvent.patch b/patches/server/0484-Add-PlayerStonecutterRecipeSelectEvent.patch
index ec46b8f54b..ec46b8f54b 100644
--- a/patches/server/0485-Add-PlayerStonecutterRecipeSelectEvent.patch
+++ b/patches/server/0484-Add-PlayerStonecutterRecipeSelectEvent.patch
diff --git a/patches/server/0486-Expand-EntityUnleashEvent.patch b/patches/server/0485-Expand-EntityUnleashEvent.patch
index 02e8ed7290..02e8ed7290 100644
--- a/patches/server/0486-Expand-EntityUnleashEvent.patch
+++ b/patches/server/0485-Expand-EntityUnleashEvent.patch
diff --git a/patches/server/0487-Reset-shield-blocking-on-dimension-change.patch b/patches/server/0486-Reset-shield-blocking-on-dimension-change.patch
index c53c26b979..92cccc29d0 100644
--- a/patches/server/0487-Reset-shield-blocking-on-dimension-change.patch
+++ b/patches/server/0486-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 62dbdc56d5529800d7a424040eb6821e9d527255..0f5c34ad7b983b9ea4e994145142457033a8c997 100644
+index 406dc0516f53fdc779fa611637bca304f5cef2f5..685601f7ae8396524be6acc1b1394a2403ac6163 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1352,6 +1352,11 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1349,6 +1349,11 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
// CraftBukkit end
diff --git a/patches/server/0488-Add-DragonEggFormEvent.patch b/patches/server/0487-Add-DragonEggFormEvent.patch
index c9ec752038..c9ec752038 100644
--- a/patches/server/0488-Add-DragonEggFormEvent.patch
+++ b/patches/server/0487-Add-DragonEggFormEvent.patch
diff --git a/patches/server/0489-Add-EntityMoveEvent.patch b/patches/server/0488-Add-EntityMoveEvent.patch
index 983c902724..2992bc3199 100644
--- a/patches/server/0489-Add-EntityMoveEvent.patch
+++ b/patches/server/0488-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 3511b578f137c94ed562690901952e81e6f90ee5..93c92146c2c7961a5de970e1c18eb7a1907c551b 100644
+index 84028b8ad189407f89fbdd63d3e185c86335b596..d38cc3e642eb33759175227fbf86ed250cf0b9f3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1608,6 +1608,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1607,6 +1607,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 3511b578f137c94ed562690901952e81e6f90ee5..93c92146c2c7961a5de970e1c18eb7a1
this.profiler.push(() -> {
String s = String.valueOf(worldserver);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index deabbf30a550ff1835530257177b8f47e4710414..6b2d00878a373680bc3d59e19ae11a2d545146cc 100644
+index 373560fc82e491e6c8b755fecfe78d49a2fc3e2f..644341b8bc3079c6f092226acd11667f64bd55a1 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -228,6 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0490-added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/0489-added-option-to-disable-pathfinding-updates-on-block.patch
index dd30ec31b5..e40ef31e16 100644
--- a/patches/server/0490-added-option-to-disable-pathfinding-updates-on-block.patch
+++ b/patches/server/0489-added-option-to-disable-pathfinding-updates-on-block.patch
@@ -5,7 +5,7 @@ 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 6b2d00878a373680bc3d59e19ae11a2d545146cc..58c56636f324f1073bbb03d94f51cd69600a80c4 100644
+index 644341b8bc3079c6f092226acd11667f64bd55a1..1fe013b94cf1b5332f1e4645dd35df01e11fe0d9 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1374,6 +1374,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0491-Inline-shift-direction-fields.patch b/patches/server/0490-Inline-shift-direction-fields.patch
index 910b881e3a..910b881e3a 100644
--- a/patches/server/0491-Inline-shift-direction-fields.patch
+++ b/patches/server/0490-Inline-shift-direction-fields.patch
diff --git a/patches/server/0492-Allow-adding-items-to-BlockDropItemEvent.patch b/patches/server/0491-Allow-adding-items-to-BlockDropItemEvent.patch
index 808e585500..808e585500 100644
--- a/patches/server/0492-Allow-adding-items-to-BlockDropItemEvent.patch
+++ b/patches/server/0491-Allow-adding-items-to-BlockDropItemEvent.patch
diff --git a/patches/server/0493-Add-getMainThreadExecutor-to-BukkitScheduler.patch b/patches/server/0492-Add-getMainThreadExecutor-to-BukkitScheduler.patch
index 57d54a0434..57d54a0434 100644
--- a/patches/server/0493-Add-getMainThreadExecutor-to-BukkitScheduler.patch
+++ b/patches/server/0492-Add-getMainThreadExecutor-to-BukkitScheduler.patch
diff --git a/patches/server/0494-living-entity-allow-attribute-registration.patch b/patches/server/0493-living-entity-allow-attribute-registration.patch
index 586ae419e6..586ae419e6 100644
--- a/patches/server/0494-living-entity-allow-attribute-registration.patch
+++ b/patches/server/0493-living-entity-allow-attribute-registration.patch
diff --git a/patches/server/0495-fix-dead-slime-setSize-invincibility.patch b/patches/server/0494-fix-dead-slime-setSize-invincibility.patch
index 494e56127e..494e56127e 100644
--- a/patches/server/0495-fix-dead-slime-setSize-invincibility.patch
+++ b/patches/server/0494-fix-dead-slime-setSize-invincibility.patch
diff --git a/patches/server/0496-Merchant-getRecipes-should-return-an-immutable-list.patch b/patches/server/0495-Merchant-getRecipes-should-return-an-immutable-list.patch
index cbb0cdc052..cbb0cdc052 100644
--- a/patches/server/0496-Merchant-getRecipes-should-return-an-immutable-list.patch
+++ b/patches/server/0495-Merchant-getRecipes-should-return-an-immutable-list.patch
diff --git a/patches/server/0497-Expose-Tracked-Players.patch b/patches/server/0496-Expose-Tracked-Players.patch
index f7b030cbff..f7b030cbff 100644
--- a/patches/server/0497-Expose-Tracked-Players.patch
+++ b/patches/server/0496-Expose-Tracked-Players.patch
diff --git a/patches/server/0498-Improve-ServerGUI.patch b/patches/server/0497-Improve-ServerGUI.patch
index 872206f5fe..872206f5fe 100644
--- a/patches/server/0498-Improve-ServerGUI.patch
+++ b/patches/server/0497-Improve-ServerGUI.patch
diff --git a/patches/server/0499-fix-converting-txt-to-json-file.patch b/patches/server/0498-fix-converting-txt-to-json-file.patch
index efc09dd833..efc09dd833 100644
--- a/patches/server/0499-fix-converting-txt-to-json-file.patch
+++ b/patches/server/0498-fix-converting-txt-to-json-file.patch
diff --git a/patches/server/0500-Add-worldborder-events.patch b/patches/server/0499-Add-worldborder-events.patch
index 44a467547c..44a467547c 100644
--- a/patches/server/0500-Add-worldborder-events.patch
+++ b/patches/server/0499-Add-worldborder-events.patch
diff --git a/patches/server/0501-Add-PlayerNameEntityEvent.patch b/patches/server/0500-Add-PlayerNameEntityEvent.patch
index 9287edc1b7..9287edc1b7 100644
--- a/patches/server/0501-Add-PlayerNameEntityEvent.patch
+++ b/patches/server/0500-Add-PlayerNameEntityEvent.patch
diff --git a/patches/server/0502-Add-recipe-to-cook-events.patch b/patches/server/0501-Add-recipe-to-cook-events.patch
index 6fe8720d21..6fe8720d21 100644
--- a/patches/server/0502-Add-recipe-to-cook-events.patch
+++ b/patches/server/0501-Add-recipe-to-cook-events.patch
diff --git a/patches/server/0503-Add-Block-isValidTool.patch b/patches/server/0502-Add-Block-isValidTool.patch
index 5f36fb047c..5f36fb047c 100644
--- a/patches/server/0503-Add-Block-isValidTool.patch
+++ b/patches/server/0502-Add-Block-isValidTool.patch
diff --git a/patches/server/0504-Allow-using-signs-inside-spawn-protection.patch b/patches/server/0503-Allow-using-signs-inside-spawn-protection.patch
index b105615726..b105615726 100644
--- a/patches/server/0504-Allow-using-signs-inside-spawn-protection.patch
+++ b/patches/server/0503-Allow-using-signs-inside-spawn-protection.patch
diff --git a/patches/server/0505-Expand-world-key-API.patch b/patches/server/0504-Expand-world-key-API.patch
index 17d7ac06c4..17d7ac06c4 100644
--- a/patches/server/0505-Expand-world-key-API.patch
+++ b/patches/server/0504-Expand-world-key-API.patch
diff --git a/patches/server/0506-Add-fast-alternative-constructor-for-Rotations.patch b/patches/server/0505-Add-fast-alternative-constructor-for-Rotations.patch
index e28775fc9a..e28775fc9a 100644
--- a/patches/server/0506-Add-fast-alternative-constructor-for-Rotations.patch
+++ b/patches/server/0505-Add-fast-alternative-constructor-for-Rotations.patch
diff --git a/patches/server/0507-Drop-carried-item-when-player-has-disconnected.patch b/patches/server/0506-Drop-carried-item-when-player-has-disconnected.patch
index 757cfd681e..757cfd681e 100644
--- a/patches/server/0507-Drop-carried-item-when-player-has-disconnected.patch
+++ b/patches/server/0506-Drop-carried-item-when-player-has-disconnected.patch
diff --git a/patches/server/0508-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0507-forced-whitelist-use-configurable-kick-message.patch
index a4cd1362fc..4ec0ee6b72 100644
--- a/patches/server/0508-forced-whitelist-use-configurable-kick-message.patch
+++ b/patches/server/0507-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 93c92146c2c7961a5de970e1c18eb7a1907c551b..84bc3fac67c8db28a7102f99bffe762cf34a4a7a 100644
+index d38cc3e642eb33759175227fbf86ed250cf0b9f3..e02e57d243bc8bccddcf3e3c40887fb774f5e460 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2289,7 +2289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2288,7 +2288,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/0509-Don-t-ignore-result-of-PlayerEditBookEvent.patch b/patches/server/0508-Don-t-ignore-result-of-PlayerEditBookEvent.patch
index ea634835be..ea634835be 100644
--- a/patches/server/0509-Don-t-ignore-result-of-PlayerEditBookEvent.patch
+++ b/patches/server/0508-Don-t-ignore-result-of-PlayerEditBookEvent.patch
diff --git a/patches/server/0510-Expose-protocol-version.patch b/patches/server/0509-Expose-protocol-version.patch
index 37634ea475..37634ea475 100644
--- a/patches/server/0510-Expose-protocol-version.patch
+++ b/patches/server/0509-Expose-protocol-version.patch
diff --git a/patches/server/0511-Enhance-console-tab-completions-for-brigadier-comman.patch b/patches/server/0510-Enhance-console-tab-completions-for-brigadier-comman.patch
index 701ba9042a..701ba9042a 100644
--- a/patches/server/0511-Enhance-console-tab-completions-for-brigadier-comman.patch
+++ b/patches/server/0510-Enhance-console-tab-completions-for-brigadier-comman.patch
diff --git a/patches/server/0512-Fix-PlayerItemConsumeEvent-cancelling-properly.patch b/patches/server/0511-Fix-PlayerItemConsumeEvent-cancelling-properly.patch
index 8663738c4b..8663738c4b 100644
--- a/patches/server/0512-Fix-PlayerItemConsumeEvent-cancelling-properly.patch
+++ b/patches/server/0511-Fix-PlayerItemConsumeEvent-cancelling-properly.patch
diff --git a/patches/server/0513-Add-bypass-host-check.patch b/patches/server/0512-Add-bypass-host-check.patch
index 53fea6e14d..53fea6e14d 100644
--- a/patches/server/0513-Add-bypass-host-check.patch
+++ b/patches/server/0512-Add-bypass-host-check.patch
diff --git a/patches/server/0514-Set-area-affect-cloud-rotation.patch b/patches/server/0513-Set-area-affect-cloud-rotation.patch
index 1816791836..1816791836 100644
--- a/patches/server/0514-Set-area-affect-cloud-rotation.patch
+++ b/patches/server/0513-Set-area-affect-cloud-rotation.patch
diff --git a/patches/server/0515-add-isDeeplySleeping-to-HumanEntity.patch b/patches/server/0514-add-isDeeplySleeping-to-HumanEntity.patch
index 26e38b4777..8784fcb163 100644
--- a/patches/server/0515-add-isDeeplySleeping-to-HumanEntity.patch
+++ b/patches/server/0514-add-isDeeplySleeping-to-HumanEntity.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] add isDeeplySleeping to HumanEntity
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-index 796945fb1a8b43987ed9f01375113b2c13ff67c0..6c500a2ccc050fc44076e443032b0ef9d87a7de8 100644
+index 87d067c3a83283931bc16dccf6a304142848cd6a..148279d06dc5bf46aa5d4319f0b7d2ebfcee412d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -132,6 +132,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
diff --git a/patches/server/0516-add-consumeFuel-to-FurnaceBurnEvent.patch b/patches/server/0515-add-consumeFuel-to-FurnaceBurnEvent.patch
index 1938dc07ed..1938dc07ed 100644
--- a/patches/server/0516-add-consumeFuel-to-FurnaceBurnEvent.patch
+++ b/patches/server/0515-add-consumeFuel-to-FurnaceBurnEvent.patch
diff --git a/patches/server/0517-add-get-set-drop-chance-to-EntityEquipment.patch b/patches/server/0516-add-get-set-drop-chance-to-EntityEquipment.patch
index 746b410784..746b410784 100644
--- a/patches/server/0517-add-get-set-drop-chance-to-EntityEquipment.patch
+++ b/patches/server/0516-add-get-set-drop-chance-to-EntityEquipment.patch
diff --git a/patches/server/0518-fix-PigZombieAngerEvent-cancellation.patch b/patches/server/0517-fix-PigZombieAngerEvent-cancellation.patch
index 3f0d89aea9..3f0d89aea9 100644
--- a/patches/server/0518-fix-PigZombieAngerEvent-cancellation.patch
+++ b/patches/server/0517-fix-PigZombieAngerEvent-cancellation.patch
diff --git a/patches/server/0519-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0518-fix-PlayerItemHeldEvent-firing-twice.patch
index 1934fa9d5d..1934fa9d5d 100644
--- a/patches/server/0519-fix-PlayerItemHeldEvent-firing-twice.patch
+++ b/patches/server/0518-fix-PlayerItemHeldEvent-firing-twice.patch
diff --git a/patches/server/0520-Add-PlayerDeepSleepEvent.patch b/patches/server/0519-Add-PlayerDeepSleepEvent.patch
index c348ba15bc..c348ba15bc 100644
--- a/patches/server/0520-Add-PlayerDeepSleepEvent.patch
+++ b/patches/server/0519-Add-PlayerDeepSleepEvent.patch
diff --git a/patches/server/0521-More-World-API.patch b/patches/server/0520-More-World-API.patch
index 93e3efa40d..acbb18e7df 100644
--- a/patches/server/0521-More-World-API.patch
+++ b/patches/server/0520-More-World-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] More World API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index c1125b0db7449a6d61e7b0a4e7c5d30917744b5d..a197e6993842a1e43311ad9c1fae2f18f799e44b 100644
+index 08124dd65d1f950bdec8fcb55d2553c601b30a66..c3581aa9a2d708e410c7eae1b7abe6c6f3427ad6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2130,6 +2130,28 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0522-Add-PlayerBedFailEnterEvent.patch b/patches/server/0521-Add-PlayerBedFailEnterEvent.patch
index feffef2aec..feffef2aec 100644
--- a/patches/server/0522-Add-PlayerBedFailEnterEvent.patch
+++ b/patches/server/0521-Add-PlayerBedFailEnterEvent.patch
diff --git a/patches/server/0523-Implement-methods-to-convert-between-Component-and-B.patch b/patches/server/0522-Implement-methods-to-convert-between-Component-and-B.patch
index 614386ecde..614386ecde 100644
--- a/patches/server/0523-Implement-methods-to-convert-between-Component-and-B.patch
+++ b/patches/server/0522-Implement-methods-to-convert-between-Component-and-B.patch
diff --git a/patches/server/0524-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch b/patches/server/0523-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch
index ac20a62072..97439cc49c 100644
--- a/patches/server/0524-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch
+++ b/patches/server/0523-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Expand PlayerRespawnEvent, fix passed parameter issues
Co-authored-by: Jake Potrebic <[email protected]>
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 0f5c34ad7b983b9ea4e994145142457033a8c997..bd1abd4ad5dc129df4c844571c9a91e7cc1748d9 100644
+index 685601f7ae8396524be6acc1b1394a2403ac6163..3e2a623bda0a65b78cdd725feb4581ded6ec07fe 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1197,7 +1197,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1194,7 +1194,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
Player respawnPlayer = this.getBukkitEntity();
Location location = CraftLocation.toBukkit(dimensionTransition.pos(), dimensionTransition.newLevel().getWorld(), dimensionTransition.yRot(), dimensionTransition.xRot());
diff --git a/patches/server/0525-Introduce-beacon-activation-deactivation-events.patch b/patches/server/0524-Introduce-beacon-activation-deactivation-events.patch
index 6d74a805c1..6d74a805c1 100644
--- a/patches/server/0525-Introduce-beacon-activation-deactivation-events.patch
+++ b/patches/server/0524-Introduce-beacon-activation-deactivation-events.patch
diff --git a/patches/server/0526-Add-Channel-initialization-listeners.patch b/patches/server/0525-Add-Channel-initialization-listeners.patch
index 334eb230f0..334eb230f0 100644
--- a/patches/server/0526-Add-Channel-initialization-listeners.patch
+++ b/patches/server/0525-Add-Channel-initialization-listeners.patch
diff --git a/patches/server/0527-Send-empty-commands-if-tab-completion-is-disabled.patch b/patches/server/0526-Send-empty-commands-if-tab-completion-is-disabled.patch
index daa33fbefc..daa33fbefc 100644
--- a/patches/server/0527-Send-empty-commands-if-tab-completion-is-disabled.patch
+++ b/patches/server/0526-Send-empty-commands-if-tab-completion-is-disabled.patch
diff --git a/patches/server/0528-Add-more-WanderingTrader-API.patch b/patches/server/0527-Add-more-WanderingTrader-API.patch
index 0ce65786dc..0ce65786dc 100644
--- a/patches/server/0528-Add-more-WanderingTrader-API.patch
+++ b/patches/server/0527-Add-more-WanderingTrader-API.patch
diff --git a/patches/server/0529-Add-EntityBlockStorage-clearEntities.patch b/patches/server/0528-Add-EntityBlockStorage-clearEntities.patch
index e52d1c5e1c..b19812d989 100644
--- a/patches/server/0529-Add-EntityBlockStorage-clearEntities.patch
+++ b/patches/server/0528-Add-EntityBlockStorage-clearEntities.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityBlockStorage#clearEntities()
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
-index 344b18127d3e8c7408a162cc85287382bdfdda9a..b18494d2a83473e9bc4197f86ff599de59043217 100644
+index b345403cdf5b2828f99708fef65136594a3331c3..ef8a0236ab4fb648c4bb2a8cfc90e3cefe8f9f1d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
@@ -151,6 +151,11 @@ public class BeehiveBlockEntity extends BlockEntity {
diff --git a/patches/server/0530-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch b/patches/server/0529-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch
index c0fd5f11db..c0fd5f11db 100644
--- a/patches/server/0530-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch
+++ b/patches/server/0529-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch
diff --git a/patches/server/0531-Add-HiddenPotionEffect-API.patch b/patches/server/0530-Add-HiddenPotionEffect-API.patch
index 2d0b0d5b03..2d0b0d5b03 100644
--- a/patches/server/0531-Add-HiddenPotionEffect-API.patch
+++ b/patches/server/0530-Add-HiddenPotionEffect-API.patch
diff --git a/patches/server/0532-Inventory-close.patch b/patches/server/0531-Inventory-close.patch
index 9ca8b717ab..9ca8b717ab 100644
--- a/patches/server/0532-Inventory-close.patch
+++ b/patches/server/0531-Inventory-close.patch
diff --git a/patches/server/0533-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/patches/server/0532-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch
index d5f2f9db1f..d5f2f9db1f 100644
--- a/patches/server/0533-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch
+++ b/patches/server/0532-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch
diff --git a/patches/server/0534-Add-basic-Datapack-API.patch b/patches/server/0533-Add-basic-Datapack-API.patch
index e6fb0b935a..e6fb0b935a 100644
--- a/patches/server/0534-Add-basic-Datapack-API.patch
+++ b/patches/server/0533-Add-basic-Datapack-API.patch
diff --git a/patches/server/0535-Add-environment-variable-to-disable-server-gui.patch b/patches/server/0534-Add-environment-variable-to-disable-server-gui.patch
index e4de8ec477..e4de8ec477 100644
--- a/patches/server/0535-Add-environment-variable-to-disable-server-gui.patch
+++ b/patches/server/0534-Add-environment-variable-to-disable-server-gui.patch
diff --git a/patches/server/0536-Expand-PlayerGameModeChangeEvent.patch b/patches/server/0535-Expand-PlayerGameModeChangeEvent.patch
index 98696ab8cc..67e3856a2e 100644
--- a/patches/server/0536-Expand-PlayerGameModeChangeEvent.patch
+++ b/patches/server/0535-Expand-PlayerGameModeChangeEvent.patch
@@ -45,10 +45,10 @@ index 7f09119bc7d661e08a960dd2bd46006efe752d3e..d1da3600dc07107309b20ebe6e7c0c4d
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 47259d580460fd00c6c7a4e798e28667f333ca9c..205d0f5bc3da737f960fb0e795b959e611e48422 100644
+index 3e2a623bda0a65b78cdd725feb4581ded6ec07fe..9e9ef3c8e7316fc9d35672ff2a4eb1795c333279 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2087,10 +2087,18 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2084,10 +2084,18 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
public boolean setGameMode(GameType gameMode) {
@@ -69,7 +69,7 @@ index 47259d580460fd00c6c7a4e798e28667f333ca9c..205d0f5bc3da737f960fb0e795b959e6
} else {
this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, (float) gameMode.getId()));
if (gameMode == GameType.SPECTATOR) {
-@@ -2106,7 +2114,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2103,7 +2111,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.onUpdateAbilities();
this.updateEffectVisibility();
@@ -78,7 +78,7 @@ index 47259d580460fd00c6c7a4e798e28667f333ca9c..205d0f5bc3da737f960fb0e795b959e6
}
}
-@@ -2512,6 +2520,16 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2509,6 +2517,16 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
public void loadGameTypes(@Nullable CompoundTag nbt) {
@@ -147,7 +147,7 @@ index 699658bd80eb88907041efb01d31e4051edb91de..58e5acbd00c4f8c0fcafa4f2c21b6a9f
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index b2e5bf420d0d8e3f635632d91faf15e10f1988f6..00ccb9ae0d41ba87db2617853206d714a4225563 100644
+index 7652da85170cd5a64d1b443430b85c388e2939a9..6aa9a31b2bba086265c0e83c4ea9181540a0a5f6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1654,7 +1654,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0537-ItemStack-repair-check-API.patch b/patches/server/0536-ItemStack-repair-check-API.patch
index 9621b72ce2..9621b72ce2 100644
--- a/patches/server/0537-ItemStack-repair-check-API.patch
+++ b/patches/server/0536-ItemStack-repair-check-API.patch
diff --git a/patches/server/0538-More-Enchantment-API.patch b/patches/server/0537-More-Enchantment-API.patch
index 692f90b66a..692f90b66a 100644
--- a/patches/server/0538-More-Enchantment-API.patch
+++ b/patches/server/0537-More-Enchantment-API.patch
diff --git a/patches/server/0539-Move-range-check-for-block-placing-up.patch b/patches/server/0538-Move-range-check-for-block-placing-up.patch
index 684068f18d..684068f18d 100644
--- a/patches/server/0539-Move-range-check-for-block-placing-up.patch
+++ b/patches/server/0538-Move-range-check-for-block-placing-up.patch
diff --git a/patches/server/0540-Add-Mob-lookAt-API.patch b/patches/server/0539-Add-Mob-lookAt-API.patch
index 3139490a61..3139490a61 100644
--- a/patches/server/0540-Add-Mob-lookAt-API.patch
+++ b/patches/server/0539-Add-Mob-lookAt-API.patch
diff --git a/patches/server/0541-Correctly-check-if-bucket-dispenses-will-succeed-for.patch b/patches/server/0540-Correctly-check-if-bucket-dispenses-will-succeed-for.patch
index 5a8b0c1cb5..5a8b0c1cb5 100644
--- a/patches/server/0541-Correctly-check-if-bucket-dispenses-will-succeed-for.patch
+++ b/patches/server/0540-Correctly-check-if-bucket-dispenses-will-succeed-for.patch
diff --git a/patches/server/0542-Add-Unix-domain-socket-support.patch b/patches/server/0541-Add-Unix-domain-socket-support.patch
index 7def3d56ce..7def3d56ce 100644
--- a/patches/server/0542-Add-Unix-domain-socket-support.patch
+++ b/patches/server/0541-Add-Unix-domain-socket-support.patch
diff --git a/patches/server/0543-Add-EntityInsideBlockEvent.patch b/patches/server/0542-Add-EntityInsideBlockEvent.patch
index 912a0dbe33..5080baf21f 100644
--- a/patches/server/0543-Add-EntityInsideBlockEvent.patch
+++ b/patches/server/0542-Add-EntityInsideBlockEvent.patch
@@ -137,7 +137,7 @@ index e2d6693da4abe6204c0ecb5e924a3903fa80ab7d..cff3e9869340f1ffb7093431cbe1ac5e
// CraftBukkit start - Entity in portal
EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
-index 211b7809f099678bc3bd64bd29fd9c4d19e3ab0d..6e7595193275e88c69b82ebbc9f9df636879a03e 100644
+index b968129b9a93fdf771caba5f768456070543ba6a..669234bca9fa50548447f77dc5f314df8d9dd7c9 100644
--- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
@@ -79,6 +79,7 @@ public class FrogspawnBlock extends Block {
diff --git a/patches/server/0544-Improve-item-default-attribute-API.patch b/patches/server/0543-Improve-item-default-attribute-API.patch
index 5a9d7ca280..5a9d7ca280 100644
--- a/patches/server/0544-Improve-item-default-attribute-API.patch
+++ b/patches/server/0543-Improve-item-default-attribute-API.patch
diff --git a/patches/server/0545-Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/server/0544-Add-cause-to-Weather-ThunderChangeEvents.patch
index 6fddf161d3..2807ad861f 100644
--- a/patches/server/0545-Add-cause-to-Weather-ThunderChangeEvents.patch
+++ b/patches/server/0544-Add-cause-to-Weather-ThunderChangeEvents.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 58c56636f324f1073bbb03d94f51cd69600a80c4..9a09946b6b178837c44daae894555000668aeb72 100644
+index 1fe013b94cf1b5332f1e4645dd35df01e11fe0d9..055650b315d53b56798ded7af2054c3e8e3ee319 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -441,8 +441,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -95,7 +95,7 @@ index e50ad48658193f889d65d37c57b1e30ce46758b7..efd0bcfebb3b4f63018d4e20a6a89f79
if (weather.isCancelled()) {
return;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index a197e6993842a1e43311ad9c1fae2f18f799e44b..862a83b421b77b7126efa455e5f7ba9c744f59f5 100644
+index c3581aa9a2d708e410c7eae1b7abe6c6f3427ad6..dc16ed952719a5203b1b9a61e0ad2bd39021e8f1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1208,7 +1208,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0546-More-Lidded-Block-API.patch b/patches/server/0545-More-Lidded-Block-API.patch
index 437434c525..437434c525 100644
--- a/patches/server/0546-More-Lidded-Block-API.patch
+++ b/patches/server/0545-More-Lidded-Block-API.patch
diff --git a/patches/server/0547-Limit-item-frame-cursors-on-maps.patch b/patches/server/0546-Limit-item-frame-cursors-on-maps.patch
index d710b59685..d710b59685 100644
--- a/patches/server/0547-Limit-item-frame-cursors-on-maps.patch
+++ b/patches/server/0546-Limit-item-frame-cursors-on-maps.patch
diff --git a/patches/server/0548-Add-PlayerKickEvent-causes.patch b/patches/server/0547-Add-PlayerKickEvent-causes.patch
index 5cb94d101b..d5a0964872 100644
--- a/patches/server/0548-Add-PlayerKickEvent-causes.patch
+++ b/patches/server/0547-Add-PlayerKickEvent-causes.patch
@@ -43,10 +43,10 @@ index dbcf183483766f39334d7f7e8336033906625f3f..300929a406905f5ff1ede664d5b99fb0
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 84bc3fac67c8db28a7102f99bffe762cf34a4a7a..695d6265b4a9f98ba630593ba6c47769240bed93 100644
+index e02e57d243bc8bccddcf3e3c40887fb774f5e460..6ad7c34513034c87059f8a0790aea3231dd0d2a9 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2289,7 +2289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2288,7 +2288,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)
@@ -480,7 +480,7 @@ index f472dea0bd4f834c0c8f0aa59ae7cdae082b14af..2fa51c3a70f43cd23b8f494fc643d66c
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 00ccb9ae0d41ba87db2617853206d714a4225563..ddd5bdf07f92f18ad27b34ce63a98a61f8263733 100644
+index 6aa9a31b2bba086265c0e83c4ea9181540a0a5f6..8f78f4879dfc46d2214243b927e0cff0257b7692 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -635,7 +635,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0549-Add-PufferFishStateChangeEvent.patch b/patches/server/0548-Add-PufferFishStateChangeEvent.patch
index 87e61bb2a3..87e61bb2a3 100644
--- a/patches/server/0549-Add-PufferFishStateChangeEvent.patch
+++ b/patches/server/0548-Add-PufferFishStateChangeEvent.patch
diff --git a/patches/server/0550-Fix-PlayerBucketEmptyEvent-result-itemstack.patch b/patches/server/0549-Fix-PlayerBucketEmptyEvent-result-itemstack.patch
index 12c519eefe..12c519eefe 100644
--- a/patches/server/0550-Fix-PlayerBucketEmptyEvent-result-itemstack.patch
+++ b/patches/server/0549-Fix-PlayerBucketEmptyEvent-result-itemstack.patch
diff --git a/patches/server/0551-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch b/patches/server/0550-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch
index 04a6d787b6..04a6d787b6 100644
--- a/patches/server/0551-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch
+++ b/patches/server/0550-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch
diff --git a/patches/server/0552-Add-option-to-fix-items-merging-through-walls.patch b/patches/server/0551-Add-option-to-fix-items-merging-through-walls.patch
index 636797089d..636797089d 100644
--- a/patches/server/0552-Add-option-to-fix-items-merging-through-walls.patch
+++ b/patches/server/0551-Add-option-to-fix-items-merging-through-walls.patch
diff --git a/patches/server/0553-Add-BellRevealRaiderEvent.patch b/patches/server/0552-Add-BellRevealRaiderEvent.patch
index 871aa2a198..871aa2a198 100644
--- a/patches/server/0553-Add-BellRevealRaiderEvent.patch
+++ b/patches/server/0552-Add-BellRevealRaiderEvent.patch
diff --git a/patches/server/0554-Fix-invulnerable-end-crystals.patch b/patches/server/0553-Fix-invulnerable-end-crystals.patch
index 57cba19656..57cba19656 100644
--- a/patches/server/0554-Fix-invulnerable-end-crystals.patch
+++ b/patches/server/0553-Fix-invulnerable-end-crystals.patch
diff --git a/patches/server/0555-Add-ElderGuardianAppearanceEvent.patch b/patches/server/0554-Add-ElderGuardianAppearanceEvent.patch
index d9bc14356d..d9bc14356d 100644
--- a/patches/server/0555-Add-ElderGuardianAppearanceEvent.patch
+++ b/patches/server/0554-Add-ElderGuardianAppearanceEvent.patch
diff --git a/patches/server/0556-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/patches/server/0555-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch
index 3d03f4c4d2..3d03f4c4d2 100644
--- a/patches/server/0556-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch
+++ b/patches/server/0555-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch
diff --git a/patches/server/0557-Line-Of-Sight-Changes.patch b/patches/server/0556-Line-Of-Sight-Changes.patch
index 1e1018607b..1e1018607b 100644
--- a/patches/server/0557-Line-Of-Sight-Changes.patch
+++ b/patches/server/0556-Line-Of-Sight-Changes.patch
diff --git a/patches/server/0558-add-per-world-spawn-limits.patch b/patches/server/0557-add-per-world-spawn-limits.patch
index 90e01a2a02..2af34cd439 100644
--- a/patches/server/0558-add-per-world-spawn-limits.patch
+++ b/patches/server/0557-add-per-world-spawn-limits.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] add per world spawn limits
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 862a83b421b77b7126efa455e5f7ba9c744f59f5..bcde7c39e0676bf247a825b40b63f6c7b9f19952 100644
+index dc16ed952719a5203b1b9a61e0ad2bd39021e8f1..a41c6705aa7e04ad32395f89b95ca76617c9416d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -222,6 +222,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0559-Fix-potions-splash-events.patch b/patches/server/0558-Fix-potions-splash-events.patch
index 8d894f25e2..8d894f25e2 100644
--- a/patches/server/0559-Fix-potions-splash-events.patch
+++ b/patches/server/0558-Fix-potions-splash-events.patch
diff --git a/patches/server/0560-Add-more-LimitedRegion-API.patch b/patches/server/0559-Add-more-LimitedRegion-API.patch
index 6e183e954e..6e183e954e 100644
--- a/patches/server/0560-Add-more-LimitedRegion-API.patch
+++ b/patches/server/0559-Add-more-LimitedRegion-API.patch
diff --git a/patches/server/0561-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0560-Fix-PlayerDropItemEvent-using-wrong-item.patch
index 3bb995b5ce..bd43d1ba66 100644
--- a/patches/server/0561-Fix-PlayerDropItemEvent-using-wrong-item.patch
+++ b/patches/server/0560-Fix-PlayerDropItemEvent-using-wrong-item.patch
@@ -31,10 +31,10 @@ index c81fd3e1108fb0a02f9240263404af2b968c8494..0d9de4c61c7b26a6ff37c12fde629161
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 205d0f5bc3da737f960fb0e795b959e611e48422..07ddd327c625d58137f0368be36fb708ac64ff4c 100644
+index 9e9ef3c8e7316fc9d35672ff2a4eb1795c333279..e3b8c14bdf674663152936df4d1469e91545d640 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2489,7 +2489,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2486,7 +2486,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
if (flag1) {
if (!itemstack1.isEmpty()) {
diff --git a/patches/server/0562-Missing-Entity-API.patch b/patches/server/0561-Missing-Entity-API.patch
index 6c433c2da4..7c7a99d9c9 100644
--- a/patches/server/0562-Missing-Entity-API.patch
+++ b/patches/server/0561-Missing-Entity-API.patch
@@ -45,10 +45,10 @@ Co-authored-by: maxcom1 <[email protected]>
Co-authored-by: TotalledZebra <[email protected]>
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
-index 3f8cca8027051694cb0440373e75f418f73edf87..06455d65c4605ce092bf5300d432087f24186741 100644
+index c99eafab2103c7f5bca7ffba68a10bd853df055f..f7241c5292f1c012404eea11256813fbc2c2df1a 100644
--- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
-@@ -165,7 +165,7 @@ public class MobGoalHelper {
+@@ -164,7 +164,7 @@ public class MobGoalHelper {
bukkitMap.put(net.minecraft.world.entity.monster.Endermite.class, Endermite.class);
bukkitMap.put(net.minecraft.world.entity.monster.Evoker.class, Evoker.class);
bukkitMap.put(AbstractFish.class, Fish.class);
diff --git a/patches/server/0563-Fix-return-value-of-Block-applyBoneMeal-always-being.patch b/patches/server/0562-Fix-return-value-of-Block-applyBoneMeal-always-being.patch
index a5c4eefb9a..a5c4eefb9a 100644
--- a/patches/server/0563-Fix-return-value-of-Block-applyBoneMeal-always-being.patch
+++ b/patches/server/0562-Fix-return-value-of-Block-applyBoneMeal-always-being.patch
diff --git a/patches/server/0564-Use-getChunkIfLoadedImmediately-in-places.patch b/patches/server/0563-Use-getChunkIfLoadedImmediately-in-places.patch
index 0cfa5936f9..0fb834902a 100644
--- a/patches/server/0564-Use-getChunkIfLoadedImmediately-in-places.patch
+++ b/patches/server/0563-Use-getChunkIfLoadedImmediately-in-places.patch
@@ -8,7 +8,7 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case).
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 9a09946b6b178837c44daae894555000668aeb72..8c268f57d44d70df3210510abf7832939d41781d 100644
+index 055650b315d53b56798ded7af2054c3e8e3ee319..c72687fb23e8d01639cce7d79e3f97805d51e01f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -231,7 +231,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0565-Fix-commands-from-signs-not-firing-command-events.patch b/patches/server/0564-Fix-commands-from-signs-not-firing-command-events.patch
index b86e341359..b86e341359 100644
--- a/patches/server/0565-Fix-commands-from-signs-not-firing-command-events.patch
+++ b/patches/server/0564-Fix-commands-from-signs-not-firing-command-events.patch
diff --git a/patches/server/0566-Add-PlayerArmSwingEvent.patch b/patches/server/0565-Add-PlayerArmSwingEvent.patch
index 080029d23f..080029d23f 100644
--- a/patches/server/0566-Add-PlayerArmSwingEvent.patch
+++ b/patches/server/0565-Add-PlayerArmSwingEvent.patch
diff --git a/patches/server/0567-Fix-kick-event-leave-message-not-being-sent.patch b/patches/server/0566-Fix-kick-event-leave-message-not-being-sent.patch
index 3d2effd695..9c15380b00 100644
--- a/patches/server/0567-Fix-kick-event-leave-message-not-being-sent.patch
+++ b/patches/server/0566-Fix-kick-event-leave-message-not-being-sent.patch
@@ -5,7 +5,7 @@ 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 d413c4d445f42f6a923a49ce4f04b13c3ee28f7a..698fe3042670cee5495ab96f475d36c5b837593e 100644
+index e3b8c14bdf674663152936df4d1469e91545d640..36dddec9ddb025790577bdb6b6b21d84bb9d1020 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -289,7 +289,6 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@@ -15,7 +15,7 @@ index d413c4d445f42f6a923a49ce4f04b13c3ee28f7a..698fe3042670cee5495ab96f475d36c5
- public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent
// CraftBukkit end
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
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index feb529adf2168025c785ab92d95a3246e73c0236..b43f87ff4b9853b5d4bbea5ff9686d64d9d0d26b 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
diff --git a/patches/server/0568-Don-t-apply-cramming-damage-to-players.patch b/patches/server/0567-Don-t-apply-cramming-damage-to-players.patch
index 5176f24655..f722e5492c 100644
--- a/patches/server/0568-Don-t-apply-cramming-damage-to-players.patch
+++ b/patches/server/0567-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 698fe3042670cee5495ab96f475d36c5b837593e..967a61aa38f5361e5fceb8b7761664cb36cf568e 100644
+index 36dddec9ddb025790577bdb6b6b21d84bb9d1020..bcb5eac701749516928d9772ca906c51ebab9b34 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 698fe3042670cee5495ab96f475d36c5b837593e..967a61aa38f5361e5fceb8b7761664cb
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity;
-@@ -1548,7 +1549,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1545,7 +1546,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@Override
public boolean isInvulnerableTo(DamageSource damageSource) {
diff --git a/patches/server/0569-Rate-options-and-timings-for-sensors-and-behaviors.patch b/patches/server/0568-Rate-options-and-timings-for-sensors-and-behaviors.patch
index d74af14524..d74af14524 100644
--- a/patches/server/0569-Rate-options-and-timings-for-sensors-and-behaviors.patch
+++ b/patches/server/0568-Rate-options-and-timings-for-sensors-and-behaviors.patch
diff --git a/patches/server/0570-Add-missing-forceDrop-toggles.patch b/patches/server/0569-Add-missing-forceDrop-toggles.patch
index e11380293a..e11380293a 100644
--- a/patches/server/0570-Add-missing-forceDrop-toggles.patch
+++ b/patches/server/0569-Add-missing-forceDrop-toggles.patch
diff --git a/patches/server/0571-Stinger-API.patch b/patches/server/0570-Stinger-API.patch
index 766da8df45..766da8df45 100644
--- a/patches/server/0571-Stinger-API.patch
+++ b/patches/server/0570-Stinger-API.patch
diff --git a/patches/server/0572-Add-System.out-err-catcher.patch b/patches/server/0571-Add-System.out-err-catcher.patch
index 1a4bfc12d1..1a4bfc12d1 100644
--- a/patches/server/0572-Add-System.out-err-catcher.patch
+++ b/patches/server/0571-Add-System.out-err-catcher.patch
diff --git a/patches/server/0573-Prevent-AFK-kick-while-watching-end-credits.patch b/patches/server/0572-Prevent-AFK-kick-while-watching-end-credits.patch
index 73cf011e9d..73cf011e9d 100644
--- a/patches/server/0573-Prevent-AFK-kick-while-watching-end-credits.patch
+++ b/patches/server/0572-Prevent-AFK-kick-while-watching-end-credits.patch
diff --git a/patches/server/0574-Allow-skipping-writing-of-comments-to-server.propert.patch b/patches/server/0573-Allow-skipping-writing-of-comments-to-server.propert.patch
index 1fce522892..1fce522892 100644
--- a/patches/server/0574-Allow-skipping-writing-of-comments-to-server.propert.patch
+++ b/patches/server/0573-Allow-skipping-writing-of-comments-to-server.propert.patch
diff --git a/patches/server/0575-Add-PlayerSetSpawnEvent.patch b/patches/server/0574-Add-PlayerSetSpawnEvent.patch
index cc76cab591..511f5579a9 100644
--- a/patches/server/0575-Add-PlayerSetSpawnEvent.patch
+++ b/patches/server/0574-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 2e9cf68e7e58cffa296bb60ddb97639662b2ab5c..fdf73f71ca34099081f9f80994bbe411052c0149 100644
+index bcb5eac701749516928d9772ca906c51ebab9b34..882dae91f9db702edd233f7cab9f95e9874d1270 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1425,7 +1425,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1422,7 +1422,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
} else if (this.bedBlocked(blockposition, enumdirection)) {
return Either.left(net.minecraft.world.entity.player.Player.BedSleepingProblem.OBSTRUCTED);
} else {
@@ -61,7 +61,7 @@ index 2e9cf68e7e58cffa296bb60ddb97639662b2ab5c..fdf73f71ca34099081f9f80994bbe411
if (this.level().isDay()) {
return Either.left(net.minecraft.world.entity.player.Player.BedSleepingProblem.NOT_POSSIBLE_NOW);
} else {
-@@ -2402,44 +2402,50 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2399,44 +2399,50 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.setRespawnPosition(player.getRespawnDimension(), player.getRespawnPosition(), player.getRespawnAngle(), player.isRespawnForced(), false);
}
@@ -145,7 +145,7 @@ index 2e9cf68e7e58cffa296bb60ddb97639662b2ab5c..fdf73f71ca34099081f9f80994bbe411
} else {
this.respawnPosition = null;
this.respawnDimension = Level.OVERWORLD;
-@@ -2447,6 +2453,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -2444,6 +2450,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.respawnForced = false;
}
@@ -187,7 +187,7 @@ index ba22ad1e4253477572d10d71db6db0ebc14d6755..94d067e9eeee73183de25165d8c97043
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index ddd5bdf07f92f18ad27b34ce63a98a61f8263733..d58e7197da3c4b35b28c2f427e9539c3f1df13b8 100644
+index 8f78f4879dfc46d2214243b927e0cff0257b7692..395d5b5378e122c820fd4632180cf4f859e1f502 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1413,9 +1413,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch b/patches/server/0575-Make-hoppers-respect-inventory-max-stack-size.patch
index a062b815e2..a062b815e2 100644
--- a/patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch
+++ b/patches/server/0575-Make-hoppers-respect-inventory-max-stack-size.patch
diff --git a/patches/server/0577-Optimize-entity-tracker-passenger-checks.patch b/patches/server/0576-Optimize-entity-tracker-passenger-checks.patch
index 0dd7d25ba3..0dd7d25ba3 100644
--- a/patches/server/0577-Optimize-entity-tracker-passenger-checks.patch
+++ b/patches/server/0576-Optimize-entity-tracker-passenger-checks.patch
diff --git a/patches/server/0578-Config-option-for-Piglins-guarding-chests.patch b/patches/server/0577-Config-option-for-Piglins-guarding-chests.patch
index 8e2094a53d..8e2094a53d 100644
--- a/patches/server/0578-Config-option-for-Piglins-guarding-chests.patch
+++ b/patches/server/0577-Config-option-for-Piglins-guarding-chests.patch
diff --git a/patches/server/0579-Add-EntityDamageItemEvent.patch b/patches/server/0578-Add-EntityDamageItemEvent.patch
index d9c3b86a2a..d9c3b86a2a 100644
--- a/patches/server/0579-Add-EntityDamageItemEvent.patch
+++ b/patches/server/0578-Add-EntityDamageItemEvent.patch
diff --git a/patches/server/0580-Optimize-indirect-passenger-iteration.patch b/patches/server/0579-Optimize-indirect-passenger-iteration.patch
index 8f1a5a8cfb..8f1a5a8cfb 100644
--- a/patches/server/0580-Optimize-indirect-passenger-iteration.patch
+++ b/patches/server/0579-Optimize-indirect-passenger-iteration.patch
diff --git a/patches/server/0581-Configurable-item-frame-map-cursor-update-interval.patch b/patches/server/0580-Configurable-item-frame-map-cursor-update-interval.patch
index a6389cdcbb..a6389cdcbb 100644
--- a/patches/server/0581-Configurable-item-frame-map-cursor-update-interval.patch
+++ b/patches/server/0580-Configurable-item-frame-map-cursor-update-interval.patch
diff --git a/patches/server/0582-Change-EnderEye-target-without-changing-other-things.patch b/patches/server/0581-Change-EnderEye-target-without-changing-other-things.patch
index 53d06a36ec..53d06a36ec 100644
--- a/patches/server/0582-Change-EnderEye-target-without-changing-other-things.patch
+++ b/patches/server/0581-Change-EnderEye-target-without-changing-other-things.patch
diff --git a/patches/server/0583-Add-BlockBreakBlockEvent.patch b/patches/server/0582-Add-BlockBreakBlockEvent.patch
index 4bc0c5116f..4bc0c5116f 100644
--- a/patches/server/0583-Add-BlockBreakBlockEvent.patch
+++ b/patches/server/0582-Add-BlockBreakBlockEvent.patch
diff --git a/patches/server/0584-Option-to-prevent-data-components-copy-in-smithing-r.patch b/patches/server/0583-Option-to-prevent-data-components-copy-in-smithing-r.patch
index 7246d24edd..7246d24edd 100644
--- a/patches/server/0584-Option-to-prevent-data-components-copy-in-smithing-r.patch
+++ b/patches/server/0583-Option-to-prevent-data-components-copy-in-smithing-r.patch
diff --git a/patches/server/0585-More-CommandBlock-API.patch b/patches/server/0584-More-CommandBlock-API.patch
index 16cf3ee3d7..16cf3ee3d7 100644
--- a/patches/server/0585-More-CommandBlock-API.patch
+++ b/patches/server/0584-More-CommandBlock-API.patch
diff --git a/patches/server/0586-Add-missing-team-sidebar-display-slots.patch b/patches/server/0585-Add-missing-team-sidebar-display-slots.patch
index 641de83a40..641de83a40 100644
--- a/patches/server/0586-Add-missing-team-sidebar-display-slots.patch
+++ b/patches/server/0585-Add-missing-team-sidebar-display-slots.patch
diff --git a/patches/server/0587-Add-back-EntityPortalExitEvent.patch b/patches/server/0586-Add-back-EntityPortalExitEvent.patch
index b1812c54bf..b1812c54bf 100644
--- a/patches/server/0587-Add-back-EntityPortalExitEvent.patch
+++ b/patches/server/0586-Add-back-EntityPortalExitEvent.patch
diff --git a/patches/server/0588-Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/server/0587-Add-methods-to-find-targets-for-lightning-strikes.patch
index fac79b2807..ca096b9dd9 100644
--- a/patches/server/0588-Add-methods-to-find-targets-for-lightning-strikes.patch
+++ b/patches/server/0587-Add-methods-to-find-targets-for-lightning-strikes.patch
@@ -7,7 +7,7 @@ Subject: [PATCH] Add methods to find targets for lightning strikes
public net.minecraft.server.level.ServerLevel findLightningRod(Lnet/minecraft/core/BlockPos;)Ljava/util/Optional;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 8c268f57d44d70df3210510abf7832939d41781d..efc27bb4072172f10839c181de9b5fba1f488b6f 100644
+index c72687fb23e8d01639cce7d79e3f97805d51e01f..778d3f3ea2247be5bd6edd382b872f6de5bc359c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -764,6 +764,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -31,7 +31,7 @@ index 8c268f57d44d70df3210510abf7832939d41781d..efc27bb4072172f10839c181de9b5fba
blockposition1 = blockposition1.above(2);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index bcde7c39e0676bf247a825b40b63f6c7b9f19952..7fbf4fba8df8f47b730a46068e68b33502ed63f8 100644
+index a41c6705aa7e04ad32395f89b95ca76617c9416d..390cacc7916d1322a7e1e8bff004d415e9fa5622 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -689,6 +689,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0589-Get-entity-default-attributes.patch b/patches/server/0588-Get-entity-default-attributes.patch
index 89cfa6b22f..89cfa6b22f 100644
--- a/patches/server/0589-Get-entity-default-attributes.patch
+++ b/patches/server/0588-Get-entity-default-attributes.patch
diff --git a/patches/server/0590-Left-handed-API.patch b/patches/server/0589-Left-handed-API.patch
index 643df451a4..643df451a4 100644
--- a/patches/server/0590-Left-handed-API.patch
+++ b/patches/server/0589-Left-handed-API.patch
diff --git a/patches/server/0591-Add-more-advancement-API.patch b/patches/server/0590-Add-more-advancement-API.patch
index bd3ae33fff..bd3ae33fff 100644
--- a/patches/server/0591-Add-more-advancement-API.patch
+++ b/patches/server/0590-Add-more-advancement-API.patch
diff --git a/patches/server/0592-Add-ItemFactory-getSpawnEgg-API.patch b/patches/server/0591-Add-ItemFactory-getSpawnEgg-API.patch
index ee1d80dabb..ee1d80dabb 100644
--- a/patches/server/0592-Add-ItemFactory-getSpawnEgg-API.patch
+++ b/patches/server/0591-Add-ItemFactory-getSpawnEgg-API.patch
diff --git a/patches/server/0593-Add-critical-damage-API.patch b/patches/server/0592-Add-critical-damage-API.patch
index b3f7792da1..b3f7792da1 100644
--- a/patches/server/0593-Add-critical-damage-API.patch
+++ b/patches/server/0592-Add-critical-damage-API.patch
diff --git a/patches/server/0594-Fix-issues-with-mob-conversion.patch b/patches/server/0593-Fix-issues-with-mob-conversion.patch
index 1b4597fe00..1b4597fe00 100644
--- a/patches/server/0594-Fix-issues-with-mob-conversion.patch
+++ b/patches/server/0593-Fix-issues-with-mob-conversion.patch
diff --git a/patches/server/0595-Add-hasCollision-methods-to-various-places.patch b/patches/server/0594-Add-hasCollision-methods-to-various-places.patch
index a6045ddd1b..a6045ddd1b 100644
--- a/patches/server/0595-Add-hasCollision-methods-to-various-places.patch
+++ b/patches/server/0594-Add-hasCollision-methods-to-various-places.patch
diff --git a/patches/server/0596-Goat-ram-API.patch b/patches/server/0595-Goat-ram-API.patch
index 2f5ccdfed4..2f5ccdfed4 100644
--- a/patches/server/0596-Goat-ram-API.patch
+++ b/patches/server/0595-Goat-ram-API.patch
diff --git a/patches/server/0597-Add-API-for-resetting-a-single-score.patch b/patches/server/0596-Add-API-for-resetting-a-single-score.patch
index b9dd1c2be3..b9dd1c2be3 100644
--- a/patches/server/0597-Add-API-for-resetting-a-single-score.patch
+++ b/patches/server/0596-Add-API-for-resetting-a-single-score.patch
diff --git a/patches/server/0598-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0597-Add-Raw-Byte-Entity-Serialization.patch
index 8f31d07f88..8f31d07f88 100644
--- a/patches/server/0598-Add-Raw-Byte-Entity-Serialization.patch
+++ b/patches/server/0597-Add-Raw-Byte-Entity-Serialization.patch
diff --git a/patches/server/0599-Vanilla-command-permission-fixes.patch b/patches/server/0598-Vanilla-command-permission-fixes.patch
index a9f23f8a53..a9f23f8a53 100644
--- a/patches/server/0599-Vanilla-command-permission-fixes.patch
+++ b/patches/server/0598-Vanilla-command-permission-fixes.patch
diff --git a/patches/server/0600-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/0599-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch
index e615b2ea62..aae11b3a82 100644
--- a/patches/server/0600-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch
+++ b/patches/server/0599-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch
@@ -9,7 +9,7 @@ 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 efc27bb4072172f10839c181de9b5fba1f488b6f..4c739717fcf53b28312e8a98f9bf0989c604d0f0 100644
+index 778d3f3ea2247be5bd6edd382b872f6de5bc359c..de154106419d57a6b6c410fedc29cec1dbe532de 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1274,9 +1274,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -28,10 +28,10 @@ index efc27bb4072172f10839c181de9b5fba1f488b6f..4c739717fcf53b28312e8a98f9bf0989
}
// 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 fdf73f71ca34099081f9f80994bbe411052c0149..d868d0776a8ca26deefe2e6b77838c2b502fff57 100644
+index 882dae91f9db702edd233f7cab9f95e9874d1270..cf765213001c3c642477658b7aac0916e64ad5e4 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1718,6 +1718,18 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1715,6 +1715,18 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId));
this.doCloseContainer();
}
diff --git a/patches/server/0601-Fix-GameProfileCache-concurrency.patch b/patches/server/0600-Fix-GameProfileCache-concurrency.patch
index 6cb7e5235f..6cb7e5235f 100644
--- a/patches/server/0601-Fix-GameProfileCache-concurrency.patch
+++ b/patches/server/0600-Fix-GameProfileCache-concurrency.patch
diff --git a/patches/server/0602-Improve-and-expand-AsyncCatcher.patch b/patches/server/0601-Improve-and-expand-AsyncCatcher.patch
index a228047ccb..43a86ca3d4 100644
--- a/patches/server/0602-Improve-and-expand-AsyncCatcher.patch
+++ b/patches/server/0601-Improve-and-expand-AsyncCatcher.patch
@@ -42,7 +42,7 @@ index 85f3dcdc8349683cb79ce1d9fe56eff02af2a7a7..4714931fd5218df160e39f013278b799
this.effectsToProcess.add(new ProcessableEffect(mobeffect, cause));
return true;
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
-index 219062cff8a05c765b092f1525043d9d9a1153ae..1c6e8438219f355274db4e0fa849cdd90648fbb4 100644
+index 1cfc906317f07a44f06a4adf021c44e34a2f1d07..6baa313b8201ed23193d7885c85606b0899ade3c 100644
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
@@ -78,6 +78,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@@ -166,7 +166,7 @@ index 219062cff8a05c765b092f1525043d9d9a1153ae..1c6e8438219f355274db4e0fa849cdd9
PersistentEntitySectionManager.LOGGER.warn("Entity {} wasn't found in section {} (destroying due to {})", new Object[]{this.entity, SectionPos.of(this.currentSectionKey), reason});
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 7fbf4fba8df8f47b730a46068e68b33502ed63f8..c5265e9731f32b08916a60067ee5ae3fcadd35db 100644
+index 390cacc7916d1322a7e1e8bff004d415e9fa5622..786a3722f3a50d828e5abe2ff9d415b0e10995ce 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1758,6 +1758,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -214,12 +214,12 @@ index e3487e8429b285519a0a12d6d283266225b75a80..464d67075e052f13e86b51f3e71d05a6
return true;
}
diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java
-index 78669fa035b7537ff7e533cf32aaf2995625424f..e8e3cc48cf1c58bd8151d1f28df28781859cd0e3 100644
+index bbf0d9d9c44fe8d7add2f978994ec129420814c7..ef2598760458833021ef1bee92137f42c9fe591f 100644
--- a/src/main/java/org/spigotmc/AsyncCatcher.java
+++ b/src/main/java/org/spigotmc/AsyncCatcher.java
@@ -11,6 +11,7 @@ public class AsyncCatcher
{
- if ( (AsyncCatcher.enabled || io.papermc.paper.util.TickThread.STRICT_THREAD_CHECKS) && Thread.currentThread() != MinecraftServer.getServer().serverThread ) // Paper
+ if ( AsyncCatcher.enabled && Thread.currentThread() != MinecraftServer.getServer().serverThread )
{
+ MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); // Paper
throw new IllegalStateException( "Asynchronous " + reason + "!" );
diff --git a/patches/server/0603-Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/0602-Add-paper-mobcaps-and-paper-playermobcaps.patch
index e945bbb794..3ab90602a9 100644
--- a/patches/server/0603-Add-paper-mobcaps-and-paper-playermobcaps.patch
+++ b/patches/server/0602-Add-paper-mobcaps-and-paper-playermobcaps.patch
@@ -294,7 +294,7 @@ index 0fc2e453c63b63e12f33cde28ad5afea5657ac57..3c9a9103783495c9015a8cea41562083
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index c5265e9731f32b08916a60067ee5ae3fcadd35db..560d2ff53abd3cdc82d44b45f6896de553b8035c 100644
+index 786a3722f3a50d828e5abe2ff9d415b0e10995ce..0c2734c1d06b6c5dff383f9c6139c0389f220a76 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1716,9 +1716,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0604-Sanitize-ResourceLocation-error-logging.patch b/patches/server/0603-Sanitize-ResourceLocation-error-logging.patch
index 602f0d3b27..602f0d3b27 100644
--- a/patches/server/0604-Sanitize-ResourceLocation-error-logging.patch
+++ b/patches/server/0603-Sanitize-ResourceLocation-error-logging.patch
diff --git a/patches/server/0605-Manually-inline-methods-in-BlockPosition.patch b/patches/server/0604-Manually-inline-methods-in-BlockPosition.patch
index 77b9a47ac1..77b9a47ac1 100644
--- a/patches/server/0605-Manually-inline-methods-in-BlockPosition.patch
+++ b/patches/server/0604-Manually-inline-methods-in-BlockPosition.patch
diff --git a/patches/server/0606-Name-craft-scheduler-threads-according-to-the-plugin.patch b/patches/server/0605-Name-craft-scheduler-threads-according-to-the-plugin.patch
index 30f250f235..30f250f235 100644
--- a/patches/server/0606-Name-craft-scheduler-threads-according-to-the-plugin.patch
+++ b/patches/server/0605-Name-craft-scheduler-threads-according-to-the-plugin.patch
diff --git a/patches/server/0607-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch b/patches/server/0606-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch
index b950818c7b..b950818c7b 100644
--- a/patches/server/0607-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch
+++ b/patches/server/0606-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch
diff --git a/patches/server/0608-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch b/patches/server/0607-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch
index 48449be461..48449be461 100644
--- a/patches/server/0608-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch
+++ b/patches/server/0607-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch
diff --git a/patches/server/0609-Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch b/patches/server/0608-Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch
index 0ab3e48f48..0ab3e48f48 100644
--- a/patches/server/0609-Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch
+++ b/patches/server/0608-Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch
diff --git a/patches/server/0610-Time-scoreboard-search.patch b/patches/server/0609-Time-scoreboard-search.patch
index 8d15084758..8d15084758 100644
--- a/patches/server/0610-Time-scoreboard-search.patch
+++ b/patches/server/0609-Time-scoreboard-search.patch
diff --git a/patches/server/0611-Oprimise-map-impl-for-tracked-players.patch b/patches/server/0610-Oprimise-map-impl-for-tracked-players.patch
index 667d423e0c..891e360d2c 100644
--- a/patches/server/0611-Oprimise-map-impl-for-tracked-players.patch
+++ b/patches/server/0610-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 37bfe3d315210462ed69bb1cb161604e9eb85c36..be0f4a2a9c7fbc359fe79ecf82340db8f7436b22 100644
+index 161792d0226dbb50e9f5ab5c0fe42cc73f44c2a8..b95690dc28dbe8420b0054205c50d14de79f7a42 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1502,7 +1502,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1466,7 +1466,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity;
private final int range;
SectionPos lastSectionPos;
diff --git a/patches/server/0612-Add-missing-InventoryType.patch b/patches/server/0611-Add-missing-InventoryType.patch
index a49bdf073d..a49bdf073d 100644
--- a/patches/server/0612-Add-missing-InventoryType.patch
+++ b/patches/server/0611-Add-missing-InventoryType.patch
diff --git a/patches/server/0613-Optimise-BlockSoil-nearby-water-lookup.patch b/patches/server/0612-Optimise-BlockSoil-nearby-water-lookup.patch
index 81b199a243..81b199a243 100644
--- a/patches/server/0613-Optimise-BlockSoil-nearby-water-lookup.patch
+++ b/patches/server/0612-Optimise-BlockSoil-nearby-water-lookup.patch
diff --git a/patches/server/0614-Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/0613-Fix-merchant-inventory-not-closing-on-entity-removal.patch
index e15a3485c3..2cd406fbc0 100644
--- a/patches/server/0614-Fix-merchant-inventory-not-closing-on-entity-removal.patch
+++ b/patches/server/0613-Fix-merchant-inventory-not-closing-on-entity-removal.patch
@@ -5,7 +5,7 @@ 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 4c739717fcf53b28312e8a98f9bf0989c604d0f0..0723e6fb396a7afa11772f460a98f68cc815bba0 100644
+index de154106419d57a6b6c410fedc29cec1dbe532de..3c947dc0aea06d66a00aeca51355ea41e8d98f88 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2245,6 +2245,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0615-Check-requirement-before-suggesting-root-nodes.patch b/patches/server/0614-Check-requirement-before-suggesting-root-nodes.patch
index fce5e326f9..fce5e326f9 100644
--- a/patches/server/0615-Check-requirement-before-suggesting-root-nodes.patch
+++ b/patches/server/0614-Check-requirement-before-suggesting-root-nodes.patch
diff --git a/patches/server/0616-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch b/patches/server/0615-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch
index 90b29a13b4..90b29a13b4 100644
--- a/patches/server/0616-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch
+++ b/patches/server/0615-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch
diff --git a/patches/server/0617-Add-packet-limiter-config.patch b/patches/server/0616-Add-packet-limiter-config.patch
index a6bd6521f4..a6bd6521f4 100644
--- a/patches/server/0617-Add-packet-limiter-config.patch
+++ b/patches/server/0616-Add-packet-limiter-config.patch
diff --git a/patches/server/0618-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch b/patches/server/0617-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch
index 0b139a1e02..0b139a1e02 100644
--- a/patches/server/0618-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch
+++ b/patches/server/0617-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch
diff --git a/patches/server/0619-Ensure-valid-vehicle-status.patch b/patches/server/0618-Ensure-valid-vehicle-status.patch
index 70f49165db..8b39284257 100644
--- a/patches/server/0619-Ensure-valid-vehicle-status.patch
+++ b/patches/server/0618-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 ecd43bbca7ea0e74f506f49fd14f2dd5d467efa1..a9a0e6c495c696a40bdc8147e9a2856500e422e5 100644
+index cf765213001c3c642477658b7aac0916e64ad5e4..780e9ad1ce3434df6366c0a28cae0ce8727cc32f 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -576,7 +576,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -573,7 +573,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
}
diff --git a/patches/server/0620-Prevent-softlocked-end-exit-portal-generation.patch b/patches/server/0619-Prevent-softlocked-end-exit-portal-generation.patch
index e2698e961b..e2698e961b 100644
--- a/patches/server/0620-Prevent-softlocked-end-exit-portal-generation.patch
+++ b/patches/server/0619-Prevent-softlocked-end-exit-portal-generation.patch
diff --git a/patches/server/0621-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch b/patches/server/0620-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch
index 4fac0c1ab3..4fac0c1ab3 100644
--- a/patches/server/0621-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch
+++ b/patches/server/0620-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch
diff --git a/patches/server/0622-Don-t-log-debug-logging-being-disabled.patch b/patches/server/0621-Don-t-log-debug-logging-being-disabled.patch
index d62e56bfc1..d62e56bfc1 100644
--- a/patches/server/0622-Don-t-log-debug-logging-being-disabled.patch
+++ b/patches/server/0621-Don-t-log-debug-logging-being-disabled.patch
diff --git a/patches/server/0623-fix-various-menus-with-empty-level-accesses.patch b/patches/server/0622-fix-various-menus-with-empty-level-accesses.patch
index efe5d1ddce..efe5d1ddce 100644
--- a/patches/server/0623-fix-various-menus-with-empty-level-accesses.patch
+++ b/patches/server/0622-fix-various-menus-with-empty-level-accesses.patch
diff --git a/patches/server/0624-Preserve-overstacked-loot.patch b/patches/server/0623-Preserve-overstacked-loot.patch
index bd657ec906..bd657ec906 100644
--- a/patches/server/0624-Preserve-overstacked-loot.patch
+++ b/patches/server/0623-Preserve-overstacked-loot.patch
diff --git a/patches/server/0625-Update-head-rotation-in-missing-places.patch b/patches/server/0624-Update-head-rotation-in-missing-places.patch
index 9d1c0adad3..9d1c0adad3 100644
--- a/patches/server/0625-Update-head-rotation-in-missing-places.patch
+++ b/patches/server/0624-Update-head-rotation-in-missing-places.patch
diff --git a/patches/server/0626-prevent-unintended-light-block-manipulation.patch b/patches/server/0625-prevent-unintended-light-block-manipulation.patch
index bff44792dc..bff44792dc 100644
--- a/patches/server/0626-prevent-unintended-light-block-manipulation.patch
+++ b/patches/server/0625-prevent-unintended-light-block-manipulation.patch
diff --git a/patches/server/0627-Fix-CraftCriteria-defaults-map.patch b/patches/server/0626-Fix-CraftCriteria-defaults-map.patch
index 3e79bd7fb7..3e79bd7fb7 100644
--- a/patches/server/0627-Fix-CraftCriteria-defaults-map.patch
+++ b/patches/server/0626-Fix-CraftCriteria-defaults-map.patch
diff --git a/patches/server/0628-Fix-upstreams-block-state-factories.patch b/patches/server/0627-Fix-upstreams-block-state-factories.patch
index a48a6b0d09..a48a6b0d09 100644
--- a/patches/server/0628-Fix-upstreams-block-state-factories.patch
+++ b/patches/server/0627-Fix-upstreams-block-state-factories.patch
diff --git a/patches/server/0629-Configurable-feature-seeds.patch b/patches/server/0628-Configurable-feature-seeds.patch
index 27997ba7c0..27997ba7c0 100644
--- a/patches/server/0629-Configurable-feature-seeds.patch
+++ b/patches/server/0628-Configurable-feature-seeds.patch
diff --git a/patches/server/0630-Add-root-admin-user-detection.patch b/patches/server/0629-Add-root-admin-user-detection.patch
index abe2f3b5ae..abe2f3b5ae 100644
--- a/patches/server/0630-Add-root-admin-user-detection.patch
+++ b/patches/server/0629-Add-root-admin-user-detection.patch
diff --git a/patches/server/0631-don-t-attempt-to-teleport-dead-entities.patch b/patches/server/0630-don-t-attempt-to-teleport-dead-entities.patch
index 50f0c34acb..50f0c34acb 100644
--- a/patches/server/0631-don-t-attempt-to-teleport-dead-entities.patch
+++ b/patches/server/0630-don-t-attempt-to-teleport-dead-entities.patch
diff --git a/patches/server/0632-Prevent-excessive-velocity-through-repeated-crits.patch b/patches/server/0631-Prevent-excessive-velocity-through-repeated-crits.patch
index b9094798f2..b9094798f2 100644
--- a/patches/server/0632-Prevent-excessive-velocity-through-repeated-crits.patch
+++ b/patches/server/0631-Prevent-excessive-velocity-through-repeated-crits.patch
diff --git a/patches/server/0633-Remove-client-side-code-using-deprecated-for-removal.patch b/patches/server/0632-Remove-client-side-code-using-deprecated-for-removal.patch
index 4aed4f1f3a..4aed4f1f3a 100644
--- a/patches/server/0633-Remove-client-side-code-using-deprecated-for-removal.patch
+++ b/patches/server/0632-Remove-client-side-code-using-deprecated-for-removal.patch
diff --git a/patches/server/0634-Fix-Spigot-growth-modifiers.patch b/patches/server/0633-Fix-Spigot-growth-modifiers.patch
index 35160b163d..35160b163d 100644
--- a/patches/server/0634-Fix-Spigot-growth-modifiers.patch
+++ b/patches/server/0633-Fix-Spigot-growth-modifiers.patch
diff --git a/patches/server/0635-Prevent-ContainerOpenersCounter-openCount-from-going.patch b/patches/server/0634-Prevent-ContainerOpenersCounter-openCount-from-going.patch
index b017de75d1..b017de75d1 100644
--- a/patches/server/0635-Prevent-ContainerOpenersCounter-openCount-from-going.patch
+++ b/patches/server/0634-Prevent-ContainerOpenersCounter-openCount-from-going.patch
diff --git a/patches/server/0636-Add-PlayerItemFrameChangeEvent.patch b/patches/server/0635-Add-PlayerItemFrameChangeEvent.patch
index e047726740..e047726740 100644
--- a/patches/server/0636-Add-PlayerItemFrameChangeEvent.patch
+++ b/patches/server/0635-Add-PlayerItemFrameChangeEvent.patch
diff --git a/patches/server/0637-Optimize-HashMapPalette.patch b/patches/server/0636-Optimize-HashMapPalette.patch
index d50159b901..d50159b901 100644
--- a/patches/server/0637-Optimize-HashMapPalette.patch
+++ b/patches/server/0636-Optimize-HashMapPalette.patch
diff --git a/patches/server/0638-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch b/patches/server/0637-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch
index 8f7f6be080..8f7f6be080 100644
--- a/patches/server/0638-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch
+++ b/patches/server/0637-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch
diff --git a/patches/server/0639-Add-more-Campfire-API.patch b/patches/server/0638-Add-more-Campfire-API.patch
index 012ca1cc7d..012ca1cc7d 100644
--- a/patches/server/0639-Add-more-Campfire-API.patch
+++ b/patches/server/0638-Add-more-Campfire-API.patch
diff --git a/patches/server/0640-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch b/patches/server/0639-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch
index 80c053acc6..80c053acc6 100644
--- a/patches/server/0640-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch
+++ b/patches/server/0639-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch
diff --git a/patches/server/0641-Forward-CraftEntity-in-teleport-command.patch b/patches/server/0640-Forward-CraftEntity-in-teleport-command.patch
index 5628023ff7..5628023ff7 100644
--- a/patches/server/0641-Forward-CraftEntity-in-teleport-command.patch
+++ b/patches/server/0640-Forward-CraftEntity-in-teleport-command.patch
diff --git a/patches/server/0642-Improve-scoreboard-entries.patch b/patches/server/0641-Improve-scoreboard-entries.patch
index 8acac86ce3..8acac86ce3 100644
--- a/patches/server/0642-Improve-scoreboard-entries.patch
+++ b/patches/server/0641-Improve-scoreboard-entries.patch
diff --git a/patches/server/0643-Entity-powdered-snow-API.patch b/patches/server/0642-Entity-powdered-snow-API.patch
index adef89850e..adef89850e 100644
--- a/patches/server/0643-Entity-powdered-snow-API.patch
+++ b/patches/server/0642-Entity-powdered-snow-API.patch
diff --git a/patches/server/0644-Add-API-for-item-entity-health.patch b/patches/server/0643-Add-API-for-item-entity-health.patch
index cd2757b544..cd2757b544 100644
--- a/patches/server/0644-Add-API-for-item-entity-health.patch
+++ b/patches/server/0643-Add-API-for-item-entity-health.patch
diff --git a/patches/server/0645-Configurable-max-block-light-for-monster-spawning.patch b/patches/server/0644-Configurable-max-block-light-for-monster-spawning.patch
index 421d176050..421d176050 100644
--- a/patches/server/0645-Configurable-max-block-light-for-monster-spawning.patch
+++ b/patches/server/0644-Configurable-max-block-light-for-monster-spawning.patch
diff --git a/patches/server/0646-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch b/patches/server/0645-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch
index 2ee001a77a..2ee001a77a 100644
--- a/patches/server/0646-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch
+++ b/patches/server/0645-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch
diff --git a/patches/server/0647-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch b/patches/server/0646-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch
index 026f793541..026f793541 100644
--- a/patches/server/0647-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch
+++ b/patches/server/0646-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch
diff --git a/patches/server/0648-Bucketable-API.patch b/patches/server/0647-Bucketable-API.patch
index 274ccde059..274ccde059 100644
--- a/patches/server/0648-Bucketable-API.patch
+++ b/patches/server/0647-Bucketable-API.patch
diff --git a/patches/server/0649-Validate-usernames.patch b/patches/server/0648-Validate-usernames.patch
index 08d6e377eb..08d6e377eb 100644
--- a/patches/server/0649-Validate-usernames.patch
+++ b/patches/server/0648-Validate-usernames.patch
diff --git a/patches/server/0650-Make-water-animal-spawn-height-configurable.patch b/patches/server/0649-Make-water-animal-spawn-height-configurable.patch
index 14f75d9b89..14f75d9b89 100644
--- a/patches/server/0650-Make-water-animal-spawn-height-configurable.patch
+++ b/patches/server/0649-Make-water-animal-spawn-height-configurable.patch
diff --git a/patches/server/0651-Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/0650-Expose-vanilla-BiomeProvider-from-WorldInfo.patch
index b31f8fcb58..885b2a15ca 100644
--- a/patches/server/0651-Expose-vanilla-BiomeProvider-from-WorldInfo.patch
+++ b/patches/server/0650-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 695d6265b4a9f98ba630593ba6c47769240bed93..2559a40546701fefa7f28603cb637108bfc659da 100644
+index 6ad7c34513034c87059f8a0790aea3231dd0d2a9..188b1844ca6ee5a97f7a588121255417a184a4df 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -612,7 +612,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -31,7 +31,7 @@ index 3c9a9103783495c9015a8cea415620839f140f9c..b3c6ecff971cc6fbff463d17f49f0907
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 560d2ff53abd3cdc82d44b45f6896de553b8035c..87379165355e597d02115907da4a096621caf254 100644
+index 0c2734c1d06b6c5dff383f9c6139c0389f220a76..da556cdbd7eecfd0743924d9ab79142c41f08d0a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -212,6 +212,29 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0652-Add-config-option-for-worlds-affected-by-time-cmd.patch b/patches/server/0651-Add-config-option-for-worlds-affected-by-time-cmd.patch
index 156eacada9..156eacada9 100644
--- a/patches/server/0652-Add-config-option-for-worlds-affected-by-time-cmd.patch
+++ b/patches/server/0651-Add-config-option-for-worlds-affected-by-time-cmd.patch
diff --git a/patches/server/0653-Add-missing-IAE-check-for-PersistentDataContainer-ha.patch b/patches/server/0652-Add-missing-IAE-check-for-PersistentDataContainer-ha.patch
index be0eedab93..be0eedab93 100644
--- a/patches/server/0653-Add-missing-IAE-check-for-PersistentDataContainer-ha.patch
+++ b/patches/server/0652-Add-missing-IAE-check-for-PersistentDataContainer-ha.patch
diff --git a/patches/server/0654-Multiple-Entries-with-Scoreboards.patch b/patches/server/0653-Multiple-Entries-with-Scoreboards.patch
index c286ca9e4b..c286ca9e4b 100644
--- a/patches/server/0654-Multiple-Entries-with-Scoreboards.patch
+++ b/patches/server/0653-Multiple-Entries-with-Scoreboards.patch
diff --git a/patches/server/0655-Reset-placed-block-on-exception.patch b/patches/server/0654-Reset-placed-block-on-exception.patch
index c5b6f9f135..c5b6f9f135 100644
--- a/patches/server/0655-Reset-placed-block-on-exception.patch
+++ b/patches/server/0654-Reset-placed-block-on-exception.patch
diff --git a/patches/server/0656-Add-configurable-height-for-slime-spawn.patch b/patches/server/0655-Add-configurable-height-for-slime-spawn.patch
index 5ed7f1549d..5ed7f1549d 100644
--- a/patches/server/0656-Add-configurable-height-for-slime-spawn.patch
+++ b/patches/server/0655-Add-configurable-height-for-slime-spawn.patch
diff --git a/patches/server/0657-Fix-xp-reward-for-baby-zombies.patch b/patches/server/0656-Fix-xp-reward-for-baby-zombies.patch
index a4fec4e0f2..a4fec4e0f2 100644
--- a/patches/server/0657-Fix-xp-reward-for-baby-zombies.patch
+++ b/patches/server/0656-Fix-xp-reward-for-baby-zombies.patch
diff --git a/patches/server/0658-Multi-Block-Change-API-Implementation.patch b/patches/server/0657-Multi-Block-Change-API-Implementation.patch
index 52d9d21721..6cf3af0bc9 100644
--- a/patches/server/0658-Multi-Block-Change-API-Implementation.patch
+++ b/patches/server/0657-Multi-Block-Change-API-Implementation.patch
@@ -24,7 +24,7 @@ index 926ff9be3d9e3f5d620e4c7ccb22b9f64865ff8c..1a37654aff9a9c86c9f7af10a1cf7213
buf.writeLong(this.sectionPos.asLong());
buf.writeVarInt(this.positions.length);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index d22990a2e7a1fcaf6e1f2d2f4856bd9b4b25aadb..240b00ac76d299994129724372d899427c9604c7 100644
+index 395d5b5378e122c820fd4632180cf4f859e1f502..1ffbb31f2926a1b076ab213cb32dd19c7b0f8768 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -930,6 +930,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0659-Fix-NotePlayEvent.patch b/patches/server/0658-Fix-NotePlayEvent.patch
index 4a601d8f1b..4a601d8f1b 100644
--- a/patches/server/0659-Fix-NotePlayEvent.patch
+++ b/patches/server/0658-Fix-NotePlayEvent.patch
diff --git a/patches/server/0660-Freeze-Tick-Lock-API.patch b/patches/server/0659-Freeze-Tick-Lock-API.patch
index d00c82feec..d00c82feec 100644
--- a/patches/server/0660-Freeze-Tick-Lock-API.patch
+++ b/patches/server/0659-Freeze-Tick-Lock-API.patch
diff --git a/patches/server/0661-More-PotionEffectType-API.patch b/patches/server/0660-More-PotionEffectType-API.patch
index 1bbb96d291..1bbb96d291 100644
--- a/patches/server/0661-More-PotionEffectType-API.patch
+++ b/patches/server/0660-More-PotionEffectType-API.patch
diff --git a/patches/server/0662-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch b/patches/server/0661-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch
index 82d25835a6..82d25835a6 100644
--- a/patches/server/0662-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch
+++ b/patches/server/0661-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch
diff --git a/patches/server/0663-API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/0662-API-for-creating-command-sender-which-forwards-feedb.patch
index 0bd41db0fa..0bd41db0fa 100644
--- a/patches/server/0663-API-for-creating-command-sender-which-forwards-feedb.patch
+++ b/patches/server/0662-API-for-creating-command-sender-which-forwards-feedb.patch
diff --git a/patches/server/0664-Add-missing-structure-set-seed-configs.patch b/patches/server/0663-Add-missing-structure-set-seed-configs.patch
index 12c137b53e..12c137b53e 100644
--- a/patches/server/0664-Add-missing-structure-set-seed-configs.patch
+++ b/patches/server/0663-Add-missing-structure-set-seed-configs.patch
diff --git a/patches/server/0665-Fix-cancelled-powdered-snow-bucket-placement.patch b/patches/server/0664-Fix-cancelled-powdered-snow-bucket-placement.patch
index d4169a6e7a..d4169a6e7a 100644
--- a/patches/server/0665-Fix-cancelled-powdered-snow-bucket-placement.patch
+++ b/patches/server/0664-Fix-cancelled-powdered-snow-bucket-placement.patch
diff --git a/patches/server/0666-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch b/patches/server/0665-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch
index d797848359..d797848359 100644
--- a/patches/server/0666-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch
+++ b/patches/server/0665-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch
diff --git a/patches/server/0667-Add-GameEvent-tags.patch b/patches/server/0666-Add-GameEvent-tags.patch
index 7bd38c77bb..7bd38c77bb 100644
--- a/patches/server/0667-Add-GameEvent-tags.patch
+++ b/patches/server/0666-Add-GameEvent-tags.patch
diff --git a/patches/server/0668-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0667-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch
index 524fa973b7..b22ddd6951 100644
--- a/patches/server/0668-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch
+++ b/patches/server/0667-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch
@@ -9,7 +9,7 @@ This might result in chunks loading far slower in the nether,
for example.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 2559a40546701fefa7f28603cb637108bfc659da..f728c5b75ee7db5522e558891988079c52df5e72 100644
+index 188b1844ca6ee5a97f7a588121255417a184a4df..ca6be44c6b2d0176ea41b1735106c5af7cf9f868 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1371,6 +1371,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0669-Furnace-RecipesUsed-API.patch b/patches/server/0668-Furnace-RecipesUsed-API.patch
index d8224fe839..d8224fe839 100644
--- a/patches/server/0669-Furnace-RecipesUsed-API.patch
+++ b/patches/server/0668-Furnace-RecipesUsed-API.patch
diff --git a/patches/server/0670-Configurable-sculk-sensor-listener-range.patch b/patches/server/0669-Configurable-sculk-sensor-listener-range.patch
index 99ff902efa..99ff902efa 100644
--- a/patches/server/0670-Configurable-sculk-sensor-listener-range.patch
+++ b/patches/server/0669-Configurable-sculk-sensor-listener-range.patch
diff --git a/patches/server/0671-Add-missing-block-data-mins-and-maxes.patch b/patches/server/0670-Add-missing-block-data-mins-and-maxes.patch
index fe8170196d..fe8170196d 100644
--- a/patches/server/0671-Add-missing-block-data-mins-and-maxes.patch
+++ b/patches/server/0670-Add-missing-block-data-mins-and-maxes.patch
diff --git a/patches/server/0672-Option-to-have-default-CustomSpawners-in-custom-worl.patch b/patches/server/0671-Option-to-have-default-CustomSpawners-in-custom-worl.patch
index fb23e5d34e..3d41fa27d1 100644
--- a/patches/server/0672-Option-to-have-default-CustomSpawners-in-custom-worl.patch
+++ b/patches/server/0671-Option-to-have-default-CustomSpawners-in-custom-worl.patch
@@ -10,7 +10,7 @@ just looking at the LevelStem key, look at the DimensionType key which
is one level below that. Defaults to off to keep vanilla behavior.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index f728c5b75ee7db5522e558891988079c52df5e72..0ec8f1c94279b75369ab6bae98789c60a971502c 100644
+index ca6be44c6b2d0176ea41b1735106c5af7cf9f868..aa1fbbe55e3dc8fd6bbf021806c66686f8de3d9a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -632,7 +632,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0673-Put-world-into-worldlist-before-initing-the-world.patch b/patches/server/0672-Put-world-into-worldlist-before-initing-the-world.patch
index 030720dfbf..8fa6264db1 100644
--- a/patches/server/0673-Put-world-into-worldlist-before-initing-the-world.patch
+++ b/patches/server/0672-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 0ec8f1c94279b75369ab6bae98789c60a971502c..4e2ce30bc67b0033107715a5a2dbb419bdf17a4f 100644
+index aa1fbbe55e3dc8fd6bbf021806c66686f8de3d9a..04286e907ff14cc8c45dbfc6ab12f520afcca2ca 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -644,9 +644,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0674-Custom-Potion-Mixes.patch b/patches/server/0673-Custom-Potion-Mixes.patch
index 3b95d09b1a..c3c7ad04dd 100644
--- a/patches/server/0674-Custom-Potion-Mixes.patch
+++ b/patches/server/0673-Custom-Potion-Mixes.patch
@@ -96,10 +96,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 4e2ce30bc67b0033107715a5a2dbb419bdf17a4f..2408e5afb9096aa991742983bb573040fbfdb5cb 100644
+index 04286e907ff14cc8c45dbfc6ab12f520afcca2ca..8142e4a238066404f3d1685f9cee1a2b91cdd371 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2161,6 +2161,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2160,6 +2160,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.worldData.setDataConfiguration(worlddataconfiguration);
this.resources.managers.updateRegistryTags();
diff --git a/patches/server/0675-Force-close-world-loading-screen.patch b/patches/server/0674-Force-close-world-loading-screen.patch
index 83d9e2f203..83d9e2f203 100644
--- a/patches/server/0675-Force-close-world-loading-screen.patch
+++ b/patches/server/0674-Force-close-world-loading-screen.patch
diff --git a/patches/server/0676-Fix-falling-block-spawn-methods.patch b/patches/server/0675-Fix-falling-block-spawn-methods.patch
index 22cab6121b..730e95b540 100644
--- a/patches/server/0676-Fix-falling-block-spawn-methods.patch
+++ b/patches/server/0675-Fix-falling-block-spawn-methods.patch
@@ -11,7 +11,7 @@ Restores the API behavior from previous versions of the server
public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 87379165355e597d02115907da4a096621caf254..fd732a22916cba613d168bc03a2ef06dd63960a9 100644
+index da556cdbd7eecfd0743924d9ab79142c41f08d0a..c0c26825865404231f57883447328c84cdf32d82 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1383,7 +1383,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0677-Expose-furnace-minecart-push-values.patch b/patches/server/0676-Expose-furnace-minecart-push-values.patch
index 6245e14b4e..6245e14b4e 100644
--- a/patches/server/0677-Expose-furnace-minecart-push-values.patch
+++ b/patches/server/0676-Expose-furnace-minecart-push-values.patch
diff --git a/patches/server/0678-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch b/patches/server/0677-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch
index 4698298019..4698298019 100644
--- a/patches/server/0678-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch
+++ b/patches/server/0677-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch
diff --git a/patches/server/0679-More-Projectile-API.patch b/patches/server/0678-More-Projectile-API.patch
index ac564ab406..0fbc4c2f87 100644
--- a/patches/server/0679-More-Projectile-API.patch
+++ b/patches/server/0678-More-Projectile-API.patch
@@ -764,7 +764,7 @@ index ebe547736862b38dd11727124cdd70c7abe7d791..6bed9cce39eacf0f42ee4c6b007d2bde
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
-index 23d61d553be3ab0a62624e469b2782baa2b075db..a147b54668854668b02bbe39c9eae22bb98dc217 100644
+index 75f9405ee3453620e1561857575cc8700971a865..8468bf6676b7ade3508085f44fac8980a8c6081e 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -306,12 +306,23 @@ public final class CraftItemStack extends ItemStack {
diff --git a/patches/server/0680-Fix-swamp-hut-cat-generation-deadlock.patch b/patches/server/0679-Fix-swamp-hut-cat-generation-deadlock.patch
index 6aa68bdd5c..6aa68bdd5c 100644
--- a/patches/server/0680-Fix-swamp-hut-cat-generation-deadlock.patch
+++ b/patches/server/0679-Fix-swamp-hut-cat-generation-deadlock.patch
diff --git a/patches/server/0681-Don-t-allow-vehicle-movement-from-players-while-tele.patch b/patches/server/0680-Don-t-allow-vehicle-movement-from-players-while-tele.patch
index 97f05cf771..97f05cf771 100644
--- a/patches/server/0681-Don-t-allow-vehicle-movement-from-players-while-tele.patch
+++ b/patches/server/0680-Don-t-allow-vehicle-movement-from-players-while-tele.patch
diff --git a/patches/server/0682-Implement-getComputedBiome-API.patch b/patches/server/0681-Implement-getComputedBiome-API.patch
index 41624673a7..41624673a7 100644
--- a/patches/server/0682-Implement-getComputedBiome-API.patch
+++ b/patches/server/0681-Implement-getComputedBiome-API.patch
diff --git a/patches/server/0683-Make-some-itemstacks-nonnull.patch b/patches/server/0682-Make-some-itemstacks-nonnull.patch
index 4679d4a859..4679d4a859 100644
--- a/patches/server/0683-Make-some-itemstacks-nonnull.patch
+++ b/patches/server/0682-Make-some-itemstacks-nonnull.patch
diff --git a/patches/server/0684-Implement-enchantWithLevels-API.patch b/patches/server/0683-Implement-enchantWithLevels-API.patch
index 7bf61f04ba..7bf61f04ba 100644
--- a/patches/server/0684-Implement-enchantWithLevels-API.patch
+++ b/patches/server/0683-Implement-enchantWithLevels-API.patch
diff --git a/patches/server/0685-Fix-saving-in-unloadWorld.patch b/patches/server/0684-Fix-saving-in-unloadWorld.patch
index 6148bbda3c..6148bbda3c 100644
--- a/patches/server/0685-Fix-saving-in-unloadWorld.patch
+++ b/patches/server/0684-Fix-saving-in-unloadWorld.patch
diff --git a/patches/server/0686-Buffer-OOB-setBlock-calls.patch b/patches/server/0685-Buffer-OOB-setBlock-calls.patch
index 7bc7bd4823..7bc7bd4823 100644
--- a/patches/server/0686-Buffer-OOB-setBlock-calls.patch
+++ b/patches/server/0685-Buffer-OOB-setBlock-calls.patch
diff --git a/patches/server/0687-Add-TameableDeathMessageEvent.patch b/patches/server/0686-Add-TameableDeathMessageEvent.patch
index e683289da1..e683289da1 100644
--- a/patches/server/0687-Add-TameableDeathMessageEvent.patch
+++ b/patches/server/0686-Add-TameableDeathMessageEvent.patch
diff --git a/patches/server/0688-Fix-new-block-data-for-EntityChangeBlockEvent.patch b/patches/server/0687-Fix-new-block-data-for-EntityChangeBlockEvent.patch
index 1602195aee..1602195aee 100644
--- a/patches/server/0688-Fix-new-block-data-for-EntityChangeBlockEvent.patch
+++ b/patches/server/0687-Fix-new-block-data-for-EntityChangeBlockEvent.patch
diff --git a/patches/server/0689-fix-player-loottables-running-when-mob-loot-gamerule.patch b/patches/server/0688-fix-player-loottables-running-when-mob-loot-gamerule.patch
index 11ef07e7f6..184750f3e3 100644
--- a/patches/server/0689-fix-player-loottables-running-when-mob-loot-gamerule.patch
+++ b/patches/server/0688-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 2a0a182191436cce8889aaa22821d770717ba8a8..8bf10e87954a42694894d107ed5fb13bc9106528 100644
+index 780e9ad1ce3434df6366c0a28cae0ce8727cc32f..787bba01f9cfc735c1082c7c90074f0e0807ec07 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -961,12 +961,14 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -958,12 +958,14 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
}
}
diff --git a/patches/server/0690-Ensure-entity-passenger-world-matches-ridden-entity.patch b/patches/server/0689-Ensure-entity-passenger-world-matches-ridden-entity.patch
index 449425a576..449425a576 100644
--- a/patches/server/0690-Ensure-entity-passenger-world-matches-ridden-entity.patch
+++ b/patches/server/0689-Ensure-entity-passenger-world-matches-ridden-entity.patch
diff --git a/patches/server/0691-cache-resource-keys.patch b/patches/server/0690-cache-resource-keys.patch
index 7f3b6ce992..7f3b6ce992 100644
--- a/patches/server/0691-cache-resource-keys.patch
+++ b/patches/server/0690-cache-resource-keys.patch
diff --git a/patches/server/0692-Allow-changing-the-EnderDragon-podium.patch b/patches/server/0691-Allow-changing-the-EnderDragon-podium.patch
index 7c00628ca0..7c00628ca0 100644
--- a/patches/server/0692-Allow-changing-the-EnderDragon-podium.patch
+++ b/patches/server/0691-Allow-changing-the-EnderDragon-podium.patch
diff --git a/patches/server/0693-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch b/patches/server/0692-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch
index 265f2bbdbb..265f2bbdbb 100644
--- a/patches/server/0693-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch
+++ b/patches/server/0692-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch
diff --git a/patches/server/0694-Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/0693-Prevent-tile-entity-copies-loading-chunks.patch
index 41eee9f92e..41eee9f92e 100644
--- a/patches/server/0694-Prevent-tile-entity-copies-loading-chunks.patch
+++ b/patches/server/0693-Prevent-tile-entity-copies-loading-chunks.patch
diff --git a/patches/server/0695-Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/0694-Use-username-instead-of-display-name-in-PlayerList-g.patch
index 59639c77c4..59639c77c4 100644
--- a/patches/server/0695-Use-username-instead-of-display-name-in-PlayerList-g.patch
+++ b/patches/server/0694-Use-username-instead-of-display-name-in-PlayerList-g.patch
diff --git a/patches/server/0696-Expand-PlayerItemDamageEvent.patch b/patches/server/0695-Expand-PlayerItemDamageEvent.patch
index bf458d8c9b..bf458d8c9b 100644
--- a/patches/server/0696-Expand-PlayerItemDamageEvent.patch
+++ b/patches/server/0695-Expand-PlayerItemDamageEvent.patch
diff --git a/patches/server/0697-WorldCreator-keepSpawnLoaded.patch b/patches/server/0696-WorldCreator-keepSpawnLoaded.patch
index ce6b29605a..ce6b29605a 100644
--- a/patches/server/0697-WorldCreator-keepSpawnLoaded.patch
+++ b/patches/server/0696-WorldCreator-keepSpawnLoaded.patch
diff --git a/patches/server/0698-Fix-CME-in-CraftPersistentDataTypeRegistry.patch b/patches/server/0697-Fix-CME-in-CraftPersistentDataTypeRegistry.patch
index ed8adb4503..ed8adb4503 100644
--- a/patches/server/0698-Fix-CME-in-CraftPersistentDataTypeRegistry.patch
+++ b/patches/server/0697-Fix-CME-in-CraftPersistentDataTypeRegistry.patch
diff --git a/patches/server/0699-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch b/patches/server/0698-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch
index ed6f344427..ed6f344427 100644
--- a/patches/server/0699-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch
+++ b/patches/server/0698-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch
diff --git a/patches/server/0700-Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/server/0699-Add-EntityDyeEvent-and-CollarColorable-interface.patch
index 0c6a5c56da..0c6a5c56da 100644
--- a/patches/server/0700-Add-EntityDyeEvent-and-CollarColorable-interface.patch
+++ b/patches/server/0699-Add-EntityDyeEvent-and-CollarColorable-interface.patch
diff --git a/patches/server/0701-Fire-CauldronLevelChange-on-initial-fill.patch b/patches/server/0700-Fire-CauldronLevelChange-on-initial-fill.patch
index 07f836b363..07f836b363 100644
--- a/patches/server/0701-Fire-CauldronLevelChange-on-initial-fill.patch
+++ b/patches/server/0700-Fire-CauldronLevelChange-on-initial-fill.patch
diff --git a/patches/server/0702-fix-powder-snow-cauldrons-not-turning-to-water.patch b/patches/server/0701-fix-powder-snow-cauldrons-not-turning-to-water.patch
index f277b93aa1..f277b93aa1 100644
--- a/patches/server/0702-fix-powder-snow-cauldrons-not-turning-to-water.patch
+++ b/patches/server/0701-fix-powder-snow-cauldrons-not-turning-to-water.patch
diff --git a/patches/server/0703-Add-PlayerStopUsingItemEvent.patch b/patches/server/0702-Add-PlayerStopUsingItemEvent.patch
index 735b98addf..735b98addf 100644
--- a/patches/server/0703-Add-PlayerStopUsingItemEvent.patch
+++ b/patches/server/0702-Add-PlayerStopUsingItemEvent.patch
diff --git a/patches/server/0704-Don-t-tick-markers.patch b/patches/server/0703-Don-t-tick-markers.patch
index c8a214b154..98a89bf35d 100644
--- a/patches/server/0704-Don-t-tick-markers.patch
+++ b/patches/server/0703-Don-t-tick-markers.patch
@@ -23,7 +23,7 @@ index 67fcba634f8183bb33834ac3b2c3dcfb8d87129e..777b789fdcdf297309cfb36fc7f77e3f
}
});
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 0723e6fb396a7afa11772f460a98f68cc815bba0..d839dd47eb02ce30119c57ff2c1a46c9570fe913 100644
+index 3c947dc0aea06d66a00aeca51355ea41e8d98f88..ec2996d306d3466867e94bb6e4707f2b5fe13af2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2160,6 +2160,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0705-Expand-FallingBlock-API.patch b/patches/server/0704-Expand-FallingBlock-API.patch
index 84c7821142..84c7821142 100644
--- a/patches/server/0705-Expand-FallingBlock-API.patch
+++ b/patches/server/0704-Expand-FallingBlock-API.patch
diff --git a/patches/server/0706-Add-support-for-Proxy-Protocol.patch b/patches/server/0705-Add-support-for-Proxy-Protocol.patch
index aca878218f..aca878218f 100644
--- a/patches/server/0706-Add-support-for-Proxy-Protocol.patch
+++ b/patches/server/0705-Add-support-for-Proxy-Protocol.patch
diff --git a/patches/server/0707-Fix-OfflinePlayer-getBedSpawnLocation.patch b/patches/server/0706-Fix-OfflinePlayer-getBedSpawnLocation.patch
index 61c9b7dd07..61c9b7dd07 100644
--- a/patches/server/0707-Fix-OfflinePlayer-getBedSpawnLocation.patch
+++ b/patches/server/0706-Fix-OfflinePlayer-getBedSpawnLocation.patch
diff --git a/patches/server/0708-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch b/patches/server/0707-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch
index 7158b83635..7158b83635 100644
--- a/patches/server/0708-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch
+++ b/patches/server/0707-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch
diff --git a/patches/server/0709-Sanitize-sent-BlockEntity-NBT.patch b/patches/server/0708-Sanitize-sent-BlockEntity-NBT.patch
index 0f97b535cc..0f97b535cc 100644
--- a/patches/server/0709-Sanitize-sent-BlockEntity-NBT.patch
+++ b/patches/server/0708-Sanitize-sent-BlockEntity-NBT.patch
diff --git a/patches/server/0710-Disable-component-selector-resolving-in-books-by-def.patch b/patches/server/0709-Disable-component-selector-resolving-in-books-by-def.patch
index 796fcc7f2a..796fcc7f2a 100644
--- a/patches/server/0710-Disable-component-selector-resolving-in-books-by-def.patch
+++ b/patches/server/0709-Disable-component-selector-resolving-in-books-by-def.patch
diff --git a/patches/server/0711-Prevent-entity-loading-causing-async-lookups.patch b/patches/server/0710-Prevent-entity-loading-causing-async-lookups.patch
index 666fd8ab2f..666fd8ab2f 100644
--- a/patches/server/0711-Prevent-entity-loading-causing-async-lookups.patch
+++ b/patches/server/0710-Prevent-entity-loading-causing-async-lookups.patch
diff --git a/patches/server/0712-Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/0711-Throw-exception-on-world-create-while-being-ticked.patch
index ccad54896d..6d760986bc 100644
--- a/patches/server/0712-Throw-exception-on-world-create-while-being-ticked.patch
+++ b/patches/server/0711-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 2408e5afb9096aa991742983bb573040fbfdb5cb..56ab40965ca6034ed430d4d5c4be99fa69a3a453 100644
+index 8142e4a238066404f3d1685f9cee1a2b91cdd371..acdba56f025fe729398c5549175baad8e6818f62 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -318,6 +318,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -18,7 +18,7 @@ index 2408e5afb9096aa991742983bb573040fbfdb5cb..56ab40965ca6034ed430d4d5c4be99fa
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
-@@ -1583,7 +1584,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1582,7 +1583,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 2408e5afb9096aa991742983bb573040fbfdb5cb..56ab40965ca6034ed430d4d5c4be99fa
// CraftBukkit start
// Run tasks that are waiting on processing
-@@ -1615,6 +1616,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1614,6 +1615,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end - Perf: Optimize time updates
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
@@ -36,7 +36,7 @@ index 2408e5afb9096aa991742983bb573040fbfdb5cb..56ab40965ca6034ed430d4d5c4be99fa
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
-@@ -1650,6 +1653,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1649,6 +1652,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop();
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
}
diff --git a/patches/server/0713-Dont-resent-entity-on-art-update.patch b/patches/server/0712-Dont-resent-entity-on-art-update.patch
index 38d1a4ca58..38d1a4ca58 100644
--- a/patches/server/0713-Dont-resent-entity-on-art-update.patch
+++ b/patches/server/0712-Dont-resent-entity-on-art-update.patch
diff --git a/patches/server/0714-Add-WardenAngerChangeEvent.patch b/patches/server/0713-Add-WardenAngerChangeEvent.patch
index 41f4251548..41f4251548 100644
--- a/patches/server/0714-Add-WardenAngerChangeEvent.patch
+++ b/patches/server/0713-Add-WardenAngerChangeEvent.patch
diff --git a/patches/server/0715-Add-option-for-strict-advancement-dimension-checks.patch b/patches/server/0714-Add-option-for-strict-advancement-dimension-checks.patch
index 236729352e..0a608e96e8 100644
--- a/patches/server/0715-Add-option-for-strict-advancement-dimension-checks.patch
+++ b/patches/server/0714-Add-option-for-strict-advancement-dimension-checks.patch
@@ -24,10 +24,10 @@ index 01b8f7024fbc965bc6a7f97f79ba3dec964ef769..801823d003a8e28a13fe90db4604cd09
} 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 af19742353008b42f5e12ed4e9351e3a3697c925..cb244eccf64c285d56e824131171da5ad1eec0c8 100644
+index 787bba01f9cfc735c1082c7c90074f0e0807ec07..ff213eefc93a06c40352f8901c33469ba8863fb5 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1390,6 +1390,12 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1387,6 +1387,12 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
ResourceKey<Level> maindimensionkey = CraftDimensionUtil.getMainDimensionKey(origin);
ResourceKey<Level> maindimensionkey1 = CraftDimensionUtil.getMainDimensionKey(this.level());
diff --git a/patches/server/0716-Add-missing-important-BlockStateListPopulator-method.patch b/patches/server/0715-Add-missing-important-BlockStateListPopulator-method.patch
index ecf565ebf6..ecf565ebf6 100644
--- a/patches/server/0716-Add-missing-important-BlockStateListPopulator-method.patch
+++ b/patches/server/0715-Add-missing-important-BlockStateListPopulator-method.patch
diff --git a/patches/server/0717-Nameable-Banner-API.patch b/patches/server/0716-Nameable-Banner-API.patch
index da3d804d8f..da3d804d8f 100644
--- a/patches/server/0717-Nameable-Banner-API.patch
+++ b/patches/server/0716-Nameable-Banner-API.patch
diff --git a/patches/server/0718-Don-t-broadcast-messages-to-command-blocks.patch b/patches/server/0717-Don-t-broadcast-messages-to-command-blocks.patch
index 5a89b4427f..5a89b4427f 100644
--- a/patches/server/0718-Don-t-broadcast-messages-to-command-blocks.patch
+++ b/patches/server/0717-Don-t-broadcast-messages-to-command-blocks.patch
diff --git a/patches/server/0719-Prevent-empty-items-from-being-added-to-world.patch b/patches/server/0718-Prevent-empty-items-from-being-added-to-world.patch
index 5659cfbcab..c9e7ae9955 100644
--- a/patches/server/0719-Prevent-empty-items-from-being-added-to-world.patch
+++ b/patches/server/0718-Prevent-empty-items-from-being-added-to-world.patch
@@ -7,7 +7,7 @@ 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 d839dd47eb02ce30119c57ff2c1a46c9570fe913..e1e0cf97d2badd26a9391bf0f758edae262a14c2 100644
+index ec2996d306d3466867e94bb6e4707f2b5fe13af2..43d54a7fab4b5d46bf4ca319519a39fda1fc264f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1235,6 +1235,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0720-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch b/patches/server/0719-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch
index c2e21a749e..c2e21a749e 100644
--- a/patches/server/0720-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch
+++ b/patches/server/0719-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch
diff --git a/patches/server/0721-Add-Player-getFishHook.patch b/patches/server/0720-Add-Player-getFishHook.patch
index d87fa21619..7ab8083ac7 100644
--- a/patches/server/0721-Add-Player-getFishHook.patch
+++ b/patches/server/0720-Add-Player-getFishHook.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add Player#getFishHook
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
-index 6c500a2ccc050fc44076e443032b0ef9d87a7de8..79faf3c64891899bf5d6d119154aba02d4665b3b 100644
+index 148279d06dc5bf46aa5d4319f0b7d2ebfcee412d..0213898b4d029ea9260a755d6411d909a1b6885c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -160,6 +160,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
diff --git a/patches/server/0722-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch b/patches/server/0721-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch
index 32aaf6dc6e..32aaf6dc6e 100644
--- a/patches/server/0722-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch
+++ b/patches/server/0721-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch
diff --git a/patches/server/0723-Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/0722-Add-various-missing-EntityDropItemEvent-calls.patch
index d13d0cd3b0..d13d0cd3b0 100644
--- a/patches/server/0723-Add-various-missing-EntityDropItemEvent-calls.patch
+++ b/patches/server/0722-Add-various-missing-EntityDropItemEvent-calls.patch
diff --git a/patches/server/0724-Fix-Bee-flower-NPE.patch b/patches/server/0723-Fix-Bee-flower-NPE.patch
index db6e1b0ad9..db6e1b0ad9 100644
--- a/patches/server/0724-Fix-Bee-flower-NPE.patch
+++ b/patches/server/0723-Fix-Bee-flower-NPE.patch
diff --git a/patches/server/0725-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/0724-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch
index 6a05adf6b7..6a05adf6b7 100644
--- a/patches/server/0725-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch
+++ b/patches/server/0724-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch
diff --git a/patches/server/0726-More-Teleport-API.patch b/patches/server/0725-More-Teleport-API.patch
index deb574d5df..658e715895 100644
--- a/patches/server/0726-More-Teleport-API.patch
+++ b/patches/server/0725-More-Teleport-API.patch
@@ -112,7 +112,7 @@ index 47f24e390efd8eb4cb7f62b5203825f4160772b7..243ac4253a1541dba52126bad96682e4
private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot()
{
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index c92ca61b2af012e58f998c8b08c895007a423f67..17becfd5a08a87682d665151e3539f870b72f981 100644
+index 1ffbb31f2926a1b076ab213cb32dd19c7b0f8768..7f449bc5a0644709b426dba70a5afccc26a37de8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1286,13 +1286,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0727-Add-EntityPortalReadyEvent.patch b/patches/server/0726-Add-EntityPortalReadyEvent.patch
index 3b5704098f..3b5704098f 100644
--- a/patches/server/0727-Add-EntityPortalReadyEvent.patch
+++ b/patches/server/0726-Add-EntityPortalReadyEvent.patch
diff --git a/patches/server/0728-Don-t-use-level-random-in-entity-constructors.patch b/patches/server/0727-Don-t-use-level-random-in-entity-constructors.patch
index cb41bd38c5..cb41bd38c5 100644
--- a/patches/server/0728-Don-t-use-level-random-in-entity-constructors.patch
+++ b/patches/server/0727-Don-t-use-level-random-in-entity-constructors.patch
diff --git a/patches/server/0729-Send-block-entities-after-destroy-prediction.patch b/patches/server/0728-Send-block-entities-after-destroy-prediction.patch
index 40992c754a..40992c754a 100644
--- a/patches/server/0729-Send-block-entities-after-destroy-prediction.patch
+++ b/patches/server/0728-Send-block-entities-after-destroy-prediction.patch
diff --git a/patches/server/0730-Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/0729-Warn-on-plugins-accessing-faraway-chunks.patch
index f3d50c526a..b405c21a44 100644
--- a/patches/server/0730-Warn-on-plugins-accessing-faraway-chunks.patch
+++ b/patches/server/0729-Warn-on-plugins-accessing-faraway-chunks.patch
@@ -18,7 +18,7 @@ index 38bcf9f410e8a9d47c7d486c28dbc16a6225b650..210c3b6167dac93e550fe849e34b5aa4
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 fd732a22916cba613d168bc03a2ef06dd63960a9..1ef380cbd77132b743520f952afa8321042bec6d 100644
+index c0c26825865404231f57883447328c84cdf32d82..0c5a583f2ced1ae5e1e92a045ef2ef1cd5b35496 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -295,9 +295,24 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0731-Custom-Chat-Completion-Suggestions-API.patch b/patches/server/0730-Custom-Chat-Completion-Suggestions-API.patch
index 839ee2255a..eb2cf4cb83 100644
--- a/patches/server/0731-Custom-Chat-Completion-Suggestions-API.patch
+++ b/patches/server/0730-Custom-Chat-Completion-Suggestions-API.patch
@@ -5,7 +5,7 @@ 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 d0005af63d4ae0081a39797cb62c5ff3e2efa537..bffb3c029e917ccfc4b092a5d213a4d0f7a42ce4 100644
+index 7f449bc5a0644709b426dba70a5afccc26a37de8..7a4ae758616225002cc14060753bb691ee1d94bb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -691,6 +691,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0732-Add-and-fix-missing-BlockFadeEvents.patch b/patches/server/0731-Add-and-fix-missing-BlockFadeEvents.patch
index 055406ea3e..062bad35bb 100644
--- a/patches/server/0732-Add-and-fix-missing-BlockFadeEvents.patch
+++ b/patches/server/0731-Add-and-fix-missing-BlockFadeEvents.patch
@@ -10,7 +10,7 @@ potentially waterlogged block states fading.
Co-authored-by: Lulu13022002 <[email protected]
diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
-index 6e7595193275e88c69b82ebbc9f9df636879a03e..3c4949965c0fad3c6200d0fd1e31ebe844ba6e0e 100644
+index 669234bca9fa50548447f77dc5f314df8d9dd7c9..f2d4264743b6070f36adb66d00a3de0a72b86846 100644
--- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
@@ -92,6 +92,11 @@ public class FrogspawnBlock extends Block {
@@ -39,7 +39,7 @@ index 580c77eeaf88083f2aed2e46e6c57dc1fcf9564c..f4cccbc134b33758cd553a29b9f8e996
FallingBlockEntity.fall(world, pos, iblockdata1);
} else {
diff --git a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
-index 1eda49c9ce8ee009cb08b18f02f59b37c2118628..38288f20306632e6546c95b4cb1a42806be49975 100644
+index 14a5cd54820243f4ca59857b0d67c1e86457d590..f53808e200bd83ab80954ec5c1e9c14250302be8 100644
--- a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
@@ -60,12 +60,26 @@ public class SnifferEggBlock extends Block {
diff --git a/patches/server/0733-Collision-API.patch b/patches/server/0732-Collision-API.patch
index 6bd05181ad..6bd05181ad 100644
--- a/patches/server/0733-Collision-API.patch
+++ b/patches/server/0732-Collision-API.patch
diff --git a/patches/server/0734-Fix-suggest-command-message-for-brigadier-syntax-exc.patch b/patches/server/0733-Fix-suggest-command-message-for-brigadier-syntax-exc.patch
index f661ad8722..f661ad8722 100644
--- a/patches/server/0734-Fix-suggest-command-message-for-brigadier-syntax-exc.patch
+++ b/patches/server/0733-Fix-suggest-command-message-for-brigadier-syntax-exc.patch
diff --git a/patches/server/0735-Block-Ticking-API.patch b/patches/server/0734-Block-Ticking-API.patch
index 9e5247f35f..9e5247f35f 100644
--- a/patches/server/0735-Block-Ticking-API.patch
+++ b/patches/server/0734-Block-Ticking-API.patch
diff --git a/patches/server/0736-Add-Velocity-IP-Forwarding-Support.patch b/patches/server/0735-Add-Velocity-IP-Forwarding-Support.patch
index 99b0cc4d6a..99b0cc4d6a 100644
--- a/patches/server/0736-Add-Velocity-IP-Forwarding-Support.patch
+++ b/patches/server/0735-Add-Velocity-IP-Forwarding-Support.patch
diff --git a/patches/server/0737-Add-NamespacedKey-biome-methods.patch b/patches/server/0736-Add-NamespacedKey-biome-methods.patch
index 0a5e2f5d8a..0a5e2f5d8a 100644
--- a/patches/server/0737-Add-NamespacedKey-biome-methods.patch
+++ b/patches/server/0736-Add-NamespacedKey-biome-methods.patch
diff --git a/patches/server/0738-Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/0737-Fix-plugin-loggers-on-server-shutdown.patch
index 896ce1668f..18da0811b4 100644
--- a/patches/server/0738-Fix-plugin-loggers-on-server-shutdown.patch
+++ b/patches/server/0737-Fix-plugin-loggers-on-server-shutdown.patch
@@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 56ab40965ca6034ed430d4d5c4be99fa69a3a453..eef519384b5f8f6b2551ed61affe6cb1f3489702 100644
+index acdba56f025fe729398c5549175baad8e6818f62..3aba668f9a34cabc26063c61660ab22f83b1070e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1239,6 +1239,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -49,7 +49,7 @@ index 56ab40965ca6034ed430d4d5c4be99fa69a3a453..eef519384b5f8f6b2551ed61affe6cb1
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 02243b69cca7255588b43dab57e1c9ca4c3ca87f..6e1f92b45504cef0c4dcbbebf3df339ef4cad0a1 100644
+index b9b93a4e20eed028b76eab4dcb9610ae05f22faf..1acc0a579804dee7bb3d0f755c24240413ed7540 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -19,6 +19,12 @@ public class Main {
diff --git a/patches/server/0739-Stop-large-look-changes-from-crashing-the-server.patch b/patches/server/0738-Stop-large-look-changes-from-crashing-the-server.patch
index 592bb75b03..592bb75b03 100644
--- a/patches/server/0739-Stop-large-look-changes-from-crashing-the-server.patch
+++ b/patches/server/0738-Stop-large-look-changes-from-crashing-the-server.patch
diff --git a/patches/server/0740-Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/0739-Fire-EntityChangeBlockEvent-in-more-places.patch
index bafa064971..bafa064971 100644
--- a/patches/server/0740-Fire-EntityChangeBlockEvent-in-more-places.patch
+++ b/patches/server/0739-Fire-EntityChangeBlockEvent-in-more-places.patch
diff --git a/patches/server/0741-Missing-eating-regain-reason.patch b/patches/server/0740-Missing-eating-regain-reason.patch
index af804e161b..af804e161b 100644
--- a/patches/server/0741-Missing-eating-regain-reason.patch
+++ b/patches/server/0740-Missing-eating-regain-reason.patch
diff --git a/patches/server/0742-Missing-effect-cause.patch b/patches/server/0741-Missing-effect-cause.patch
index f9c09496b6..f9c09496b6 100644
--- a/patches/server/0742-Missing-effect-cause.patch
+++ b/patches/server/0741-Missing-effect-cause.patch
diff --git a/patches/server/0743-Added-byte-array-serialization-deserialization-for-P.patch b/patches/server/0742-Added-byte-array-serialization-deserialization-for-P.patch
index f2a4d437f0..f2a4d437f0 100644
--- a/patches/server/0743-Added-byte-array-serialization-deserialization-for-P.patch
+++ b/patches/server/0742-Added-byte-array-serialization-deserialization-for-P.patch
diff --git a/patches/server/0744-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch b/patches/server/0743-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch
index 1472e064ab..1472e064ab 100644
--- a/patches/server/0744-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch
+++ b/patches/server/0743-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch
diff --git a/patches/server/0745-Call-BlockPhysicsEvent-more-often.patch b/patches/server/0744-Call-BlockPhysicsEvent-more-often.patch
index 1839fbe711..1839fbe711 100644
--- a/patches/server/0745-Call-BlockPhysicsEvent-more-often.patch
+++ b/patches/server/0744-Call-BlockPhysicsEvent-more-often.patch
diff --git a/patches/server/0746-Configurable-chat-thread-limit.patch b/patches/server/0745-Configurable-chat-thread-limit.patch
index 62a41e3361..764335837b 100644
--- a/patches/server/0746-Configurable-chat-thread-limit.patch
+++ b/patches/server/0745-Configurable-chat-thread-limit.patch
@@ -22,7 +22,7 @@ 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 7045040681e639f36fefcf2735f67367d5e3cbc4..cc847dce0116b8260790b890b1d5452c280e186c 100644
+index a4f91ef8d5c4a8263961c4f00c0ce8cc937497d9..701196635f9c08d62d785fa1b448313937259c76 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -287,7 +287,18 @@ public class GlobalConfiguration extends ConfigurationPart {
diff --git a/patches/server/0747-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/0746-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch
index e344e07414..e344e07414 100644
--- a/patches/server/0747-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch
+++ b/patches/server/0746-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch
diff --git a/patches/server/0748-fix-Jigsaw-block-kicking-user.patch b/patches/server/0747-fix-Jigsaw-block-kicking-user.patch
index 6e1aef94c8..6e1aef94c8 100644
--- a/patches/server/0748-fix-Jigsaw-block-kicking-user.patch
+++ b/patches/server/0747-fix-Jigsaw-block-kicking-user.patch
diff --git a/patches/server/0749-use-BlockFormEvent-for-mud-converting-into-clay.patch b/patches/server/0748-use-BlockFormEvent-for-mud-converting-into-clay.patch
index 8653ffd786..8653ffd786 100644
--- a/patches/server/0749-use-BlockFormEvent-for-mud-converting-into-clay.patch
+++ b/patches/server/0748-use-BlockFormEvent-for-mud-converting-into-clay.patch
diff --git a/patches/server/0750-Add-getDrops-to-BlockState.patch b/patches/server/0749-Add-getDrops-to-BlockState.patch
index ea12f69bde..ea12f69bde 100644
--- a/patches/server/0750-Add-getDrops-to-BlockState.patch
+++ b/patches/server/0749-Add-getDrops-to-BlockState.patch
diff --git a/patches/server/0751-Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/0750-Fix-a-bunch-of-vanilla-bugs.patch
index 72188bb0c4..0a3f563bd4 100644
--- a/patches/server/0751-Fix-a-bunch-of-vanilla-bugs.patch
+++ b/patches/server/0750-Fix-a-bunch-of-vanilla-bugs.patch
@@ -85,10 +85,10 @@ index 6854ca4d4fec2b4fa541c3fabf63787665572609..e7b444a10b244828827b3c66c5346520
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index be0f4a2a9c7fbc359fe79ecf82340db8f7436b22..b6b15e8ce98603d6e580a31ba458fedc8b3f663a 100644
+index b95690dc28dbe8420b0054205c50d14de79f7a42..54a7e65929ca29526f670d5e5d4ef19cb9008d43 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1064,7 +1064,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1031,7 +1031,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit end
}
@@ -98,7 +98,7 @@ index be0f4a2a9c7fbc359fe79ecf82340db8f7436b22..b6b15e8ce98603d6e580a31ba458fedc
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 e1e0cf97d2badd26a9391bf0f758edae262a14c2..b9002600a3efca0079abe238a6d9b43693b6af8b 100644
+index 43d54a7fab4b5d46bf4ca319519a39fda1fc264f..4924e19c3fdafb3bb3f0550b16f8acf08e436c67 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -777,7 +777,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0752-Remove-unnecessary-onTrackingStart-during-navigation.patch b/patches/server/0751-Remove-unnecessary-onTrackingStart-during-navigation.patch
index 382d4cc3a7..bbff07c888 100644
--- a/patches/server/0752-Remove-unnecessary-onTrackingStart-during-navigation.patch
+++ b/patches/server/0751-Remove-unnecessary-onTrackingStart-during-navigation.patch
@@ -5,7 +5,7 @@ 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 b9002600a3efca0079abe238a6d9b43693b6af8b..15607da2883653cd757a3220ddf79833afd39330 100644
+index 4924e19c3fdafb3bb3f0550b16f8acf08e436c67..66f795168d3e120506aafa3cade78e6e8dcd8619 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2184,7 +2184,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0753-Fix-custom-piglin-loved-items.patch b/patches/server/0752-Fix-custom-piglin-loved-items.patch
index a09a51f7ea..a09a51f7ea 100644
--- a/patches/server/0753-Fix-custom-piglin-loved-items.patch
+++ b/patches/server/0752-Fix-custom-piglin-loved-items.patch
diff --git a/patches/server/0754-EntityPickupItemEvent-fixes.patch b/patches/server/0753-EntityPickupItemEvent-fixes.patch
index 375a09d01d..375a09d01d 100644
--- a/patches/server/0754-EntityPickupItemEvent-fixes.patch
+++ b/patches/server/0753-EntityPickupItemEvent-fixes.patch
diff --git a/patches/server/0755-Correctly-handle-interactions-with-items-on-cooldown.patch b/patches/server/0754-Correctly-handle-interactions-with-items-on-cooldown.patch
index 103b29fc68..103b29fc68 100644
--- a/patches/server/0755-Correctly-handle-interactions-with-items-on-cooldown.patch
+++ b/patches/server/0754-Correctly-handle-interactions-with-items-on-cooldown.patch
diff --git a/patches/server/0756-Add-PlayerInventorySlotChangeEvent.patch b/patches/server/0755-Add-PlayerInventorySlotChangeEvent.patch
index ddeaac02da..6c7535a4e3 100644
--- a/patches/server/0756-Add-PlayerInventorySlotChangeEvent.patch
+++ b/patches/server/0755-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 cb244eccf64c285d56e824131171da5ad1eec0c8..118a6b58947417d107f8b0b4c0622d69332eee95 100644
+index ff213eefc93a06c40352f8901c33469ba8863fb5..84e9478c5dc3f0af57739c4ab107ffe9f76a81a9 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -352,6 +352,25 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -351,6 +351,25 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
}
diff --git a/patches/server/0757-Elder-Guardian-appearance-API.patch b/patches/server/0756-Elder-Guardian-appearance-API.patch
index f5fe07ced7..05ca8f144b 100644
--- a/patches/server/0757-Elder-Guardian-appearance-API.patch
+++ b/patches/server/0756-Elder-Guardian-appearance-API.patch
@@ -5,7 +5,7 @@ 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 f49b65a34e9ca249d9055ecf09262cfe4ab445c5..4ba269dbbb44cc4ef36db7386e4ccc99bd90bd72 100644
+index 7a4ae758616225002cc14060753bb691ee1d94bb..3566c607c7d66eb8d64cdcd77204b6b132287f58 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3298,6 +3298,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0758-Allow-changing-bed-s-occupied-property.patch b/patches/server/0757-Allow-changing-bed-s-occupied-property.patch
index d8b51d7f0b..d8b51d7f0b 100644
--- a/patches/server/0758-Allow-changing-bed-s-occupied-property.patch
+++ b/patches/server/0757-Allow-changing-bed-s-occupied-property.patch
diff --git a/patches/server/0759-Add-entity-knockback-API.patch b/patches/server/0758-Add-entity-knockback-API.patch
index e69cd1ea90..e69cd1ea90 100644
--- a/patches/server/0759-Add-entity-knockback-API.patch
+++ b/patches/server/0758-Add-entity-knockback-API.patch
diff --git a/patches/server/0760-Detect-headless-JREs.patch b/patches/server/0759-Detect-headless-JREs.patch
index 5ba28913a8..5ba28913a8 100644
--- a/patches/server/0760-Detect-headless-JREs.patch
+++ b/patches/server/0759-Detect-headless-JREs.patch
diff --git a/patches/server/0761-fix-entity-vehicle-collision-event-not-called.patch b/patches/server/0760-fix-entity-vehicle-collision-event-not-called.patch
index e39b0eaf22..e39b0eaf22 100644
--- a/patches/server/0761-fix-entity-vehicle-collision-event-not-called.patch
+++ b/patches/server/0760-fix-entity-vehicle-collision-event-not-called.patch
diff --git a/patches/server/0762-Add-EntityToggleSitEvent.patch b/patches/server/0761-Add-EntityToggleSitEvent.patch
index c9aef59416..c9aef59416 100644
--- a/patches/server/0762-Add-EntityToggleSitEvent.patch
+++ b/patches/server/0761-Add-EntityToggleSitEvent.patch
diff --git a/patches/server/0763-Add-fire-tick-delay-option.patch b/patches/server/0762-Add-fire-tick-delay-option.patch
index 848f831f0e..848f831f0e 100644
--- a/patches/server/0763-Add-fire-tick-delay-option.patch
+++ b/patches/server/0762-Add-fire-tick-delay-option.patch
diff --git a/patches/server/0764-Add-Moving-Piston-API.patch b/patches/server/0763-Add-Moving-Piston-API.patch
index e3d3955822..e3d3955822 100644
--- a/patches/server/0764-Add-Moving-Piston-API.patch
+++ b/patches/server/0763-Add-Moving-Piston-API.patch
diff --git a/patches/server/0765-Ignore-impossible-spawn-tick.patch b/patches/server/0764-Ignore-impossible-spawn-tick.patch
index f046102ceb..f046102ceb 100644
--- a/patches/server/0765-Ignore-impossible-spawn-tick.patch
+++ b/patches/server/0764-Ignore-impossible-spawn-tick.patch
diff --git a/patches/server/0766-Fix-EntityArgument-suggestion-permissions-to-align-w.patch b/patches/server/0765-Fix-EntityArgument-suggestion-permissions-to-align-w.patch
index c42422ceca..c42422ceca 100644
--- a/patches/server/0766-Fix-EntityArgument-suggestion-permissions-to-align-w.patch
+++ b/patches/server/0765-Fix-EntityArgument-suggestion-permissions-to-align-w.patch
diff --git a/patches/server/0767-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch b/patches/server/0766-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch
index 878a07af2b..878a07af2b 100644
--- a/patches/server/0767-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch
+++ b/patches/server/0766-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch
diff --git a/patches/server/0768-Add-PrePlayerAttackEntityEvent.patch b/patches/server/0767-Add-PrePlayerAttackEntityEvent.patch
index b0f3a07890..b0f3a07890 100644
--- a/patches/server/0768-Add-PrePlayerAttackEntityEvent.patch
+++ b/patches/server/0767-Add-PrePlayerAttackEntityEvent.patch
diff --git a/patches/server/0769-ensure-reset-EnderDragon-boss-event-name.patch b/patches/server/0768-ensure-reset-EnderDragon-boss-event-name.patch
index 854c391fc5..854c391fc5 100644
--- a/patches/server/0769-ensure-reset-EnderDragon-boss-event-name.patch
+++ b/patches/server/0768-ensure-reset-EnderDragon-boss-event-name.patch
diff --git a/patches/server/0770-Add-Player-Warden-Warning-API.patch b/patches/server/0769-Add-Player-Warden-Warning-API.patch
index 85b7ab61e8..647754a109 100644
--- a/patches/server/0770-Add-Player-Warden-Warning-API.patch
+++ b/patches/server/0769-Add-Player-Warden-Warning-API.patch
@@ -10,7 +10,7 @@ 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 4ba269dbbb44cc4ef36db7386e4ccc99bd90bd72..02b9233ecf929ac9ec7d304231d8bc66fc00dad4 100644
+index 3566c607c7d66eb8d64cdcd77204b6b132287f58..cc631c6882ee623cb1191b9d422a7adc4fa742a2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3303,6 +3303,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0771-More-vanilla-friendly-methods-to-update-trades.patch b/patches/server/0770-More-vanilla-friendly-methods-to-update-trades.patch
index 79a6b155bd..79a6b155bd 100644
--- a/patches/server/0771-More-vanilla-friendly-methods-to-update-trades.patch
+++ b/patches/server/0770-More-vanilla-friendly-methods-to-update-trades.patch
diff --git a/patches/server/0772-Add-paper-dumplisteners-command.patch b/patches/server/0771-Add-paper-dumplisteners-command.patch
index aabb60033d..aabb60033d 100644
--- a/patches/server/0772-Add-paper-dumplisteners-command.patch
+++ b/patches/server/0771-Add-paper-dumplisteners-command.patch
diff --git a/patches/server/0773-check-global-player-list-where-appropriate.patch b/patches/server/0772-check-global-player-list-where-appropriate.patch
index 32596b991d..3afedde0df 100644
--- a/patches/server/0773-check-global-player-list-where-appropriate.patch
+++ b/patches/server/0772-check-global-player-list-where-appropriate.patch
@@ -7,7 +7,7 @@ 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 15607da2883653cd757a3220ddf79833afd39330..b9d3a98824fc146128f35244f5f15bba97948674 100644
+index 66f795168d3e120506aafa3cade78e6e8dcd8619..cff225eab588248f1e6487a4a33da006672b3ba4 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2300,4 +2300,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0774-Fix-async-entity-add-due-to-fungus-trees.patch b/patches/server/0773-Fix-async-entity-add-due-to-fungus-trees.patch
index 2a7830d952..2a7830d952 100644
--- a/patches/server/0774-Fix-async-entity-add-due-to-fungus-trees.patch
+++ b/patches/server/0773-Fix-async-entity-add-due-to-fungus-trees.patch
diff --git a/patches/server/0775-ItemStack-damage-API.patch b/patches/server/0774-ItemStack-damage-API.patch
index 24e6ad94dd..24e6ad94dd 100644
--- a/patches/server/0775-ItemStack-damage-API.patch
+++ b/patches/server/0774-ItemStack-damage-API.patch
diff --git a/patches/server/0776-Friction-API.patch b/patches/server/0775-Friction-API.patch
index dfa1fdc21b..dfa1fdc21b 100644
--- a/patches/server/0776-Friction-API.patch
+++ b/patches/server/0775-Friction-API.patch
diff --git a/patches/server/0777-Ability-to-control-player-s-insomnia-and-phantoms.patch b/patches/server/0776-Ability-to-control-player-s-insomnia-and-phantoms.patch
index 5bc45a7af4..5bc45a7af4 100644
--- a/patches/server/0777-Ability-to-control-player-s-insomnia-and-phantoms.patch
+++ b/patches/server/0776-Ability-to-control-player-s-insomnia-and-phantoms.patch
diff --git a/patches/server/0778-Fix-premature-player-kicks-on-shutdown.patch b/patches/server/0777-Fix-premature-player-kicks-on-shutdown.patch
index 1050fc37f7..d3dbe3d230 100644
--- a/patches/server/0778-Fix-premature-player-kicks-on-shutdown.patch
+++ b/patches/server/0777-Fix-premature-player-kicks-on-shutdown.patch
@@ -47,10 +47,10 @@ index 4d9f1fc884050993287adfa4578a87da710623fb..a8dfe7a4b3d01bf75587be078f471d1e
this.disconnect((Component) Component.translatable("multiplayer.disconnect.server_shutdown"));
} catch (ClassCastException classcastexception) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index eef519384b5f8f6b2551ed61affe6cb1f3489702..374c20e530d2abd41674d80c711bd3737c6f6941 100644
+index 3aba668f9a34cabc26063c61660ab22f83b1070e..a72b278826be1d0da79ca619ea9a9a437fa9c54b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2094,7 +2094,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2093,7 +2093,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override
public void executeIfPossible(Runnable runnable) {
if (this.isStopped()) {
diff --git a/patches/server/0779-Sync-offhand-slot-in-menus.patch b/patches/server/0778-Sync-offhand-slot-in-menus.patch
index 0cac839445..415c804e18 100644
--- a/patches/server/0779-Sync-offhand-slot-in-menus.patch
+++ b/patches/server/0778-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 118a6b58947417d107f8b0b4c0622d69332eee95..9d6c6a979fb1751ca90c9c1210ec52bbf12495f4 100644
+index 84e9478c5dc3f0af57739c4ab107ffe9f76a81a9..a755d5d8e435e6545ca433ce5c7ea818d5cd6a28 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -321,6 +321,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -320,6 +320,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
}
diff --git a/patches/server/0780-Player-Entity-Tracking-Events.patch b/patches/server/0779-Player-Entity-Tracking-Events.patch
index 6713f183a6..a88e72e72e 100644
--- a/patches/server/0780-Player-Entity-Tracking-Events.patch
+++ b/patches/server/0779-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 b6b15e8ce98603d6e580a31ba458fedc8b3f663a..91ca37605bf7ba65875b588fe9764b30214f63b6 100644
+index 54a7e65929ca29526f670d5e5d4ef19cb9008d43..cc7c284079af5ec4fd7085e87a7de47aacda587d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1574,7 +1574,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1538,7 +1538,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit end
if (flag) {
if (this.seenBy.add(player.connection)) {
diff --git a/patches/server/0781-Limit-pet-look-distance.patch b/patches/server/0780-Limit-pet-look-distance.patch
index 983f861539..983f861539 100644
--- a/patches/server/0781-Limit-pet-look-distance.patch
+++ b/patches/server/0780-Limit-pet-look-distance.patch
diff --git a/patches/server/0782-fix-Instruments.patch b/patches/server/0781-fix-Instruments.patch
index 44204573e7..fd5c343d0b 100644
--- a/patches/server/0782-fix-Instruments.patch
+++ b/patches/server/0781-fix-Instruments.patch
@@ -6,7 +6,7 @@ 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 02b9233ecf929ac9ec7d304231d8bc66fc00dad4..682c5e9328d965bf335bb06ac7aedf6d49b1c6cb 100644
+index cc631c6882ee623cb1191b9d422a7adc4fa742a2..c426dbff75f0ad3889594fba9a66669fc71b63e8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -768,7 +768,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0783-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch b/patches/server/0782-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch
index 3a64891f6a..3a64891f6a 100644
--- a/patches/server/0783-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch
+++ b/patches/server/0782-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch
diff --git a/patches/server/0784-Fix-inconsistencies-in-dispense-events-regarding-sta.patch b/patches/server/0783-Fix-inconsistencies-in-dispense-events-regarding-sta.patch
index 8b797606ed..8b797606ed 100644
--- a/patches/server/0784-Fix-inconsistencies-in-dispense-events-regarding-sta.patch
+++ b/patches/server/0783-Fix-inconsistencies-in-dispense-events-regarding-sta.patch
diff --git a/patches/server/0785-Add-BlockLockCheckEvent.patch b/patches/server/0784-Add-BlockLockCheckEvent.patch
index deeeae6839..deeeae6839 100644
--- a/patches/server/0785-Add-BlockLockCheckEvent.patch
+++ b/patches/server/0784-Add-BlockLockCheckEvent.patch
diff --git a/patches/server/0786-Add-Sneaking-API-for-Entities.patch b/patches/server/0785-Add-Sneaking-API-for-Entities.patch
index a8db30ee3c..a8db30ee3c 100644
--- a/patches/server/0786-Add-Sneaking-API-for-Entities.patch
+++ b/patches/server/0785-Add-Sneaking-API-for-Entities.patch
diff --git a/patches/server/0787-Improve-logging-and-errors.patch b/patches/server/0786-Improve-logging-and-errors.patch
index 243a962373..243a962373 100644
--- a/patches/server/0787-Improve-logging-and-errors.patch
+++ b/patches/server/0786-Improve-logging-and-errors.patch
diff --git a/patches/server/0788-Improve-PortalEvents.patch b/patches/server/0787-Improve-PortalEvents.patch
index d9ad0225b3..d9ad0225b3 100644
--- a/patches/server/0788-Improve-PortalEvents.patch
+++ b/patches/server/0787-Improve-PortalEvents.patch
diff --git a/patches/server/0789-Add-config-option-for-spider-worldborder-climbing.patch b/patches/server/0788-Add-config-option-for-spider-worldborder-climbing.patch
index b10bcacd3c..b10bcacd3c 100644
--- a/patches/server/0789-Add-config-option-for-spider-worldborder-climbing.patch
+++ b/patches/server/0788-Add-config-option-for-spider-worldborder-climbing.patch
diff --git a/patches/server/0790-Add-missing-SpigotConfig-logCommands-check.patch b/patches/server/0789-Add-missing-SpigotConfig-logCommands-check.patch
index a7d5349548..a7d5349548 100644
--- a/patches/server/0790-Add-missing-SpigotConfig-logCommands-check.patch
+++ b/patches/server/0789-Add-missing-SpigotConfig-logCommands-check.patch
diff --git a/patches/server/0791-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch b/patches/server/0790-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch
index 581ad00ec1..581ad00ec1 100644
--- a/patches/server/0791-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch
+++ b/patches/server/0790-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch
diff --git a/patches/server/0792-Flying-Fall-Damage.patch b/patches/server/0791-Flying-Fall-Damage.patch
index 4132811a77..f7fc90f3fd 100644
--- a/patches/server/0792-Flying-Fall-Damage.patch
+++ b/patches/server/0791-Flying-Fall-Damage.patch
@@ -26,7 +26,7 @@ index ad334f149fe1b44d4ebe48489dcd2811ff1b5cd0..950ce40d268d89ff3c503116081db6c9
} 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 682c5e9328d965bf335bb06ac7aedf6d49b1c6cb..4bcceef859099405a3d78bc7e6b12c778e906d72 100644
+index c426dbff75f0ad3889594fba9a66669fc71b63e8..cb191389007ccaae2e3af1defc5e95ee571c46ac 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2581,6 +2581,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0793-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/server/0792-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch
index 1748503da4..1748503da4 100644
--- a/patches/server/0793-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch
+++ b/patches/server/0792-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch
diff --git a/patches/server/0794-config-for-disabling-entity-tag-tags.patch b/patches/server/0793-config-for-disabling-entity-tag-tags.patch
index aabc1e1a31..aabc1e1a31 100644
--- a/patches/server/0794-config-for-disabling-entity-tag-tags.patch
+++ b/patches/server/0793-config-for-disabling-entity-tag-tags.patch
diff --git a/patches/server/0795-Use-single-player-info-update-packet-on-join.patch b/patches/server/0794-Use-single-player-info-update-packet-on-join.patch
index 4552daec45..4552daec45 100644
--- a/patches/server/0795-Use-single-player-info-update-packet-on-join.patch
+++ b/patches/server/0794-Use-single-player-info-update-packet-on-join.patch
diff --git a/patches/server/0796-Correctly-shrink-items-during-EntityResurrectEvent.patch b/patches/server/0795-Correctly-shrink-items-during-EntityResurrectEvent.patch
index 8f9bf2cb24..8f9bf2cb24 100644
--- a/patches/server/0796-Correctly-shrink-items-during-EntityResurrectEvent.patch
+++ b/patches/server/0795-Correctly-shrink-items-during-EntityResurrectEvent.patch
diff --git a/patches/server/0797-Win-Screen-API.patch b/patches/server/0796-Win-Screen-API.patch
index 6c72c065c2..95dd061087 100644
--- a/patches/server/0797-Win-Screen-API.patch
+++ b/patches/server/0796-Win-Screen-API.patch
@@ -7,7 +7,7 @@ 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 4bcceef859099405a3d78bc7e6b12c778e906d72..d0cd2a8c99d607e36d37718b9e2c439f4a939535 100644
+index cb191389007ccaae2e3af1defc5e95ee571c46ac..756ba61af10b552c5c0bf86e506a31df0f0ce6f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1305,6 +1305,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0798-Remove-CraftItemStack-setAmount-null-assignment.patch b/patches/server/0797-Remove-CraftItemStack-setAmount-null-assignment.patch
index ce34d80c3f..ce34d80c3f 100644
--- a/patches/server/0798-Remove-CraftItemStack-setAmount-null-assignment.patch
+++ b/patches/server/0797-Remove-CraftItemStack-setAmount-null-assignment.patch
diff --git a/patches/server/0799-Fix-force-opening-enchantment-tables.patch b/patches/server/0798-Fix-force-opening-enchantment-tables.patch
index db009af8c8..db009af8c8 100644
--- a/patches/server/0799-Fix-force-opening-enchantment-tables.patch
+++ b/patches/server/0798-Fix-force-opening-enchantment-tables.patch
diff --git a/patches/server/0800-Add-Entity-Body-Yaw-API.patch b/patches/server/0799-Add-Entity-Body-Yaw-API.patch
index ec4ca323aa..ec4ca323aa 100644
--- a/patches/server/0800-Add-Entity-Body-Yaw-API.patch
+++ b/patches/server/0799-Add-Entity-Body-Yaw-API.patch
diff --git a/patches/server/0801-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch b/patches/server/0800-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch
index 962917dab8..962917dab8 100644
--- a/patches/server/0801-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch
+++ b/patches/server/0800-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch
diff --git a/patches/server/0802-Add-EntityFertilizeEggEvent.patch b/patches/server/0801-Add-EntityFertilizeEggEvent.patch
index f8723b10b0..f8723b10b0 100644
--- a/patches/server/0802-Add-EntityFertilizeEggEvent.patch
+++ b/patches/server/0801-Add-EntityFertilizeEggEvent.patch
diff --git a/patches/server/0803-Fix-HumanEntity-drop-not-updating-the-client-inv.patch b/patches/server/0802-Fix-HumanEntity-drop-not-updating-the-client-inv.patch
index 99130d8f1a..99130d8f1a 100644
--- a/patches/server/0803-Fix-HumanEntity-drop-not-updating-the-client-inv.patch
+++ b/patches/server/0802-Fix-HumanEntity-drop-not-updating-the-client-inv.patch
diff --git a/patches/server/0804-Add-CompostItemEvent-and-EntityCompostItemEvent.patch b/patches/server/0803-Add-CompostItemEvent-and-EntityCompostItemEvent.patch
index 85321a4a5b..85321a4a5b 100644
--- a/patches/server/0804-Add-CompostItemEvent-and-EntityCompostItemEvent.patch
+++ b/patches/server/0803-Add-CompostItemEvent-and-EntityCompostItemEvent.patch
diff --git a/patches/server/0805-Correctly-handle-ArmorStand-invisibility.patch b/patches/server/0804-Correctly-handle-ArmorStand-invisibility.patch
index 34b66d686a..34b66d686a 100644
--- a/patches/server/0805-Correctly-handle-ArmorStand-invisibility.patch
+++ b/patches/server/0804-Correctly-handle-ArmorStand-invisibility.patch
diff --git a/patches/server/0806-Fix-advancement-triggers-for-entity-damage.patch b/patches/server/0805-Fix-advancement-triggers-for-entity-damage.patch
index 4ebe570740..4ebe570740 100644
--- a/patches/server/0806-Fix-advancement-triggers-for-entity-damage.patch
+++ b/patches/server/0805-Fix-advancement-triggers-for-entity-damage.patch
diff --git a/patches/server/0807-Fix-text-display-error-on-spawn.patch b/patches/server/0806-Fix-text-display-error-on-spawn.patch
index 7f64cfe6d9..7f64cfe6d9 100644
--- a/patches/server/0807-Fix-text-display-error-on-spawn.patch
+++ b/patches/server/0806-Fix-text-display-error-on-spawn.patch
diff --git a/patches/server/0808-Fix-inventories-returning-null-Locations.patch b/patches/server/0807-Fix-inventories-returning-null-Locations.patch
index eabfae28c5..eabfae28c5 100644
--- a/patches/server/0808-Fix-inventories-returning-null-Locations.patch
+++ b/patches/server/0807-Fix-inventories-returning-null-Locations.patch
diff --git a/patches/server/0809-Add-Shearable-API.patch b/patches/server/0808-Add-Shearable-API.patch
index 675a1bf358..675a1bf358 100644
--- a/patches/server/0809-Add-Shearable-API.patch
+++ b/patches/server/0808-Add-Shearable-API.patch
diff --git a/patches/server/0810-Fix-SpawnEggMeta-get-setSpawnedType.patch b/patches/server/0809-Fix-SpawnEggMeta-get-setSpawnedType.patch
index f3afed07e4..f3afed07e4 100644
--- a/patches/server/0810-Fix-SpawnEggMeta-get-setSpawnedType.patch
+++ b/patches/server/0809-Fix-SpawnEggMeta-get-setSpawnedType.patch
diff --git a/patches/server/0811-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch b/patches/server/0810-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch
index d90e599897..d90e599897 100644
--- a/patches/server/0811-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch
+++ b/patches/server/0810-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch
diff --git a/patches/server/0812-Treat-sequence-violations-like-they-should-be.patch b/patches/server/0811-Treat-sequence-violations-like-they-should-be.patch
index 0a8d25783a..0a8d25783a 100644
--- a/patches/server/0812-Treat-sequence-violations-like-they-should-be.patch
+++ b/patches/server/0811-Treat-sequence-violations-like-they-should-be.patch
diff --git a/patches/server/0813-Prevent-causing-expired-keys-from-impacting-new-join.patch b/patches/server/0812-Prevent-causing-expired-keys-from-impacting-new-join.patch
index d08f848c6e..d08f848c6e 100644
--- a/patches/server/0813-Prevent-causing-expired-keys-from-impacting-new-join.patch
+++ b/patches/server/0812-Prevent-causing-expired-keys-from-impacting-new-join.patch
diff --git a/patches/server/0814-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch b/patches/server/0813-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch
index 9f9f6c26b3..b0096b0c97 100644
--- a/patches/server/0814-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch
+++ b/patches/server/0813-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch
@@ -5,7 +5,7 @@ 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 b9d3a98824fc146128f35244f5f15bba97948674..6e9a3b6a1595a1731ca8187d2610c840337a12ed 100644
+index cff225eab588248f1e6487a4a33da006672b3ba4..a27fd023e4f9b6ee113f6b3ed21b4c5aeb7ce15d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1372,6 +1372,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0815-Use-array-for-gamerule-storage.patch b/patches/server/0814-Use-array-for-gamerule-storage.patch
index 194ff8f15b..194ff8f15b 100644
--- a/patches/server/0815-Use-array-for-gamerule-storage.patch
+++ b/patches/server/0814-Use-array-for-gamerule-storage.patch
diff --git a/patches/server/0816-Fix-a-couple-of-upstream-bed-issues.patch b/patches/server/0815-Fix-a-couple-of-upstream-bed-issues.patch
index 665db524c5..665db524c5 100644
--- a/patches/server/0816-Fix-a-couple-of-upstream-bed-issues.patch
+++ b/patches/server/0815-Fix-a-couple-of-upstream-bed-issues.patch
diff --git a/patches/server/0817-Fix-demo-flag-not-enabling-demo-mode.patch b/patches/server/0816-Fix-demo-flag-not-enabling-demo-mode.patch
index d64dd23e37..d64dd23e37 100644
--- a/patches/server/0817-Fix-demo-flag-not-enabling-demo-mode.patch
+++ b/patches/server/0816-Fix-demo-flag-not-enabling-demo-mode.patch
diff --git a/patches/server/0818-Add-Mob-Experience-reward-API.patch b/patches/server/0817-Add-Mob-Experience-reward-API.patch
index f82f765beb..f82f765beb 100644
--- a/patches/server/0818-Add-Mob-Experience-reward-API.patch
+++ b/patches/server/0817-Add-Mob-Experience-reward-API.patch
diff --git a/patches/server/0819-Break-redstone-on-top-of-trap-doors-early.patch b/patches/server/0818-Break-redstone-on-top-of-trap-doors-early.patch
index 11c427e808..11c427e808 100644
--- a/patches/server/0819-Break-redstone-on-top-of-trap-doors-early.patch
+++ b/patches/server/0818-Break-redstone-on-top-of-trap-doors-early.patch
diff --git a/patches/server/0820-Avoid-Lazy-Initialization-for-Enum-Fields.patch b/patches/server/0819-Avoid-Lazy-Initialization-for-Enum-Fields.patch
index becde16ce8..becde16ce8 100644
--- a/patches/server/0820-Avoid-Lazy-Initialization-for-Enum-Fields.patch
+++ b/patches/server/0819-Avoid-Lazy-Initialization-for-Enum-Fields.patch
diff --git a/patches/server/0821-More-accurate-isInOpenWater-impl.patch b/patches/server/0820-More-accurate-isInOpenWater-impl.patch
index 6e110094dd..6e110094dd 100644
--- a/patches/server/0821-More-accurate-isInOpenWater-impl.patch
+++ b/patches/server/0820-More-accurate-isInOpenWater-impl.patch
diff --git a/patches/server/0822-Expand-PlayerItemMendEvent.patch b/patches/server/0821-Expand-PlayerItemMendEvent.patch
index 5cc04e3321..f822118b27 100644
--- a/patches/server/0822-Expand-PlayerItemMendEvent.patch
+++ b/patches/server/0821-Expand-PlayerItemMendEvent.patch
@@ -30,7 +30,7 @@ index a758b2456acac23095fe4619ae10300a034cb460..a58ff67052fb5f33782f8b5c83465ec0
if (l > 0) {
// this.value = l; // CraftBukkit - update exp value of orb for PlayerItemMendEvent calls // Paper - the value field should not be mutated here because it doesn't take "count" into account
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index d0cd2a8c99d607e36d37718b9e2c439f4a939535..7cd9b17e1863a369b578bc2a22d892246e7a02b9 100644
+index 756ba61af10b552c5c0bf86e506a31df0f0ce6f5..b3faca24fa8bdb22d1bf3e581d0396bc444a9f5f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1853,11 +1853,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0823-Refresh-ProjectileSource-for-projectiles.patch b/patches/server/0822-Refresh-ProjectileSource-for-projectiles.patch
index 7388f355f9..7388f355f9 100644
--- a/patches/server/0823-Refresh-ProjectileSource-for-projectiles.patch
+++ b/patches/server/0822-Refresh-ProjectileSource-for-projectiles.patch
diff --git a/patches/server/0824-Add-transient-modifier-API.patch b/patches/server/0823-Add-transient-modifier-API.patch
index 36cc0a030a..36cc0a030a 100644
--- a/patches/server/0824-Add-transient-modifier-API.patch
+++ b/patches/server/0823-Add-transient-modifier-API.patch
diff --git a/patches/server/0825-Fix-block-place-logic.patch b/patches/server/0824-Fix-block-place-logic.patch
index 3796cc773d..3796cc773d 100644
--- a/patches/server/0825-Fix-block-place-logic.patch
+++ b/patches/server/0824-Fix-block-place-logic.patch
diff --git a/patches/server/0826-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch b/patches/server/0825-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch
index 89ec0d95ff..89ec0d95ff 100644
--- a/patches/server/0826-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch
+++ b/patches/server/0825-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch
diff --git a/patches/server/0827-Call-BlockGrowEvent-for-missing-blocks.patch b/patches/server/0826-Call-BlockGrowEvent-for-missing-blocks.patch
index 895a528de8..895a528de8 100644
--- a/patches/server/0827-Call-BlockGrowEvent-for-missing-blocks.patch
+++ b/patches/server/0826-Call-BlockGrowEvent-for-missing-blocks.patch
diff --git a/patches/server/0828-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch b/patches/server/0827-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch
index 5c55e8560a..5c55e8560a 100644
--- a/patches/server/0828-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch
+++ b/patches/server/0827-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch
diff --git a/patches/server/0829-fix-MapLike-spam-for-missing-key-selector.patch b/patches/server/0828-fix-MapLike-spam-for-missing-key-selector.patch
index 2bd3b889f1..2bd3b889f1 100644
--- a/patches/server/0829-fix-MapLike-spam-for-missing-key-selector.patch
+++ b/patches/server/0828-fix-MapLike-spam-for-missing-key-selector.patch
diff --git a/patches/server/0830-Fix-sniffer-removeExploredLocation.patch b/patches/server/0829-Fix-sniffer-removeExploredLocation.patch
index e8b1703090..e8b1703090 100644
--- a/patches/server/0830-Fix-sniffer-removeExploredLocation.patch
+++ b/patches/server/0829-Fix-sniffer-removeExploredLocation.patch
diff --git a/patches/server/0831-Add-method-to-remove-all-active-potion-effects.patch b/patches/server/0830-Add-method-to-remove-all-active-potion-effects.patch
index eb810dfef5..eb810dfef5 100644
--- a/patches/server/0831-Add-method-to-remove-all-active-potion-effects.patch
+++ b/patches/server/0830-Add-method-to-remove-all-active-potion-effects.patch
diff --git a/patches/server/0832-Fix-incorrect-crafting-result-amount-for-fireworks.patch b/patches/server/0831-Fix-incorrect-crafting-result-amount-for-fireworks.patch
index ed5525cfda..ed5525cfda 100644
--- a/patches/server/0832-Fix-incorrect-crafting-result-amount-for-fireworks.patch
+++ b/patches/server/0831-Fix-incorrect-crafting-result-amount-for-fireworks.patch
diff --git a/patches/server/0833-Add-event-for-player-editing-sign.patch b/patches/server/0832-Add-event-for-player-editing-sign.patch
index 231c6c0fc3..231c6c0fc3 100644
--- a/patches/server/0833-Add-event-for-player-editing-sign.patch
+++ b/patches/server/0832-Add-event-for-player-editing-sign.patch
diff --git a/patches/server/0834-Only-tick-item-frames-if-players-can-see-it.patch b/patches/server/0833-Only-tick-item-frames-if-players-can-see-it.patch
index bf73ba4a5c..bf73ba4a5c 100644
--- a/patches/server/0834-Only-tick-item-frames-if-players-can-see-it.patch
+++ b/patches/server/0833-Only-tick-item-frames-if-players-can-see-it.patch
diff --git a/patches/server/0835-Fix-cmd-permission-levels-for-command-blocks.patch b/patches/server/0834-Fix-cmd-permission-levels-for-command-blocks.patch
index 5167eee08c..5167eee08c 100644
--- a/patches/server/0835-Fix-cmd-permission-levels-for-command-blocks.patch
+++ b/patches/server/0834-Fix-cmd-permission-levels-for-command-blocks.patch
diff --git a/patches/server/0836-Add-option-to-disable-block-updates.patch b/patches/server/0835-Add-option-to-disable-block-updates.patch
index 8fe599472e..8fe599472e 100644
--- a/patches/server/0836-Add-option-to-disable-block-updates.patch
+++ b/patches/server/0835-Add-option-to-disable-block-updates.patch
diff --git a/patches/server/0837-Call-missing-BlockDispenseEvent.patch b/patches/server/0836-Call-missing-BlockDispenseEvent.patch
index e4be646fe3..e4be646fe3 100644
--- a/patches/server/0837-Call-missing-BlockDispenseEvent.patch
+++ b/patches/server/0836-Call-missing-BlockDispenseEvent.patch
diff --git a/patches/server/0838-Don-t-load-chunks-for-supporting-block-checks.patch b/patches/server/0837-Don-t-load-chunks-for-supporting-block-checks.patch
index 4d234a8fb3..4d234a8fb3 100644
--- a/patches/server/0838-Don-t-load-chunks-for-supporting-block-checks.patch
+++ b/patches/server/0837-Don-t-load-chunks-for-supporting-block-checks.patch
diff --git a/patches/server/0839-Optimize-player-lookups-for-beacons.patch b/patches/server/0838-Optimize-player-lookups-for-beacons.patch
index 1c203c23a6..1c203c23a6 100644
--- a/patches/server/0839-Optimize-player-lookups-for-beacons.patch
+++ b/patches/server/0838-Optimize-player-lookups-for-beacons.patch
diff --git a/patches/server/0840-Add-Sign-getInteractableSideFor.patch b/patches/server/0839-Add-Sign-getInteractableSideFor.patch
index 2833829ce4..2833829ce4 100644
--- a/patches/server/0840-Add-Sign-getInteractableSideFor.patch
+++ b/patches/server/0839-Add-Sign-getInteractableSideFor.patch
diff --git a/patches/server/0841-fix-item-meta-for-tadpole-buckets.patch b/patches/server/0840-fix-item-meta-for-tadpole-buckets.patch
index 0fc39b3ea1..0fc39b3ea1 100644
--- a/patches/server/0841-fix-item-meta-for-tadpole-buckets.patch
+++ b/patches/server/0840-fix-item-meta-for-tadpole-buckets.patch
diff --git a/patches/server/0842-Fix-BanList-API.patch b/patches/server/0841-Fix-BanList-API.patch
index 995aa9c90a..780f2ca5be 100644
--- a/patches/server/0842-Fix-BanList-API.patch
+++ b/patches/server/0841-Fix-BanList-API.patch
@@ -208,7 +208,7 @@ 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 7cd9b17e1863a369b578bc2a22d892246e7a02b9..49e22acbcdcdb2108b360c2a6e40c752c12ab9f6 100644
+index b3faca24fa8bdb22d1bf3e581d0396bc444a9f5f..28536a8bfab2c8bdde03852efa0e41cf19a37a9c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1747,23 +1747,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0843-Determine-lava-and-water-fluid-explosion-resistance-.patch b/patches/server/0842-Determine-lava-and-water-fluid-explosion-resistance-.patch
index 5f51eb317c..5f51eb317c 100644
--- a/patches/server/0843-Determine-lava-and-water-fluid-explosion-resistance-.patch
+++ b/patches/server/0842-Determine-lava-and-water-fluid-explosion-resistance-.patch
diff --git a/patches/server/0844-Fix-possible-NPE-on-painting-creation.patch b/patches/server/0843-Fix-possible-NPE-on-painting-creation.patch
index dc3838be94..dc3838be94 100644
--- a/patches/server/0844-Fix-possible-NPE-on-painting-creation.patch
+++ b/patches/server/0843-Fix-possible-NPE-on-painting-creation.patch
diff --git a/patches/server/0845-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch b/patches/server/0844-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
index 6785f755ab..6785f755ab 100644
--- a/patches/server/0845-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
+++ b/patches/server/0844-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
diff --git a/patches/server/0846-ExperienceOrb-should-call-EntitySpawnEvent.patch b/patches/server/0845-ExperienceOrb-should-call-EntitySpawnEvent.patch
index e3ebc75918..e3ebc75918 100644
--- a/patches/server/0846-ExperienceOrb-should-call-EntitySpawnEvent.patch
+++ b/patches/server/0845-ExperienceOrb-should-call-EntitySpawnEvent.patch
diff --git a/patches/server/0847-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch b/patches/server/0846-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch
index 301b345fb9..301b345fb9 100644
--- a/patches/server/0847-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch
+++ b/patches/server/0846-Make-Amethyst-throw-both-Spread-and-Grow-Events.patch
diff --git a/patches/server/0848-Add-whitelist-events.patch b/patches/server/0847-Add-whitelist-events.patch
index 96884032fb..96884032fb 100644
--- a/patches/server/0848-Add-whitelist-events.patch
+++ b/patches/server/0847-Add-whitelist-events.patch
diff --git a/patches/server/0849-Implement-PlayerFailMoveEvent.patch b/patches/server/0848-Implement-PlayerFailMoveEvent.patch
index e222dfa6e2..e222dfa6e2 100644
--- a/patches/server/0849-Implement-PlayerFailMoveEvent.patch
+++ b/patches/server/0848-Implement-PlayerFailMoveEvent.patch
diff --git a/patches/server/0850-Folia-scheduler-and-owned-region-API.patch b/patches/server/0849-Folia-scheduler-and-owned-region-API.patch
index 02f361a409..6657e8e33f 100644
--- a/patches/server/0850-Folia-scheduler-and-owned-region-API.patch
+++ b/patches/server/0849-Folia-scheduler-and-owned-region-API.patch
@@ -45,14 +45,14 @@ index d2dee700f2c5cc7d6a272e751a933901fe7a55b6..834b85f24df023642f8abf7213fe578a
} catch (Throwable ex) {
diff --git a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
new file mode 100644
-index 0000000000000000000000000000000000000000..62484ebf4550b05182f693a3180bbac5d5fd906d
+index 0000000000000000000000000000000000000000..c03608fec96b51e1867f43d8f42e5aefb1520e46
--- /dev/null
+++ b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
@@ -0,0 +1,181 @@
+package io.papermc.paper.threadedregions;
+
+import ca.spottedleaf.concurrentutil.util.Validate;
-+import io.papermc.paper.util.TickThread;
++import ca.spottedleaf.moonrise.common.util.TickThread;
+import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
+import net.minecraft.world.entity.Entity;
+import org.bukkit.craftbukkit.entity.CraftEntity;
@@ -1148,10 +1148,10 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 374c20e530d2abd41674d80c711bd3737c6f6941..cbceb0ddea32781f89a19b1edb258bc23b96ee92 100644
+index a72b278826be1d0da79ca619ea9a9a437fa9c54b..2dfa9c4c0c2ef489649944eed89d8c77c482b92f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1579,6 +1579,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1578,6 +1578,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
@@ -1251,7 +1251,7 @@ index 1d5d477b0b689167742c2f2edff263be40a991c8..aebe9cb97776bb833221a0f11285696c
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 7197cbf15ff9382cbc59c4a58e2f189c8cacbaaa..24097256203990a818aab2716fdb8a4a672a1daa 100644
+index 7197cbf15ff9382cbc59c4a58e2f189c8cacbaaa..6d373fb254225aa92a10181d8dd21e2dd7fb063a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -310,6 +310,76 @@ public final class CraftServer implements Server {
@@ -1280,14 +1280,14 @@ index 7197cbf15ff9382cbc59c4a58e2f189c8cacbaaa..24097256203990a818aab2716fdb8a4a
+
+ @Override
+ public final boolean isOwnedByCurrentRegion(World world, io.papermc.paper.math.Position position) {
-+ return io.papermc.paper.util.TickThread.isTickThreadFor(
++ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(
+ ((CraftWorld) world).getHandle(), position.blockX() >> 4, position.blockZ() >> 4
+ );
+ }
+
+ @Override
+ public final boolean isOwnedByCurrentRegion(World world, io.papermc.paper.math.Position position, int squareRadiusChunks) {
-+ return io.papermc.paper.util.TickThread.isTickThreadFor(
++ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(
+ ((CraftWorld) world).getHandle(), position.blockX() >> 4, position.blockZ() >> 4, squareRadiusChunks
+ );
+ }
@@ -1295,7 +1295,7 @@ index 7197cbf15ff9382cbc59c4a58e2f189c8cacbaaa..24097256203990a818aab2716fdb8a4a
+ @Override
+ public final boolean isOwnedByCurrentRegion(Location location) {
+ World world = location.getWorld();
-+ return io.papermc.paper.util.TickThread.isTickThreadFor(
++ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(
+ ((CraftWorld) world).getHandle(), location.getBlockX() >> 4, location.getBlockZ() >> 4
+ );
+ }
@@ -1303,28 +1303,28 @@ index 7197cbf15ff9382cbc59c4a58e2f189c8cacbaaa..24097256203990a818aab2716fdb8a4a
+ @Override
+ public final boolean isOwnedByCurrentRegion(Location location, int squareRadiusChunks) {
+ World world = location.getWorld();
-+ return io.papermc.paper.util.TickThread.isTickThreadFor(
++ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(
+ ((CraftWorld) world).getHandle(), location.getBlockX() >> 4, location.getBlockZ() >> 4, squareRadiusChunks
+ );
+ }
+
+ @Override
+ public final boolean isOwnedByCurrentRegion(World world, int chunkX, int chunkZ) {
-+ return io.papermc.paper.util.TickThread.isTickThreadFor(
++ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(
+ ((CraftWorld) world).getHandle(), chunkX, chunkZ
+ );
+ }
+
+ @Override
+ public final boolean isOwnedByCurrentRegion(World world, int chunkX, int chunkZ, int squareRadiusChunks) {
-+ return io.papermc.paper.util.TickThread.isTickThreadFor(
++ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(
+ ((CraftWorld) world).getHandle(), chunkX, chunkZ, squareRadiusChunks
+ );
+ }
+
+ @Override
+ public final boolean isOwnedByCurrentRegion(Entity entity) {
-+ return io.papermc.paper.util.TickThread.isTickThreadFor(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandleRaw());
++ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandleRaw());
+ }
+ // Paper end - Folia reagion threading API
+
diff --git a/patches/server/0851-Only-erase-allay-memory-on-non-item-targets.patch b/patches/server/0850-Only-erase-allay-memory-on-non-item-targets.patch
index 4afac36fc3..4afac36fc3 100644
--- a/patches/server/0851-Only-erase-allay-memory-on-non-item-targets.patch
+++ b/patches/server/0850-Only-erase-allay-memory-on-non-item-targets.patch
diff --git a/patches/server/0852-API-for-updating-recipes-on-clients.patch b/patches/server/0851-API-for-updating-recipes-on-clients.patch
index 5c29dfb157..6ffb4d4c04 100644
--- a/patches/server/0852-API-for-updating-recipes-on-clients.patch
+++ b/patches/server/0851-API-for-updating-recipes-on-clients.patch
@@ -39,7 +39,7 @@ index de96d7df65713f2fa7b8f2dd068856bb5fa45a45..be6bf7afa3cea4ed48f363e89ccd0790
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 24097256203990a818aab2716fdb8a4a672a1daa..5400493e48b508310adfb51c23b63ff53aeda49f 100644
+index 6d373fb254225aa92a10181d8dd21e2dd7fb063a..71d335984d845c95acf5772e8ae773899a429e84 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1165,6 +1165,18 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0853-Fix-rotation-when-spawning-display-entities.patch b/patches/server/0852-Fix-rotation-when-spawning-display-entities.patch
index 7491ff60fe..7491ff60fe 100644
--- a/patches/server/0853-Fix-rotation-when-spawning-display-entities.patch
+++ b/patches/server/0852-Fix-rotation-when-spawning-display-entities.patch
diff --git a/patches/server/0854-Only-capture-actual-tree-growth.patch b/patches/server/0853-Only-capture-actual-tree-growth.patch
index 74ca9ab6b6..74ca9ab6b6 100644
--- a/patches/server/0854-Only-capture-actual-tree-growth.patch
+++ b/patches/server/0853-Only-capture-actual-tree-growth.patch
diff --git a/patches/server/0855-Use-correct-source-for-mushroom-block-spread-event.patch b/patches/server/0854-Use-correct-source-for-mushroom-block-spread-event.patch
index a295e29bcb..a295e29bcb 100644
--- a/patches/server/0855-Use-correct-source-for-mushroom-block-spread-event.patch
+++ b/patches/server/0854-Use-correct-source-for-mushroom-block-spread-event.patch
diff --git a/patches/server/0856-Respect-randomizeData-on-more-entities-when-spawning.patch b/patches/server/0855-Respect-randomizeData-on-more-entities-when-spawning.patch
index d04e8bf4f6..d04e8bf4f6 100644
--- a/patches/server/0856-Respect-randomizeData-on-more-entities-when-spawning.patch
+++ b/patches/server/0855-Respect-randomizeData-on-more-entities-when-spawning.patch
diff --git a/patches/server/0857-Use-correct-seed-on-api-world-load.patch b/patches/server/0856-Use-correct-seed-on-api-world-load.patch
index f29dbe4467..6c4ddae940 100644
--- a/patches/server/0857-Use-correct-seed-on-api-world-load.patch
+++ b/patches/server/0856-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 5400493e48b508310adfb51c23b63ff53aeda49f..2e0c07ab0f89043a97bcb15b6c507f6c052d2a4e 100644
+index 71d335984d845c95acf5772e8ae773899a429e84..67a199f022bc9387f7fd69889efec5bad2ed0a5f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1387,7 +1387,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0858-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch b/patches/server/0857-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch
index 2f19c9d94a..2f19c9d94a 100644
--- a/patches/server/0858-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch
+++ b/patches/server/0857-Remove-UpgradeData-neighbour-ticks-outside-of-range.patch
diff --git a/patches/server/0859-Cache-map-ids-on-item-frames.patch b/patches/server/0858-Cache-map-ids-on-item-frames.patch
index 65e3e3499f..65e3e3499f 100644
--- a/patches/server/0859-Cache-map-ids-on-item-frames.patch
+++ b/patches/server/0858-Cache-map-ids-on-item-frames.patch
diff --git a/patches/server/0860-Fix-custom-statistic-criteria-creation.patch b/patches/server/0859-Fix-custom-statistic-criteria-creation.patch
index 23faf0bb9f..23faf0bb9f 100644
--- a/patches/server/0860-Fix-custom-statistic-criteria-creation.patch
+++ b/patches/server/0859-Fix-custom-statistic-criteria-creation.patch
diff --git a/patches/server/0861-Bandaid-fix-for-Effect.patch b/patches/server/0860-Bandaid-fix-for-Effect.patch
index bc688c91d4..37c8fc587f 100644
--- a/patches/server/0861-Bandaid-fix-for-Effect.patch
+++ b/patches/server/0860-Bandaid-fix-for-Effect.patch
@@ -68,7 +68,7 @@ index 71733f918ed84b9879ac1b142ef6205c5e768a9c..c856384019eff2f2d0bb831ebe1ccb0f
break;
case BONE_MEAL_USE:
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 1ef380cbd77132b743520f952afa8321042bec6d..7fe43ac849d3ee80c447e8c024ea39fd338d616f 100644
+index 0c5a583f2ced1ae5e1e92a045ef2ef1cd5b35496..5c83ca573ccaa75a1d4e8129c96a24e3cf0f3266 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1360,7 +1360,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -81,7 +81,7 @@ index 1ef380cbd77132b743520f952afa8321042bec6d..7fe43ac849d3ee80c447e8c024ea39fd
// 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 49e22acbcdcdb2108b360c2a6e40c752c12ab9f6..4c5249eab8e59b46c902f2cb65f90aa2a66a33d4 100644
+index 28536a8bfab2c8bdde03852efa0e41cf19a37a9c..cb41fad4b94c4da64a699dc1b0848fc08ff2c456 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -917,7 +917,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0862-SculkCatalyst-bloom-API.patch b/patches/server/0861-SculkCatalyst-bloom-API.patch
index ba050f6086..ba050f6086 100644
--- a/patches/server/0862-SculkCatalyst-bloom-API.patch
+++ b/patches/server/0861-SculkCatalyst-bloom-API.patch
diff --git a/patches/server/0863-API-for-an-entity-s-scoreboard-name.patch b/patches/server/0862-API-for-an-entity-s-scoreboard-name.patch
index a7d3664dd4..a7d3664dd4 100644
--- a/patches/server/0863-API-for-an-entity-s-scoreboard-name.patch
+++ b/patches/server/0862-API-for-an-entity-s-scoreboard-name.patch
diff --git a/patches/server/0864-Deprecate-and-replace-methods-with-old-StructureType.patch b/patches/server/0863-Deprecate-and-replace-methods-with-old-StructureType.patch
index 7eeb4db8f2..aba2d09d90 100644
--- a/patches/server/0864-Deprecate-and-replace-methods-with-old-StructureType.patch
+++ b/patches/server/0863-Deprecate-and-replace-methods-with-old-StructureType.patch
@@ -5,7 +5,7 @@ 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 2e0c07ab0f89043a97bcb15b6c507f6c052d2a4e..56f9b69b5a30c4ee5bcbcb8ae33e26f75b477475 100644
+index 67a199f022bc9387f7fd69889efec5bad2ed0a5f..3ca0d01d4d55d0919624356751144985587ddc25 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1992,6 +1992,11 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0865-Don-t-tab-complete-namespaced-commands-if-send-names.patch b/patches/server/0864-Don-t-tab-complete-namespaced-commands-if-send-names.patch
index 200d3d6a57..200d3d6a57 100644
--- a/patches/server/0865-Don-t-tab-complete-namespaced-commands-if-send-names.patch
+++ b/patches/server/0864-Don-t-tab-complete-namespaced-commands-if-send-names.patch
diff --git a/patches/server/0866-Properly-handle-BlockBreakEvent-isDropItems.patch b/patches/server/0865-Properly-handle-BlockBreakEvent-isDropItems.patch
index 75a746ca81..75a746ca81 100644
--- a/patches/server/0866-Properly-handle-BlockBreakEvent-isDropItems.patch
+++ b/patches/server/0865-Properly-handle-BlockBreakEvent-isDropItems.patch
diff --git a/patches/server/0867-Fire-entity-death-event-for-ender-dragon.patch b/patches/server/0866-Fire-entity-death-event-for-ender-dragon.patch
index 7f6054281d..7f6054281d 100644
--- a/patches/server/0867-Fire-entity-death-event-for-ender-dragon.patch
+++ b/patches/server/0866-Fire-entity-death-event-for-ender-dragon.patch
diff --git a/patches/server/0868-Configurable-entity-tracking-range-by-Y-coordinate.patch b/patches/server/0867-Configurable-entity-tracking-range-by-Y-coordinate.patch
index 8cb5db78e2..b9f6c1d957 100644
--- a/patches/server/0868-Configurable-entity-tracking-range-by-Y-coordinate.patch
+++ b/patches/server/0867-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 91ca37605bf7ba65875b588fe9764b30214f63b6..2943390c0ec7e542d2bb1996dbbd626445c3108e 100644
+index cc7c284079af5ec4fd7085e87a7de47aacda587d..a179fef4a020b66224984e3bf5b4b5255274103c 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1566,6 +1566,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1530,6 +1530,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/0869-Add-Listing-API-for-Player.patch b/patches/server/0868-Add-Listing-API-for-Player.patch
index 8f4e9c9d40..bb270bf016 100644
--- a/patches/server/0869-Add-Listing-API-for-Player.patch
+++ b/patches/server/0868-Add-Listing-API-for-Player.patch
@@ -119,7 +119,7 @@ index be6bf7afa3cea4ed48f363e89ccd079062edc8d9..9b1a6d8351fb473eec75a2fd08fb892b
// 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 4c5249eab8e59b46c902f2cb65f90aa2a66a33d4..204e4e4dd197088457cd6d2a18f86287ca3324b2 100644
+index cb41fad4b94c4da64a699dc1b0848fc08ff2c456..c80cbc9dece765091b2ad9281bdc061df8b491dc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -201,6 +201,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0870-Configurable-Region-Compression-Format.patch b/patches/server/0869-Configurable-Region-Compression-Format.patch
index 64a52a4ea2..64a52a4ea2 100644
--- a/patches/server/0870-Configurable-Region-Compression-Format.patch
+++ b/patches/server/0869-Configurable-Region-Compression-Format.patch
diff --git a/patches/server/0871-Add-BlockFace-to-BlockDamageEvent.patch b/patches/server/0870-Add-BlockFace-to-BlockDamageEvent.patch
index 7721e78d75..7721e78d75 100644
--- a/patches/server/0871-Add-BlockFace-to-BlockDamageEvent.patch
+++ b/patches/server/0870-Add-BlockFace-to-BlockDamageEvent.patch
diff --git a/patches/server/0872-Fix-NPE-on-Boat-getStatus.patch b/patches/server/0871-Fix-NPE-on-Boat-getStatus.patch
index 70323a4352..70323a4352 100644
--- a/patches/server/0872-Fix-NPE-on-Boat-getStatus.patch
+++ b/patches/server/0871-Fix-NPE-on-Boat-getStatus.patch
diff --git a/patches/server/0873-Expand-Pose-API.patch b/patches/server/0872-Expand-Pose-API.patch
index b1ad16fc18..b1ad16fc18 100644
--- a/patches/server/0873-Expand-Pose-API.patch
+++ b/patches/server/0872-Expand-Pose-API.patch
diff --git a/patches/server/0874-More-DragonBattle-API.patch b/patches/server/0873-More-DragonBattle-API.patch
index a6e0c111c0..a6e0c111c0 100644
--- a/patches/server/0874-More-DragonBattle-API.patch
+++ b/patches/server/0873-More-DragonBattle-API.patch
diff --git a/patches/server/0875-Add-PlayerPickItemEvent.patch b/patches/server/0874-Add-PlayerPickItemEvent.patch
index b9ddd8ed60..b9ddd8ed60 100644
--- a/patches/server/0875-Add-PlayerPickItemEvent.patch
+++ b/patches/server/0874-Add-PlayerPickItemEvent.patch
diff --git a/patches/server/0876-Allow-trident-custom-damage.patch b/patches/server/0875-Allow-trident-custom-damage.patch
index 95137bd7d5..95137bd7d5 100644
--- a/patches/server/0876-Allow-trident-custom-damage.patch
+++ b/patches/server/0875-Allow-trident-custom-damage.patch
diff --git a/patches/server/0877-Expose-hand-in-BlockCanBuildEvent.patch b/patches/server/0876-Expose-hand-in-BlockCanBuildEvent.patch
index 4abc7e9fc5..4abc7e9fc5 100644
--- a/patches/server/0877-Expose-hand-in-BlockCanBuildEvent.patch
+++ b/patches/server/0876-Expose-hand-in-BlockCanBuildEvent.patch
diff --git a/patches/server/0878-Optimize-nearest-structure-border-iteration.patch b/patches/server/0877-Optimize-nearest-structure-border-iteration.patch
index df5f60c52c..df5f60c52c 100644
--- a/patches/server/0878-Optimize-nearest-structure-border-iteration.patch
+++ b/patches/server/0877-Optimize-nearest-structure-border-iteration.patch
diff --git a/patches/server/0879-Implement-OfflinePlayer-isConnected.patch b/patches/server/0878-Implement-OfflinePlayer-isConnected.patch
index b56ab203ed..2d00249134 100644
--- a/patches/server/0879-Implement-OfflinePlayer-isConnected.patch
+++ b/patches/server/0878-Implement-OfflinePlayer-isConnected.patch
@@ -23,7 +23,7 @@ index 4d654c4f0b6210a9841427789ba70ce5d1d308be..9d93130f23addb18b97d7f5ec013faef
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 204e4e4dd197088457cd6d2a18f86287ca3324b2..ea742de14280c64f94461ebfb4647536a1dddb4f 100644
+index c80cbc9dece765091b2ad9281bdc061df8b491dc..a996f721fa0794a4551ff1e99ea1b66a723bfaff 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -256,6 +256,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0880-Fix-inventory-desync.patch b/patches/server/0879-Fix-inventory-desync.patch
index faa218a853..dbce7345ef 100644
--- a/patches/server/0880-Fix-inventory-desync.patch
+++ b/patches/server/0879-Fix-inventory-desync.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix inventory desync
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index ccb4cbb28fc9c565571e1f9da2bf459cec25d36c..b5035cc4b5cfa246487dc5091cc5d43e04253d6d 100644
+index a755d5d8e435e6545ca433ce5c7ea818d5cd6a28..2ba005b04577d424128c60bb77ce07fa63b40251 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -402,6 +402,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -399,6 +399,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
// Use method to resend items in hands in case of client desync, because the item use got cancelled.
// For example, when cancelling the leash event
diff --git a/patches/server/0881-Add-titleOverride-to-InventoryOpenEvent.patch b/patches/server/0880-Add-titleOverride-to-InventoryOpenEvent.patch
index c8738e3bfc..ba8d018f54 100644
--- a/patches/server/0881-Add-titleOverride-to-InventoryOpenEvent.patch
+++ b/patches/server/0880-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 b5035cc4b5cfa246487dc5091cc5d43e04253d6d..f568fa18ddcb1a1cd060c469edd6db45431bb53c 100644
+index 2ba005b04577d424128c60bb77ce07fa63b40251..2f880e10c73b48c4989c7623ea6cf368f4afb53a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1659,12 +1659,17 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1656,12 +1656,17 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.nextContainerCounter();
AbstractContainerMenu container = factory.createMenu(this.containerCounter, this.getInventory(), this);
@@ -27,7 +27,7 @@ index b5035cc4b5cfa246487dc5091cc5d43e04253d6d..f568fa18ddcb1a1cd060c469edd6db45
if (container == null && !cancelled) { // Let pre-cancelled events fall through
// SPIGOT-5263 - close chest if cancelled
if (factory instanceof Container) {
-@@ -1686,7 +1691,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -1683,7 +1688,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
} else {
// CraftBukkit start
this.containerMenu = container;
diff --git a/patches/server/0882-Configure-sniffer-egg-hatch-time.patch b/patches/server/0881-Configure-sniffer-egg-hatch-time.patch
index 7def55b1f7..7def55b1f7 100644
--- a/patches/server/0882-Configure-sniffer-egg-hatch-time.patch
+++ b/patches/server/0881-Configure-sniffer-egg-hatch-time.patch
diff --git a/patches/server/0883-Do-crystal-portal-proximity-check-before-entity-look.patch b/patches/server/0882-Do-crystal-portal-proximity-check-before-entity-look.patch
index 67d506a715..67d506a715 100644
--- a/patches/server/0883-Do-crystal-portal-proximity-check-before-entity-look.patch
+++ b/patches/server/0882-Do-crystal-portal-proximity-check-before-entity-look.patch
diff --git a/patches/server/0884-Skip-POI-finding-if-stuck-in-vehicle.patch b/patches/server/0883-Skip-POI-finding-if-stuck-in-vehicle.patch
index a4dcac44ac..a4dcac44ac 100644
--- a/patches/server/0884-Skip-POI-finding-if-stuck-in-vehicle.patch
+++ b/patches/server/0883-Skip-POI-finding-if-stuck-in-vehicle.patch
diff --git a/patches/server/0885-Add-slot-sanity-checks-in-container-clicks.patch b/patches/server/0884-Add-slot-sanity-checks-in-container-clicks.patch
index 00c27f3999..00c27f3999 100644
--- a/patches/server/0885-Add-slot-sanity-checks-in-container-clicks.patch
+++ b/patches/server/0884-Add-slot-sanity-checks-in-container-clicks.patch
diff --git a/patches/server/0886-Call-BlockRedstoneEvents-for-lecterns.patch b/patches/server/0885-Call-BlockRedstoneEvents-for-lecterns.patch
index b2cf0ce209..b2cf0ce209 100644
--- a/patches/server/0886-Call-BlockRedstoneEvents-for-lecterns.patch
+++ b/patches/server/0885-Call-BlockRedstoneEvents-for-lecterns.patch
diff --git a/patches/server/0887-Allow-proper-checking-of-empty-item-stacks.patch b/patches/server/0886-Allow-proper-checking-of-empty-item-stacks.patch
index f6dbcfa46d..f6dbcfa46d 100644
--- a/patches/server/0887-Allow-proper-checking-of-empty-item-stacks.patch
+++ b/patches/server/0886-Allow-proper-checking-of-empty-item-stacks.patch
diff --git a/patches/server/0888-Fix-silent-equipment-change-for-mobs.patch b/patches/server/0887-Fix-silent-equipment-change-for-mobs.patch
index edc3ea39f0..edc3ea39f0 100644
--- a/patches/server/0888-Fix-silent-equipment-change-for-mobs.patch
+++ b/patches/server/0887-Fix-silent-equipment-change-for-mobs.patch
diff --git a/patches/server/0889-Fix-spigot-s-Forced-Stats.patch b/patches/server/0888-Fix-spigot-s-Forced-Stats.patch
index 554f1f8844..554f1f8844 100644
--- a/patches/server/0889-Fix-spigot-s-Forced-Stats.patch
+++ b/patches/server/0888-Fix-spigot-s-Forced-Stats.patch
diff --git a/patches/server/0890-Add-missing-InventoryHolders-to-inventories.patch b/patches/server/0889-Add-missing-InventoryHolders-to-inventories.patch
index ae956d4693..ae956d4693 100644
--- a/patches/server/0890-Add-missing-InventoryHolders-to-inventories.patch
+++ b/patches/server/0889-Add-missing-InventoryHolders-to-inventories.patch
diff --git a/patches/server/0891-Do-not-read-tile-entities-in-chunks-that-are-positio.patch b/patches/server/0890-Do-not-read-tile-entities-in-chunks-that-are-positio.patch
index ab4d61b97a..ab4d61b97a 100644
--- a/patches/server/0891-Do-not-read-tile-entities-in-chunks-that-are-positio.patch
+++ b/patches/server/0890-Do-not-read-tile-entities-in-chunks-that-are-positio.patch
diff --git a/patches/server/0892-Add-missing-logs-for-log-ips-config-option.patch b/patches/server/0891-Add-missing-logs-for-log-ips-config-option.patch
index 2898d66615..2898d66615 100644
--- a/patches/server/0892-Add-missing-logs-for-log-ips-config-option.patch
+++ b/patches/server/0891-Add-missing-logs-for-log-ips-config-option.patch
diff --git a/patches/server/0893-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch b/patches/server/0892-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch
index e1f2934daa..e1f2934daa 100644
--- a/patches/server/0893-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch
+++ b/patches/server/0892-Fix-race-condition-on-UpgradeData.BlockFixers-class-.patch
diff --git a/patches/server/0894-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch b/patches/server/0893-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch
index 7ccf4c0f03..7ccf4c0f03 100644
--- a/patches/server/0894-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch
+++ b/patches/server/0893-Fix-NPE-in-AdvancementProgress-getDateAwarded.patch
diff --git a/patches/server/0895-Fix-team-sidebar-objectives-not-being-cleared.patch b/patches/server/0894-Fix-team-sidebar-objectives-not-being-cleared.patch
index 88a39d0b20..88a39d0b20 100644
--- a/patches/server/0895-Fix-team-sidebar-objectives-not-being-cleared.patch
+++ b/patches/server/0894-Fix-team-sidebar-objectives-not-being-cleared.patch
diff --git a/patches/server/0896-Fix-missing-map-initialize-event-call.patch b/patches/server/0895-Fix-missing-map-initialize-event-call.patch
index 214c9bce18..1ee21864ad 100644
--- a/patches/server/0896-Fix-missing-map-initialize-event-call.patch
+++ b/patches/server/0895-Fix-missing-map-initialize-event-call.patch
@@ -7,7 +7,7 @@ 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 6e9a3b6a1595a1731ca8187d2610c840337a12ed..8b5eabea1a0926c22b58ef8761caee3a06aa5ee0 100644
+index a27fd023e4f9b6ee113f6b3ed21b4c5aeb7ce15d..c5e404dcdab14dc0b972aa3286b05e21d9ea67e0 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1662,13 +1662,24 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0897-Update-entity-data-when-attaching-firework-to-entity.patch b/patches/server/0896-Update-entity-data-when-attaching-firework-to-entity.patch
index f2c094976f..f2c094976f 100644
--- a/patches/server/0897-Update-entity-data-when-attaching-firework-to-entity.patch
+++ b/patches/server/0896-Update-entity-data-when-attaching-firework-to-entity.patch
diff --git a/patches/server/0898-Fix-UnsafeValues-loadAdvancement.patch b/patches/server/0897-Fix-UnsafeValues-loadAdvancement.patch
index ff17036140..ff17036140 100644
--- a/patches/server/0898-Fix-UnsafeValues-loadAdvancement.patch
+++ b/patches/server/0897-Fix-UnsafeValues-loadAdvancement.patch
diff --git a/patches/server/0899-Add-player-idle-duration-API.patch b/patches/server/0898-Add-player-idle-duration-API.patch
index eac8276c5d..9e5130fc3a 100644
--- a/patches/server/0899-Add-player-idle-duration-API.patch
+++ b/patches/server/0898-Add-player-idle-duration-API.patch
@@ -6,7 +6,7 @@ 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 ea742de14280c64f94461ebfb4647536a1dddb4f..bababc918704a671ee4635ba0c79219d94474821 100644
+index a996f721fa0794a4551ff1e99ea1b66a723bfaff..e443e260afbda55cc9888efd60d9b5f56dcbf55b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3419,6 +3419,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0900-Don-t-check-if-we-can-see-non-visible-entities.patch b/patches/server/0899-Don-t-check-if-we-can-see-non-visible-entities.patch
index 246f9bf864..dbe3bb37ce 100644
--- a/patches/server/0900-Don-t-check-if-we-can-see-non-visible-entities.patch
+++ b/patches/server/0899-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 2943390c0ec7e542d2bb1996dbbd626445c3108e..7bc142fd0ba58846f1b2ac57df0bfc044966f4ed 100644
+index a179fef4a020b66224984e3bf5b4b5255274103c..12361438efd12e327c8f6c2c1b233f05075402f8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1577,7 +1577,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1541,7 +1541,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/0901-Fix-NPE-in-SculkBloomEvent-world-access.patch b/patches/server/0900-Fix-NPE-in-SculkBloomEvent-world-access.patch
index 5abf7cda2c..5abf7cda2c 100644
--- a/patches/server/0901-Fix-NPE-in-SculkBloomEvent-world-access.patch
+++ b/patches/server/0900-Fix-NPE-in-SculkBloomEvent-world-access.patch
diff --git a/patches/server/0902-Allow-null-itemstack-for-Player-sendEquipmentChange.patch b/patches/server/0901-Allow-null-itemstack-for-Player-sendEquipmentChange.patch
index ef0d009597..ec4d42387a 100644
--- a/patches/server/0902-Allow-null-itemstack-for-Player-sendEquipmentChange.patch
+++ b/patches/server/0901-Allow-null-itemstack-for-Player-sendEquipmentChange.patch
@@ -5,7 +5,7 @@ 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 bababc918704a671ee4635ba0c79219d94474821..cb2cda2cb472b6ca0dd9b4fd1aea74ec3d215bbf 100644
+index e443e260afbda55cc9888efd60d9b5f56dcbf55b..f337c32fa4521d6ddd1c4d6102404db389f23b71 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1127,7 +1127,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0903-Optimize-VarInts.patch b/patches/server/0902-Optimize-VarInts.patch
index b96957d432..b96957d432 100644
--- a/patches/server/0903-Optimize-VarInts.patch
+++ b/patches/server/0902-Optimize-VarInts.patch
diff --git a/patches/server/0904-Add-API-to-get-the-collision-shape-of-a-block-before.patch b/patches/server/0903-Add-API-to-get-the-collision-shape-of-a-block-before.patch
index f0fcc8b9eb..f0fcc8b9eb 100644
--- a/patches/server/0904-Add-API-to-get-the-collision-shape-of-a-block-before.patch
+++ b/patches/server/0903-Add-API-to-get-the-collision-shape-of-a-block-before.patch
diff --git a/patches/server/0905-Add-predicate-for-blocks-when-raytracing.patch b/patches/server/0904-Add-predicate-for-blocks-when-raytracing.patch
index 96bceb6bfa..3d4d267627 100644
--- a/patches/server/0905-Add-predicate-for-blocks-when-raytracing.patch
+++ b/patches/server/0904-Add-predicate-for-blocks-when-raytracing.patch
@@ -47,7 +47,7 @@ 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 7fe43ac849d3ee80c447e8c024ea39fd338d616f..e216ac53f94cc5bcd90330a21e0cbda11b65b6ac 100644
+index 5c83ca573ccaa75a1d4e8129c96a24e3cf0f3266..29fa82c15411fbdae09e45e334209dcc93aa1789 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1094,9 +1094,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0906-Broadcast-take-item-packets-with-collector-as-source.patch b/patches/server/0905-Broadcast-take-item-packets-with-collector-as-source.patch
index 25d46b180a..25d46b180a 100644
--- a/patches/server/0906-Broadcast-take-item-packets-with-collector-as-source.patch
+++ b/patches/server/0905-Broadcast-take-item-packets-with-collector-as-source.patch
diff --git a/patches/server/0907-Expand-LingeringPotion-API.patch b/patches/server/0906-Expand-LingeringPotion-API.patch
index fdd0abf668..fdd0abf668 100644
--- a/patches/server/0907-Expand-LingeringPotion-API.patch
+++ b/patches/server/0906-Expand-LingeringPotion-API.patch
diff --git a/patches/server/0908-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch b/patches/server/0907-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch
index 00e51b071b..0ff11632f4 100644
--- a/patches/server/0908-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch
+++ b/patches/server/0907-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch
@@ -45,7 +45,7 @@ index 0471d9c85af02133f99cca4e181b83b58a3f1abc..4f701788bd21b61cad251a3a88f9bc41
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 e216ac53f94cc5bcd90330a21e0cbda11b65b6ac..202470633343add6768caa000bda05a0b5d93f4e 100644
+index 29fa82c15411fbdae09e45e334209dcc93aa1789..612dc787880e58e8325a658a63f9fe7536d0860c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -726,7 +726,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0909-Add-hand-to-fish-event-for-all-player-interactions.patch b/patches/server/0908-Add-hand-to-fish-event-for-all-player-interactions.patch
index dd3e5bba44..dd3e5bba44 100644
--- a/patches/server/0909-Add-hand-to-fish-event-for-all-player-interactions.patch
+++ b/patches/server/0908-Add-hand-to-fish-event-for-all-player-interactions.patch
diff --git a/patches/server/0910-Fix-several-issues-with-EntityBreedEvent.patch b/patches/server/0909-Fix-several-issues-with-EntityBreedEvent.patch
index 6a97d9fb9e..6a97d9fb9e 100644
--- a/patches/server/0910-Fix-several-issues-with-EntityBreedEvent.patch
+++ b/patches/server/0909-Fix-several-issues-with-EntityBreedEvent.patch
diff --git a/patches/server/0911-Add-UUID-attribute-modifier-API.patch b/patches/server/0910-Add-UUID-attribute-modifier-API.patch
index 4b5e695553..4b5e695553 100644
--- a/patches/server/0911-Add-UUID-attribute-modifier-API.patch
+++ b/patches/server/0910-Add-UUID-attribute-modifier-API.patch
diff --git a/patches/server/0912-Fix-missing-event-call-for-entity-teleport-API.patch b/patches/server/0911-Fix-missing-event-call-for-entity-teleport-API.patch
index 79cebb8989..79cebb8989 100644
--- a/patches/server/0912-Fix-missing-event-call-for-entity-teleport-API.patch
+++ b/patches/server/0911-Fix-missing-event-call-for-entity-teleport-API.patch
diff --git a/patches/server/0913-Lazily-create-LootContext-for-criterions.patch b/patches/server/0912-Lazily-create-LootContext-for-criterions.patch
index d1033bf7e7..d1033bf7e7 100644
--- a/patches/server/0913-Lazily-create-LootContext-for-criterions.patch
+++ b/patches/server/0912-Lazily-create-LootContext-for-criterions.patch
diff --git a/patches/server/0914-Don-t-fire-sync-events-during-worldgen.patch b/patches/server/0913-Don-t-fire-sync-events-during-worldgen.patch
index 01cd11852f..9ee1999a85 100644
--- a/patches/server/0914-Don-t-fire-sync-events-during-worldgen.patch
+++ b/patches/server/0913-Don-t-fire-sync-events-during-worldgen.patch
@@ -19,7 +19,7 @@ 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 8b5eabea1a0926c22b58ef8761caee3a06aa5ee0..53fdf4e104f36a2bd88fdf26d8c68cd3daf61574 100644
+index c5e404dcdab14dc0b972aa3286b05e21d9ea67e0..aaaf5b91402a1562311dfdc287193a1aefbaf9a7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1224,6 +1224,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0915-Add-Structure-check-API.patch b/patches/server/0914-Add-Structure-check-API.patch
index 93eeb5ef48..38a42bd17d 100644
--- a/patches/server/0915-Add-Structure-check-API.patch
+++ b/patches/server/0914-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 202470633343add6768caa000bda05a0b5d93f4e..b3bc35956228a997a88d4af2f7b5810f1c09d5b8 100644
+index 612dc787880e58e8325a658a63f9fe7536d0860c..ebb119ab9f5a8ae580e54cb3c102cd86f948a8d2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -236,6 +236,20 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0916-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch b/patches/server/0915-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch
index ad38c13cd7..ad38c13cd7 100644
--- a/patches/server/0916-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch
+++ b/patches/server/0915-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch
diff --git a/patches/server/0917-Restore-vanilla-entity-drops-behavior.patch b/patches/server/0916-Restore-vanilla-entity-drops-behavior.patch
index 7aa60b4674..cb805e0e1b 100644
--- a/patches/server/0917-Restore-vanilla-entity-drops-behavior.patch
+++ b/patches/server/0916-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 f568fa18ddcb1a1cd060c469edd6db45431bb53c..191dfbd0f15c3a21278f3c4f9ce29f1698e0836c 100644
+index 2f880e10c73b48c4989c7623ea6cf368f4afb53a..7f83f40c76eac2ce5b053dc651224c44701613ea 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -978,20 +978,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -975,20 +975,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
if (this.isRemoved()) {
return;
}
diff --git a/patches/server/0918-Dont-resend-blocks-on-interactions.patch b/patches/server/0917-Dont-resend-blocks-on-interactions.patch
index 3e498be31c..3e498be31c 100644
--- a/patches/server/0918-Dont-resend-blocks-on-interactions.patch
+++ b/patches/server/0917-Dont-resend-blocks-on-interactions.patch
diff --git a/patches/server/0919-add-more-scoreboard-API.patch b/patches/server/0918-add-more-scoreboard-API.patch
index 3365b53a36..3365b53a36 100644
--- a/patches/server/0919-add-more-scoreboard-API.patch
+++ b/patches/server/0918-add-more-scoreboard-API.patch
diff --git a/patches/server/0920-Improve-Registry.patch b/patches/server/0919-Improve-Registry.patch
index 14131191a6..14131191a6 100644
--- a/patches/server/0920-Improve-Registry.patch
+++ b/patches/server/0919-Improve-Registry.patch
diff --git a/patches/server/0921-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch b/patches/server/0920-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch
index 72b2cc189a..72b2cc189a 100644
--- a/patches/server/0921-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch
+++ b/patches/server/0920-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch
diff --git a/patches/server/0922-Add-experience-points-API.patch b/patches/server/0921-Add-experience-points-API.patch
index e4e988cec2..f29e610a9b 100644
--- a/patches/server/0922-Add-experience-points-API.patch
+++ b/patches/server/0921-Add-experience-points-API.patch
@@ -18,7 +18,7 @@ index 950ce40d268d89ff3c503116081db6c9ccd65329..454b29d8c9e42e328933aa578f49d28f
// 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 cb2cda2cb472b6ca0dd9b4fd1aea74ec3d215bbf..3a1777539f378f1e41bbd6b972c12a726afe5feb 100644
+index f337c32fa4521d6ddd1c4d6102404db389f23b71..4d3838c5184296451089697fd3f7438a7f1be762 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1921,6 +1921,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0923-Add-drops-to-shear-events.patch b/patches/server/0922-Add-drops-to-shear-events.patch
index 354ac06ddc..354ac06ddc 100644
--- a/patches/server/0923-Add-drops-to-shear-events.patch
+++ b/patches/server/0922-Add-drops-to-shear-events.patch
diff --git a/patches/server/0924-Add-PlayerShieldDisableEvent.patch b/patches/server/0923-Add-PlayerShieldDisableEvent.patch
index 5bbd9b6ff6..5bbd9b6ff6 100644
--- a/patches/server/0924-Add-PlayerShieldDisableEvent.patch
+++ b/patches/server/0923-Add-PlayerShieldDisableEvent.patch
diff --git a/patches/server/0925-Validate-ResourceLocation-in-NBT-reading.patch b/patches/server/0924-Validate-ResourceLocation-in-NBT-reading.patch
index 5531d9ffc8..5531d9ffc8 100644
--- a/patches/server/0925-Validate-ResourceLocation-in-NBT-reading.patch
+++ b/patches/server/0924-Validate-ResourceLocation-in-NBT-reading.patch
diff --git a/patches/server/0926-Properly-handle-experience-dropping-on-block-break.patch b/patches/server/0925-Properly-handle-experience-dropping-on-block-break.patch
index 63f20a9c63..63f20a9c63 100644
--- a/patches/server/0926-Properly-handle-experience-dropping-on-block-break.patch
+++ b/patches/server/0925-Properly-handle-experience-dropping-on-block-break.patch
diff --git a/patches/server/0927-Fixup-NamespacedKey-handling.patch b/patches/server/0926-Fixup-NamespacedKey-handling.patch
index 2861dc5138..2861dc5138 100644
--- a/patches/server/0927-Fixup-NamespacedKey-handling.patch
+++ b/patches/server/0926-Fixup-NamespacedKey-handling.patch
diff --git a/patches/server/0928-Expose-LootTable-of-DecoratedPot.patch b/patches/server/0927-Expose-LootTable-of-DecoratedPot.patch
index afa86977a9..afa86977a9 100644
--- a/patches/server/0928-Expose-LootTable-of-DecoratedPot.patch
+++ b/patches/server/0927-Expose-LootTable-of-DecoratedPot.patch
diff --git a/patches/server/0929-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0928-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
index 16af41429a..243b47d2f4 100644
--- a/patches/server/0929-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
+++ b/patches/server/0928-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
@@ -18,10 +18,10 @@ index a043ac10834562d357ef0b5aded2e916e2a0d056..74276c368016fcc4dbf9579b2ecbadc9
@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 7bc142fd0ba58846f1b2ac57df0bfc044966f4ed..a03385b1b0a2f9b98319137b87d917856d3c632c 100644
+index 12361438efd12e327c8f6c2c1b233f05075402f8..56ef427af5cdfa9b673089cabc43167012b343bc 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1560,10 +1560,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1524,10 +1524,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) {
diff --git a/patches/server/0930-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch b/patches/server/0929-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch
index a58beffec5..a58beffec5 100644
--- a/patches/server/0930-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch
+++ b/patches/server/0929-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch
diff --git a/patches/server/0931-Add-ShulkerDuplicateEvent.patch b/patches/server/0930-Add-ShulkerDuplicateEvent.patch
index de864137e2..de864137e2 100644
--- a/patches/server/0931-Add-ShulkerDuplicateEvent.patch
+++ b/patches/server/0930-Add-ShulkerDuplicateEvent.patch
diff --git a/patches/server/0932-Add-api-for-spawn-egg-texture-colors.patch b/patches/server/0931-Add-api-for-spawn-egg-texture-colors.patch
index 0652b1399e..0652b1399e 100644
--- a/patches/server/0932-Add-api-for-spawn-egg-texture-colors.patch
+++ b/patches/server/0931-Add-api-for-spawn-egg-texture-colors.patch
diff --git a/patches/server/0933-Add-Lifecycle-Event-system.patch b/patches/server/0932-Add-Lifecycle-Event-system.patch
index 6c4f2f8644..8217c1e749 100644
--- a/patches/server/0933-Add-Lifecycle-Event-system.patch
+++ b/patches/server/0932-Add-Lifecycle-Event-system.patch
@@ -719,7 +719,7 @@ index 2e96308696e131f3f013469a395e5ddda2c5d529..65a66e484c1c39c5f41d97db52f31c67
} catch (Throwable e) {
LOGGER.error("Failed to run bootstrapper for %s. This plugin will not be loaded.".formatted(provider.getSource()), e);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 56f9b69b5a30c4ee5bcbcb8ae33e26f75b477475..1699f091839eb30fffc064a83ad369b8aee3ed4f 100644
+index 3ca0d01d4d55d0919624356751144985587ddc25..4bb633d202eebd679a07ce45f486b301717dbafd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1038,6 +1038,11 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0934-ItemStack-Tooltip-API.patch b/patches/server/0933-ItemStack-Tooltip-API.patch
index 16bb22ce78..16bb22ce78 100644
--- a/patches/server/0934-ItemStack-Tooltip-API.patch
+++ b/patches/server/0933-ItemStack-Tooltip-API.patch
diff --git a/patches/server/0935-Add-getChunkSnapshot-includeLightData-parameter.patch b/patches/server/0934-Add-getChunkSnapshot-includeLightData-parameter.patch
index 54aa35539f..54aa35539f 100644
--- a/patches/server/0935-Add-getChunkSnapshot-includeLightData-parameter.patch
+++ b/patches/server/0934-Add-getChunkSnapshot-includeLightData-parameter.patch
diff --git a/patches/server/0936-Add-FluidState-API.patch b/patches/server/0935-Add-FluidState-API.patch
index aac0912819..aac0912819 100644
--- a/patches/server/0936-Add-FluidState-API.patch
+++ b/patches/server/0935-Add-FluidState-API.patch
diff --git a/patches/server/0937-add-number-format-api.patch b/patches/server/0936-add-number-format-api.patch
index d412b5f929..d412b5f929 100644
--- a/patches/server/0937-add-number-format-api.patch
+++ b/patches/server/0936-add-number-format-api.patch
diff --git a/patches/server/0938-improve-BanList-types.patch b/patches/server/0937-improve-BanList-types.patch
index c63e72309a..5f8c62e060 100644
--- a/patches/server/0938-improve-BanList-types.patch
+++ b/patches/server/0937-improve-BanList-types.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] improve BanList types
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 1699f091839eb30fffc064a83ad369b8aee3ed4f..edd3fc01c3e4f8eeedf9b6e646cd31c3db7a89dc 100644
+index 4bb633d202eebd679a07ce45f486b301717dbafd..70b13bab453d50d72c3df9fed06b3956fe2703fe 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2245,6 +2245,21 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0939-Expanded-Hopper-API.patch b/patches/server/0938-Expanded-Hopper-API.patch
index 2b59ac9974..2b59ac9974 100644
--- a/patches/server/0939-Expanded-Hopper-API.patch
+++ b/patches/server/0938-Expanded-Hopper-API.patch
diff --git a/patches/server/0940-Add-BlockBreakProgressUpdateEvent.patch b/patches/server/0939-Add-BlockBreakProgressUpdateEvent.patch
index 125844c5b6..3e5409551e 100644
--- a/patches/server/0940-Add-BlockBreakProgressUpdateEvent.patch
+++ b/patches/server/0939-Add-BlockBreakProgressUpdateEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add BlockBreakProgressUpdateEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 53fdf4e104f36a2bd88fdf26d8c68cd3daf61574..10063efb983dcef6dd0a9d55ecff49c26371bbb1 100644
+index aaaf5b91402a1562311dfdc287193a1aefbaf9a7..fd6e0f1a67f56e3b5fe97894919c7e4e1b90c4e8 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1320,6 +1320,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0941-Deprecate-ItemStack-setType.patch b/patches/server/0940-Deprecate-ItemStack-setType.patch
index 7079056771..7079056771 100644
--- a/patches/server/0941-Deprecate-ItemStack-setType.patch
+++ b/patches/server/0940-Deprecate-ItemStack-setType.patch
diff --git a/patches/server/0942-Add-CartographyItemEvent.patch b/patches/server/0941-Add-CartographyItemEvent.patch
index 2d775d4172..2d775d4172 100644
--- a/patches/server/0942-Add-CartographyItemEvent.patch
+++ b/patches/server/0941-Add-CartographyItemEvent.patch
diff --git a/patches/server/0943-More-Raid-API.patch b/patches/server/0942-More-Raid-API.patch
index c98e63a452..5f013c673c 100644
--- a/patches/server/0943-More-Raid-API.patch
+++ b/patches/server/0942-More-Raid-API.patch
@@ -86,7 +86,7 @@ index b8ce1c1c2447f9cff1717bfcfd6eb911ade0d4b3..51f21af9d75769abdcba713b9aa33392
+ // Paper end - more Raid API
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index b3bc35956228a997a88d4af2f7b5810f1c09d5b8..8f88ccec6b8947ca2738dc07c23aebe258145c83 100644
+index ebb119ab9f5a8ae580e54cb3c102cd86f948a8d2..94640aa827c9b2e1d0174eb012fdb37c0851f501 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2306,6 +2306,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0944-Add-onboarding-message-for-initial-server-start.patch b/patches/server/0943-Add-onboarding-message-for-initial-server-start.patch
index e3249e5435..ed4f8105fc 100644
--- a/patches/server/0944-Add-onboarding-message-for-initial-server-start.patch
+++ b/patches/server/0943-Add-onboarding-message-for-initial-server-start.patch
@@ -17,7 +17,7 @@ index d9502ba028a96f9cc846f9ed428bd8066b857ca3..87e5f614ba988547a827486740db217e
node = loader.load();
this.verifyGlobalConfigVersion(node);
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
-index cc847dce0116b8260790b890b1d5452c280e186c..2a5453707bc172d8d0efe3f11959cb0b5f830984 100644
+index 701196635f9c08d62d785fa1b448313937259c76..5160dc617cc5037cd3f10479454159f2a9984169 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -25,6 +25,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -29,7 +29,7 @@ index cc847dce0116b8260790b890b1d5452c280e186c..2a5453707bc172d8d0efe3f11959cb0b
return instance;
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index cbceb0ddea32781f89a19b1edb258bc23b96ee92..fc0f17cd7ed4fcf10e0396aeeed115280318128d 100644
+index 2dfa9c4c0c2ef489649944eed89d8c77c482b92f..e055769071841d56ec7e2a64fc519d1f8b48ff42 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1136,6 +1136,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0945-Configurable-max-block-fluid-ticks.patch b/patches/server/0944-Configurable-max-block-fluid-ticks.patch
index 02e6a701ce..780b696029 100644
--- a/patches/server/0945-Configurable-max-block-fluid-ticks.patch
+++ b/patches/server/0944-Configurable-max-block-fluid-ticks.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable max block/fluid ticks
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 10063efb983dcef6dd0a9d55ecff49c26371bbb1..4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a 100644
+index fd6e0f1a67f56e3b5fe97894919c7e4e1b90c4e8..c97292f22a3402dbd59cef4af554954dc1d4f91a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -501,9 +501,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
diff --git a/patches/server/0946-Fix-bees-aging-inside-hives.patch b/patches/server/0945-Fix-bees-aging-inside-hives.patch
index 400ede1160..400ede1160 100644
--- a/patches/server/0946-Fix-bees-aging-inside-hives.patch
+++ b/patches/server/0945-Fix-bees-aging-inside-hives.patch
diff --git a/patches/server/0947-Disable-memory-reserve-allocating.patch b/patches/server/0946-Disable-memory-reserve-allocating.patch
index ea801f5092..ea801f5092 100644
--- a/patches/server/0947-Disable-memory-reserve-allocating.patch
+++ b/patches/server/0946-Disable-memory-reserve-allocating.patch
diff --git a/patches/server/0948-Fire-EntityDamageByEntityEvent-for-unowned-wither-sk.patch b/patches/server/0947-Fire-EntityDamageByEntityEvent-for-unowned-wither-sk.patch
index d98b3aeccc..d98b3aeccc 100644
--- a/patches/server/0948-Fire-EntityDamageByEntityEvent-for-unowned-wither-sk.patch
+++ b/patches/server/0947-Fire-EntityDamageByEntityEvent-for-unowned-wither-sk.patch
diff --git a/patches/server/0949-Fix-DamageSource-API.patch b/patches/server/0948-Fix-DamageSource-API.patch
index 2ab4af0ad8..2ab4af0ad8 100644
--- a/patches/server/0949-Fix-DamageSource-API.patch
+++ b/patches/server/0948-Fix-DamageSource-API.patch
diff --git a/patches/server/0950-Fix-creation-of-invalid-block-entity-during-world-ge.patch b/patches/server/0949-Fix-creation-of-invalid-block-entity-during-world-ge.patch
index d810be487e..d810be487e 100644
--- a/patches/server/0950-Fix-creation-of-invalid-block-entity-during-world-ge.patch
+++ b/patches/server/0949-Fix-creation-of-invalid-block-entity-during-world-ge.patch
diff --git a/patches/server/0951-Fix-possible-StackOverflowError-for-some-dispenses.patch b/patches/server/0950-Fix-possible-StackOverflowError-for-some-dispenses.patch
index 5351dde83c..5351dde83c 100644
--- a/patches/server/0951-Fix-possible-StackOverflowError-for-some-dispenses.patch
+++ b/patches/server/0950-Fix-possible-StackOverflowError-for-some-dispenses.patch
diff --git a/patches/server/0952-Improve-tag-parser-handling.patch b/patches/server/0951-Improve-tag-parser-handling.patch
index e800ee95bf..e800ee95bf 100644
--- a/patches/server/0952-Improve-tag-parser-handling.patch
+++ b/patches/server/0951-Improve-tag-parser-handling.patch
diff --git a/patches/server/0953-Item-Mutation-Fixes.patch b/patches/server/0952-Item-Mutation-Fixes.patch
index 0e20a90a87..0e20a90a87 100644
--- a/patches/server/0953-Item-Mutation-Fixes.patch
+++ b/patches/server/0952-Item-Mutation-Fixes.patch
diff --git a/patches/server/0954-Per-world-ticks-per-spawn-settings.patch b/patches/server/0953-Per-world-ticks-per-spawn-settings.patch
index ea163724cf..ea163724cf 100644
--- a/patches/server/0954-Per-world-ticks-per-spawn-settings.patch
+++ b/patches/server/0953-Per-world-ticks-per-spawn-settings.patch
diff --git a/patches/server/0955-Properly-track-the-changed-item-from-dispense-events.patch b/patches/server/0954-Properly-track-the-changed-item-from-dispense-events.patch
index 2dc797fea7..2dc797fea7 100644
--- a/patches/server/0955-Properly-track-the-changed-item-from-dispense-events.patch
+++ b/patches/server/0954-Properly-track-the-changed-item-from-dispense-events.patch
diff --git a/patches/server/0956-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch b/patches/server/0955-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch
index 586f341b5f..586f341b5f 100644
--- a/patches/server/0956-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch
+++ b/patches/server/0955-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch
diff --git a/patches/server/0957-Fix-tripwire-disarming-not-working-as-intended.patch b/patches/server/0956-Fix-tripwire-disarming-not-working-as-intended.patch
index fa7f6bde06..fa7f6bde06 100644
--- a/patches/server/0957-Fix-tripwire-disarming-not-working-as-intended.patch
+++ b/patches/server/0956-Fix-tripwire-disarming-not-working-as-intended.patch
diff --git a/patches/server/0958-Add-config-for-mobs-immune-to-default-effects.patch b/patches/server/0957-Add-config-for-mobs-immune-to-default-effects.patch
index 5989f9bd5f..5989f9bd5f 100644
--- a/patches/server/0958-Add-config-for-mobs-immune-to-default-effects.patch
+++ b/patches/server/0957-Add-config-for-mobs-immune-to-default-effects.patch
diff --git a/patches/server/0959-Deep-clone-nbt-tags-in-PDC.patch b/patches/server/0958-Deep-clone-nbt-tags-in-PDC.patch
index f833a51efa..f833a51efa 100644
--- a/patches/server/0959-Deep-clone-nbt-tags-in-PDC.patch
+++ b/patches/server/0958-Deep-clone-nbt-tags-in-PDC.patch
diff --git a/patches/server/0960-Support-old-UUID-format-for-NBT.patch b/patches/server/0959-Support-old-UUID-format-for-NBT.patch
index a38c2a7f7b..a38c2a7f7b 100644
--- a/patches/server/0960-Support-old-UUID-format-for-NBT.patch
+++ b/patches/server/0959-Support-old-UUID-format-for-NBT.patch
diff --git a/patches/server/0961-Fix-shield-disable-inconsistency.patch b/patches/server/0960-Fix-shield-disable-inconsistency.patch
index 25f666c8ec..25f666c8ec 100644
--- a/patches/server/0961-Fix-shield-disable-inconsistency.patch
+++ b/patches/server/0960-Fix-shield-disable-inconsistency.patch
diff --git a/patches/server/0962-Handle-Large-Packets-disconnecting-client.patch b/patches/server/0961-Handle-Large-Packets-disconnecting-client.patch
index ea20a101a7..ea20a101a7 100644
--- a/patches/server/0962-Handle-Large-Packets-disconnecting-client.patch
+++ b/patches/server/0961-Handle-Large-Packets-disconnecting-client.patch
diff --git a/patches/server/0963-Fix-ItemFlags.patch b/patches/server/0962-Fix-ItemFlags.patch
index d750443ba5..d750443ba5 100644
--- a/patches/server/0963-Fix-ItemFlags.patch
+++ b/patches/server/0962-Fix-ItemFlags.patch
diff --git a/patches/server/0964-Fix-Player-setBlockUpdate.patch b/patches/server/0963-Fix-Player-setBlockUpdate.patch
index 17597398de..81049f5c54 100644
--- a/patches/server/0964-Fix-Player-setBlockUpdate.patch
+++ b/patches/server/0963-Fix-Player-setBlockUpdate.patch
@@ -18,7 +18,7 @@ index 397eb1a101bd60f49dbb2fa8eddf28f6f233167f..e28bc898786542f695017ff0a0366768
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 3a1777539f378f1e41bbd6b972c12a726afe5feb..cd5bb089c336df3140cfd5d11a398d4aaf9c39b4 100644
+index 4d3838c5184296451089697fd3f7438a7f1be762..94524dee7e3ff78d378bd7812c49d041d07e138d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1118,6 +1118,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0965-Fix-helmet-damage-reduction-inconsistencies.patch b/patches/server/0964-Fix-helmet-damage-reduction-inconsistencies.patch
index 68b0416c32..68b0416c32 100644
--- a/patches/server/0965-Fix-helmet-damage-reduction-inconsistencies.patch
+++ b/patches/server/0964-Fix-helmet-damage-reduction-inconsistencies.patch
diff --git a/patches/server/0966-Revert-to-vanilla-handling-of-LivingEntity-actuallyH.patch b/patches/server/0965-Revert-to-vanilla-handling-of-LivingEntity-actuallyH.patch
index 865466307d..865466307d 100644
--- a/patches/server/0966-Revert-to-vanilla-handling-of-LivingEntity-actuallyH.patch
+++ b/patches/server/0965-Revert-to-vanilla-handling-of-LivingEntity-actuallyH.patch
diff --git a/patches/server/0967-improve-checking-handled-tags-in-itemmeta.patch b/patches/server/0966-improve-checking-handled-tags-in-itemmeta.patch
index ba576b47eb..ba576b47eb 100644
--- a/patches/server/0967-improve-checking-handled-tags-in-itemmeta.patch
+++ b/patches/server/0966-improve-checking-handled-tags-in-itemmeta.patch
diff --git a/patches/server/0968-General-ItemMeta-fixes.patch b/patches/server/0967-General-ItemMeta-fixes.patch
index 99201f828a..99201f828a 100644
--- a/patches/server/0968-General-ItemMeta-fixes.patch
+++ b/patches/server/0967-General-ItemMeta-fixes.patch
diff --git a/patches/server/0969-Expose-hasColor-to-leather-armor.patch b/patches/server/0968-Expose-hasColor-to-leather-armor.patch
index fb4dc944de..fb4dc944de 100644
--- a/patches/server/0969-Expose-hasColor-to-leather-armor.patch
+++ b/patches/server/0968-Expose-hasColor-to-leather-armor.patch
diff --git a/patches/server/0970-Added-API-to-get-player-ha-proxy-address.patch b/patches/server/0969-Added-API-to-get-player-ha-proxy-address.patch
index f12e7f6ec8..305f6bd981 100644
--- a/patches/server/0970-Added-API-to-get-player-ha-proxy-address.patch
+++ b/patches/server/0969-Added-API-to-get-player-ha-proxy-address.patch
@@ -35,7 +35,7 @@ index 96355e1da8feb6687ea0069dda4a82fcd7e25e8a..1f696644b958538e9f5d568a2e4bba69
} else {
super.channelRead(ctx, msg);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index cd5bb089c336df3140cfd5d11a398d4aaf9c39b4..3480f06d4476c5c200246e6200e2eda2a5de1a5a 100644
+index 94524dee7e3ff78d378bd7812c49d041d07e138d..65a6952d48f40f3fd73d6693b61be9d29741f2f6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -265,7 +265,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0971-More-Chest-Block-API.patch b/patches/server/0970-More-Chest-Block-API.patch
index 020d97d086..020d97d086 100644
--- a/patches/server/0971-More-Chest-Block-API.patch
+++ b/patches/server/0970-More-Chest-Block-API.patch
diff --git a/patches/server/0972-Print-data-component-type-on-encoding-error.patch b/patches/server/0971-Print-data-component-type-on-encoding-error.patch
index a60bdfee87..a60bdfee87 100644
--- a/patches/server/0972-Print-data-component-type-on-encoding-error.patch
+++ b/patches/server/0971-Print-data-component-type-on-encoding-error.patch
diff --git a/patches/server/0973-Brigadier-based-command-API.patch b/patches/server/0972-Brigadier-based-command-API.patch
index ab14bb6a9c..de3edd2e00 100644
--- a/patches/server/0973-Brigadier-based-command-API.patch
+++ b/patches/server/0972-Brigadier-based-command-API.patch
@@ -2214,7 +2214,7 @@ index 982b2bab27e3d55d0ba07060862c0c3183ad91b0..5fa8a3343ffc11e82c20b78a73205fd8
Component component = message.resolveComponent(commandSourceStack);
CommandSigningContext commandSigningContext = commandSourceStack.getSigningContext();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index fc0f17cd7ed4fcf10e0396aeeed115280318128d..e14c0e1ccf526f81e28db5545d9e2351641e1bc8 100644
+index e055769071841d56ec7e2a64fc519d1f8b48ff42..c97fb8eec949c693d4e822d8cf2e666a0858f20c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -306,7 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2244,7 +2244,7 @@ index fc0f17cd7ed4fcf10e0396aeeed115280318128d..e14c0e1ccf526f81e28db5545d9e2351
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.connection.acceptConnections();
}
-@@ -2182,9 +2184,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2181,9 +2183,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return new MinecraftServer.ReloadableResources(resourcemanager, datapackresources);
});
}).thenAcceptAsync((minecraftserver_reloadableresources) -> {
@@ -2255,7 +2255,7 @@ index fc0f17cd7ed4fcf10e0396aeeed115280318128d..e14c0e1ccf526f81e28db5545d9e2351
this.packRepository.setSelected(dataPacks);
WorldDataConfiguration worlddataconfiguration = new WorldDataConfiguration(MinecraftServer.getSelectedPacks(this.packRepository, true), this.worldData.enabledFeatures());
-@@ -2195,8 +2197,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2194,8 +2196,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().reloadResources();
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
@@ -2378,7 +2378,7 @@ index 134f31cce8d8eca669948a784e2766216fb91ab5..60c65af218d533d53b765ba2175fed16
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index edd3fc01c3e4f8eeedf9b6e646cd31c3db7a89dc..77f3ac4e45a691181a94831cf49f7840c9f88e3a 100644
+index 70b13bab453d50d72c3df9fed06b3956fe2703fe..2f7119ca17cf0df445c0c34804e40acb209a5b0d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -272,11 +272,11 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0974-Fix-issues-with-Recipe-API.patch b/patches/server/0973-Fix-issues-with-Recipe-API.patch
index bb85dca687..bb85dca687 100644
--- a/patches/server/0974-Fix-issues-with-Recipe-API.patch
+++ b/patches/server/0973-Fix-issues-with-Recipe-API.patch
diff --git a/patches/server/0975-Fix-equipment-slot-and-group-API.patch b/patches/server/0974-Fix-equipment-slot-and-group-API.patch
index 05b6eafa06..05b6eafa06 100644
--- a/patches/server/0975-Fix-equipment-slot-and-group-API.patch
+++ b/patches/server/0974-Fix-equipment-slot-and-group-API.patch
diff --git a/patches/server/0976-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch b/patches/server/0975-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch
index 980c3dc8a0..980c3dc8a0 100644
--- a/patches/server/0976-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch
+++ b/patches/server/0975-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch
diff --git a/patches/server/0977-Prevent-sending-oversized-item-data-in-equipment-and.patch b/patches/server/0976-Prevent-sending-oversized-item-data-in-equipment-and.patch
index 077dab00a8..077dab00a8 100644
--- a/patches/server/0977-Prevent-sending-oversized-item-data-in-equipment-and.patch
+++ b/patches/server/0976-Prevent-sending-oversized-item-data-in-equipment-and.patch
diff --git a/patches/server/0978-Prevent-NPE-if-hooked-entity-was-cleared.patch b/patches/server/0977-Prevent-NPE-if-hooked-entity-was-cleared.patch
index 8d3547db93..8d3547db93 100644
--- a/patches/server/0978-Prevent-NPE-if-hooked-entity-was-cleared.patch
+++ b/patches/server/0977-Prevent-NPE-if-hooked-entity-was-cleared.patch
diff --git a/patches/server/0979-Fix-cancelling-BlockPlaceEvent-calling-onRemove.patch b/patches/server/0978-Fix-cancelling-BlockPlaceEvent-calling-onRemove.patch
index 8af7943ca8..8af7943ca8 100644
--- a/patches/server/0979-Fix-cancelling-BlockPlaceEvent-calling-onRemove.patch
+++ b/patches/server/0978-Fix-cancelling-BlockPlaceEvent-calling-onRemove.patch
diff --git a/patches/server/0980-Add-missing-fishing-event-state.patch b/patches/server/0979-Add-missing-fishing-event-state.patch
index 6ad1a92dd0..6ad1a92dd0 100644
--- a/patches/server/0980-Add-missing-fishing-event-state.patch
+++ b/patches/server/0979-Add-missing-fishing-event-state.patch
diff --git a/patches/server/0981-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch b/patches/server/0980-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch
index 1af38ab7e6..1af38ab7e6 100644
--- a/patches/server/0981-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch
+++ b/patches/server/0980-Deprecate-InvAction-HOTBAR_MOVE_AND_READD.patch
diff --git a/patches/server/0982-Fix-sending-disconnect-packet-in-phases-where-it-doe.patch b/patches/server/0981-Fix-sending-disconnect-packet-in-phases-where-it-doe.patch
index 1abf467e7e..1abf467e7e 100644
--- a/patches/server/0982-Fix-sending-disconnect-packet-in-phases-where-it-doe.patch
+++ b/patches/server/0981-Fix-sending-disconnect-packet-in-phases-where-it-doe.patch
diff --git a/patches/server/0983-Adopt-MaterialRerouting.patch b/patches/server/0982-Adopt-MaterialRerouting.patch
index c1057b6bc1..c1057b6bc1 100644
--- a/patches/server/0983-Adopt-MaterialRerouting.patch
+++ b/patches/server/0982-Adopt-MaterialRerouting.patch
diff --git a/patches/server/0984-Suspicious-Effect-Entry-API.patch b/patches/server/0983-Suspicious-Effect-Entry-API.patch
index bc26031199..bc26031199 100644
--- a/patches/server/0984-Suspicious-Effect-Entry-API.patch
+++ b/patches/server/0983-Suspicious-Effect-Entry-API.patch
diff --git a/patches/server/0985-check-if-itemstack-is-stackable-first.patch b/patches/server/0984-check-if-itemstack-is-stackable-first.patch
index 8e11960bdd..8e11960bdd 100644
--- a/patches/server/0985-check-if-itemstack-is-stackable-first.patch
+++ b/patches/server/0984-check-if-itemstack-is-stackable-first.patch
diff --git a/patches/server/0986-Fix-removing-recipes-from-RecipeIterator.patch b/patches/server/0985-Fix-removing-recipes-from-RecipeIterator.patch
index 461c3eb854..461c3eb854 100644
--- a/patches/server/0986-Fix-removing-recipes-from-RecipeIterator.patch
+++ b/patches/server/0985-Fix-removing-recipes-from-RecipeIterator.patch
diff --git a/patches/server/0987-Configurable-damage-tick-when-blocking-with-shield.patch b/patches/server/0986-Configurable-damage-tick-when-blocking-with-shield.patch
index 5854c4306d..5854c4306d 100644
--- a/patches/server/0987-Configurable-damage-tick-when-blocking-with-shield.patch
+++ b/patches/server/0986-Configurable-damage-tick-when-blocking-with-shield.patch
diff --git a/patches/server/0988-Properly-remove-the-experimental-smithing-inventory-.patch b/patches/server/0987-Properly-remove-the-experimental-smithing-inventory-.patch
index 9ede88caa7..9ede88caa7 100644
--- a/patches/server/0988-Properly-remove-the-experimental-smithing-inventory-.patch
+++ b/patches/server/0987-Properly-remove-the-experimental-smithing-inventory-.patch
diff --git a/patches/server/0989-Moonrise-optimisation-patches.patch b/patches/server/0988-Moonrise-optimisation-patches.patch
index 6e85164f4e..9b4fdcfd30 100644
--- a/patches/server/0989-Moonrise-optimisation-patches.patch
+++ b/patches/server/0988-Moonrise-optimisation-patches.patch
@@ -8,3362 +8,351 @@ Currently includes:
- Entity tracker optimisations
- Collision optimisations
- Random block ticking optimisations
+ - Chunk tick iteration optimisations
See https://github.com/Tuinity/Moonrise
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/EntityList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/EntityList.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..ba68998f6ef57b24c72fd833bd7de440de9501cc
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/list/EntityList.java
-@@ -0,0 +1,129 @@
-+package ca.spottedleaf.moonrise.common.list;
-+
-+import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
-+import net.minecraft.world.entity.Entity;
-+import java.util.Arrays;
-+import java.util.Iterator;
-+import java.util.NoSuchElementException;
-+
-+// list with O(1) remove & contains
-+
-+/**
-+ * @author Spottedleaf
-+ */
-+public final class EntityList implements Iterable<Entity> {
-+
-+ protected final Int2IntOpenHashMap entityToIndex = new Int2IntOpenHashMap(2, 0.8f);
-+ {
-+ this.entityToIndex.defaultReturnValue(Integer.MIN_VALUE);
-+ }
-+
-+ protected static final Entity[] EMPTY_LIST = new Entity[0];
-+
-+ protected Entity[] entities = EMPTY_LIST;
-+ protected int count;
-+
-+ public int size() {
-+ return this.count;
-+ }
-+
-+ public boolean contains(final Entity entity) {
-+ return this.entityToIndex.containsKey(entity.getId());
-+ }
-+
-+ public boolean remove(final Entity entity) {
-+ final int index = this.entityToIndex.remove(entity.getId());
-+ if (index == Integer.MIN_VALUE) {
-+ return false;
-+ }
-+
-+ // move the entity at the end to this index
-+ final int endIndex = --this.count;
-+ final Entity end = this.entities[endIndex];
-+ if (index != endIndex) {
-+ // not empty after this call
-+ this.entityToIndex.put(end.getId(), index); // update index
-+ }
-+ this.entities[index] = end;
-+ this.entities[endIndex] = null;
-+
-+ return true;
-+ }
-+
-+ public boolean add(final Entity entity) {
-+ final int count = this.count;
-+ final int currIndex = this.entityToIndex.putIfAbsent(entity.getId(), count);
-+
-+ if (currIndex != Integer.MIN_VALUE) {
-+ return false; // already in this list
-+ }
-+
-+ Entity[] list = this.entities;
-+
-+ if (list.length == count) {
-+ // resize required
-+ list = this.entities = Arrays.copyOf(list, (int)Math.max(4L, count * 2L)); // overflow results in negative
-+ }
-+
-+ list[count] = entity;
-+ this.count = count + 1;
-+
-+ return true;
-+ }
-+
-+ public Entity getChecked(final int index) {
-+ if (index < 0 || index >= this.count) {
-+ throw new IndexOutOfBoundsException("Index: " + index + " is out of bounds, size: " + this.count);
-+ }
-+ return this.entities[index];
-+ }
-+
-+ public Entity getUnchecked(final int index) {
-+ return this.entities[index];
-+ }
-+
-+ public Entity[] getRawData() {
-+ return this.entities;
-+ }
-+
-+ public void clear() {
-+ this.entityToIndex.clear();
-+ Arrays.fill(this.entities, 0, this.count, null);
-+ this.count = 0;
-+ }
-+
-+ @Override
-+ public Iterator<Entity> iterator() {
-+ return new Iterator<Entity>() {
-+
-+ Entity lastRet;
-+ int current;
-+
-+ @Override
-+ public boolean hasNext() {
-+ return this.current < EntityList.this.count;
-+ }
-+
-+ @Override
-+ public Entity next() {
-+ if (this.current >= EntityList.this.count) {
-+ throw new NoSuchElementException();
-+ }
-+ return this.lastRet = EntityList.this.entities[this.current++];
-+ }
-+
-+ @Override
-+ public void remove() {
-+ final Entity lastRet = this.lastRet;
-+
-+ if (lastRet == null) {
-+ throw new IllegalStateException();
-+ }
-+ this.lastRet = null;
-+
-+ EntityList.this.remove(lastRet);
-+ --this.current;
-+ }
-+ };
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/IBlockDataList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/IBlockDataList.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..fcfbca333234c09f7c056bbfcd9ac8860b20a8db
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/list/IBlockDataList.java
-@@ -0,0 +1,125 @@
-+package ca.spottedleaf.moonrise.common.list;
-+
-+import it.unimi.dsi.fastutil.longs.LongIterator;
-+import it.unimi.dsi.fastutil.shorts.Short2LongOpenHashMap;
-+import java.util.Arrays;
-+import net.minecraft.world.level.block.Block;
-+import net.minecraft.world.level.block.state.BlockState;
-+import net.minecraft.world.level.chunk.GlobalPalette;
-+
-+public final class IBlockDataList {
-+
-+ private static final GlobalPalette<BlockState> GLOBAL_PALETTE = new GlobalPalette<>(Block.BLOCK_STATE_REGISTRY);
-+
-+ // map of location -> (index | (location << 16) | (palette id << 32))
-+ private final Short2LongOpenHashMap map = new Short2LongOpenHashMap(2, 0.8f);
-+ {
-+ this.map.defaultReturnValue(Long.MAX_VALUE);
-+ }
-+
-+ private static final long[] EMPTY_LIST = new long[0];
-+
-+ private long[] byIndex = EMPTY_LIST;
-+ private int size;
-+
-+ public static int getLocationKey(final int x, final int y, final int z) {
-+ return (x & 15) | (((z & 15) << 4)) | ((y & 255) << (4 + 4));
-+ }
-+
-+ public static BlockState getBlockDataFromRaw(final long raw) {
-+ return GLOBAL_PALETTE.valueFor((int)(raw >>> 32));
-+ }
-+
-+ public static int getIndexFromRaw(final long raw) {
-+ return (int)(raw & 0xFFFF);
-+ }
-+
-+ public static int getLocationFromRaw(final long raw) {
-+ return (int)((raw >>> 16) & 0xFFFF);
-+ }
-+
-+ public static long getRawFromValues(final int index, final int location, final BlockState data) {
-+ return (long)index | ((long)location << 16) | (((long)GLOBAL_PALETTE.idFor(data)) << 32);
-+ }
-+
-+ public static long setIndexRawValues(final long value, final int index) {
-+ return value & ~(0xFFFF) | (index);
-+ }
-+
-+ public long add(final int x, final int y, final int z, final BlockState data) {
-+ return this.add(getLocationKey(x, y, z), data);
-+ }
-+
-+ public long add(final int location, final BlockState data) {
-+ final long curr = this.map.get((short)location);
-+
-+ if (curr == Long.MAX_VALUE) {
-+ final int index = this.size++;
-+ final long raw = getRawFromValues(index, location, data);
-+ this.map.put((short)location, raw);
-+
-+ if (index >= this.byIndex.length) {
-+ this.byIndex = Arrays.copyOf(this.byIndex, (int)Math.max(4L, this.byIndex.length * 2L));
-+ }
-+
-+ this.byIndex[index] = raw;
-+ return raw;
-+ } else {
-+ final int index = getIndexFromRaw(curr);
-+ final long raw = this.byIndex[index] = getRawFromValues(index, location, data);
-+
-+ this.map.put((short)location, raw);
-+
-+ return raw;
-+ }
-+ }
-+
-+ public long remove(final int x, final int y, final int z) {
-+ return this.remove(getLocationKey(x, y, z));
-+ }
-+
-+ public long remove(final int location) {
-+ final long ret = this.map.remove((short)location);
-+ final int index = getIndexFromRaw(ret);
-+ if (ret == Long.MAX_VALUE) {
-+ return ret;
-+ }
-+
-+ // move the entry at the end to this index
-+ final int endIndex = --this.size;
-+ final long end = this.byIndex[endIndex];
-+ if (index != endIndex) {
-+ // not empty after this call
-+ this.map.put((short)getLocationFromRaw(end), setIndexRawValues(end, index));
-+ }
-+ this.byIndex[index] = end;
-+ this.byIndex[endIndex] = 0L;
-+
-+ return ret;
-+ }
-+
-+ public int size() {
-+ return this.size;
-+ }
-+
-+ public long getRaw(final int index) {
-+ return this.byIndex[index];
-+ }
-+
-+ public int getLocation(final int index) {
-+ return getLocationFromRaw(this.getRaw(index));
-+ }
-+
-+ public BlockState getData(final int index) {
-+ return getBlockDataFromRaw(this.getRaw(index));
-+ }
-+
-+ public void clear() {
-+ this.size = 0;
-+ this.map.clear();
-+ }
-+
-+ public LongIterator getRawIterator() {
-+ return this.map.values().iterator();
-+ }
-+}
-\ No newline at end of file
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/IteratorSafeOrderedReferenceSet.java b/src/main/java/ca/spottedleaf/moonrise/common/list/IteratorSafeOrderedReferenceSet.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..c21e00812f1aaa1279834a0562d360d6b89e146c
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/list/IteratorSafeOrderedReferenceSet.java
-@@ -0,0 +1,312 @@
-+package ca.spottedleaf.moonrise.common.list;
-+
-+import it.unimi.dsi.fastutil.objects.Reference2IntLinkedOpenHashMap;
-+import it.unimi.dsi.fastutil.objects.Reference2IntMap;
-+import java.util.Arrays;
-+import java.util.NoSuchElementException;
-+
-+public final class IteratorSafeOrderedReferenceSet<E> {
-+
-+ public static final int ITERATOR_FLAG_SEE_ADDITIONS = 1 << 0;
-+
-+ private final Reference2IntLinkedOpenHashMap<E> indexMap;
-+ private int firstInvalidIndex = -1;
-+
-+ /* list impl */
-+ private E[] listElements;
-+ private int listSize;
-+
-+ private final double maxFragFactor;
-+
-+ private int iteratorCount;
-+
-+ public IteratorSafeOrderedReferenceSet() {
-+ this(16, 0.75f, 16, 0.2);
-+ }
-+
-+ public IteratorSafeOrderedReferenceSet(final int setCapacity, final float setLoadFactor, final int arrayCapacity,
-+ final double maxFragFactor) {
-+ this.indexMap = new Reference2IntLinkedOpenHashMap<>(setCapacity, setLoadFactor);
-+ this.indexMap.defaultReturnValue(-1);
-+ this.maxFragFactor = maxFragFactor;
-+ this.listElements = (E[])new Object[arrayCapacity];
-+ }
-+
-+ /*
-+ public void check() {
-+ int iterated = 0;
-+ ReferenceOpenHashSet<E> check = new ReferenceOpenHashSet<>();
-+ if (this.listElements != null) {
-+ for (int i = 0; i < this.listSize; ++i) {
-+ Object obj = this.listElements[i];
-+ if (obj != null) {
-+ iterated++;
-+ if (!check.add((E)obj)) {
-+ throw new IllegalStateException("contains duplicate");
-+ }
-+ if (!this.contains((E)obj)) {
-+ throw new IllegalStateException("desync");
-+ }
-+ }
-+ }
-+ }
-+
-+ if (iterated != this.size()) {
-+ throw new IllegalStateException("Size is mismatched! Got " + iterated + ", expected " + this.size());
-+ }
-+
-+ check.clear();
-+ iterated = 0;
-+ for (final java.util.Iterator<E> iterator = this.unsafeIterator(IteratorSafeOrderedReferenceSet.ITERATOR_FLAG_SEE_ADDITIONS); iterator.hasNext();) {
-+ final E element = iterator.next();
-+ iterated++;
-+ if (!check.add(element)) {
-+ throw new IllegalStateException("contains duplicate (iterator is wrong)");
-+ }
-+ if (!this.contains(element)) {
-+ throw new IllegalStateException("desync (iterator is wrong)");
-+ }
-+ }
-+
-+ if (iterated != this.size()) {
-+ throw new IllegalStateException("Size is mismatched! (iterator is wrong) Got " + iterated + ", expected " + this.size());
-+ }
-+ }
-+ */
-+
-+ private double getFragFactor() {
-+ return 1.0 - ((double)this.indexMap.size() / (double)this.listSize);
-+ }
-+
-+ public int createRawIterator() {
-+ ++this.iteratorCount;
-+ if (this.indexMap.isEmpty()) {
-+ return -1;
-+ } else {
-+ return this.firstInvalidIndex == 0 ? this.indexMap.getInt(this.indexMap.firstKey()) : 0;
-+ }
-+ }
-+
-+ public int advanceRawIterator(final int index) {
-+ final E[] elements = this.listElements;
-+ int ret = index + 1;
-+ for (int len = this.listSize; ret < len; ++ret) {
-+ if (elements[ret] != null) {
-+ return ret;
-+ }
-+ }
-+
-+ return -1;
-+ }
-+
-+ public void finishRawIterator() {
-+ if (--this.iteratorCount == 0) {
-+ if (this.getFragFactor() >= this.maxFragFactor) {
-+ this.defrag();
-+ }
-+ }
-+ }
-+
-+ public boolean remove(final E element) {
-+ final int index = this.indexMap.removeInt(element);
-+ if (index >= 0) {
-+ if (this.firstInvalidIndex < 0 || index < this.firstInvalidIndex) {
-+ this.firstInvalidIndex = index;
-+ }
-+ if (this.listElements[index] != element) {
-+ throw new IllegalStateException();
-+ }
-+ this.listElements[index] = null;
-+ if (this.iteratorCount == 0 && this.getFragFactor() >= this.maxFragFactor) {
-+ this.defrag();
-+ }
-+ //this.check();
-+ return true;
-+ }
-+ return false;
-+ }
-+
-+ public boolean contains(final E element) {
-+ return this.indexMap.containsKey(element);
-+ }
-+
-+ public boolean add(final E element) {
-+ final int listSize = this.listSize;
-+
-+ final int previous = this.indexMap.putIfAbsent(element, listSize);
-+ if (previous != -1) {
-+ return false;
-+ }
-+
-+ if (listSize >= this.listElements.length) {
-+ this.listElements = Arrays.copyOf(this.listElements, listSize * 2);
-+ }
-+ this.listElements[listSize] = element;
-+ this.listSize = listSize + 1;
-+
-+ //this.check();
-+ return true;
-+ }
-+
-+ private void defrag() {
-+ if (this.firstInvalidIndex < 0) {
-+ return; // nothing to do
-+ }
-+
-+ if (this.indexMap.isEmpty()) {
-+ Arrays.fill(this.listElements, 0, this.listSize, null);
-+ this.listSize = 0;
-+ this.firstInvalidIndex = -1;
-+ //this.check();
-+ return;
-+ }
-+
-+ final E[] backingArray = this.listElements;
-+
-+ int lastValidIndex;
-+ java.util.Iterator<Reference2IntMap.Entry<E>> iterator;
-+
-+ if (this.firstInvalidIndex == 0) {
-+ iterator = this.indexMap.reference2IntEntrySet().fastIterator();
-+ lastValidIndex = 0;
-+ } else {
-+ lastValidIndex = this.firstInvalidIndex;
-+ final E key = backingArray[lastValidIndex - 1];
-+ iterator = this.indexMap.reference2IntEntrySet().fastIterator(new Reference2IntMap.Entry<E>() {
-+ @Override
-+ public int getIntValue() {
-+ throw new UnsupportedOperationException();
-+ }
-+
-+ @Override
-+ public int setValue(int i) {
-+ throw new UnsupportedOperationException();
-+ }
-+
-+ @Override
-+ public E getKey() {
-+ return key;
-+ }
-+ });
-+ }
-+
-+ while (iterator.hasNext()) {
-+ final Reference2IntMap.Entry<E> entry = iterator.next();
-+
-+ final int newIndex = lastValidIndex++;
-+ backingArray[newIndex] = entry.getKey();
-+ entry.setValue(newIndex);
-+ }
-+
-+ // cleanup end
-+ Arrays.fill(backingArray, lastValidIndex, this.listSize, null);
-+ this.listSize = lastValidIndex;
-+ this.firstInvalidIndex = -1;
-+ //this.check();
-+ }
-+
-+ public E rawGet(final int index) {
-+ return this.listElements[index];
-+ }
-+
-+ public int size() {
-+ // always returns the correct amount - listSize can be different
-+ return this.indexMap.size();
-+ }
-+
-+ public IteratorSafeOrderedReferenceSet.Iterator<E> iterator() {
-+ return this.iterator(0);
-+ }
-+
-+ public IteratorSafeOrderedReferenceSet.Iterator<E> iterator(final int flags) {
-+ ++this.iteratorCount;
-+ return new BaseIterator<>(this, true, (flags & ITERATOR_FLAG_SEE_ADDITIONS) != 0 ? Integer.MAX_VALUE : this.listSize);
-+ }
-+
-+ public java.util.Iterator<E> unsafeIterator() {
-+ return this.unsafeIterator(0);
-+ }
-+ public java.util.Iterator<E> unsafeIterator(final int flags) {
-+ return new BaseIterator<>(this, false, (flags & ITERATOR_FLAG_SEE_ADDITIONS) != 0 ? Integer.MAX_VALUE : this.listSize);
-+ }
-+
-+ public static interface Iterator<E> extends java.util.Iterator<E> {
-+
-+ public void finishedIterating();
-+
-+ }
-+
-+ private static final class BaseIterator<E> implements IteratorSafeOrderedReferenceSet.Iterator<E> {
-+
-+ private final IteratorSafeOrderedReferenceSet<E> set;
-+ private final boolean canFinish;
-+ private final int maxIndex;
-+ private int nextIndex;
-+ private E pendingValue;
-+ private boolean finished;
-+ private E lastReturned;
-+
-+ private BaseIterator(final IteratorSafeOrderedReferenceSet<E> set, final boolean canFinish, final int maxIndex) {
-+ this.set = set;
-+ this.canFinish = canFinish;
-+ this.maxIndex = maxIndex;
-+ }
-+
-+ @Override
-+ public boolean hasNext() {
-+ if (this.finished) {
-+ return false;
-+ }
-+ if (this.pendingValue != null) {
-+ return true;
-+ }
-+
-+ final E[] elements = this.set.listElements;
-+ int index, len;
-+ for (index = this.nextIndex, len = Math.min(this.maxIndex, this.set.listSize); index < len; ++index) {
-+ final E element = elements[index];
-+ if (element != null) {
-+ this.pendingValue = element;
-+ this.nextIndex = index + 1;
-+ return true;
-+ }
-+ }
-+
-+ this.nextIndex = index;
-+ return false;
-+ }
-+
-+ @Override
-+ public E next() {
-+ if (!this.hasNext()) {
-+ throw new NoSuchElementException();
-+ }
-+ final E ret = this.pendingValue;
-+
-+ this.pendingValue = null;
-+ this.lastReturned = ret;
-+
-+ return ret;
-+ }
-+
-+ @Override
-+ public void remove() {
-+ final E lastReturned = this.lastReturned;
-+ if (lastReturned == null) {
-+ throw new IllegalStateException();
-+ }
-+ this.lastReturned = null;
-+ this.set.remove(lastReturned);
-+ }
-+
-+ @Override
-+ public void finishedIterating() {
-+ if (this.finished || !this.canFinish) {
-+ throw new IllegalStateException();
-+ }
-+ this.lastReturned = null;
-+ this.finished = true;
-+ this.set.finishRawIterator();
-+ }
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/ReferenceList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/ReferenceList.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..93e8c8134da8ee1a9b777c708f992922a1a7de8b
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/list/ReferenceList.java
-@@ -0,0 +1,135 @@
-+package ca.spottedleaf.moonrise.common.list;
-+
-+import it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap;
-+import java.util.Arrays;
-+import java.util.Iterator;
-+import java.util.NoSuchElementException;
-+
-+public final class ReferenceList<E> implements Iterable<E> {
-+
-+ private final Reference2IntOpenHashMap<E> referenceToIndex = new Reference2IntOpenHashMap<>(2, 0.8f);
-+ {
-+ this.referenceToIndex.defaultReturnValue(Integer.MIN_VALUE);
-+ }
-+
-+ private static final Object[] EMPTY_LIST = new Object[0];
-+
-+ private E[] references;
-+ private int count;
-+
-+ public ReferenceList() {
-+ this((E[])EMPTY_LIST, 0);
-+ }
-+
-+ public ReferenceList(final E[] array, final int count) {
-+ this.references = array;
-+ this.count = count;
-+ }
-+
-+ public int size() {
-+ return this.count;
-+ }
-+
-+ public boolean contains(final E obj) {
-+ return this.referenceToIndex.containsKey(obj);
-+ }
-+
-+ public boolean remove(final E obj) {
-+ final int index = this.referenceToIndex.removeInt(obj);
-+ if (index == Integer.MIN_VALUE) {
-+ return false;
-+ }
-+
-+ // move the object at the end to this index
-+ final int endIndex = --this.count;
-+ final E end = (E)this.references[endIndex];
-+ if (index != endIndex) {
-+ // not empty after this call
-+ this.referenceToIndex.put(end, index); // update index
-+ }
-+ this.references[index] = end;
-+ this.references[endIndex] = null;
-+
-+ return true;
-+ }
-+
-+ public boolean add(final E obj) {
-+ final int count = this.count;
-+ final int currIndex = this.referenceToIndex.putIfAbsent(obj, count);
-+
-+ if (currIndex != Integer.MIN_VALUE) {
-+ return false; // already in this list
-+ }
-+
-+ E[] list = this.references;
-+
-+ if (list.length == count) {
-+ // resize required
-+ list = this.references = Arrays.copyOf(list, (int)Math.max(4L, count * 2L)); // overflow results in negative
-+ }
-+
-+ list[count] = obj;
-+ this.count = count + 1;
-+
-+ return true;
-+ }
-+
-+ public E getChecked(final int index) {
-+ if (index < 0 || index >= this.count) {
-+ throw new IndexOutOfBoundsException("Index: " + index + " is out of bounds, size: " + this.count);
-+ }
-+ return this.references[index];
-+ }
-+
-+ public E getUnchecked(final int index) {
-+ return this.references[index];
-+ }
-+
-+ public Object[] getRawData() {
-+ return this.references;
-+ }
-+
-+ public E[] getRawDataUnchecked() {
-+ return this.references;
-+ }
-+
-+ public void clear() {
-+ this.referenceToIndex.clear();
-+ Arrays.fill(this.references, 0, this.count, null);
-+ this.count = 0;
-+ }
-+
-+ @Override
-+ public Iterator<E> iterator() {
-+ return new Iterator<>() {
-+ private E lastRet;
-+ private int current;
-+
-+ @Override
-+ public boolean hasNext() {
-+ return this.current < ReferenceList.this.count;
-+ }
-+
-+ @Override
-+ public E next() {
-+ if (this.current >= ReferenceList.this.count) {
-+ throw new NoSuchElementException();
-+ }
-+ return this.lastRet = ReferenceList.this.references[this.current++];
-+ }
-+
-+ @Override
-+ public void remove() {
-+ final E lastRet = this.lastRet;
-+
-+ if (lastRet == null) {
-+ throw new IllegalStateException();
-+ }
-+ this.lastRet = null;
-+
-+ ReferenceList.this.remove(lastRet);
-+ --this.current;
-+ }
-+ };
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/SortedList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/SortedList.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..db92261a6cb3758391108361096417c61bc82cdc
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/list/SortedList.java
-@@ -0,0 +1,117 @@
-+package ca.spottedleaf.moonrise.common.list;
-+
-+import java.lang.reflect.Array;
-+import java.util.Arrays;
-+import java.util.Comparator;
-+
-+public final class SortedList<E> {
-+
-+ private static final Object[] EMPTY_LIST = new Object[0];
-+
-+ private Comparator<? super E> comparator;
-+ private E[] elements;
-+ private int count;
-+
-+ public SortedList(final Comparator<? super E> comparator) {
-+ this((E[])EMPTY_LIST, comparator);
-+ }
-+
-+ public SortedList(final E[] elements, final Comparator<? super E> comparator) {
-+ this.elements = elements;
-+ this.comparator = comparator;
-+ }
-+
-+ // start, end are inclusive
-+ private static <E> int insertIdx(final E[] elements, final E element, final Comparator<E> comparator,
-+ int start, int end) {
-+ while (start <= end) {
-+ final int middle = (start + end) >>> 1;
-+
-+ final E middleVal = elements[middle];
-+
-+ final int cmp = comparator.compare(element, middleVal);
-+
-+ if (cmp < 0) {
-+ end = middle - 1;
-+ } else {
-+ start = middle + 1;
-+ }
-+ }
-+
-+ return start;
-+ }
-+
-+ public int size() {
-+ return this.count;
-+ }
-+
-+ public boolean isEmpty() {
-+ return this.count == 0;
-+ }
-+
-+ public int add(final E element) {
-+ E[] elements = this.elements;
-+ final int count = this.count;
-+ this.count = count + 1;
-+ final Comparator<? super E> comparator = this.comparator;
-+
-+ final int idx = insertIdx(elements, element, comparator, 0, count - 1);
-+
-+ if (count >= elements.length) {
-+ // copy and insert at the same time
-+ if (idx == count) {
-+ this.elements = elements = Arrays.copyOf(elements, (int)Math.max(4L, count * 2L)); // overflow results in negative
-+ elements[count] = element;
-+ return idx;
-+ } else {
-+ final E[] newElements = (E[])Array.newInstance(elements.getClass().getComponentType(), (int)Math.max(4L, count * 2L));
-+ System.arraycopy(elements, 0, newElements, 0, idx);
-+ newElements[idx] = element;
-+ System.arraycopy(elements, idx, newElements, idx + 1, count - idx);
-+ this.elements = newElements;
-+ return idx;
-+ }
-+ } else {
-+ if (idx == count) {
-+ // no copy needed
-+ elements[idx] = element;
-+ return idx;
-+ } else {
-+ // shift elements down
-+ System.arraycopy(elements, idx, elements, idx + 1, count - idx);
-+ elements[idx] = element;
-+ return idx;
-+ }
-+ }
-+ }
-+
-+ public E get(final int idx) {
-+ if (idx < 0 || idx >= this.count) {
-+ throw new IndexOutOfBoundsException(idx);
-+ }
-+ return this.elements[idx];
-+ }
-+
-+
-+ public E remove(final E element) {
-+ E[] elements = this.elements;
-+ final int count = this.count;
-+ final Comparator<? super E> comparator = this.comparator;
-+
-+ final int idx = Arrays.binarySearch(elements, 0, count, element, comparator);
-+ if (idx < 0) {
-+ return null;
-+ }
-+
-+ final int last = this.count - 1;
-+ this.count = last;
-+
-+ final E ret = elements[idx];
-+
-+ System.arraycopy(elements, idx + 1, elements, idx, last - idx);
-+
-+ elements[last] = null;
-+
-+ return ret;
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/Int2IntArraySortedMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/Int2IntArraySortedMap.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..62caf61a4b0b7ebc764006ea8bbd0274594d9f4a
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/map/Int2IntArraySortedMap.java
-@@ -0,0 +1,77 @@
-+package ca.spottedleaf.moonrise.common.map;
-+
-+import it.unimi.dsi.fastutil.ints.Int2IntFunction;
-+
-+import java.util.Arrays;
-+
-+public class Int2IntArraySortedMap {
-+
-+ protected int[] key;
-+ protected int[] val;
-+ protected int size;
-+
-+ public Int2IntArraySortedMap() {
-+ this.key = new int[8];
-+ this.val = new int[8];
-+ }
-+
-+ public int put(final int key, final int value) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index >= 0) {
-+ final int current = this.val[index];
-+ this.val[index] = value;
-+ return current;
-+ }
-+ final int insert = -(index + 1);
-+ // shift entries down
-+ if (this.size >= this.val.length) {
-+ this.key = Arrays.copyOf(this.key, this.key.length * 2);
-+ this.val = Arrays.copyOf(this.val, this.val.length * 2);
-+ }
-+ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
-+ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
-+ ++this.size;
-+
-+ this.key[insert] = key;
-+ this.val[insert] = value;
-+
-+ return 0;
-+ }
-+
-+ public int computeIfAbsent(final int key, final Int2IntFunction producer) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index >= 0) {
-+ return this.val[index];
-+ }
-+ final int insert = -(index + 1);
-+ // shift entries down
-+ if (this.size >= this.val.length) {
-+ this.key = Arrays.copyOf(this.key, this.key.length * 2);
-+ this.val = Arrays.copyOf(this.val, this.val.length * 2);
-+ }
-+ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
-+ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
-+ ++this.size;
-+
-+ this.key[insert] = key;
-+
-+ return this.val[insert] = producer.apply(key);
-+ }
-+
-+ public int get(final int key) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index < 0) {
-+ return 0;
-+ }
-+ return this.val[index];
-+ }
-+
-+ public int getFloor(final int key) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index < 0) {
-+ final int insert = -(index + 1) - 1;
-+ return insert < 0 ? 0 : this.val[insert];
-+ }
-+ return this.val[index];
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/Int2ObjectArraySortedMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/Int2ObjectArraySortedMap.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..fea9e8ba7caaf6259614090d4f872619470d32f9
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/map/Int2ObjectArraySortedMap.java
-@@ -0,0 +1,74 @@
-+package ca.spottedleaf.moonrise.common.map;
-+
-+import java.util.Arrays;
-+import java.util.function.IntFunction;
-+
-+public class Int2ObjectArraySortedMap<V> {
-+
-+ protected int[] key;
-+ protected V[] val;
-+ protected int size;
-+
-+ public Int2ObjectArraySortedMap() {
-+ this.key = new int[8];
-+ this.val = (V[])new Object[8];
-+ }
-+
-+ public V put(final int key, final V value) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index >= 0) {
-+ final V current = this.val[index];
-+ this.val[index] = value;
-+ return current;
-+ }
-+ final int insert = -(index + 1);
-+ // shift entries down
-+ if (this.size >= this.val.length) {
-+ this.key = Arrays.copyOf(this.key, this.key.length * 2);
-+ this.val = Arrays.copyOf(this.val, this.val.length * 2);
-+ }
-+ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
-+ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
-+
-+ this.key[insert] = key;
-+ this.val[insert] = value;
-+
-+ return null;
-+ }
-+
-+ public V computeIfAbsent(final int key, final IntFunction<V> producer) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index >= 0) {
-+ return this.val[index];
-+ }
-+ final int insert = -(index + 1);
-+ // shift entries down
-+ if (this.size >= this.val.length) {
-+ this.key = Arrays.copyOf(this.key, this.key.length * 2);
-+ this.val = Arrays.copyOf(this.val, this.val.length * 2);
-+ }
-+ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
-+ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
-+
-+ this.key[insert] = key;
-+
-+ return this.val[insert] = producer.apply(key);
-+ }
-+
-+ public V get(final int key) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index < 0) {
-+ return null;
-+ }
-+ return this.val[index];
-+ }
-+
-+ public V getFloor(final int key) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index < 0) {
-+ final int insert = -(index + 1);
-+ return this.val[insert];
-+ }
-+ return this.val[index];
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/Long2IntArraySortedMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/Long2IntArraySortedMap.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..c077ca606934e9f13da3a8e2a194f82a99fe9ae9
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/map/Long2IntArraySortedMap.java
-@@ -0,0 +1,77 @@
-+package ca.spottedleaf.moonrise.common.map;
-+
-+import it.unimi.dsi.fastutil.longs.Long2IntFunction;
-+
-+import java.util.Arrays;
-+
-+public class Long2IntArraySortedMap {
-+
-+ protected long[] key;
-+ protected int[] val;
-+ protected int size;
-+
-+ public Long2IntArraySortedMap() {
-+ this.key = new long[8];
-+ this.val = new int[8];
-+ }
-+
-+ public int put(final long key, final int value) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index >= 0) {
-+ final int current = this.val[index];
-+ this.val[index] = value;
-+ return current;
-+ }
-+ final int insert = -(index + 1);
-+ // shift entries down
-+ if (this.size >= this.val.length) {
-+ this.key = Arrays.copyOf(this.key, this.key.length * 2);
-+ this.val = Arrays.copyOf(this.val, this.val.length * 2);
-+ }
-+ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
-+ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
-+ ++this.size;
-+
-+ this.key[insert] = key;
-+ this.val[insert] = value;
-+
-+ return 0;
-+ }
-+
-+ public int computeIfAbsent(final long key, final Long2IntFunction producer) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index >= 0) {
-+ return this.val[index];
-+ }
-+ final int insert = -(index + 1);
-+ // shift entries down
-+ if (this.size >= this.val.length) {
-+ this.key = Arrays.copyOf(this.key, this.key.length * 2);
-+ this.val = Arrays.copyOf(this.val, this.val.length * 2);
-+ }
-+ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
-+ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
-+ ++this.size;
-+
-+ this.key[insert] = key;
-+
-+ return this.val[insert] = producer.apply(key);
-+ }
-+
-+ public int get(final long key) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index < 0) {
-+ return 0;
-+ }
-+ return this.val[index];
-+ }
-+
-+ public int getFloor(final long key) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index < 0) {
-+ final int insert = -(index + 1) - 1;
-+ return insert < 0 ? 0 : this.val[insert];
-+ }
-+ return this.val[index];
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/Long2ObjectArraySortedMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/Long2ObjectArraySortedMap.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..b24d037af5709196b66c79c692e1814cd5b20e49
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/map/Long2ObjectArraySortedMap.java
-@@ -0,0 +1,76 @@
-+package ca.spottedleaf.moonrise.common.map;
-+
-+import java.util.Arrays;
-+import java.util.function.LongFunction;
-+
-+public class Long2ObjectArraySortedMap<V> {
-+
-+ protected long[] key;
-+ protected V[] val;
-+ protected int size;
-+
-+ public Long2ObjectArraySortedMap() {
-+ this.key = new long[8];
-+ this.val = (V[])new Object[8];
-+ }
-+
-+ public V put(final long key, final V value) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index >= 0) {
-+ final V current = this.val[index];
-+ this.val[index] = value;
-+ return current;
-+ }
-+ final int insert = -(index + 1);
-+ // shift entries down
-+ if (this.size >= this.val.length) {
-+ this.key = Arrays.copyOf(this.key, this.key.length * 2);
-+ this.val = Arrays.copyOf(this.val, this.val.length * 2);
-+ }
-+ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
-+ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
-+ ++this.size;
-+
-+ this.key[insert] = key;
-+ this.val[insert] = value;
-+
-+ return null;
-+ }
-+
-+ public V computeIfAbsent(final long key, final LongFunction<V> producer) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index >= 0) {
-+ return this.val[index];
-+ }
-+ final int insert = -(index + 1);
-+ // shift entries down
-+ if (this.size >= this.val.length) {
-+ this.key = Arrays.copyOf(this.key, this.key.length * 2);
-+ this.val = Arrays.copyOf(this.val, this.val.length * 2);
-+ }
-+ System.arraycopy(this.key, insert, this.key, insert + 1, this.size - insert);
-+ System.arraycopy(this.val, insert, this.val, insert + 1, this.size - insert);
-+ ++this.size;
-+
-+ this.key[insert] = key;
-+
-+ return this.val[insert] = producer.apply(key);
-+ }
-+
-+ public V get(final long key) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index < 0) {
-+ return null;
-+ }
-+ return this.val[index];
-+ }
-+
-+ public V getFloor(final long key) {
-+ final int index = Arrays.binarySearch(this.key, 0, this.size, key);
-+ if (index < 0) {
-+ final int insert = -(index + 1) - 1;
-+ return insert < 0 ? null : this.val[insert];
-+ }
-+ return this.val[index];
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2BooleanMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2BooleanMap.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..aa86882bb7b0712f29d7344009093c0e7a81be84
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2BooleanMap.java
-@@ -0,0 +1,48 @@
-+package ca.spottedleaf.moonrise.common.map;
-+
-+import it.unimi.dsi.fastutil.longs.Long2BooleanFunction;
-+import it.unimi.dsi.fastutil.longs.Long2BooleanLinkedOpenHashMap;
-+
-+public final class SynchronisedLong2BooleanMap {
-+ private final Long2BooleanLinkedOpenHashMap map = new Long2BooleanLinkedOpenHashMap();
-+ private final int limit;
-+
-+ public SynchronisedLong2BooleanMap(final int limit) {
-+ this.limit = limit;
-+ }
-+
-+ // must hold lock on map
-+ private void purgeEntries() {
-+ while (this.map.size() > this.limit) {
-+ this.map.removeLastBoolean();
-+ }
-+ }
-+
-+ public boolean remove(final long key) {
-+ synchronized (this.map) {
-+ return this.map.remove(key);
-+ }
-+ }
-+
-+ // note:
-+ public boolean getOrCompute(final long key, final Long2BooleanFunction ifAbsent) {
-+ synchronized (this.map) {
-+ if (this.map.containsKey(key)) {
-+ return this.map.getAndMoveToFirst(key);
-+ }
-+ }
-+
-+ final boolean put = ifAbsent.get(key);
-+
-+ synchronized (this.map) {
-+ if (this.map.containsKey(key)) {
-+ return this.map.getAndMoveToFirst(key);
-+ }
-+ this.map.putAndMoveToFirst(key, put);
-+
-+ this.purgeEntries();
-+
-+ return put;
-+ }
-+ }
-+}
-\ No newline at end of file
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2ObjectMap.java b/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2ObjectMap.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..dbb51afc6cefe0071fe3ddcd2c1109f2755c3b4d
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/map/SynchronisedLong2ObjectMap.java
-@@ -0,0 +1,47 @@
-+package ca.spottedleaf.moonrise.common.map;
-+
-+import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
-+import java.util.function.BiFunction;
-+
-+public final class SynchronisedLong2ObjectMap<V> {
-+ private final Long2ObjectLinkedOpenHashMap<V> map = new Long2ObjectLinkedOpenHashMap<>();
-+ private final int limit;
-+
-+ public SynchronisedLong2ObjectMap(final int limit) {
-+ this.limit = limit;
-+ }
-+
-+ // must hold lock on map
-+ private void purgeEntries() {
-+ while (this.map.size() > this.limit) {
-+ this.map.removeLast();
-+ }
-+ }
-+
-+ public V get(final long key) {
-+ synchronized (this.map) {
-+ return this.map.getAndMoveToFirst(key);
-+ }
-+ }
-+
-+ public V put(final long key, final V value) {
-+ synchronized (this.map) {
-+ final V ret = this.map.putAndMoveToFirst(key, value);
-+ this.purgeEntries();
-+ return ret;
-+ }
-+ }
-+
-+ public V compute(final long key, final BiFunction<? super Long, ? super V, ? extends V> remappingFunction) {
-+ synchronized (this.map) {
-+ // first, compute the value - if one is added, it will be at the last entry
-+ this.map.compute(key, remappingFunction);
-+ // move the entry to first, just in case it was added at last
-+ final V ret = this.map.getAndMoveToFirst(key);
-+ // now purge the last entries
-+ this.purgeEntries();
-+
-+ return ret;
-+ }
-+ }
-+}
-\ No newline at end of file
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/AllocatingRateLimiter.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/AllocatingRateLimiter.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..9c0eff9017b24bb65b1029cefb5d0bfcb9beff01
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/AllocatingRateLimiter.java
-@@ -0,0 +1,75 @@
-+package ca.spottedleaf.moonrise.common.misc;
-+
-+public final class AllocatingRateLimiter {
-+
-+ // max difference granularity in ns
-+ private final long maxGranularity;
-+
-+ private double allocation = 0.0;
-+ private long lastAllocationUpdate;
-+ // the carry is used to store the remainder of the last take, so that the take amount remains the same (minus floating point error)
-+ // over any time period using take regardless of the number of take calls or the intervals between the take calls
-+ // i.e. take obtains 3.5 elements, stores 0.5 to this field for the next take() call to use and returns 3
-+ private double takeCarry = 0.0;
-+ private long lastTakeUpdate;
-+
-+ public AllocatingRateLimiter(final long maxGranularity) {
-+ this.maxGranularity = maxGranularity;
-+ }
-+
-+ public void reset(final long time) {
-+ this.allocation = 0.0;
-+ this.lastAllocationUpdate = time;
-+ this.takeCarry = 0.0;
-+ this.lastTakeUpdate = time;
-+ }
-+
-+ // rate in units/s, and time in ns
-+ public void tickAllocation(final long time, final double rate, final double maxAllocation) {
-+ final long diff = Math.min(this.maxGranularity, time - this.lastAllocationUpdate);
-+ this.lastAllocationUpdate = time;
-+
-+ this.allocation = Math.min(maxAllocation - this.takeCarry, this.allocation + rate * (diff*1.0E-9D));
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java b/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java
+index da323a1105347d5cf4b946df10ded78a953236f2..79ea42ff287beadb997d5d805a3d5faa6f80216a 100644
+--- a/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java
+@@ -1,6 +1,10 @@
+ package ca.spottedleaf.moonrise.common.util;
+
+ import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
++import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel;
++import ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkSystemLevelChunk;
++import ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader;
++import ca.spottedleaf.moonrise.patches.chunk_system.world.ChunkSystemServerChunkCache;
+ import com.mojang.logging.LogUtils;
+ import net.minecraft.server.level.ChunkHolder;
+ import net.minecraft.server.level.FullChunkStatus;
+@@ -17,203 +21,46 @@ import java.util.function.Consumer;
+ public final class ChunkSystem {
+
+ private static final Logger LOGGER = LogUtils.getLogger();
+- private static final net.minecraft.world.level.chunk.status.ChunkStep FULL_CHUNK_STEP = net.minecraft.world.level.chunk.status.ChunkPyramid.GENERATION_PYRAMID.getStepTo(ChunkStatus.FULL);
+-
+- private static int getDistance(final ChunkStatus status) {
+- return FULL_CHUNK_STEP.getAccumulatedRadiusOf(status);
+- }
+
+ public static void scheduleChunkTask(final ServerLevel level, final int chunkX, final int chunkZ, final Runnable run) {
+ scheduleChunkTask(level, chunkX, chunkZ, run, PrioritisedExecutor.Priority.NORMAL);
+ }
+
+ public static void scheduleChunkTask(final ServerLevel level, final int chunkX, final int chunkZ, final Runnable run, final PrioritisedExecutor.Priority priority) {
+- level.chunkSource.mainThreadProcessor.execute(run);
++ ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().scheduleChunkTask(chunkX, chunkZ, run, priority);
+ }
+
+ public static void scheduleChunkLoad(final ServerLevel level, final int chunkX, final int chunkZ, final boolean gen,
+ final ChunkStatus toStatus, final boolean addTicket, final PrioritisedExecutor.Priority priority,
+ final Consumer<ChunkAccess> onComplete) {
+- if (gen) {
+- scheduleChunkLoad(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
+- return;
+- }
+- scheduleChunkLoad(level, chunkX, chunkZ, ChunkStatus.EMPTY, addTicket, priority, (final ChunkAccess chunk) -> {
+- if (chunk == null) {
+- if (onComplete != null) {
+- onComplete.accept(null);
+- }
+- } else {
+- if (chunk.getPersistedStatus().isOrAfter(toStatus)) {
+- scheduleChunkLoad(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
+- } else {
+- if (onComplete != null) {
+- onComplete.accept(null);
+- }
+- }
+- }
+- });
++ ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().scheduleChunkLoad(chunkX, chunkZ, gen, toStatus, addTicket, priority, onComplete);
+ }
+
+- static final net.minecraft.server.level.TicketType<Long> CHUNK_LOAD = net.minecraft.server.level.TicketType.create("chunk_load", Long::compareTo);
+-
+- private static long chunkLoadCounter = 0L;
+ public static void scheduleChunkLoad(final ServerLevel level, final int chunkX, final int chunkZ, final ChunkStatus toStatus,
+ final boolean addTicket, final PrioritisedExecutor.Priority priority, final Consumer<ChunkAccess> onComplete) {
+- if (!org.bukkit.Bukkit.isPrimaryThread()) {
+- scheduleChunkTask(level, chunkX, chunkZ, () -> {
+- scheduleChunkLoad(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
+- }, priority);
+- return;
+- }
+-
+- final int minLevel = 33 + getDistance(toStatus);
+- final Long chunkReference = addTicket ? Long.valueOf(++chunkLoadCounter) : null;
+- final net.minecraft.world.level.ChunkPos chunkPos = new net.minecraft.world.level.ChunkPos(chunkX, chunkZ);
+-
+- if (addTicket) {
+- level.chunkSource.addTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
+- }
+- level.chunkSource.runDistanceManagerUpdates();
+-
+- final Consumer<ChunkAccess> loadCallback = (final ChunkAccess chunk) -> {
+- try {
+- if (onComplete != null) {
+- onComplete.accept(chunk);
+- }
+- } catch (final Throwable thr) {
+- LOGGER.error("Exception handling chunk load callback", thr);
+- com.destroystokyo.paper.util.SneakyThrow.sneaky(thr);
+- } finally {
+- if (addTicket) {
+- level.chunkSource.addTicketAtLevel(net.minecraft.server.level.TicketType.UNKNOWN, chunkPos, minLevel, chunkPos);
+- level.chunkSource.removeTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
+- }
+- }
+- };
+-
+- final ChunkHolder holder = level.chunkSource.chunkMap.updatingChunkMap.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
+-
+- if (holder == null || holder.getTicketLevel() > minLevel) {
+- loadCallback.accept(null);
+- return;
+- }
+-
+- final java.util.concurrent.CompletableFuture<net.minecraft.server.level.ChunkResult<net.minecraft.world.level.chunk.ChunkAccess>> loadFuture = holder.scheduleChunkGenerationTask(toStatus, level.chunkSource.chunkMap);
+-
+- if (loadFuture.isDone()) {
+- loadCallback.accept(loadFuture.join().orElse(null));
+- return;
+- }
+-
+- loadFuture.whenCompleteAsync((final net.minecraft.server.level.ChunkResult<net.minecraft.world.level.chunk.ChunkAccess> result, final Throwable thr) -> {
+- if (thr != null) {
+- loadCallback.accept(null);
+- return;
+- }
+- loadCallback.accept(result.orElse(null));
+- }, (final Runnable r) -> {
+- scheduleChunkTask(level, chunkX, chunkZ, r, PrioritisedExecutor.Priority.HIGHEST);
+- });
++ ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().scheduleChunkLoad(chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
+ }
+
+ 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) {
+- // This method goes unused until the chunk system rewrite
+- if (toStatus == FullChunkStatus.INACCESSIBLE) {
+- throw new IllegalArgumentException("Cannot wait for INACCESSIBLE status");
+- }
+-
+- if (!org.bukkit.Bukkit.isPrimaryThread()) {
+- scheduleChunkTask(level, chunkX, chunkZ, () -> {
+- scheduleTickingState(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
+- }, priority);
+- return;
+- }
+-
+- final int minLevel = 33 - (toStatus.ordinal() - 1);
+- final int radius = toStatus.ordinal() - 1;
+- final Long chunkReference = addTicket ? Long.valueOf(++chunkLoadCounter) : null;
+- final net.minecraft.world.level.ChunkPos chunkPos = new net.minecraft.world.level.ChunkPos(chunkX, chunkZ);
+-
+- if (addTicket) {
+- level.chunkSource.addTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
+- }
+- level.chunkSource.runDistanceManagerUpdates();
+-
+- final Consumer<LevelChunk> loadCallback = (final LevelChunk chunk) -> {
+- try {
+- if (onComplete != null) {
+- onComplete.accept(chunk);
+- }
+- } catch (final Throwable thr) {
+- LOGGER.error("Exception handling chunk load callback", thr);
+- com.destroystokyo.paper.util.SneakyThrow.sneaky(thr);
+- } finally {
+- if (addTicket) {
+- level.chunkSource.addTicketAtLevel(net.minecraft.server.level.TicketType.UNKNOWN, chunkPos, minLevel, chunkPos);
+- level.chunkSource.removeTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
+- }
+- }
+- };
+-
+- final ChunkHolder holder = level.chunkSource.chunkMap.updatingChunkMap.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
+-
+- if (holder == null || holder.getTicketLevel() > minLevel) {
+- loadCallback.accept(null);
+- return;
+- }
+-
+- final java.util.concurrent.CompletableFuture<net.minecraft.server.level.ChunkResult<net.minecraft.world.level.chunk.LevelChunk>> tickingState;
+- switch (toStatus) {
+- case FULL: {
+- tickingState = holder.getFullChunkFuture();
+- break;
+- }
+- case BLOCK_TICKING: {
+- tickingState = holder.getTickingChunkFuture();
+- break;
+- }
+- case ENTITY_TICKING: {
+- tickingState = holder.getEntityTickingChunkFuture();
+- break;
+- }
+- default: {
+- throw new IllegalStateException("Cannot reach here");
+- }
+- }
+-
+- if (tickingState.isDone()) {
+- loadCallback.accept(tickingState.join().orElse(null));
+- return;
+- }
+-
+- tickingState.whenCompleteAsync((final net.minecraft.server.level.ChunkResult<net.minecraft.world.level.chunk.LevelChunk> result, final Throwable thr) -> {
+- if (thr != null) {
+- loadCallback.accept(null);
+- return;
+- }
+- loadCallback.accept(result.orElse(null));
+- }, (final Runnable r) -> {
+- scheduleChunkTask(level, chunkX, chunkZ, r, PrioritisedExecutor.Priority.HIGHEST);
+- });
++ ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().scheduleTickingState(chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
+ }
+
+ public static List<ChunkHolder> getVisibleChunkHolders(final ServerLevel level) {
+- return new java.util.ArrayList<>(level.chunkSource.chunkMap.visibleChunkMap.values());
++ return ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().chunkHolderManager.getOldChunkHolders();
+ }
+
+ public static List<ChunkHolder> getUpdatingChunkHolders(final ServerLevel level) {
+- return new java.util.ArrayList<>(level.chunkSource.chunkMap.updatingChunkMap.values());
++ return ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().chunkHolderManager.getOldChunkHolders();
+ }
+
+ public static int getVisibleChunkHolderCount(final ServerLevel level) {
+- return level.chunkSource.chunkMap.visibleChunkMap.size();
++ return ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().chunkHolderManager.size();
+ }
+
+ public static int getUpdatingChunkHolderCount(final ServerLevel level) {
+- return level.chunkSource.chunkMap.updatingChunkMap.size();
++ return ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().chunkHolderManager.size();
+ }
+
+ public static boolean hasAnyChunkHolders(final ServerLevel level) {
+@@ -232,52 +79,83 @@ public final class ChunkSystem {
+
+ }
+
+- public static void onChunkBorder(final LevelChunk chunk, final ChunkHolder holder) {
++ public static void onChunkPreBorder(final LevelChunk chunk, final ChunkHolder holder) {
++ ((ChunkSystemServerChunkCache)((ServerLevel)chunk.getLevel()).getChunkSource())
++ .moonrise$setFullChunk(chunk.getPos().x, chunk.getPos().z, chunk);
+ }
-+
-+ public long previewAllocation(final long time, final double rate, final long maxTake) {
-+ if (maxTake < 1L) {
-+ return 0L;
-+ }
-+
-+ final long diff = Math.min(this.maxGranularity, time - this.lastTakeUpdate);
-+
-+ // note: abs(takeCarry) <= 1.0
-+ final double take = Math.min(
-+ Math.min((double)maxTake - this.takeCarry, this.allocation),
-+ rate * (diff*1.0E-9)
+
++ public static void onChunkBorder(final LevelChunk chunk, final ChunkHolder holder) {
++ ((ChunkSystemServerLevel)((ServerLevel)chunk.getLevel())).moonrise$getLoadedChunks().add(
++ ((ChunkSystemLevelChunk)chunk).moonrise$getChunkAndHolder()
+ );
-+
-+ return (long)Math.floor(this.takeCarry + take);
-+ }
-+
-+ // rate in units/s, and time in ns
-+ public long takeAllocation(final long time, final double rate, final long maxTake) {
-+ if (maxTake < 1L) {
-+ return 0L;
-+ }
-+
-+ double ret = this.takeCarry;
-+ final long diff = Math.min(this.maxGranularity, time - this.lastTakeUpdate);
-+ this.lastTakeUpdate = time;
-+
-+ // note: abs(takeCarry) <= 1.0
-+ final double take = Math.min(
-+ Math.min((double)maxTake - this.takeCarry, this.allocation),
-+ rate * (diff*1.0E-9)
+ }
+
+ public static void onChunkNotBorder(final LevelChunk chunk, final ChunkHolder holder) {
++ ((ChunkSystemServerLevel)((ServerLevel)chunk.getLevel())).moonrise$getLoadedChunks().remove(
++ ((ChunkSystemLevelChunk)chunk).moonrise$getChunkAndHolder()
+ );
-+
-+ ret += take;
-+ this.allocation -= take;
-+
-+ final long retInteger = (long)Math.floor(ret);
-+ this.takeCarry = ret - (double)retInteger;
-+
-+ return retInteger;
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed26WayDistancePropagator3D.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed26WayDistancePropagator3D.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..460e27ab0506c83a28934800ee74ee886d4b025e
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed26WayDistancePropagator3D.java
-@@ -0,0 +1,297 @@
-+package ca.spottedleaf.moonrise.common.misc;
-+
-+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
-+import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap;
-+import it.unimi.dsi.fastutil.longs.LongIterator;
-+import it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet;
-+
-+public final class Delayed26WayDistancePropagator3D {
-+
-+ // this map is considered "stale" unless updates are propagated.
-+ protected final Delayed8WayDistancePropagator2D.LevelMap levels = new Delayed8WayDistancePropagator2D.LevelMap(8192*2, 0.6f);
-+
-+ // this map is never stale
-+ protected final Long2ByteOpenHashMap sources = new Long2ByteOpenHashMap(4096, 0.6f);
-+
-+ // Generally updates to positions are made close to other updates, so we link to decrease cache misses when
-+ // propagating updates
-+ protected final LongLinkedOpenHashSet updatedSources = new LongLinkedOpenHashSet();
-+
-+ @FunctionalInterface
-+ public static interface LevelChangeCallback {
-+
-+ /**
-+ * This can be called for intermediate updates. So do not rely on newLevel being close to or
-+ * the exact level that is expected after a full propagation has occured.
-+ */
-+ public void onLevelUpdate(final long coordinate, final byte oldLevel, final byte newLevel);
-+
-+ }
-+
-+ protected final LevelChangeCallback changeCallback;
-+
-+ public Delayed26WayDistancePropagator3D() {
-+ this(null);
-+ }
-+
-+ public Delayed26WayDistancePropagator3D(final LevelChangeCallback changeCallback) {
-+ this.changeCallback = changeCallback;
-+ }
-+
-+ public int getLevel(final long pos) {
-+ return this.levels.get(pos);
-+ }
-+
-+ public int getLevel(final int x, final int y, final int z) {
-+ return this.levels.get(CoordinateUtils.getChunkSectionKey(x, y, z));
-+ }
-+
-+ public void setSource(final int x, final int y, final int z, final int level) {
-+ this.setSource(CoordinateUtils.getChunkSectionKey(x, y, z), level);
-+ }
-+
-+ public void setSource(final long coordinate, final int level) {
-+ if ((level & 63) != level || level == 0) {
-+ throw new IllegalArgumentException("Level must be in (0, 63], not " + level);
-+ }
-+
-+ final byte byteLevel = (byte)level;
-+ final byte oldLevel = this.sources.put(coordinate, byteLevel);
-+
-+ if (oldLevel == byteLevel) {
-+ return; // nothing to do
-+ }
-+
-+ // queue to update later
-+ this.updatedSources.add(coordinate);
-+ }
-+
-+ public void removeSource(final int x, final int y, final int z) {
-+ this.removeSource(CoordinateUtils.getChunkSectionKey(x, y, z));
-+ }
-+
-+ public void removeSource(final long coordinate) {
-+ if (this.sources.remove(coordinate) != 0) {
-+ this.updatedSources.add(coordinate);
-+ }
-+ }
-+
-+ // queues used for BFS propagating levels
-+ protected final Delayed8WayDistancePropagator2D.WorkQueue[] levelIncreaseWorkQueues = new Delayed8WayDistancePropagator2D.WorkQueue[64];
-+ {
-+ for (int i = 0; i < this.levelIncreaseWorkQueues.length; ++i) {
-+ this.levelIncreaseWorkQueues[i] = new Delayed8WayDistancePropagator2D.WorkQueue();
-+ }
-+ }
-+ protected final Delayed8WayDistancePropagator2D.WorkQueue[] levelRemoveWorkQueues = new Delayed8WayDistancePropagator2D.WorkQueue[64];
-+ {
-+ for (int i = 0; i < this.levelRemoveWorkQueues.length; ++i) {
-+ this.levelRemoveWorkQueues[i] = new Delayed8WayDistancePropagator2D.WorkQueue();
-+ }
-+ }
-+ protected long levelIncreaseWorkQueueBitset;
-+ protected long levelRemoveWorkQueueBitset;
-+
-+ protected final void addToIncreaseWorkQueue(final long coordinate, final byte level) {
-+ final Delayed8WayDistancePropagator2D.WorkQueue queue = this.levelIncreaseWorkQueues[level];
-+ queue.queuedCoordinates.enqueue(coordinate);
-+ queue.queuedLevels.enqueue(level);
-+
-+ this.levelIncreaseWorkQueueBitset |= (1L << level);
-+ }
-+
-+ protected final void addToIncreaseWorkQueue(final long coordinate, final byte index, final byte level) {
-+ final Delayed8WayDistancePropagator2D.WorkQueue queue = this.levelIncreaseWorkQueues[index];
-+ queue.queuedCoordinates.enqueue(coordinate);
-+ queue.queuedLevels.enqueue(level);
-+
-+ this.levelIncreaseWorkQueueBitset |= (1L << index);
-+ }
-+
-+ protected final void addToRemoveWorkQueue(final long coordinate, final byte level) {
-+ final Delayed8WayDistancePropagator2D.WorkQueue queue = this.levelRemoveWorkQueues[level];
-+ queue.queuedCoordinates.enqueue(coordinate);
-+ queue.queuedLevels.enqueue(level);
-+
-+ this.levelRemoveWorkQueueBitset |= (1L << level);
-+ }
-+
-+ public boolean propagateUpdates() {
-+ if (this.updatedSources.isEmpty()) {
-+ return false;
-+ }
-+
-+ boolean ret = false;
-+
-+ for (final LongIterator iterator = this.updatedSources.iterator(); iterator.hasNext();) {
-+ final long coordinate = iterator.nextLong();
-+
-+ final byte currentLevel = this.levels.get(coordinate);
-+ final byte updatedSource = this.sources.get(coordinate);
-+
-+ if (currentLevel == updatedSource) {
-+ continue;
-+ }
-+ ret = true;
-+
-+ if (updatedSource > currentLevel) {
-+ // level increase
-+ this.addToIncreaseWorkQueue(coordinate, updatedSource);
-+ } else {
-+ // level decrease
-+ this.addToRemoveWorkQueue(coordinate, currentLevel);
-+ // if the current coordinate is a source, then the decrease propagation will detect that and queue
-+ // the source propagation
-+ }
-+ }
-+
-+ this.updatedSources.clear();
-+
-+ // propagate source level increases first for performance reasons (in crowded areas hopefully the additions
-+ // make the removes remove less)
-+ this.propagateIncreases();
-+
-+ // now we propagate the decreases (which will then re-propagate clobbered sources)
-+ this.propagateDecreases();
-+
-+ return ret;
-+ }
-+
-+ protected void propagateIncreases() {
-+ for (int queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelIncreaseWorkQueueBitset);
-+ this.levelIncreaseWorkQueueBitset != 0L;
-+ this.levelIncreaseWorkQueueBitset ^= (1L << queueIndex), queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelIncreaseWorkQueueBitset)) {
-+
-+ final Delayed8WayDistancePropagator2D.WorkQueue queue = this.levelIncreaseWorkQueues[queueIndex];
-+ while (!queue.queuedLevels.isEmpty()) {
-+ final long coordinate = queue.queuedCoordinates.removeFirstLong();
-+ byte level = queue.queuedLevels.removeFirstByte();
-+
-+ final boolean neighbourCheck = level < 0;
-+
-+ final byte currentLevel;
-+ if (neighbourCheck) {
-+ level = (byte)-level;
-+ currentLevel = this.levels.get(coordinate);
-+ } else {
-+ currentLevel = this.levels.putIfGreater(coordinate, level);
-+ }
-+
-+ if (neighbourCheck) {
-+ // used when propagating from decrease to indicate that this level needs to check its neighbours
-+ // this means the level at coordinate could be equal, but would still need neighbours checked
-+
-+ if (currentLevel != level) {
-+ // something caused the level to change, which means something propagated to it (which means
-+ // us propagating here is redundant), or something removed the level (which means we
-+ // cannot propagate further)
-+ continue;
-+ }
-+ } else if (currentLevel >= level) {
-+ // something higher/equal propagated
-+ continue;
-+ }
-+ if (this.changeCallback != null) {
-+ this.changeCallback.onLevelUpdate(coordinate, currentLevel, level);
-+ }
-+
-+ if (level == 1) {
-+ // can't propagate 0 to neighbours
-+ continue;
-+ }
-+
-+ // propagate to neighbours
-+ final byte neighbourLevel = (byte)(level - 1);
-+ final int x = CoordinateUtils.getChunkSectionX(coordinate);
-+ final int y = CoordinateUtils.getChunkSectionY(coordinate);
-+ final int z = CoordinateUtils.getChunkSectionZ(coordinate);
-+
-+ for (int dy = -1; dy <= 1; ++dy) {
-+ for (int dz = -1; dz <= 1; ++dz) {
-+ for (int dx = -1; dx <= 1; ++dx) {
-+ if ((dy | dz | dx) == 0) {
-+ // already propagated to coordinate
-+ continue;
-+ }
-+
-+ // sure we can check the neighbour level in the map right now and avoid a propagation,
-+ // but then we would still have to recheck it when popping the value off of the queue!
-+ // so just avoid the double lookup
-+ final long neighbourCoordinate = CoordinateUtils.getChunkSectionKey(dx + x, dy + y, dz + z);
-+ this.addToIncreaseWorkQueue(neighbourCoordinate, neighbourLevel);
-+ }
-+ }
-+ }
-+ }
-+ }
-+ }
-+
-+ protected void propagateDecreases() {
-+ for (int queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelRemoveWorkQueueBitset);
-+ this.levelRemoveWorkQueueBitset != 0L;
-+ this.levelRemoveWorkQueueBitset ^= (1L << queueIndex), queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelRemoveWorkQueueBitset)) {
-+
-+ final Delayed8WayDistancePropagator2D.WorkQueue queue = this.levelRemoveWorkQueues[queueIndex];
-+ while (!queue.queuedLevels.isEmpty()) {
-+ final long coordinate = queue.queuedCoordinates.removeFirstLong();
-+ final byte level = queue.queuedLevels.removeFirstByte();
-+
-+ final byte currentLevel = this.levels.removeIfGreaterOrEqual(coordinate, level);
-+ if (currentLevel == 0) {
-+ // something else removed
-+ continue;
-+ }
-+
-+ if (currentLevel > level) {
-+ // something higher propagated here or we hit the propagation of another source
-+ // in the second case we need to re-propagate because we could have just clobbered another source's
-+ // propagation
-+ this.addToIncreaseWorkQueue(coordinate, currentLevel, (byte)-currentLevel); // indicate to the increase code that the level's neighbours need checking
-+ continue;
-+ }
-+
-+ if (this.changeCallback != null) {
-+ this.changeCallback.onLevelUpdate(coordinate, currentLevel, (byte)0);
-+ }
-+
-+ final byte source = this.sources.get(coordinate);
-+ if (source != 0) {
-+ // must re-propagate source later
-+ this.addToIncreaseWorkQueue(coordinate, source);
-+ }
-+
-+ if (level == 0) {
-+ // can't propagate -1 to neighbours
-+ // we have to check neighbours for removing 1 just in case the neighbour is 2
-+ continue;
-+ }
-+
-+ // propagate to neighbours
-+ final byte neighbourLevel = (byte)(level - 1);
-+ final int x = CoordinateUtils.getChunkSectionX(coordinate);
-+ final int y = CoordinateUtils.getChunkSectionY(coordinate);
-+ final int z = CoordinateUtils.getChunkSectionZ(coordinate);
-+
-+ for (int dy = -1; dy <= 1; ++dy) {
-+ for (int dz = -1; dz <= 1; ++dz) {
-+ for (int dx = -1; dx <= 1; ++dx) {
-+ if ((dy | dz | dx) == 0) {
-+ // already propagated to coordinate
-+ continue;
-+ }
-+
-+ // sure we can check the neighbour level in the map right now and avoid a propagation,
-+ // but then we would still have to recheck it when popping the value off of the queue!
-+ // so just avoid the double lookup
-+ final long neighbourCoordinate = CoordinateUtils.getChunkSectionKey(dx + x, dy + y, dz + z);
-+ this.addToRemoveWorkQueue(neighbourCoordinate, neighbourLevel);
-+ }
-+ }
-+ }
-+ }
-+ }
-+
-+ // propagate sources we clobbered in the process
-+ this.propagateIncreases();
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed8WayDistancePropagator2D.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed8WayDistancePropagator2D.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..ab2fa1563d5e32a5313dfcc1da411cab45fb5ca0
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/Delayed8WayDistancePropagator2D.java
-@@ -0,0 +1,718 @@
-+package ca.spottedleaf.moonrise.common.misc;
-+
-+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
-+import it.unimi.dsi.fastutil.HashCommon;
-+import it.unimi.dsi.fastutil.bytes.ByteArrayFIFOQueue;
-+import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap;
-+import it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue;
-+import it.unimi.dsi.fastutil.longs.LongIterator;
-+import it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet;
-+
-+public final class Delayed8WayDistancePropagator2D {
-+
-+ // Test
-+ /*
-+ protected static void test(int x, int z, com.destroystokyo.paper.util.misc.DistanceTrackingAreaMap<Ticket> reference, Delayed8WayDistancePropagator2D test) {
-+ int got = test.getLevel(x, z);
-+
-+ int expect = 0;
-+ Object[] nearest = reference.getObjectsInRange(x, z) == null ? null : reference.getObjectsInRange(x, z).getBackingSet();
-+ if (nearest != null) {
-+ for (Object _obj : nearest) {
-+ if (_obj instanceof Ticket) {
-+ Ticket ticket = (Ticket)_obj;
-+ long ticketCoord = reference.getLastCoordinate(ticket);
-+ int viewDistance = reference.getLastViewDistance(ticket);
-+ int distance = Math.max(com.destroystokyo.paper.util.math.IntegerUtil.branchlessAbs(MCUtil.getCoordinateX(ticketCoord) - x),
-+ com.destroystokyo.paper.util.math.IntegerUtil.branchlessAbs(MCUtil.getCoordinateZ(ticketCoord) - z));
-+ int level = viewDistance - distance;
-+ if (level > expect) {
-+ expect = level;
-+ }
-+ }
-+ }
-+ }
-+
-+ if (expect != got) {
-+ throw new IllegalStateException("Expected " + expect + " at pos (" + x + "," + z + ") but got " + got);
-+ }
-+ }
-+
-+ static class Ticket {
-+
-+ int x;
-+ int z;
-+
-+ final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<Ticket> empty
-+ = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this);
-+
-+ }
-+
-+ public static void main(final String[] args) {
-+ com.destroystokyo.paper.util.misc.DistanceTrackingAreaMap<Ticket> reference = new com.destroystokyo.paper.util.misc.DistanceTrackingAreaMap<Ticket>() {
-+ @Override
-+ protected com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<Ticket> getEmptySetFor(Ticket object) {
-+ return object.empty;
-+ }
-+ };
-+ Delayed8WayDistancePropagator2D test = new Delayed8WayDistancePropagator2D();
-+
-+ final int maxDistance = 64;
-+ // test origin
-+ {
-+ Ticket originTicket = new Ticket();
-+ int originDistance = 31;
-+ // test single source
-+ reference.add(originTicket, 0, 0, originDistance);
-+ test.setSource(0, 0, originDistance); test.propagateUpdates(); // set and propagate
-+ for (int dx = -originDistance; dx <= originDistance; ++dx) {
-+ for (int dz = -originDistance; dz <= originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+ // test single source decrease
-+ reference.update(originTicket, 0, 0, originDistance/2);
-+ test.setSource(0, 0, originDistance/2); test.propagateUpdates(); // set and propagate
-+ for (int dx = -originDistance; dx <= originDistance; ++dx) {
-+ for (int dz = -originDistance; dz <= originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+ // test source increase
-+ originDistance = 2*originDistance;
-+ reference.update(originTicket, 0, 0, originDistance);
-+ test.setSource(0, 0, originDistance); test.propagateUpdates(); // set and propagate
-+ for (int dx = -4*originDistance; dx <= 4*originDistance; ++dx) {
-+ for (int dz = -4*originDistance; dz <= 4*originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+
-+ reference.remove(originTicket);
-+ test.removeSource(0, 0); test.propagateUpdates();
-+ }
-+
-+ // test multiple sources at origin
-+ {
-+ int originDistance = 31;
-+ java.util.List<Ticket> list = new java.util.ArrayList<>();
-+ for (int i = 0; i < 10; ++i) {
-+ Ticket a = new Ticket();
-+ list.add(a);
-+ a.x = (i & 1) == 1 ? -i : i;
-+ a.z = (i & 1) == 1 ? -i : i;
-+ }
-+ for (Ticket ticket : list) {
-+ reference.add(ticket, ticket.x, ticket.z, originDistance);
-+ test.setSource(ticket.x, ticket.z, originDistance);
-+ }
-+ test.propagateUpdates();
-+
-+ for (int dx = -8*originDistance; dx <= 8*originDistance; ++dx) {
-+ for (int dz = -8*originDistance; dz <= 8*originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+
-+ // test ticket level decrease
-+
-+ for (Ticket ticket : list) {
-+ reference.update(ticket, ticket.x, ticket.z, originDistance/2);
-+ test.setSource(ticket.x, ticket.z, originDistance/2);
-+ }
-+ test.propagateUpdates();
-+
-+ for (int dx = -8*originDistance; dx <= 8*originDistance; ++dx) {
-+ for (int dz = -8*originDistance; dz <= 8*originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+
-+ // test ticket level increase
-+
-+ for (Ticket ticket : list) {
-+ reference.update(ticket, ticket.x, ticket.z, originDistance*2);
-+ test.setSource(ticket.x, ticket.z, originDistance*2);
-+ }
-+ test.propagateUpdates();
-+
-+ for (int dx = -16*originDistance; dx <= 16*originDistance; ++dx) {
-+ for (int dz = -16*originDistance; dz <= 16*originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+
-+ // test ticket remove
-+ for (int i = 0, len = list.size(); i < len; ++i) {
-+ if ((i & 3) != 0) {
-+ continue;
-+ }
-+ Ticket ticket = list.get(i);
-+ reference.remove(ticket);
-+ test.removeSource(ticket.x, ticket.z);
-+ }
-+ test.propagateUpdates();
-+
-+ for (int dx = -16*originDistance; dx <= 16*originDistance; ++dx) {
-+ for (int dz = -16*originDistance; dz <= 16*originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+ }
-+
-+ // now test at coordinate offsets
-+ // test offset
-+ {
-+ Ticket originTicket = new Ticket();
-+ int originDistance = 31;
-+ int offX = 54432;
-+ int offZ = -134567;
-+ // test single source
-+ reference.add(originTicket, offX, offZ, originDistance);
-+ test.setSource(offX, offZ, originDistance); test.propagateUpdates(); // set and propagate
-+ for (int dx = -originDistance; dx <= originDistance; ++dx) {
-+ for (int dz = -originDistance; dz <= originDistance; ++dz) {
-+ test(dx + offX, dz + offZ, reference, test);
-+ }
-+ }
-+ // test single source decrease
-+ reference.update(originTicket, offX, offZ, originDistance/2);
-+ test.setSource(offX, offZ, originDistance/2); test.propagateUpdates(); // set and propagate
-+ for (int dx = -originDistance; dx <= originDistance; ++dx) {
-+ for (int dz = -originDistance; dz <= originDistance; ++dz) {
-+ test(dx + offX, dz + offZ, reference, test);
-+ }
-+ }
-+ // test source increase
-+ originDistance = 2*originDistance;
-+ reference.update(originTicket, offX, offZ, originDistance);
-+ test.setSource(offX, offZ, originDistance); test.propagateUpdates(); // set and propagate
-+ for (int dx = -4*originDistance; dx <= 4*originDistance; ++dx) {
-+ for (int dz = -4*originDistance; dz <= 4*originDistance; ++dz) {
-+ test(dx + offX, dz + offZ, reference, test);
-+ }
-+ }
-+
-+ reference.remove(originTicket);
-+ test.removeSource(offX, offZ); test.propagateUpdates();
-+ }
-+
-+ // test multiple sources at origin
-+ {
-+ int originDistance = 31;
-+ int offX = 54432;
-+ int offZ = -134567;
-+ java.util.List<Ticket> list = new java.util.ArrayList<>();
-+ for (int i = 0; i < 10; ++i) {
-+ Ticket a = new Ticket();
-+ list.add(a);
-+ a.x = offX + ((i & 1) == 1 ? -i : i);
-+ a.z = offZ + ((i & 1) == 1 ? -i : i);
-+ }
-+ for (Ticket ticket : list) {
-+ reference.add(ticket, ticket.x, ticket.z, originDistance);
-+ test.setSource(ticket.x, ticket.z, originDistance);
-+ }
-+ test.propagateUpdates();
-+
-+ for (int dx = -8*originDistance; dx <= 8*originDistance; ++dx) {
-+ for (int dz = -8*originDistance; dz <= 8*originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+
-+ // test ticket level decrease
-+
-+ for (Ticket ticket : list) {
-+ reference.update(ticket, ticket.x, ticket.z, originDistance/2);
-+ test.setSource(ticket.x, ticket.z, originDistance/2);
-+ }
-+ test.propagateUpdates();
-+
-+ for (int dx = -8*originDistance; dx <= 8*originDistance; ++dx) {
-+ for (int dz = -8*originDistance; dz <= 8*originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+
-+ // test ticket level increase
-+
-+ for (Ticket ticket : list) {
-+ reference.update(ticket, ticket.x, ticket.z, originDistance*2);
-+ test.setSource(ticket.x, ticket.z, originDistance*2);
-+ }
-+ test.propagateUpdates();
-+
-+ for (int dx = -16*originDistance; dx <= 16*originDistance; ++dx) {
-+ for (int dz = -16*originDistance; dz <= 16*originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+
-+ // test ticket remove
-+ for (int i = 0, len = list.size(); i < len; ++i) {
-+ if ((i & 3) != 0) {
-+ continue;
-+ }
-+ Ticket ticket = list.get(i);
-+ reference.remove(ticket);
-+ test.removeSource(ticket.x, ticket.z);
-+ }
-+ test.propagateUpdates();
-+
-+ for (int dx = -16*originDistance; dx <= 16*originDistance; ++dx) {
-+ for (int dz = -16*originDistance; dz <= 16*originDistance; ++dz) {
-+ test(dx, dz, reference, test);
-+ }
-+ }
-+ }
-+ }
-+ */
-+
-+ // this map is considered "stale" unless updates are propagated.
-+ protected final LevelMap levels = new LevelMap(8192*2, 0.6f);
-+
-+ // this map is never stale
-+ protected final Long2ByteOpenHashMap sources = new Long2ByteOpenHashMap(4096, 0.6f);
-+
-+ // Generally updates to positions are made close to other updates, so we link to decrease cache misses when
-+ // propagating updates
-+ protected final LongLinkedOpenHashSet updatedSources = new LongLinkedOpenHashSet();
-+
-+ @FunctionalInterface
-+ public static interface LevelChangeCallback {
-+
-+ /**
-+ * This can be called for intermediate updates. So do not rely on newLevel being close to or
-+ * the exact level that is expected after a full propagation has occured.
-+ */
-+ public void onLevelUpdate(final long coordinate, final byte oldLevel, final byte newLevel);
-+
+ }
-+
-+ protected final LevelChangeCallback changeCallback;
-+
-+ public Delayed8WayDistancePropagator2D() {
-+ this(null);
-+ }
-+
-+ public Delayed8WayDistancePropagator2D(final LevelChangeCallback changeCallback) {
-+ this.changeCallback = changeCallback;
-+ }
-+
-+ public int getLevel(final long pos) {
-+ return this.levels.get(pos);
-+ }
-+
-+ public int getLevel(final int x, final int z) {
-+ return this.levels.get(CoordinateUtils.getChunkKey(x, z));
-+ }
-+
-+ public void setSource(final int x, final int z, final int level) {
-+ this.setSource(CoordinateUtils.getChunkKey(x, z), level);
-+ }
-+
-+ public void setSource(final long coordinate, final int level) {
-+ if ((level & 63) != level || level == 0) {
-+ throw new IllegalArgumentException("Level must be in (0, 63], not " + level);
-+ }
-+
-+ final byte byteLevel = (byte)level;
-+ final byte oldLevel = this.sources.put(coordinate, byteLevel);
-+
-+ if (oldLevel == byteLevel) {
-+ return; // nothing to do
-+ }
-+
-+ // queue to update later
-+ this.updatedSources.add(coordinate);
-+ }
-+
-+ public void removeSource(final int x, final int z) {
-+ this.removeSource(CoordinateUtils.getChunkKey(x, z));
-+ }
-+
-+ public void removeSource(final long coordinate) {
-+ if (this.sources.remove(coordinate) != 0) {
-+ this.updatedSources.add(coordinate);
-+ }
-+ }
-+
-+ // queues used for BFS propagating levels
-+ protected final WorkQueue[] levelIncreaseWorkQueues = new WorkQueue[64];
-+ {
-+ for (int i = 0; i < this.levelIncreaseWorkQueues.length; ++i) {
-+ this.levelIncreaseWorkQueues[i] = new WorkQueue();
-+ }
-+ }
-+ protected final WorkQueue[] levelRemoveWorkQueues = new WorkQueue[64];
-+ {
-+ for (int i = 0; i < this.levelRemoveWorkQueues.length; ++i) {
-+ this.levelRemoveWorkQueues[i] = new WorkQueue();
-+ }
-+ }
-+ protected long levelIncreaseWorkQueueBitset;
-+ protected long levelRemoveWorkQueueBitset;
-+
-+ protected final void addToIncreaseWorkQueue(final long coordinate, final byte level) {
-+ final WorkQueue queue = this.levelIncreaseWorkQueues[level];
-+ queue.queuedCoordinates.enqueue(coordinate);
-+ queue.queuedLevels.enqueue(level);
-+
-+ this.levelIncreaseWorkQueueBitset |= (1L << level);
-+ }
-+
-+ protected final void addToIncreaseWorkQueue(final long coordinate, final byte index, final byte level) {
-+ final WorkQueue queue = this.levelIncreaseWorkQueues[index];
-+ queue.queuedCoordinates.enqueue(coordinate);
-+ queue.queuedLevels.enqueue(level);
-+
-+ this.levelIncreaseWorkQueueBitset |= (1L << index);
-+ }
-+
-+ protected final void addToRemoveWorkQueue(final long coordinate, final byte level) {
-+ final WorkQueue queue = this.levelRemoveWorkQueues[level];
-+ queue.queuedCoordinates.enqueue(coordinate);
-+ queue.queuedLevels.enqueue(level);
-+
-+ this.levelRemoveWorkQueueBitset |= (1L << level);
-+ }
-+
-+ public boolean propagateUpdates() {
-+ if (this.updatedSources.isEmpty()) {
-+ return false;
-+ }
-+
-+ boolean ret = false;
-+
-+ for (final LongIterator iterator = this.updatedSources.iterator(); iterator.hasNext();) {
-+ final long coordinate = iterator.nextLong();
-+
-+ final byte currentLevel = this.levels.get(coordinate);
-+ final byte updatedSource = this.sources.get(coordinate);
-+
-+ if (currentLevel == updatedSource) {
-+ continue;
-+ }
-+ ret = true;
-+
-+ if (updatedSource > currentLevel) {
-+ // level increase
-+ this.addToIncreaseWorkQueue(coordinate, updatedSource);
-+ } else {
-+ // level decrease
-+ this.addToRemoveWorkQueue(coordinate, currentLevel);
-+ // if the current coordinate is a source, then the decrease propagation will detect that and queue
-+ // the source propagation
-+ }
-+ }
-+
-+ this.updatedSources.clear();
-+
-+ // propagate source level increases first for performance reasons (in crowded areas hopefully the additions
-+ // make the removes remove less)
-+ this.propagateIncreases();
-+
-+ // now we propagate the decreases (which will then re-propagate clobbered sources)
-+ this.propagateDecreases();
-+
-+ return ret;
-+ }
-+
-+ protected void propagateIncreases() {
-+ for (int queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelIncreaseWorkQueueBitset);
-+ this.levelIncreaseWorkQueueBitset != 0L;
-+ this.levelIncreaseWorkQueueBitset ^= (1L << queueIndex), queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelIncreaseWorkQueueBitset)) {
-+
-+ final WorkQueue queue = this.levelIncreaseWorkQueues[queueIndex];
-+ while (!queue.queuedLevels.isEmpty()) {
-+ final long coordinate = queue.queuedCoordinates.removeFirstLong();
-+ byte level = queue.queuedLevels.removeFirstByte();
-+
-+ final boolean neighbourCheck = level < 0;
-+
-+ final byte currentLevel;
-+ if (neighbourCheck) {
-+ level = (byte)-level;
-+ currentLevel = this.levels.get(coordinate);
-+ } else {
-+ currentLevel = this.levels.putIfGreater(coordinate, level);
-+ }
-+
-+ if (neighbourCheck) {
-+ // used when propagating from decrease to indicate that this level needs to check its neighbours
-+ // this means the level at coordinate could be equal, but would still need neighbours checked
-+
-+ if (currentLevel != level) {
-+ // something caused the level to change, which means something propagated to it (which means
-+ // us propagating here is redundant), or something removed the level (which means we
-+ // cannot propagate further)
-+ continue;
-+ }
-+ } else if (currentLevel >= level) {
-+ // something higher/equal propagated
-+ continue;
-+ }
-+ if (this.changeCallback != null) {
-+ this.changeCallback.onLevelUpdate(coordinate, currentLevel, level);
-+ }
-+
-+ if (level == 1) {
-+ // can't propagate 0 to neighbours
-+ continue;
-+ }
-+
-+ // propagate to neighbours
-+ final byte neighbourLevel = (byte)(level - 1);
-+ final int x = (int)coordinate;
-+ final int z = (int)(coordinate >>> 32);
-+
-+ for (int dx = -1; dx <= 1; ++dx) {
-+ for (int dz = -1; dz <= 1; ++dz) {
-+ if ((dx | dz) == 0) {
-+ // already propagated to coordinate
-+ continue;
-+ }
-+
-+ // sure we can check the neighbour level in the map right now and avoid a propagation,
-+ // but then we would still have to recheck it when popping the value off of the queue!
-+ // so just avoid the double lookup
-+ final long neighbourCoordinate = CoordinateUtils.getChunkKey(x + dx, z + dz);
-+ this.addToIncreaseWorkQueue(neighbourCoordinate, neighbourLevel);
-+ }
-+ }
-+ }
-+ }
-+ }
-+
-+ protected void propagateDecreases() {
-+ for (int queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelRemoveWorkQueueBitset);
-+ this.levelRemoveWorkQueueBitset != 0L;
-+ this.levelRemoveWorkQueueBitset ^= (1L << queueIndex), queueIndex = 63 ^ Long.numberOfLeadingZeros(this.levelRemoveWorkQueueBitset)) {
-+
-+ final WorkQueue queue = this.levelRemoveWorkQueues[queueIndex];
-+ while (!queue.queuedLevels.isEmpty()) {
-+ final long coordinate = queue.queuedCoordinates.removeFirstLong();
-+ final byte level = queue.queuedLevels.removeFirstByte();
-+
-+ final byte currentLevel = this.levels.removeIfGreaterOrEqual(coordinate, level);
-+ if (currentLevel == 0) {
-+ // something else removed
-+ continue;
-+ }
-+
-+ if (currentLevel > level) {
-+ // something higher propagated here or we hit the propagation of another source
-+ // in the second case we need to re-propagate because we could have just clobbered another source's
-+ // propagation
-+ this.addToIncreaseWorkQueue(coordinate, currentLevel, (byte)-currentLevel); // indicate to the increase code that the level's neighbours need checking
-+ continue;
-+ }
-+
-+ if (this.changeCallback != null) {
-+ this.changeCallback.onLevelUpdate(coordinate, currentLevel, (byte)0);
-+ }
-+
-+ final byte source = this.sources.get(coordinate);
-+ if (source != 0) {
-+ // must re-propagate source later
-+ this.addToIncreaseWorkQueue(coordinate, source);
-+ }
-+
-+ if (level == 0) {
-+ // can't propagate -1 to neighbours
-+ // we have to check neighbours for removing 1 just in case the neighbour is 2
-+ continue;
-+ }
-+
-+ // propagate to neighbours
-+ final byte neighbourLevel = (byte)(level - 1);
-+ final int x = (int)coordinate;
-+ final int z = (int)(coordinate >>> 32);
-+
-+ for (int dx = -1; dx <= 1; ++dx) {
-+ for (int dz = -1; dz <= 1; ++dz) {
-+ if ((dx | dz) == 0) {
-+ // already propagated to coordinate
-+ continue;
-+ }
-+
-+ // sure we can check the neighbour level in the map right now and avoid a propagation,
-+ // but then we would still have to recheck it when popping the value off of the queue!
-+ // so just avoid the double lookup
-+ final long neighbourCoordinate = CoordinateUtils.getChunkKey(x + dx, z + dz);
-+ this.addToRemoveWorkQueue(neighbourCoordinate, neighbourLevel);
-+ }
-+ }
-+ }
-+ }
-+
-+ // propagate sources we clobbered in the process
-+ this.propagateIncreases();
-+ }
-+
-+ protected static final class LevelMap extends Long2ByteOpenHashMap {
-+ public LevelMap() {
-+ super();
-+ }
-+
-+ public LevelMap(final int expected, final float loadFactor) {
-+ super(expected, loadFactor);
-+ }
-+
-+ // copied from superclass
-+ private int find(final long k) {
-+ if (k == 0L) {
-+ return this.containsNullKey ? this.n : -(this.n + 1);
-+ } else {
-+ final long[] key = this.key;
-+ long curr;
-+ int pos;
-+ if ((curr = key[pos = (int)HashCommon.mix(k) & this.mask]) == 0L) {
-+ return -(pos + 1);
-+ } else if (k == curr) {
-+ return pos;
-+ } else {
-+ while((curr = key[pos = pos + 1 & this.mask]) != 0L) {
-+ if (k == curr) {
-+ return pos;
-+ }
-+ }
-+
-+ return -(pos + 1);
-+ }
-+ }
-+ }
-+
-+ // copied from superclass
-+ private void insert(final int pos, final long k, final byte v) {
-+ if (pos == this.n) {
-+ this.containsNullKey = true;
-+ }
-+
-+ this.key[pos] = k;
-+ this.value[pos] = v;
-+ if (this.size++ >= this.maxFill) {
-+ this.rehash(HashCommon.arraySize(this.size + 1, this.f));
-+ }
-+ }
-+
-+ // copied from superclass
-+ public byte putIfGreater(final long key, final byte value) {
-+ final int pos = this.find(key);
-+ if (pos < 0) {
-+ if (this.defRetValue < value) {
-+ this.insert(-pos - 1, key, value);
-+ }
-+ return this.defRetValue;
-+ } else {
-+ final byte curr = this.value[pos];
-+ if (value > curr) {
-+ this.value[pos] = value;
-+ return curr;
-+ }
-+ return curr;
-+ }
-+ }
-+
-+ // copied from superclass
-+ private void removeEntry(final int pos) {
-+ --this.size;
-+ this.shiftKeys(pos);
-+ if (this.n > this.minN && this.size < this.maxFill / 4 && this.n > 16) {
-+ this.rehash(this.n / 2);
-+ }
-+ }
-+
-+ // copied from superclass
-+ private void removeNullEntry() {
-+ this.containsNullKey = false;
-+ --this.size;
-+ if (this.n > this.minN && this.size < this.maxFill / 4 && this.n > 16) {
-+ this.rehash(this.n / 2);
-+ }
-+ }
-+
-+ // copied from superclass
-+ public byte removeIfGreaterOrEqual(final long key, final byte value) {
-+ if (key == 0L) {
-+ if (!this.containsNullKey) {
-+ return this.defRetValue;
-+ }
-+ final byte current = this.value[this.n];
-+ if (value >= current) {
-+ this.removeNullEntry();
-+ return current;
-+ }
-+ return current;
-+ } else {
-+ long[] keys = this.key;
-+ byte[] values = this.value;
-+ long curr;
-+ int pos;
-+ if ((curr = keys[pos = (int)HashCommon.mix(key) & this.mask]) == 0L) {
-+ return this.defRetValue;
-+ } else if (key == curr) {
-+ final byte current = values[pos];
-+ if (value >= current) {
-+ this.removeEntry(pos);
-+ return current;
-+ }
-+ return current;
-+ } else {
-+ while((curr = keys[pos = pos + 1 & this.mask]) != 0L) {
-+ if (key == curr) {
-+ final byte current = values[pos];
-+ if (value >= current) {
-+ this.removeEntry(pos);
-+ return current;
-+ }
-+ return current;
-+ }
-+ }
-+
-+ return this.defRetValue;
-+ }
-+ }
-+ }
-+ }
-+
-+ protected static final class WorkQueue {
-+
-+ public final NoResizeLongArrayFIFODeque queuedCoordinates = new NoResizeLongArrayFIFODeque();
-+ public final NoResizeByteArrayFIFODeque queuedLevels = new NoResizeByteArrayFIFODeque();
-+
-+ }
-+
-+ protected static final class NoResizeLongArrayFIFODeque extends LongArrayFIFOQueue {
-+
-+ /**
-+ * Assumes non-empty. If empty, undefined behaviour.
-+ */
-+ public long removeFirstLong() {
-+ // copied from superclass
-+ long t = this.array[this.start];
-+ if (++this.start == this.length) {
-+ this.start = 0;
-+ }
-+
-+ return t;
-+ }
-+ }
-+
-+ protected static final class NoResizeByteArrayFIFODeque extends ByteArrayFIFOQueue {
-+
-+ /**
-+ * Assumes non-empty. If empty, undefined behaviour.
-+ */
-+ public byte removeFirstByte() {
-+ // copied from superclass
-+ byte t = this.array[this.start];
-+ if (++this.start == this.length) {
-+ this.start = 0;
-+ }
-+
-+ return t;
-+ }
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..fdde1f5f988d581db41945916635cdd826a10680
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
-@@ -0,0 +1,209 @@
-+package ca.spottedleaf.moonrise.common.misc;
-+
-+import ca.spottedleaf.moonrise.common.list.ReferenceList;
-+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
-+import ca.spottedleaf.moonrise.common.util.MoonriseConstants;
-+import ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem;
-+import it.unimi.dsi.fastutil.longs.Long2ReferenceOpenHashMap;
-+import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
-+import net.minecraft.core.BlockPos;
-+import net.minecraft.server.level.ServerLevel;
-+import net.minecraft.server.level.ServerPlayer;
-+import net.minecraft.world.level.ChunkPos;
-+
-+public final class NearbyPlayers {
-+
-+ public static enum NearbyMapType {
-+ GENERAL,
-+ GENERAL_SMALL,
-+ GENERAL_REALLY_SMALL,
-+ TICK_VIEW_DISTANCE,
-+ VIEW_DISTANCE,
-+ SPAWN_RANGE,
-+ }
-+
-+ private static final NearbyMapType[] MAP_TYPES = NearbyMapType.values();
-+ public static final int TOTAL_MAP_TYPES = MAP_TYPES.length;
-+
-+ private static final int GENERAL_AREA_VIEW_DISTANCE = MoonriseConstants.MAX_VIEW_DISTANCE + 1;
-+ private static final int GENERAL_SMALL_VIEW_DISTANCE = 10;
-+ private static final int GENERAL_REALLY_SMALL_VIEW_DISTANCE = 3;
-+
-+ public static final int GENERAL_AREA_VIEW_DISTANCE_BLOCKS = (GENERAL_AREA_VIEW_DISTANCE << 4);
-+ public static final int GENERAL_SMALL_AREA_VIEW_DISTANCE_BLOCKS = (GENERAL_SMALL_VIEW_DISTANCE << 4);
-+ public static final int GENERAL_REALLY_SMALL_AREA_VIEW_DISTANCE_BLOCKS = (GENERAL_REALLY_SMALL_VIEW_DISTANCE << 4);
-+
-+ private final ServerLevel world;
-+ private final Reference2ReferenceOpenHashMap<ServerPlayer, TrackedPlayer[]> players = new Reference2ReferenceOpenHashMap<>();
-+ private final Long2ReferenceOpenHashMap<TrackedChunk> byChunk = new Long2ReferenceOpenHashMap<>();
-+
-+ public NearbyPlayers(final ServerLevel world) {
-+ this.world = world;
-+ }
-+
-+ public void addPlayer(final ServerPlayer player) {
-+ final TrackedPlayer[] newTrackers = new TrackedPlayer[TOTAL_MAP_TYPES];
-+ if (this.players.putIfAbsent(player, newTrackers) != null) {
-+ throw new IllegalStateException("Already have player " + player);
-+ }
-+
-+ final ChunkPos chunk = player.chunkPosition();
-+
-+ for (int i = 0; i < TOTAL_MAP_TYPES; ++i) {
-+ // use 0 for default, will be updated by tickPlayer
-+ (newTrackers[i] = new TrackedPlayer(player, MAP_TYPES[i])).add(chunk.x, chunk.z, 0);
-+ }
-+
-+ // update view distances
-+ this.tickPlayer(player);
-+ }
-+
-+ public void removePlayer(final ServerPlayer player) {
-+ final TrackedPlayer[] players = this.players.remove(player);
-+ if (players == null) {
-+ return; // May be called during teleportation before the player is actually placed
-+ }
-+
-+ for (final TrackedPlayer tracker : players) {
-+ tracker.remove();
-+ }
-+ }
-+
-+ public void tickPlayer(final ServerPlayer player) {
-+ final TrackedPlayer[] players = this.players.get(player);
-+ if (players == null) {
-+ throw new IllegalStateException("Don't have player " + player);
-+ }
-+
-+ final ChunkPos chunk = player.chunkPosition();
-+
-+ players[NearbyMapType.GENERAL.ordinal()].update(chunk.x, chunk.z, GENERAL_AREA_VIEW_DISTANCE);
-+ players[NearbyMapType.GENERAL_SMALL.ordinal()].update(chunk.x, chunk.z, GENERAL_SMALL_VIEW_DISTANCE);
-+ players[NearbyMapType.GENERAL_REALLY_SMALL.ordinal()].update(chunk.x, chunk.z, GENERAL_REALLY_SMALL_VIEW_DISTANCE);
-+ players[NearbyMapType.TICK_VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, ChunkSystem.getTickViewDistance(player));
-+ players[NearbyMapType.VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, ChunkSystem.getLoadViewDistance(player));
-+ }
-+
-+ public TrackedChunk getChunk(final ChunkPos pos) {
-+ return this.byChunk.get(CoordinateUtils.getChunkKey(pos));
-+ }
-+
-+ public TrackedChunk getChunk(final BlockPos pos) {
-+ return this.byChunk.get(CoordinateUtils.getChunkKey(pos));
-+ }
-+
-+ public ReferenceList<ServerPlayer> getPlayers(final BlockPos pos, final NearbyMapType type) {
-+ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(pos));
-+
-+ return chunk == null ? null : chunk.players[type.ordinal()];
-+ }
-+
-+ public ReferenceList<ServerPlayer> getPlayers(final ChunkPos pos, final NearbyMapType type) {
-+ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(pos));
-+
-+ return chunk == null ? null : chunk.players[type.ordinal()];
-+ }
-+
-+ public ReferenceList<ServerPlayer> getPlayersByChunk(final int chunkX, final int chunkZ, final NearbyMapType type) {
-+ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
-+
-+ return chunk == null ? null : chunk.players[type.ordinal()];
-+ }
-+
-+ public ReferenceList<ServerPlayer> getPlayersByBlock(final int blockX, final int blockZ, final NearbyMapType type) {
-+ final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(blockX >> 4, blockZ >> 4));
-+
-+ return chunk == null ? null : chunk.players[type.ordinal()];
-+ }
-+
-+ public static final class TrackedChunk {
-+
-+ private static final ServerPlayer[] EMPTY_PLAYERS_ARRAY = new ServerPlayer[0];
-+
-+ private final ReferenceList<ServerPlayer>[] players = new ReferenceList[TOTAL_MAP_TYPES];
-+ private int nonEmptyLists;
-+ private long updateCount;
-+
-+ public boolean isEmpty() {
-+ return this.nonEmptyLists == 0;
-+ }
-+
-+ public long getUpdateCount() {
-+ return this.updateCount;
-+ }
-+
-+ public ReferenceList<ServerPlayer> getPlayers(final NearbyMapType type) {
-+ return this.players[type.ordinal()];
-+ }
-+
-+ public void addPlayer(final ServerPlayer player, final NearbyMapType type) {
-+ ++this.updateCount;
-+
-+ final int idx = type.ordinal();
-+ final ReferenceList<ServerPlayer> list = this.players[idx];
-+ if (list == null) {
-+ ++this.nonEmptyLists;
-+ (this.players[idx] = new ReferenceList<>(EMPTY_PLAYERS_ARRAY, 0)).add(player);
-+ return;
-+ }
-+
-+ if (!list.add(player)) {
-+ throw new IllegalStateException("Already contains player " + player);
-+ }
-+ }
-+
-+ public void removePlayer(final ServerPlayer player, final NearbyMapType type) {
-+ ++this.updateCount;
-+
-+ final int idx = type.ordinal();
-+ final ReferenceList<ServerPlayer> list = this.players[idx];
-+ if (list == null) {
-+ throw new IllegalStateException("Does not contain player " + player);
-+ }
-+
-+ if (!list.remove(player)) {
-+ throw new IllegalStateException("Does not contain player " + player);
-+ }
-+
-+ if (list.size() == 0) {
-+ this.players[idx] = null;
-+ --this.nonEmptyLists;
-+ }
-+ }
-+ }
-+
-+ private final class TrackedPlayer extends SingleUserAreaMap<ServerPlayer> {
-+
-+ private final NearbyMapType type;
-+
-+ public TrackedPlayer(final ServerPlayer player, final NearbyMapType type) {
-+ super(player);
-+ this.type = type;
-+ }
-+
-+ @Override
-+ protected void addCallback(final ServerPlayer parameter, final int chunkX, final int chunkZ) {
-+ final long chunkKey = CoordinateUtils.getChunkKey(chunkX, chunkZ);
-+
-+ NearbyPlayers.this.byChunk.computeIfAbsent(chunkKey, (final long keyInMap) -> {
-+ return new TrackedChunk();
-+ }).addPlayer(parameter, this.type);
-+ }
-+
-+ @Override
-+ protected void removeCallback(final ServerPlayer parameter, final int chunkX, final int chunkZ) {
-+ final long chunkKey = CoordinateUtils.getChunkKey(chunkX, chunkZ);
-+
-+ final TrackedChunk chunk = NearbyPlayers.this.byChunk.get(chunkKey);
-+ if (chunk == null) {
-+ throw new IllegalStateException("Chunk should exist at " + new ChunkPos(chunkKey));
-+ }
-+
-+ chunk.removePlayer(parameter, this.type);
-+
-+ if (chunk.isEmpty()) {
-+ NearbyPlayers.this.byChunk.remove(chunkKey);
-+ }
-+ }
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/SingleUserAreaMap.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/SingleUserAreaMap.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..61f70247486fd15ed3ffc5b606582dc6a2dd81d3
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/SingleUserAreaMap.java
-@@ -0,0 +1,232 @@
-+package ca.spottedleaf.moonrise.common.misc;
-+
-+import ca.spottedleaf.concurrentutil.util.IntegerUtil;
-+
-+public abstract class SingleUserAreaMap<T> {
-+
-+ private static final int NOT_SET = Integer.MIN_VALUE;
-+
-+ private final T parameter;
-+ private int lastChunkX = NOT_SET;
-+ private int lastChunkZ = NOT_SET;
-+ private int distance = NOT_SET;
-+
-+ public SingleUserAreaMap(final T parameter) {
-+ this.parameter = parameter;
-+ }
-+
-+ /* math sign function except 0 returns 1 */
-+ protected static int sign(int val) {
-+ return 1 | (val >> (Integer.SIZE - 1));
-+ }
-+
-+ protected abstract void addCallback(final T parameter, final int chunkX, final int chunkZ);
-+
-+ protected abstract void removeCallback(final T parameter, final int chunkX, final int chunkZ);
-+
-+ private void addToNew(final T parameter, final int chunkX, final int chunkZ, final int distance) {
-+ final int maxX = chunkX + distance;
-+ final int maxZ = chunkZ + distance;
-+
-+ for (int cx = chunkX - distance; cx <= maxX; ++cx) {
-+ for (int cz = chunkZ - distance; cz <= maxZ; ++cz) {
-+ this.addCallback(parameter, cx, cz);
-+ }
-+ }
-+ }
-+
-+ private void removeFromOld(final T parameter, final int chunkX, final int chunkZ, final int distance) {
-+ final int maxX = chunkX + distance;
-+ final int maxZ = chunkZ + distance;
-+
-+ for (int cx = chunkX - distance; cx <= maxX; ++cx) {
-+ for (int cz = chunkZ - distance; cz <= maxZ; ++cz) {
-+ this.removeCallback(parameter, cx, cz);
-+ }
-+ }
-+ }
-+
-+ public final boolean add(final int chunkX, final int chunkZ, final int distance) {
-+ if (distance < 0) {
-+ throw new IllegalArgumentException(Integer.toString(distance));
-+ }
-+ if (this.lastChunkX != NOT_SET) {
-+ return false;
-+ }
-+ this.lastChunkX = chunkX;
-+ this.lastChunkZ = chunkZ;
-+ this.distance = distance;
-+
-+ this.addToNew(this.parameter, chunkX, chunkZ, distance);
-+
-+ return true;
-+ }
-+
-+ public final boolean update(final int toX, final int toZ, final int newViewDistance) {
-+ if (newViewDistance < 0) {
-+ throw new IllegalArgumentException(Integer.toString(newViewDistance));
-+ }
-+ final int fromX = this.lastChunkX;
-+ final int fromZ = this.lastChunkZ;
-+ final int oldViewDistance = this.distance;
-+ if (fromX == NOT_SET) {
-+ return false;
-+ }
-+
-+ this.lastChunkX = toX;
-+ this.lastChunkZ = toZ;
-+ this.distance = newViewDistance;
-+
-+ final T parameter = this.parameter;
-+
-+
-+ final int dx = toX - fromX;
-+ final int dz = toZ - fromZ;
-+
-+ final int totalX = IntegerUtil.branchlessAbs(fromX - toX);
-+ final int totalZ = IntegerUtil.branchlessAbs(fromZ - toZ);
-+
-+ if (Math.max(totalX, totalZ) > (2 * Math.max(newViewDistance, oldViewDistance))) {
-+ // teleported
-+ this.removeFromOld(parameter, fromX, fromZ, oldViewDistance);
-+ this.addToNew(parameter, toX, toZ, newViewDistance);
-+ return true;
-+ }
-+
-+ if (oldViewDistance != newViewDistance) {
-+ // remove loop
-+
-+ final int oldMinX = fromX - oldViewDistance;
-+ final int oldMinZ = fromZ - oldViewDistance;
-+ final int oldMaxX = fromX + oldViewDistance;
-+ final int oldMaxZ = fromZ + oldViewDistance;
-+ for (int currX = oldMinX; currX <= oldMaxX; ++currX) {
-+ for (int currZ = oldMinZ; currZ <= oldMaxZ; ++currZ) {
-+
-+ // only remove if we're outside the new view distance...
-+ if (Math.max(IntegerUtil.branchlessAbs(currX - toX), IntegerUtil.branchlessAbs(currZ - toZ)) > newViewDistance) {
-+ this.removeCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ // add loop
-+
-+ final int newMinX = toX - newViewDistance;
-+ final int newMinZ = toZ - newViewDistance;
-+ final int newMaxX = toX + newViewDistance;
-+ final int newMaxZ = toZ + newViewDistance;
-+ for (int currX = newMinX; currX <= newMaxX; ++currX) {
-+ for (int currZ = newMinZ; currZ <= newMaxZ; ++currZ) {
-+
-+ // only add if we're outside the old view distance...
-+ if (Math.max(IntegerUtil.branchlessAbs(currX - fromX), IntegerUtil.branchlessAbs(currZ - fromZ)) > oldViewDistance) {
-+ this.addCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ return true;
-+ }
-+
-+ // x axis is width
-+ // z axis is height
-+ // right refers to the x axis of where we moved
-+ // top refers to the z axis of where we moved
-+
-+ // same view distance
-+
-+ // used for relative positioning
-+ final int up = sign(dz); // 1 if dz >= 0, -1 otherwise
-+ final int right = sign(dx); // 1 if dx >= 0, -1 otherwise
-+
-+ // The area excluded by overlapping the two view distance squares creates four rectangles:
-+ // Two on the left, and two on the right. The ones on the left we consider the "removed" section
-+ // and on the right the "added" section.
-+ // https://i.imgur.com/MrnOBgI.png is a reference image. Note that the outside border is not actually
-+ // exclusive to the regions they surround.
-+
-+ // 4 points of the rectangle
-+ int maxX; // exclusive
-+ int minX; // inclusive
-+ int maxZ; // exclusive
-+ int minZ; // inclusive
-+
-+ if (dx != 0) {
-+ // handle right addition
-+
-+ maxX = toX + (oldViewDistance * right) + right; // exclusive
-+ minX = fromX + (oldViewDistance * right) + right; // inclusive
-+ maxZ = fromZ + (oldViewDistance * up) + up; // exclusive
-+ minZ = toZ - (oldViewDistance * up); // inclusive
-+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.addCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ if (dz != 0) {
-+ // handle up addition
-+
-+ maxX = toX + (oldViewDistance * right) + right; // exclusive
-+ minX = toX - (oldViewDistance * right); // inclusive
-+ maxZ = toZ + (oldViewDistance * up) + up; // exclusive
-+ minZ = fromZ + (oldViewDistance * up) + up; // inclusive
-+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.addCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ if (dx != 0) {
-+ // handle left removal
-+
-+ maxX = toX - (oldViewDistance * right); // exclusive
-+ minX = fromX - (oldViewDistance * right); // inclusive
-+ maxZ = fromZ + (oldViewDistance * up) + up; // exclusive
-+ minZ = toZ - (oldViewDistance * up); // inclusive
-+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.removeCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ if (dz != 0) {
-+ // handle down removal
-+
-+ maxX = fromX + (oldViewDistance * right) + right; // exclusive
-+ minX = fromX - (oldViewDistance * right); // inclusive
-+ maxZ = toZ - (oldViewDistance * up); // exclusive
-+ minZ = fromZ - (oldViewDistance * up); // inclusive
-+
-+ for (int currX = minX; currX != maxX; currX += right) {
-+ for (int currZ = minZ; currZ != maxZ; currZ += up) {
-+ this.removeCallback(parameter, currX, currZ);
-+ }
-+ }
-+ }
-+
-+ return true;
-+ }
-+
-+ public final boolean remove() {
-+ final int chunkX = this.lastChunkX;
-+ final int chunkZ = this.lastChunkZ;
-+ final int distance = this.distance;
-+ if (chunkX == NOT_SET) {
-+ return false;
-+ }
-+
-+ this.lastChunkX = this.lastChunkZ = this.distance = NOT_SET;
-+
-+ this.removeFromOld(this.parameter, chunkX, chunkZ, distance);
-+
-+ return true;
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/set/OptimizedSmallEnumSet.java b/src/main/java/ca/spottedleaf/moonrise/common/set/OptimizedSmallEnumSet.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..4123edddc556c47f3f8d83523c125fd2e46b30e2
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/set/OptimizedSmallEnumSet.java
-@@ -0,0 +1,68 @@
-+package ca.spottedleaf.moonrise.common.set;
-+
-+import java.util.Collection;
-+
-+public final class OptimizedSmallEnumSet<E extends Enum<E>> {
-+
-+ private final Class<E> enumClass;
-+ private long backingSet;
-+
-+ public OptimizedSmallEnumSet(final Class<E> clazz) {
-+ if (clazz == null) {
-+ throw new IllegalArgumentException("Null class");
-+ }
-+ if (!clazz.isEnum()) {
-+ throw new IllegalArgumentException("Class must be enum, not " + clazz.getCanonicalName());
-+ }
-+ this.enumClass = clazz;
-+ }
-+
-+ public boolean addUnchecked(final E element) {
-+ final int ordinal = element.ordinal();
-+ final long key = 1L << ordinal;
-+
-+ final long prev = this.backingSet;
-+ this.backingSet = prev | key;
-+
-+ return (prev & key) == 0;
-+ }
-+
-+ public boolean removeUnchecked(final E element) {
-+ final int ordinal = element.ordinal();
-+ final long key = 1L << ordinal;
-+
-+ final long prev = this.backingSet;
-+ this.backingSet = prev & ~key;
-+
-+ return (prev & key) != 0;
-+ }
-+
-+ public void clear() {
-+ this.backingSet = 0L;
-+ }
-+
-+ public int size() {
-+ return Long.bitCount(this.backingSet);
-+ }
-+
-+ public void addAllUnchecked(final Collection<E> enums) {
-+ for (final E element : enums) {
-+ if (element == null) {
-+ throw new NullPointerException("Null element");
-+ }
-+ this.backingSet |= (1L << element.ordinal());
-+ }
-+ }
-+
-+ public long getBackingSet() {
-+ return this.backingSet;
-+ }
-+
-+ public boolean hasCommonElements(final OptimizedSmallEnumSet<E> other) {
-+ return (other.backingSet & this.backingSet) != 0;
-+ }
-+
-+ public boolean hasElement(final E element) {
-+ return (this.backingSet & (1L << element.ordinal())) != 0;
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/CoordinateUtils.java b/src/main/java/ca/spottedleaf/moonrise/common/util/CoordinateUtils.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..31b92bd48828cbea25b44a9f0f96886347aa1ae6
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/CoordinateUtils.java
-@@ -0,0 +1,129 @@
-+package ca.spottedleaf.moonrise.common.util;
-+
-+import net.minecraft.core.BlockPos;
-+import net.minecraft.core.SectionPos;
-+import net.minecraft.util.Mth;
-+import net.minecraft.world.entity.Entity;
-+import net.minecraft.world.level.ChunkPos;
-+import net.minecraft.world.phys.Vec3;
-+
-+public final class CoordinateUtils {
-+
-+ // the chunk keys are compatible with vanilla
-+
-+ public static long getChunkKey(final BlockPos pos) {
-+ return ((long)(pos.getZ() >> 4) << 32) | ((pos.getX() >> 4) & 0xFFFFFFFFL);
-+ }
-+
-+ public static long getChunkKey(final Entity entity) {
-+ return ((Mth.lfloor(entity.getZ()) >> 4) << 32) | ((Mth.lfloor(entity.getX()) >> 4) & 0xFFFFFFFFL);
-+ }
-+
-+ public static long getChunkKey(final ChunkPos pos) {
-+ return ((long)pos.z << 32) | (pos.x & 0xFFFFFFFFL);
-+ }
-+
-+ public static long getChunkKey(final SectionPos pos) {
-+ return ((long)pos.getZ() << 32) | (pos.getX() & 0xFFFFFFFFL);
-+ }
-+
-+ public static long getChunkKey(final int x, final int z) {
-+ return ((long)z << 32) | (x & 0xFFFFFFFFL);
-+ }
-+
-+ public static int getChunkX(final long chunkKey) {
-+ return (int)chunkKey;
-+ }
-+
-+ public static int getChunkZ(final long chunkKey) {
-+ return (int)(chunkKey >>> 32);
-+ }
-+
-+ public static int getChunkCoordinate(final double blockCoordinate) {
-+ return Mth.floor(blockCoordinate) >> 4;
-+ }
-+
-+ // the section keys are compatible with vanilla's
-+
-+ static final int SECTION_X_BITS = 22;
-+ static final long SECTION_X_MASK = (1L << SECTION_X_BITS) - 1;
-+ static final int SECTION_Y_BITS = 20;
-+ static final long SECTION_Y_MASK = (1L << SECTION_Y_BITS) - 1;
-+ static final int SECTION_Z_BITS = 22;
-+ static final long SECTION_Z_MASK = (1L << SECTION_Z_BITS) - 1;
-+ // format is y,z,x (in order of LSB to MSB)
-+ static final int SECTION_Y_SHIFT = 0;
-+ static final int SECTION_Z_SHIFT = SECTION_Y_SHIFT + SECTION_Y_BITS;
-+ static final int SECTION_X_SHIFT = SECTION_Z_SHIFT + SECTION_X_BITS;
-+ static final int SECTION_TO_BLOCK_SHIFT = 4;
-+
-+ public static long getChunkSectionKey(final int x, final int y, final int z) {
-+ return ((x & SECTION_X_MASK) << SECTION_X_SHIFT)
-+ | ((y & SECTION_Y_MASK) << SECTION_Y_SHIFT)
-+ | ((z & SECTION_Z_MASK) << SECTION_Z_SHIFT);
-+ }
-+
-+ public static long getChunkSectionKey(final SectionPos pos) {
-+ return ((pos.getX() & SECTION_X_MASK) << SECTION_X_SHIFT)
-+ | ((pos.getY() & SECTION_Y_MASK) << SECTION_Y_SHIFT)
-+ | ((pos.getZ() & SECTION_Z_MASK) << SECTION_Z_SHIFT);
-+ }
-+
-+ public static long getChunkSectionKey(final ChunkPos pos, final int y) {
-+ return ((pos.x & SECTION_X_MASK) << SECTION_X_SHIFT)
-+ | ((y & SECTION_Y_MASK) << SECTION_Y_SHIFT)
-+ | ((pos.z & SECTION_Z_MASK) << SECTION_Z_SHIFT);
-+ }
-+
-+ public static long getChunkSectionKey(final BlockPos pos) {
-+ return (((long)pos.getX() << (SECTION_X_SHIFT - SECTION_TO_BLOCK_SHIFT)) & (SECTION_X_MASK << SECTION_X_SHIFT)) |
-+ ((pos.getY() >> SECTION_TO_BLOCK_SHIFT) & (SECTION_Y_MASK << SECTION_Y_SHIFT)) |
-+ (((long)pos.getZ() << (SECTION_Z_SHIFT - SECTION_TO_BLOCK_SHIFT)) & (SECTION_Z_MASK << SECTION_Z_SHIFT));
-+ }
-+
-+ public static long getChunkSectionKey(final Entity entity) {
-+ return ((Mth.lfloor(entity.getX()) << (SECTION_X_SHIFT - SECTION_TO_BLOCK_SHIFT)) & (SECTION_X_MASK << SECTION_X_SHIFT)) |
-+ ((Mth.lfloor(entity.getY()) >> SECTION_TO_BLOCK_SHIFT) & (SECTION_Y_MASK << SECTION_Y_SHIFT)) |
-+ ((Mth.lfloor(entity.getZ()) << (SECTION_Z_SHIFT - SECTION_TO_BLOCK_SHIFT)) & (SECTION_Z_MASK << SECTION_Z_SHIFT));
-+ }
-+
-+ public static int getChunkSectionX(final long key) {
-+ return (int)(key << (Long.SIZE - (SECTION_X_SHIFT + SECTION_X_BITS)) >> (Long.SIZE - SECTION_X_BITS));
-+ }
-+
-+ public static int getChunkSectionY(final long key) {
-+ return (int)(key << (Long.SIZE - (SECTION_Y_SHIFT + SECTION_Y_BITS)) >> (Long.SIZE - SECTION_Y_BITS));
-+ }
-+
-+ public static int getChunkSectionZ(final long key) {
-+ return (int)(key << (Long.SIZE - (SECTION_Z_SHIFT + SECTION_Z_BITS)) >> (Long.SIZE - SECTION_Z_BITS));
-+ }
-+
-+ public static int getBlockX(final Vec3 pos) {
-+ return Mth.floor(pos.x);
-+ }
-+
-+ public static int getBlockY(final Vec3 pos) {
-+ return Mth.floor(pos.y);
-+ }
-+
-+ public static int getBlockZ(final Vec3 pos) {
-+ return Mth.floor(pos.z);
-+ }
-+
-+ public static int getChunkX(final Vec3 pos) {
-+ return Mth.floor(pos.x) >> 4;
-+ }
-+
-+ public static int getChunkY(final Vec3 pos) {
-+ return Mth.floor(pos.y) >> 4;
-+ }
-+
-+ public static int getChunkZ(final Vec3 pos) {
-+ return Mth.floor(pos.z) >> 4;
-+ }
-+
-+ private CoordinateUtils() {
-+ throw new RuntimeException();
-+ }
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/FlatBitsetUtil.java b/src/main/java/ca/spottedleaf/moonrise/common/util/FlatBitsetUtil.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..0531f25aaad162386a029d33e68d7c8336b9d5d1
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/FlatBitsetUtil.java
-@@ -0,0 +1,109 @@
-+package ca.spottedleaf.moonrise.common.util;
-+
-+import java.util.Objects;
-+
-+public final class FlatBitsetUtil {
-+
-+ private static final int LOG2_LONG = 6;
-+ private static final long ALL_SET = -1L;
-+ private static final int BITS_PER_LONG = Long.SIZE;
-+
-+ // from inclusive
-+ // to exclusive
-+ public static int firstSet(final long[] bitset, final int from, final int to) {
-+ if ((from | to | (to - from)) < 0) {
-+ throw new IndexOutOfBoundsException();
-+ }
-+
-+ int bitsetIdx = from >>> LOG2_LONG;
-+ int bitIdx = from & ~(BITS_PER_LONG - 1);
-+
-+ long tmp = bitset[bitsetIdx] & (ALL_SET << from);
-+ for (;;) {
-+ if (tmp != 0L) {
-+ final int ret = bitIdx | Long.numberOfTrailingZeros(tmp);
-+ return ret >= to ? -1 : ret;
-+ }
-+
-+ bitIdx += BITS_PER_LONG;
-+
-+ if (bitIdx >= to) {
-+ return -1;
-+ }
-+
-+ tmp = bitset[++bitsetIdx];
-+ }
-+ }
-+
-+ // from inclusive
-+ // to exclusive
-+ public static int firstClear(final long[] bitset, final int from, final int to) {
-+ if ((from | to | (to - from)) < 0) {
-+ throw new IndexOutOfBoundsException();
-+ }
-+ // like firstSet, but invert the bitset
-+
-+ int bitsetIdx = from >>> LOG2_LONG;
-+ int bitIdx = from & ~(BITS_PER_LONG - 1);
-+
-+ long tmp = (~bitset[bitsetIdx]) & (ALL_SET << from);
-+ for (;;) {
-+ if (tmp != 0L) {
-+ final int ret = bitIdx | Long.numberOfTrailingZeros(tmp);
-+ return ret >= to ? -1 : ret;
-+ }
-+
-+ bitIdx += BITS_PER_LONG;
-+
-+ if (bitIdx >= to) {
-+ return -1;
-+ }
-+
-+ tmp = ~bitset[++bitsetIdx];
-+ }
-+ }
-+
-+ // from inclusive
-+ // to exclusive
-+ public static void clearRange(final long[] bitset, final int from, int to) {
-+ if ((from | to | (to - from)) < 0) {
-+ throw new IndexOutOfBoundsException();
-+ }
-+
-+ if (from == to) {
-+ return;
-+ }
-+
-+ --to;
-+
-+ final int fromBitsetIdx = from >>> LOG2_LONG;
-+ final int toBitsetIdx = to >>> LOG2_LONG;
-+
-+ final long keepFirst = ~(ALL_SET << from);
-+ final long keepLast = ~(ALL_SET >>> ((BITS_PER_LONG - 1) ^ to));
-+
-+ Objects.checkFromToIndex(fromBitsetIdx, toBitsetIdx, bitset.length);
-+
-+ if (fromBitsetIdx == toBitsetIdx) {
-+ // special case: need to keep both first and last
-+ bitset[fromBitsetIdx] &= (keepFirst | keepLast);
-+ } else {
-+ bitset[fromBitsetIdx] &= keepFirst;
-+
-+ for (int i = fromBitsetIdx + 1; i < toBitsetIdx; ++i) {
-+ bitset[i] = 0L;
-+ }
-+
-+ bitset[toBitsetIdx] &= keepLast;
-+ }
-+ }
-+
-+ // from inclusive
-+ // to exclusive
-+ public static boolean isRangeSet(final long[] bitset, final int from, final int to) {
-+ return firstClear(bitset, from, to) == -1;
-+ }
-+
-+
-+ private FlatBitsetUtil() {}
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/JsonUtil.java b/src/main/java/ca/spottedleaf/moonrise/common/util/JsonUtil.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..91efda726b87a8a8f28dee84e31b6a7063752ebd
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/JsonUtil.java
-@@ -0,0 +1,34 @@
-+package ca.spottedleaf.moonrise.common.util;
-+
-+import com.google.gson.JsonElement;
-+import com.google.gson.internal.Streams;
-+import com.google.gson.stream.JsonWriter;
-+import java.io.File;
-+import java.io.FileOutputStream;
-+import java.io.IOException;
-+import java.io.PrintStream;
-+import java.io.StringWriter;
-+import java.nio.charset.StandardCharsets;
-+
-+public final class JsonUtil {
-+
-+ public static void writeJson(final JsonElement element, final File file) throws IOException {
-+ final StringWriter stringWriter = new StringWriter();
-+ final JsonWriter jsonWriter = new JsonWriter(stringWriter);
-+ jsonWriter.setIndent(" ");
-+ jsonWriter.setLenient(false);
-+ Streams.write(element, jsonWriter);
-+
-+ final String jsonString = stringWriter.toString();
-+
-+ final File parent = file.getParentFile();
-+ if (parent != null) {
-+ parent.mkdirs();
-+ }
-+ file.createNewFile();
-+ try (final PrintStream out = new PrintStream(new FileOutputStream(file), false, StandardCharsets.UTF_8)) {
-+ out.print(jsonString);
-+ }
-+ }
-+
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/MixinWorkarounds.java b/src/main/java/ca/spottedleaf/moonrise/common/util/MixinWorkarounds.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..ac6f284ee4469d16c5655328b2488d7612832353
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/MixinWorkarounds.java
-@@ -0,0 +1,10 @@
-+package ca.spottedleaf.moonrise.common.util;
-+
-+public final class MixinWorkarounds {
-+
-+ // mixins tries to find the owner of the clone() method, which doesn't exist and NPEs
-+ public static long[] clone(final long[] values) {
-+ return values.clone();
-+ }
-+
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseCommon.java b/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseCommon.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..ef1c9e1e8636a14b5215c6c55d3032bacfd94cac
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseCommon.java
-@@ -0,0 +1,45 @@
-+package ca.spottedleaf.moonrise.common.util;
-+
-+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedThreadPool;
-+import org.slf4j.Logger;
-+import org.slf4j.LoggerFactory;
-+
-+public final class MoonriseCommon {
-+
-+ private static final Logger LOGGER = LoggerFactory.getLogger(MoonriseCommon.class);
-+
-+ // Paper start
-+ public static PrioritisedThreadPool WORKER_POOL;
-+ public static int WORKER_THREADS;
-+ public static void init(io.papermc.paper.configuration.GlobalConfiguration.ChunkSystem chunkSystem) {
-+ // Paper end
-+ int defaultWorkerThreads = Runtime.getRuntime().availableProcessors() / 2;
-+ if (defaultWorkerThreads <= 4) {
-+ defaultWorkerThreads = defaultWorkerThreads <= 3 ? 1 : 2;
-+ } else {
-+ defaultWorkerThreads = defaultWorkerThreads / 2;
-+ }
-+ defaultWorkerThreads = Integer.getInteger("Paper.WorkerThreadCount", Integer.valueOf(defaultWorkerThreads));
-+
-+ int workerThreads = chunkSystem.workerThreads;
-+
-+ if (workerThreads <= 0) {
-+ workerThreads = defaultWorkerThreads;
+
++ public static void onChunkPostNotBorder(final LevelChunk chunk, final ChunkHolder holder) {
++ ((ChunkSystemServerChunkCache)((ServerLevel)chunk.getLevel()).getChunkSource())
++ .moonrise$setFullChunk(chunk.getPos().x, chunk.getPos().z, null);
+ }
+
+ public static void onChunkTicking(final LevelChunk chunk, final ChunkHolder holder) {
+-
++ ((ChunkSystemServerLevel)((ServerLevel)chunk.getLevel())).moonrise$getTickingChunks().add(
++ ((ChunkSystemLevelChunk)chunk).moonrise$getChunkAndHolder()
++ );
++ if (!((ChunkSystemLevelChunk)chunk).moonrise$isPostProcessingDone()) {
++ chunk.postProcessGeneration();
+ }
-+
-+ WORKER_POOL = new PrioritisedThreadPool(
-+ "Paper Worker Pool", workerThreads,
-+ (final Thread thread, final Integer id) -> {
-+ thread.setName("Paper Common Worker #" + id.intValue());
-+ thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
-+ @Override
-+ public void uncaughtException(final Thread thread, final Throwable throwable) {
-+ LOGGER.error("Uncaught exception in thread " + thread.getName(), throwable);
-+ }
-+ });
-+ }, (long)(20.0e6)); // 20ms
-+ WORKER_THREADS = workerThreads;
-+ }
-+
-+ private MoonriseCommon() {}
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseConstants.java b/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseConstants.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..1cf32d7d1bbc8a0a3f7cb9024c793f6744199f64
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/MoonriseConstants.java
-@@ -0,0 +1,9 @@
-+package ca.spottedleaf.moonrise.common.util;
-+
-+public final class MoonriseConstants {
-+
-+ public static final int MAX_VIEW_DISTANCE = 32;
-+
-+ private MoonriseConstants() {}
-+
-+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/WorldUtil.java b/src/main/java/ca/spottedleaf/moonrise/common/util/WorldUtil.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..e95cc73ddf20050aa4a241b0a309240e2bf46abd
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/WorldUtil.java
-@@ -0,0 +1,54 @@
-+package ca.spottedleaf.moonrise.common.util;
-+
-+import net.minecraft.world.level.Level;
-+import net.minecraft.world.level.LevelHeightAccessor;
-+
-+public final class WorldUtil {
-+
-+ // min, max are inclusive
-+
-+ public static int getMaxSection(final LevelHeightAccessor world) {
-+ return world.getMaxSection() - 1; // getMaxSection() is exclusive
-+ }
-+
-+ public static int getMinSection(final LevelHeightAccessor world) {
-+ return world.getMinSection();
-+ }
-+
-+ public static int getMaxLightSection(final LevelHeightAccessor world) {
-+ return getMaxSection(world) + 1;
-+ }
-+
-+ public static int getMinLightSection(final LevelHeightAccessor world) {
-+ return getMinSection(world) - 1;
-+ }
-+
-+
-+
-+ public static int getTotalSections(final LevelHeightAccessor world) {
-+ return getMaxSection(world) - getMinSection(world) + 1;
-+ }
-+
-+ public static int getTotalLightSections(final LevelHeightAccessor world) {
-+ return getMaxLightSection(world) - getMinLightSection(world) + 1;
-+ }
-+
-+ public static int getMinBlockY(final LevelHeightAccessor world) {
-+ return getMinSection(world) << 4;
++ ((ServerLevel)chunk.getLevel()).startTickingChunk(chunk);
++ ((ServerLevel)chunk.getLevel()).getChunkSource().chunkMap.tickingGenerated.incrementAndGet();
+ }
+
+ public static void onChunkNotTicking(final LevelChunk chunk, final ChunkHolder holder) {
+-
++ ((ChunkSystemServerLevel)((ServerLevel)chunk.getLevel())).moonrise$getTickingChunks().remove(
++ ((ChunkSystemLevelChunk)chunk).moonrise$getChunkAndHolder()
++ );
+ }
+
+ public static void onChunkEntityTicking(final LevelChunk chunk, final ChunkHolder holder) {
+-
++ ((ChunkSystemServerLevel)((ServerLevel)chunk.getLevel())).moonrise$getEntityTickingChunks().add(
++ ((ChunkSystemLevelChunk)chunk).moonrise$getChunkAndHolder()
++ );
+ }
+
+ public static void onChunkNotEntityTicking(final LevelChunk chunk, final ChunkHolder holder) {
+-
++ ((ChunkSystemServerLevel)((ServerLevel)chunk.getLevel())).moonrise$getEntityTickingChunks().remove(
++ ((ChunkSystemLevelChunk)chunk).moonrise$getChunkAndHolder()
++ );
+ }
+
+ public static ChunkHolder getUnloadingChunkHolder(final ServerLevel level, final int chunkX, final int chunkZ) {
+- return level.chunkSource.chunkMap.getUnloadingChunkHolder(chunkX, chunkZ);
++ return null;
+ }
+
+ public static int getSendViewDistance(final ServerPlayer player) {
+- return getLoadViewDistance(player);
++ return RegionizedPlayerChunkLoader.getAPISendViewDistance(player);
+ }
+
+ public static int getLoadViewDistance(final ServerPlayer player) {
+- final ServerLevel level = player.serverLevel();
+- if (level == null) {
+- return org.bukkit.Bukkit.getViewDistance();
+- }
+- return level.chunkSource.chunkMap.getPlayerViewDistance(player);
++ return RegionizedPlayerChunkLoader.getLoadViewDistance(player);
+ }
+
+ public static int getTickViewDistance(final ServerPlayer player) {
+- final ServerLevel level = player.serverLevel();
+- if (level == null) {
+- return org.bukkit.Bukkit.getSimulationDistance();
+- }
+- return level.chunkSource.chunkMap.distanceManager.simulationDistance;
++ return RegionizedPlayerChunkLoader.getAPITickViewDistance(player);
+ }
+
-+ public static int getMaxBlockY(final LevelHeightAccessor world) {
-+ return (getMaxSection(world) << 4) | 15;
++ public static void addPlayerToDistanceMaps(final ServerLevel world, final ServerPlayer player) {
++ ((ChunkSystemServerLevel)world).moonrise$getPlayerChunkLoader().addPlayer(player);
+ }
+
-+ public static String getWorldName(final Level world) {
-+ if (world == null) {
-+ return "null world";
-+ }
-+ return world.getWorld().getName();
++ public static void removePlayerFromDistanceMaps(final ServerLevel world, final ServerPlayer player) {
++ ((ChunkSystemServerLevel)world).moonrise$getPlayerChunkLoader().removePlayer(player);
+ }
+
-+ private WorldUtil() {
-+ throw new RuntimeException();
-+ }
-+}
++ public static void updateMaps(final ServerLevel world, final ServerPlayer player) {
++ ((ChunkSystemServerLevel)world).moonrise$getPlayerChunkLoader().updatePlayer(player);
+ }
+
+ private ChunkSystem() {}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java b/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
+index 7deb341b7e2b4592ae3f88733d6cacf6e58764e4..b3bac1beeb0b4be8e110a61acf46740d556801ef 100644
+--- a/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
++++ b/src/main/java/ca/spottedleaf/moonrise/common/util/TickThread.java
+@@ -90,7 +90,7 @@ public class TickThread extends Thread {
+ }
+
+ public static boolean isTickThread() {
+- return org.bukkit.Bukkit.isPrimaryThread(); // Paper
++ return Thread.currentThread() instanceof TickThread;
+ }
+
+ public static boolean isShutdownThread() {
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/block_counting/BlockCountingBitStorage.java b/src/main/java/ca/spottedleaf/moonrise/patches/block_counting/BlockCountingBitStorage.java
new file mode 100644
index 0000000000000000000000000000000000000000..aef4fc0d3c272febe675d1ac846b88e58b4e7533
@@ -3412,174 +401,6 @@ index 0000000000000000000000000000000000000000..08338917dc61c856eaba0b76e05c1497
+ public BlockState moonrise$getBlock(final int x, final int y, final int z);
+
+}
-diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystem.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystem.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..c2ff037e180393de6576f12c32c665ef640d6f50
---- /dev/null
-+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystem.java
-@@ -0,0 +1,162 @@
-+package ca.spottedleaf.moonrise.patches.chunk_system;
-+
-+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
-+import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel;
-+import ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkSystemLevelChunk;
-+import ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader;
-+import ca.spottedleaf.moonrise.patches.chunk_system.world.ChunkSystemServerChunkCache;
-+import com.mojang.logging.LogUtils;
-+import net.minecraft.server.level.ChunkHolder;
-+import net.minecraft.server.level.FullChunkStatus;
-+import net.minecraft.server.level.ServerLevel;
-+import net.minecraft.server.level.ServerPlayer;
-+import net.minecraft.world.entity.Entity;
-+import net.minecraft.world.level.chunk.ChunkAccess;
-+import net.minecraft.world.level.chunk.LevelChunk;
-+import net.minecraft.world.level.chunk.status.ChunkStatus;
-+import org.slf4j.Logger;
-+import java.util.List;
-+import java.util.function.Consumer;
-+
-+public final class ChunkSystem {
-+
-+ private static final Logger LOGGER = LogUtils.getLogger();
-+
-+ public static void scheduleChunkTask(final ServerLevel level, final int chunkX, final int chunkZ, final Runnable run) {
-+ scheduleChunkTask(level, chunkX, chunkZ, run, PrioritisedExecutor.Priority.NORMAL);
-+ }
-+
-+ public static void scheduleChunkTask(final ServerLevel level, final int chunkX, final int chunkZ, final Runnable run, final PrioritisedExecutor.Priority priority) {
-+ ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().scheduleChunkTask(chunkX, chunkZ, run, priority);
-+ }
-+
-+ public static void scheduleChunkLoad(final ServerLevel level, final int chunkX, final int chunkZ, final boolean gen,
-+ final ChunkStatus toStatus, final boolean addTicket, final PrioritisedExecutor.Priority priority,
-+ final Consumer<ChunkAccess> onComplete) {
-+ ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().scheduleChunkLoad(chunkX, chunkZ, gen, toStatus, addTicket, priority, onComplete);
-+ }
-+
-+ // Paper - rewrite chunk system
-+ public static void scheduleChunkLoad(final ServerLevel level, final int chunkX, final int chunkZ, final ChunkStatus toStatus,
-+ final boolean addTicket, final PrioritisedExecutor.Priority priority, final Consumer<ChunkAccess> onComplete) {
-+ ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().scheduleChunkLoad(chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
-+ }
-+
-+ 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) {
-+ ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().scheduleTickingState(chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
-+ }
-+
-+ public static List<ChunkHolder> getVisibleChunkHolders(final ServerLevel level) {
-+ return ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().chunkHolderManager.getOldChunkHolders();
-+ }
-+
-+ public static List<ChunkHolder> getUpdatingChunkHolders(final ServerLevel level) {
-+ return ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().chunkHolderManager.getOldChunkHolders();
-+ }
-+
-+ public static int getVisibleChunkHolderCount(final ServerLevel level) {
-+ return ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().chunkHolderManager.size();
-+ }
-+
-+ public static int getUpdatingChunkHolderCount(final ServerLevel level) {
-+ return ((ChunkSystemServerLevel)level).moonrise$getChunkTaskScheduler().chunkHolderManager.size();
-+ }
-+
-+ public static boolean hasAnyChunkHolders(final ServerLevel level) {
-+ return getUpdatingChunkHolderCount(level) != 0;
-+ }
-+
-+ public static void onEntityPreAdd(final ServerLevel level, final Entity entity) {
-+ // TODO move hook
-+ io.papermc.paper.chunk.system.ChunkSystem.onEntityPreAdd(level, entity);
-+ }
-+
-+ public static void onChunkHolderCreate(final ServerLevel level, final ChunkHolder holder) {
-+ // TODO move hook
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderCreate(level, holder);
-+ }
-+
-+ public static void onChunkHolderDelete(final ServerLevel level, final ChunkHolder holder) {
-+ // TODO move hook
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderDelete(level, holder);
-+ }
-+
-+ public static void onChunkPreBorder(final LevelChunk chunk, final ChunkHolder holder) {
-+ ((ChunkSystemServerChunkCache)((ServerLevel)chunk.getLevel()).getChunkSource())
-+ .moonrise$setFullChunk(chunk.getPos().x, chunk.getPos().z, chunk);
-+ }
-+
-+ public static void onChunkBorder(final LevelChunk chunk, final ChunkHolder holder) {
-+ // TODO move hook
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkBorder(chunk, holder);
-+ chunk.loadCallback(); // Paper
-+ }
-+
-+ public static void onChunkNotBorder(final LevelChunk chunk, final ChunkHolder holder) {
-+ // TODO move hook
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkNotBorder(chunk, holder);
-+ chunk.unloadCallback(); // Paper
-+ }
-+
-+ public static void onChunkPostNotBorder(final LevelChunk chunk, final ChunkHolder holder) {
-+ ((ChunkSystemServerChunkCache)((ServerLevel)chunk.getLevel()).getChunkSource())
-+ .moonrise$setFullChunk(chunk.getPos().x, chunk.getPos().z, null);
-+ }
-+
-+ public static void onChunkTicking(final LevelChunk chunk, final ChunkHolder holder) {
-+ // TODO move hook
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkTicking(chunk, holder);
-+ if (!((ChunkSystemLevelChunk)chunk).moonrise$isPostProcessingDone()) {
-+ chunk.postProcessGeneration();
-+ }
-+ ((ServerLevel)chunk.getLevel()).startTickingChunk(chunk);
-+ ((ServerLevel)chunk.getLevel()).getChunkSource().chunkMap.tickingGenerated.incrementAndGet();
-+ }
-+
-+ public static void onChunkNotTicking(final LevelChunk chunk, final ChunkHolder holder) {
-+ // TODO move hook
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkNotTicking(chunk, holder);
-+ }
-+
-+ public static void onChunkEntityTicking(final LevelChunk chunk, final ChunkHolder holder) {
-+ // TODO move hook
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkEntityTicking(chunk, holder);
-+ }
-+
-+ public static void onChunkNotEntityTicking(final LevelChunk chunk, final ChunkHolder holder) {
-+ // TODO move hook
-+ io.papermc.paper.chunk.system.ChunkSystem.onChunkNotEntityTicking(chunk, holder);
-+ }
-+
-+ public static ChunkHolder getUnloadingChunkHolder(final ServerLevel level, final int chunkX, final int chunkZ) {
-+ return null;
-+ }
-+
-+ public static int getSendViewDistance(final ServerPlayer player) {
-+ return RegionizedPlayerChunkLoader.getAPISendViewDistance(player);
-+ }
-+
-+ public static int getLoadViewDistance(final ServerPlayer player) {
-+ return RegionizedPlayerChunkLoader.getLoadViewDistance(player);
-+ }
-+
-+ public static int getTickViewDistance(final ServerPlayer player) {
-+ return RegionizedPlayerChunkLoader.getAPITickViewDistance(player);
-+ }
-+
-+ public static void addPlayerToDistanceMaps(final ServerLevel world, final ServerPlayer player) {
-+ ((ChunkSystemServerLevel)world).moonrise$getPlayerChunkLoader().addPlayer(player);
-+ }
-+
-+ public static void removePlayerFromDistanceMaps(final ServerLevel world, final ServerPlayer player) {
-+ ((ChunkSystemServerLevel)world).moonrise$getPlayerChunkLoader().removePlayer(player);
-+ }
-+
-+ public static void updateMaps(final ServerLevel world, final ServerPlayer player) {
-+ ((ChunkSystemServerLevel)world).moonrise$getPlayerChunkLoader().updatePlayer(player);
-+ }
-+
-+ private ChunkSystem() {}
-+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystemConverters.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/ChunkSystemConverters.java
new file mode 100644
index 0000000000000000000000000000000000000000..49160a30b8e19e5c5ada811fbcae2a05959524f3
@@ -3750,10 +571,10 @@ index 0000000000000000000000000000000000000000..73df26b27146bbad2106d57b22dd3c79
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/io/RegionFileIOThread.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/io/RegionFileIOThread.java
new file mode 100644
-index 0000000000000000000000000000000000000000..c833f78d083b8f661087471c35bc90f65af1b525
+index 0000000000000000000000000000000000000000..3218cbf84f54daf06e84442d5eb1a36d8da6b215
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/io/RegionFileIOThread.java
-@@ -0,0 +1,1239 @@
+@@ -0,0 +1,1240 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.io;
+
+import ca.spottedleaf.concurrentutil.collection.MultiThreadedQueue;
@@ -3765,6 +586,7 @@ index 0000000000000000000000000000000000000000..c833f78d083b8f661087471c35bc90f6
+import ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable;
+import ca.spottedleaf.concurrentutil.util.ConcurrentUtil;
+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
++import ca.spottedleaf.moonrise.common.util.TickThread;
+import ca.spottedleaf.moonrise.common.util.WorldUtil;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel;
+import net.minecraft.nbt.CompoundTag;
@@ -4052,7 +874,7 @@ index 0000000000000000000000000000000000000000..c833f78d083b8f661087471c35bc90f6
+ * @return The priroity to use with blocking I/O on the current thread.
+ */
+ public static Priority getIOBlockingPriorityForCurrentThread() {
-+ if (io.papermc.paper.util.TickThread.isTickThread()) {
++ if (TickThread.isTickThread()) {
+ return Priority.BLOCKING;
+ }
+ return Priority.HIGHEST;
@@ -5201,18 +2023,20 @@ index 0000000000000000000000000000000000000000..0b58701342d573fa43cdd06681534854
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/ChunkSystemServerLevel.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/ChunkSystemServerLevel.java
new file mode 100644
-index 0000000000000000000000000000000000000000..1a06c2c139e930d2081e605b460ae5403de8c3ea
+index 0000000000000000000000000000000000000000..b8a87b7e6505feb76ce1bd58c84615256cf6faa6
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/ChunkSystemServerLevel.java
-@@ -0,0 +1,53 @@
+@@ -0,0 +1,61 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.level;
+
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
++import ca.spottedleaf.moonrise.common.list.ReferenceList;
+import ca.spottedleaf.moonrise.common.misc.NearbyPlayers;
+import ca.spottedleaf.moonrise.patches.chunk_system.io.RegionFileIOThread;
+import ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader;
+import ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler;
+import net.minecraft.core.BlockPos;
++import net.minecraft.server.level.ServerChunkCache;
+import net.minecraft.world.level.chunk.ChunkAccess;
+import net.minecraft.world.level.chunk.status.ChunkStatus;
+import java.util.List;
@@ -5257,6 +2081,12 @@ index 0000000000000000000000000000000000000000..1a06c2c139e930d2081e605b460ae540
+ public void moonrise$setLastMidTickFailure(final long time);
+
+ public NearbyPlayers moonrise$getNearbyPlayers();
++
++ public ReferenceList<ServerChunkCache.ChunkAndHolder> moonrise$getLoadedChunks();
++
++ public ReferenceList<ServerChunkCache.ChunkAndHolder> moonrise$getTickingChunks();
++
++ public ReferenceList<ServerChunkCache.ChunkAndHolder> moonrise$getEntityTickingChunks();
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/chunk/ChunkSystemChunkHolder.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/chunk/ChunkSystemChunkHolder.java
new file mode 100644
@@ -5339,16 +2169,22 @@ index 0000000000000000000000000000000000000000..883fe6401f1b9711fa544d18a815b4d6
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/chunk/ChunkSystemLevelChunk.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/chunk/ChunkSystemLevelChunk.java
new file mode 100644
-index 0000000000000000000000000000000000000000..755b08dd32e568d341ceef8a8aef841831a0781d
+index 0000000000000000000000000000000000000000..5b092bca7027e37aeee8f4b852ad896dd0d5febc
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/chunk/ChunkSystemLevelChunk.java
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,13 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.level.chunk;
+
++import net.minecraft.server.level.ServerChunkCache;
++
+public interface ChunkSystemLevelChunk {
+
+ public boolean moonrise$isPostProcessingDone();
+
++ public ServerChunkCache.ChunkAndHolder moonrise$getChunkAndHolder();
++
++ public void moonrise$setChunkAndHolder(final ServerChunkCache.ChunkAndHolder holder);
++
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
new file mode 100644
@@ -6177,10 +3013,10 @@ index 0000000000000000000000000000000000000000..997b05167c19472acb98edac32d4548c
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/EntityLookup.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/EntityLookup.java
new file mode 100644
-index 0000000000000000000000000000000000000000..a346435abac725b4e024acf4a1589a51caac8d69
+index 0000000000000000000000000000000000000000..efc0c1acc8239dd7b00211a1d3bfd3fc3b2c810c
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/EntityLookup.java
-@@ -0,0 +1,1077 @@
+@@ -0,0 +1,1083 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.level.entity;
+
+import ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable;
@@ -6274,6 +3110,8 @@ index 0000000000000000000000000000000000000000..a346435abac725b4e024acf4a1589a51
+
+ protected abstract void entityEndTicking(final Entity entity);
+
++ protected abstract boolean screenEntity(final Entity entity);
++
+ private static Entity maskNonAccessible(final Entity entity) {
+ if (entity == null) {
+ return null;
@@ -6595,6 +3433,10 @@ index 0000000000000000000000000000000000000000..a346435abac725b4e024acf4a1589a51
+ return false;
+ }
+
++ if (!this.screenEntity(entity)) {
++ return false;
++ }
++
+ Entity currentlyMapped = this.entityById.putIfAbsent((long)entity.getId(), entity);
+ if (currentlyMapped != null) {
+ LOGGER.warn("Entity id already exists: " + entity.getId() + ", mapped to " + currentlyMapped + ", can't add " + entity);
@@ -7261,10 +4103,10 @@ index 0000000000000000000000000000000000000000..a346435abac725b4e024acf4a1589a51
\ No newline at end of file
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/client/ClientEntityLookup.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/client/ClientEntityLookup.java
new file mode 100644
-index 0000000000000000000000000000000000000000..77e81414d43826955da8af85ec1bd0009af4e1b9
+index 0000000000000000000000000000000000000000..edcde00206d068bd79175fea33efa05b0e8c1562
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/client/ClientEntityLookup.java
-@@ -0,0 +1,118 @@
+@@ -0,0 +1,123 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.level.entity.client;
+
+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
@@ -7363,6 +4205,11 @@ index 0000000000000000000000000000000000000000..77e81414d43826955da8af85ec1bd000
+
+ }
+
++ @Override
++ protected boolean screenEntity(final Entity entity) {
++ return true;
++ }
++
+ public void markTicking(final long pos) {
+ if (this.tickingChunks.add(pos)) {
+ final int chunkX = CoordinateUtils.getChunkX(pos);
@@ -7385,10 +4232,10 @@ index 0000000000000000000000000000000000000000..77e81414d43826955da8af85ec1bd000
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/dfl/DefaultEntityLookup.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/dfl/DefaultEntityLookup.java
new file mode 100644
-index 0000000000000000000000000000000000000000..4747499e84b05d499364622b0f750fdd66b737e0
+index 0000000000000000000000000000000000000000..465469e44346c50f30f3abd6b44f4173ccfcf248
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/dfl/DefaultEntityLookup.java
-@@ -0,0 +1,109 @@
+@@ -0,0 +1,114 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.level.entity.dfl;
+
+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
@@ -7474,6 +4321,11 @@ index 0000000000000000000000000000000000000000..4747499e84b05d499364622b0f750fdd
+
+ }
+
++ @Override
++ protected boolean screenEntity(final Entity entity) {
++ return true;
++ }
++
+ protected static final class DefaultLevelCallback implements LevelCallback<Entity> {
+
+ @Override
@@ -7500,13 +4352,15 @@ index 0000000000000000000000000000000000000000..4747499e84b05d499364622b0f750fdd
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
new file mode 100644
-index 0000000000000000000000000000000000000000..eb1b0b3594ae6861a05010949ba94a60f73ecc8b
+index 0000000000000000000000000000000000000000..dacf2b2988ce603879fe525a3418ac77f8a663f7
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
-@@ -0,0 +1,106 @@
+@@ -0,0 +1,113 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.level.entity.server;
+
+import ca.spottedleaf.moonrise.common.list.ReferenceList;
++import ca.spottedleaf.moonrise.common.util.TickThread;
++import ca.spottedleaf.moonrise.common.util.ChunkSystem;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.entity.ChunkEntitySlices;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.entity.EntityLookup;
@@ -7520,8 +4374,8 @@ index 0000000000000000000000000000000000000000..eb1b0b3594ae6861a05010949ba94a60
+ private static final Entity[] EMPTY_ENTITY_ARRAY = new Entity[0];
+
+ private final ServerLevel serverWorld;
-+ public final ReferenceList<Entity> trackerEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY, 0); // Moonrise - entity tracker
-+ public final ReferenceList<Entity> trackerUnloadedEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY, 0); // Moonrise - entity tracker
++ public final ReferenceList<Entity> trackerEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
++ public final ReferenceList<Entity> trackerUnloadedEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
+
+ public ServerEntityLookup(final ServerLevel world, final LevelCallback<Entity> worldCallback) {
+ super(world, worldCallback);
@@ -7540,12 +4394,12 @@ index 0000000000000000000000000000000000000000..eb1b0b3594ae6861a05010949ba94a60
+
+ @Override
+ protected void checkThread(final int chunkX, final int chunkZ, final String reason) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.serverWorld, chunkX, chunkZ, reason);
++ TickThread.ensureTickThread(this.serverWorld, chunkX, chunkZ, reason);
+ }
+
+ @Override
+ protected void checkThread(final Entity entity, final String reason) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(entity, reason);
++ TickThread.ensureTickThread(entity, reason);
+ }
+
+ @Override
@@ -7609,6 +4463,11 @@ index 0000000000000000000000000000000000000000..eb1b0b3594ae6861a05010949ba94a60
+ protected void entityEndTicking(final Entity entity) {
+
+ }
++
++ @Override
++ protected boolean screenEntity(final Entity entity) {
++ return ChunkSystem.screenEntity(this.serverWorld, entity);
++ }
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/poi/ChunkSystemPoiManager.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/poi/ChunkSystemPoiManager.java
new file mode 100644
@@ -7653,13 +4512,14 @@ index 0000000000000000000000000000000000000000..89b956b8fdf1a0d862a843104511005e
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/poi/PoiChunk.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/poi/PoiChunk.java
new file mode 100644
-index 0000000000000000000000000000000000000000..cd1302a3aee6f543f39d71b91725128fa1aeddcc
+index 0000000000000000000000000000000000000000..fd35e4db0c8fec8f86b8743bcc2b15ed2e7433f1
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/poi/PoiChunk.java
-@@ -0,0 +1,211 @@
+@@ -0,0 +1,212 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.level.poi;
+
+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
++import ca.spottedleaf.moonrise.common.util.TickThread;
+import ca.spottedleaf.moonrise.common.util.WorldUtil;
+import com.mojang.serialization.Codec;
+import com.mojang.serialization.DataResult;
@@ -7707,7 +4567,7 @@ index 0000000000000000000000000000000000000000..cd1302a3aee6f543f39d71b91725128f
+ }
+
+ public void load() {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, this.chunkX, this.chunkZ, "Loading in poi chunk off-main");
++ TickThread.ensureTickThread(this.world, this.chunkX, this.chunkZ, "Loading in poi chunk off-main");
+ if (this.loaded) {
+ return;
+ }
@@ -7918,7 +4778,7 @@ index 0000000000000000000000000000000000000000..003a857e70ead858e8437e3c1bfaf22f
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
new file mode 100644
-index 0000000000000000000000000000000000000000..f063ab3ff122b920bcc4aa4f5bf9a442a8eb32fd
+index 0000000000000000000000000000000000000000..244674dc44d80ee5ce78d2ed2c6ab94fd5d3d07f
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
@@ -0,0 +1,1076 @@
@@ -7929,7 +4789,7 @@ index 0000000000000000000000000000000000000000..f063ab3ff122b920bcc4aa4f5bf9a442
+import ca.spottedleaf.moonrise.common.misc.AllocatingRateLimiter;
+import ca.spottedleaf.moonrise.common.misc.SingleUserAreaMap;
+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
-+import ca.spottedleaf.moonrise.common.util.MoonriseCommon;
++import ca.spottedleaf.moonrise.common.util.TickThread;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkSystemChunkHolder;
@@ -8104,7 +4964,7 @@ index 0000000000000000000000000000000000000000..f063ab3ff122b920bcc4aa4f5bf9a442
+ }
+
+ public void addPlayer(final ServerPlayer player) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(player, "Cannot add player to player chunk loader async");
++ TickThread.ensureTickThread(player, "Cannot add player to player chunk loader async");
+ if (!((ChunkSystemServerPlayer)player).moonrise$isRealPlayer()) {
+ return;
+ }
@@ -8129,7 +4989,7 @@ index 0000000000000000000000000000000000000000..f063ab3ff122b920bcc4aa4f5bf9a442
+ }
+
+ public void removePlayer(final ServerPlayer player) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(player, "Cannot remove player from player chunk loader async");
++ TickThread.ensureTickThread(player, "Cannot remove player from player chunk loader async");
+ if (!((ChunkSystemServerPlayer)player).moonrise$isRealPlayer()) {
+ return;
+ }
@@ -8223,7 +5083,7 @@ index 0000000000000000000000000000000000000000..f063ab3ff122b920bcc4aa4f5bf9a442
+ }
+
+ public void tick() {
-+ io.papermc.paper.util.TickThread.ensureTickThread("Cannot tick player chunk loader async");
++ TickThread.ensureTickThread("Cannot tick player chunk loader async");
+ long currTime = System.nanoTime();
+ for (final ServerPlayer player : new java.util.ArrayList<>(this.world.players())) {
+ final PlayerChunkLoaderData loader = ((ChunkSystemServerPlayer)player).moonrise$getChunkLoader();
@@ -8551,7 +5411,7 @@ index 0000000000000000000000000000000000000000..f063ab3ff122b920bcc4aa4f5bf9a442
+ }
+
+ void updateQueues(final long time) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.player, "Cannot tick player chunk loader async");
++ TickThread.ensureTickThread(this.player, "Cannot tick player chunk loader async");
+ if (this.removed) {
+ throw new IllegalStateException("Ticking removed player chunk loader");
+ }
@@ -8736,7 +5596,7 @@ index 0000000000000000000000000000000000000000..f063ab3ff122b920bcc4aa4f5bf9a442
+ final int pendingSendX = CoordinateUtils.getChunkX(pendingSend);
+ final int pendingSendZ = CoordinateUtils.getChunkZ(pendingSend);
+ final LevelChunk chunk = ((ChunkSystemLevel)this.world).moonrise$getFullChunkIfLoaded(pendingSendX, pendingSendZ);
-+ if (!this.areNeighboursGenerated(pendingSendX, pendingSendZ, 1) || !io.papermc.paper.util.TickThread.isTickThreadFor(this.world, pendingSendX, pendingSendZ)) {
++ if (!this.areNeighboursGenerated(pendingSendX, pendingSendZ, 1) || !TickThread.isTickThreadFor(this.world, pendingSendX, pendingSendZ)) {
+ // nothing to do
+ // the target chunk may not be owned by this region, but this should be resolved in the future
+ break;
@@ -8763,7 +5623,7 @@ index 0000000000000000000000000000000000000000..f063ab3ff122b920bcc4aa4f5bf9a442
+ }
+
+ void add() {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.player, "Cannot add player asynchronously");
++ TickThread.ensureTickThread(this.player, "Cannot add player asynchronously");
+ if (this.removed) {
+ throw new IllegalStateException("Adding removed player chunk loader");
+ }
@@ -8819,7 +5679,7 @@ index 0000000000000000000000000000000000000000..f063ab3ff122b920bcc4aa4f5bf9a442
+ }
+
+ void update() {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.player, "Cannot update player asynchronously");
++ TickThread.ensureTickThread(this.player, "Cannot update player asynchronously");
+ if (this.removed) {
+ throw new IllegalStateException("Updating removed player chunk loader");
+ }
@@ -8971,7 +5831,7 @@ index 0000000000000000000000000000000000000000..f063ab3ff122b920bcc4aa4f5bf9a442
+ }
+
+ void remove() {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.player, "Cannot add player asynchronously");
++ TickThread.ensureTickThread(this.player, "Cannot add player asynchronously");
+ if (this.removed) {
+ throw new IllegalStateException("Removing removed player chunk loader");
+ }
@@ -9151,10 +6011,10 @@ index 0000000000000000000000000000000000000000..7eafc5b7cba23d8dec92ecc1050afe3f
\ No newline at end of file
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java
new file mode 100644
-index 0000000000000000000000000000000000000000..1030e1b059f7ccdedd9c00527c3dd20c9cb81f42
+index 0000000000000000000000000000000000000000..58d3d1a47e9f2423c467bb329c2d5f4b58a8b5ef
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkHolderManager.java
-@@ -0,0 +1,1427 @@
+@@ -0,0 +1,1428 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.scheduling;
+
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
@@ -9162,8 +6022,9 @@ index 0000000000000000000000000000000000000000..1030e1b059f7ccdedd9c00527c3dd20c
+import ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable;
+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
+import ca.spottedleaf.moonrise.common.util.MoonriseCommon;
++import ca.spottedleaf.moonrise.common.util.TickThread;
+import ca.spottedleaf.moonrise.common.util.WorldUtil;
-+import ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem;
++import ca.spottedleaf.moonrise.common.util.ChunkSystem;
+import ca.spottedleaf.moonrise.patches.chunk_system.io.RegionFileIOThread;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.entity.ChunkEntitySlices;
@@ -9341,7 +6202,7 @@ index 0000000000000000000000000000000000000000..1030e1b059f7ccdedd9c00527c3dd20c
+ }
+
+ public void close(final boolean save, final boolean halt) {
-+ io.papermc.paper.util.TickThread.ensureTickThread("Closing world off-main");
++ TickThread.ensureTickThread("Closing world off-main");
+ if (halt) {
+ LOGGER.info("Waiting 60s for chunk system to halt for world '" + WorldUtil.getWorldName(this.world) + "'");
+ if (!this.taskScheduler.halt(true, TimeUnit.SECONDS.toNanos(60L))) {
@@ -10017,7 +6878,7 @@ index 0000000000000000000000000000000000000000..1030e1b059f7ccdedd9c00527c3dd20c
+ }
+
+ public ChunkEntitySlices getOrCreateEntityChunk(final int chunkX, final int chunkZ, final boolean transientChunk) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Cannot create entity chunk off-main");
++ TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Cannot create entity chunk off-main");
+ ChunkEntitySlices ret;
+
+ NewChunkHolder current = this.getChunkHolder(chunkX, chunkZ);
@@ -10098,7 +6959,7 @@ index 0000000000000000000000000000000000000000..1030e1b059f7ccdedd9c00527c3dd20c
+ }
+
+ public PoiChunk loadPoiChunk(final int chunkX, final int chunkZ) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Cannot create poi chunk off-main");
++ TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Cannot create poi chunk off-main");
+ PoiChunk ret;
+
+ NewChunkHolder current = this.getChunkHolder(chunkX, chunkZ);
@@ -10166,7 +7027,7 @@ index 0000000000000000000000000000000000000000..1030e1b059f7ccdedd9c00527c3dd20c
+ if (changedFullStatus.isEmpty()) {
+ return;
+ }
-+ if (!io.papermc.paper.util.TickThread.isTickThread()) {
++ if (!TickThread.isTickThread()) {
+ this.taskScheduler.scheduleChunkTask(() -> {
+ final ArrayDeque<NewChunkHolder> pendingFullLoadUpdate = ChunkHolderManager.this.pendingFullLoadUpdate;
+ for (int i = 0, len = changedFullStatus.size(); i < len; ++i) {
@@ -10193,7 +7054,7 @@ index 0000000000000000000000000000000000000000..1030e1b059f7ccdedd9c00527c3dd20c
+
+ // note: never call while inside the chunk system, this will absolutely break everything
+ public void processUnloads() {
-+ io.papermc.paper.util.TickThread.ensureTickThread("Cannot unload chunks off-main");
++ TickThread.ensureTickThread("Cannot unload chunks off-main");
+
+ if (BLOCK_TICKET_UPDATES.get() == Boolean.TRUE) {
+ throw new IllegalStateException("Cannot unload chunks recursively");
@@ -10472,7 +7333,7 @@ index 0000000000000000000000000000000000000000..1030e1b059f7ccdedd9c00527c3dd20c
+
+ List<NewChunkHolder> changedFullStatus = null;
+
-+ final boolean isTickThread = io.papermc.paper.util.TickThread.isTickThread();
++ final boolean isTickThread = TickThread.isTickThread();
+
+ boolean ret = false;
+ final boolean canProcessFullUpdates = processFullUpdates & isTickThread;
@@ -10584,10 +7445,10 @@ index 0000000000000000000000000000000000000000..1030e1b059f7ccdedd9c00527c3dd20c
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
new file mode 100644
-index 0000000000000000000000000000000000000000..c1c119e2e788d5963de3a74a6b9724c71a168a8a
+index 0000000000000000000000000000000000000000..b1456c1ddf24b625c6caf41a9379d8c011e1c36c
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
-@@ -0,0 +1,1037 @@
+@@ -0,0 +1,1038 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.scheduling;
+
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
@@ -10598,6 +7459,7 @@ index 0000000000000000000000000000000000000000..c1c119e2e788d5963de3a74a6b9724c7
+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
+import ca.spottedleaf.moonrise.common.util.JsonUtil;
+import ca.spottedleaf.moonrise.common.util.MoonriseCommon;
++import ca.spottedleaf.moonrise.common.util.TickThread;
+import ca.spottedleaf.moonrise.common.util.WorldUtil;
+import ca.spottedleaf.moonrise.patches.chunk_system.io.RegionFileIOThread;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel;
@@ -10955,7 +7817,7 @@ index 0000000000000000000000000000000000000000..c1c119e2e788d5963de3a74a6b9724c7
+ }
+
+ public boolean executeMainThreadTask() {
-+ io.papermc.paper.util.TickThread.ensureTickThread("Cannot execute main thread task off-main");
++ TickThread.ensureTickThread("Cannot execute main thread task off-main");
+ return this.mainThreadExecutor.executeTask();
+ }
+
@@ -10974,7 +7836,7 @@ index 0000000000000000000000000000000000000000..c1c119e2e788d5963de3a74a6b9724c7
+ public void scheduleTickingState(final int chunkX, final int chunkZ, final FullChunkStatus toStatus,
+ final boolean addTicket, final PrioritisedExecutor.Priority priority,
+ final Consumer<LevelChunk> onComplete) {
-+ if (!io.papermc.paper.util.TickThread.isTickThread()) {
++ if (!TickThread.isTickThread()) {
+ this.scheduleChunkTask(chunkX, chunkZ, () -> {
+ ChunkTaskScheduler.this.scheduleTickingState(chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
+ }, priority);
@@ -11165,7 +8027,7 @@ index 0000000000000000000000000000000000000000..c1c119e2e788d5963de3a74a6b9724c7
+
+ public void scheduleChunkLoad(final int chunkX, final int chunkZ, final ChunkStatus toStatus, final boolean addTicket,
+ final PrioritisedExecutor.Priority priority, final Consumer<ChunkAccess> onComplete) {
-+ if (!io.papermc.paper.util.TickThread.isTickThread()) {
++ if (!TickThread.isTickThread()) {
+ this.scheduleChunkTask(chunkX, chunkZ, () -> {
+ ChunkTaskScheduler.this.scheduleChunkLoad(chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
+ }, priority);
@@ -11627,10 +8489,10 @@ index 0000000000000000000000000000000000000000..c1c119e2e788d5963de3a74a6b9724c7
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
new file mode 100644
-index 0000000000000000000000000000000000000000..a7ada64a78e36642a6d5ce4a767bff12e675bb16
+index 0000000000000000000000000000000000000000..1dfddea4fd7e89fb6fd9fa49f7ab5e6f48e6ef3c
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
-@@ -0,0 +1,2034 @@
+@@ -0,0 +1,2035 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.scheduling;
+
+import ca.spottedleaf.concurrentutil.completable.Completable;
@@ -11640,8 +8502,9 @@ index 0000000000000000000000000000000000000000..a7ada64a78e36642a6d5ce4a767bff12
+import ca.spottedleaf.concurrentutil.lock.ReentrantAreaLock;
+import ca.spottedleaf.concurrentutil.util.ConcurrentUtil;
+import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
++import ca.spottedleaf.moonrise.common.util.TickThread;
+import ca.spottedleaf.moonrise.common.util.WorldUtil;
-+import ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem;
++import ca.spottedleaf.moonrise.common.util.ChunkSystem;
+import ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystemFeatures;
+import ca.spottedleaf.moonrise.patches.chunk_system.async_save.AsyncChunkSaveData;
+import ca.spottedleaf.moonrise.patches.chunk_system.io.RegionFileIOThread;
@@ -11705,7 +8568,7 @@ index 0000000000000000000000000000000000000000..a7ada64a78e36642a6d5ce4a767bff12
+ private CompoundTag pendingEntityChunk;
+
+ ChunkEntitySlices loadInEntityChunk(final boolean transientChunk) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, this.chunkX, this.chunkZ, "Cannot sync load entity data off-main");
++ TickThread.ensureTickThread(this.world, this.chunkX, this.chunkZ, "Cannot sync load entity data off-main");
+ final CompoundTag entityChunk;
+ final ChunkEntitySlices ret;
+ final ReentrantAreaLock.Node schedulingLock = this.scheduler.schedulingLockArea.lock(this.chunkX, this.chunkZ);
@@ -12856,7 +9719,7 @@ index 0000000000000000000000000000000000000000..a7ada64a78e36642a6d5ce4a767bff12
+
+ // only to be called on the main thread, no locks need to be held
+ public boolean handleFullStatusChange(final List<NewChunkHolder> changedFullStatus) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, this.chunkX, this.chunkZ, "Cannot update full status thread off-main");
++ TickThread.ensureTickThread(this.world, this.chunkX, this.chunkZ, "Cannot update full status thread off-main");
+
+ boolean ret = false;
+
@@ -13303,7 +10166,7 @@ index 0000000000000000000000000000000000000000..a7ada64a78e36642a6d5ce4a767bff12
+ public static final record SaveStat(boolean savedChunk, boolean savedEntityChunk, boolean savedPoiChunk) {}
+
+ public SaveStat save(final boolean shutdown) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, this.chunkX, this.chunkZ, "Cannot save data off-main");
++ TickThread.ensureTickThread(this.world, this.chunkX, this.chunkZ, "Cannot save data off-main");
+
+ ChunkAccess chunk = this.getCurrentChunk();
+ PoiChunk poi = this.getPoiChunk();
@@ -16026,20 +12889,21 @@ index 0000000000000000000000000000000000000000..e0b26ccb63596748b80fc6a5e47e373b
\ No newline at end of file
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/task/ChunkFullTask.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/task/ChunkFullTask.java
new file mode 100644
-index 0000000000000000000000000000000000000000..49774d42f35eeeac5e2b334cce40e6dcca6d01ed
+index 0000000000000000000000000000000000000000..fbdf721e8b4cfe6cef4ee60c53c680cbfc858d88
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/task/ChunkFullTask.java
-@@ -0,0 +1,139 @@
+@@ -0,0 +1,142 @@
+package ca.spottedleaf.moonrise.patches.chunk_system.scheduling.task;
+
+import ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor;
+import ca.spottedleaf.concurrentutil.util.ConcurrentUtil;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel;
++import ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkSystemLevelChunk;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.poi.ChunkSystemPoiManager;
+import ca.spottedleaf.moonrise.patches.chunk_system.level.poi.PoiChunk;
+import ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler;
+import ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder;
-+import net.minecraft.server.level.ChunkMap;
++import net.minecraft.server.level.ServerChunkCache;
+import net.minecraft.server.level.ServerLevel;
+import net.minecraft.world.level.chunk.ChunkAccess;
+import net.minecraft.world.level.chunk.ImposterProtoChunk;
@@ -16097,6 +12961,8 @@ index 0000000000000000000000000000000000000000..49774d42f35eeeac5e2b334cce40e6dc
+ this.chunkHolder.replaceProtoChunk(new ImposterProtoChunk(chunk, false));
+ }
+
++ ((ChunkSystemLevelChunk)chunk).moonrise$setChunkAndHolder(new ServerChunkCache.ChunkAndHolder(chunk, this.chunkHolder.vanillaChunkHolder));
++
+ final NewChunkHolder chunkHolder = this.chunkHolder;
+
+ chunk.setFullStatus(chunkHolder::getChunkStatus);
@@ -18316,6 +15182,41 @@ index 0000000000000000000000000000000000000000..4b9e2fa963c14f65f15407c1814c543c
+ public LevelChunk moonrise$getFullChunkIfLoaded(final int chunkX, final int chunkZ);
+
+}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_tick_iteration/ChunkTickConstants.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_tick_iteration/ChunkTickConstants.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..e97e7d276faf055c89207385d3820debffb06463
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_tick_iteration/ChunkTickConstants.java
+@@ -0,0 +1,7 @@
++package ca.spottedleaf.moonrise.patches.chunk_tick_iteration;
++
++public final class ChunkTickConstants {
++
++ public static final int PLAYER_SPAWN_TRACK_RANGE = 8;
++
++}
+diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_tick_iteration/ChunkTickDistanceManager.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_tick_iteration/ChunkTickDistanceManager.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..f28fd0e01e2bdda0daf9d775e514a7253d32d8d0
+--- /dev/null
++++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_tick_iteration/ChunkTickDistanceManager.java
+@@ -0,0 +1,16 @@
++package ca.spottedleaf.moonrise.patches.chunk_tick_iteration;
++
++import net.minecraft.core.SectionPos;
++import net.minecraft.server.level.ServerPlayer;
++
++public interface ChunkTickDistanceManager {
++
++ public void moonrise$addPlayer(final ServerPlayer player, final SectionPos pos);
++
++ public void moonrise$removePlayer(final ServerPlayer player, final SectionPos pos);
++
++ public void moonrise$updatePlayer(final ServerPlayer player,
++ final SectionPos oldPos, final SectionPos newPos,
++ final boolean oldIgnore, final boolean newIgnore);
++
++}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java b/src/main/java/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java
new file mode 100644
index 0000000000000000000000000000000000000000..748ab4d637ce463272bae4fdbab6842a27385126
@@ -24898,259 +21799,6 @@ index 0000000000000000000000000000000000000000..57692a503e147a00ac4e1586cd78e12b
+
+ private SaveUtil() {}
+}
-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 a79abe9b26f68d573812e91554124783075ae17a..183d99ec9b94ca20a823c46a2d6bf0a215046d48 100644
---- a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
-+++ b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
-@@ -25,6 +25,10 @@ import java.util.List;
- import java.util.concurrent.CompletableFuture;
- import java.util.function.Consumer;
-
-+/**
-+ * @deprecated Use {@link ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem}
-+ */
-+@Deprecated(forRemoval = true)
- public final class ChunkSystem {
-
- private static final Logger LOGGER = LogUtils.getLogger();
-@@ -35,35 +39,17 @@ public final class ChunkSystem {
- }
-
- public static void scheduleChunkTask(final ServerLevel level, final int chunkX, final int chunkZ, final Runnable run) {
-- scheduleChunkTask(level, chunkX, chunkZ, run, PrioritisedExecutor.Priority.NORMAL);
-+ ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.scheduleChunkTask(level, chunkX, chunkZ, run); // Paper - reroute
- }
-
- public static void scheduleChunkTask(final ServerLevel level, final int chunkX, final int chunkZ, final Runnable run, final PrioritisedExecutor.Priority priority) {
-- level.chunkSource.mainThreadProcessor.execute(run);
-+ ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.scheduleChunkTask(level, chunkX, chunkZ, run, priority); // Paper - reroute
- }
-
- public static void scheduleChunkLoad(final ServerLevel level, final int chunkX, final int chunkZ, final boolean gen,
- final ChunkStatus toStatus, final boolean addTicket, final PrioritisedExecutor.Priority priority,
- final Consumer<ChunkAccess> onComplete) {
-- if (gen) {
-- scheduleChunkLoad(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
-- return;
-- }
-- scheduleChunkLoad(level, chunkX, chunkZ, ChunkStatus.EMPTY, addTicket, priority, (final ChunkAccess chunk) -> {
-- if (chunk == null) {
-- if (onComplete != null) {
-- onComplete.accept(null);
-- }
-- } else {
-- if (chunk.getPersistedStatus().isOrAfter(toStatus)) {
-- scheduleChunkLoad(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
-- } else {
-- if (onComplete != null) {
-- onComplete.accept(null);
-- }
-- }
-- }
-- });
-+ ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.scheduleChunkLoad(level, chunkX, chunkZ, gen, toStatus, addTicket, priority, onComplete); // Paper - reroute
- }
-
- static final TicketType<Long> CHUNK_LOAD = TicketType.create("chunk_load", Long::compareTo);
-@@ -71,160 +57,29 @@ public final class ChunkSystem {
- private static long chunkLoadCounter = 0L;
- public static void scheduleChunkLoad(final ServerLevel level, final int chunkX, final int chunkZ, final ChunkStatus toStatus,
- final boolean addTicket, final PrioritisedExecutor.Priority priority, final Consumer<ChunkAccess> onComplete) {
-- if (!Bukkit.isPrimaryThread()) {
-- scheduleChunkTask(level, chunkX, chunkZ, () -> {
-- scheduleChunkLoad(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
-- }, priority);
-- return;
-- }
--
-- final int minLevel = 33 + ChunkSystem.getDistance(toStatus);
-- final Long chunkReference = addTicket ? Long.valueOf(++chunkLoadCounter) : null;
-- final ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ);
--
-- if (addTicket) {
-- level.chunkSource.addTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
-- }
-- level.chunkSource.runDistanceManagerUpdates();
--
-- final Consumer<ChunkAccess> loadCallback = (final ChunkAccess chunk) -> {
-- try {
-- if (onComplete != null) {
-- onComplete.accept(chunk);
-- }
-- } catch (final Throwable thr) {
-- LOGGER.error("Exception handling chunk load callback", thr);
-- SneakyThrow.sneaky(thr);
-- } finally {
-- if (addTicket) {
-- level.chunkSource.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, minLevel, chunkPos);
-- level.chunkSource.removeTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
-- }
-- }
-- };
--
-- final ChunkHolder holder = level.chunkSource.chunkMap.updatingChunkMap.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
--
-- if (holder == null || holder.getTicketLevel() > minLevel) {
-- loadCallback.accept(null);
-- return;
-- }
--
-- final CompletableFuture<ChunkResult<ChunkAccess>> loadFuture = holder.scheduleChunkGenerationTask(toStatus, level.chunkSource.chunkMap);
--
-- if (loadFuture.isDone()) {
-- loadCallback.accept(loadFuture.join().orElse(null));
-- return;
-- }
--
-- loadFuture.whenCompleteAsync((final ChunkResult<ChunkAccess> result, final Throwable thr) -> {
-- if (thr != null) {
-- loadCallback.accept(null);
-- return;
-- }
-- loadCallback.accept(result.orElse(null));
-- }, (final Runnable r) -> {
-- scheduleChunkTask(level, chunkX, chunkZ, r, PrioritisedExecutor.Priority.HIGHEST);
-- });
-+ ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.scheduleChunkLoad(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete); // Paper - reroute
- }
-
- 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) {
-- // This method goes unused until the chunk system rewrite
-- if (toStatus == FullChunkStatus.INACCESSIBLE) {
-- throw new IllegalArgumentException("Cannot wait for INACCESSIBLE status");
-- }
--
-- if (!Bukkit.isPrimaryThread()) {
-- scheduleChunkTask(level, chunkX, chunkZ, () -> {
-- scheduleTickingState(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete);
-- }, priority);
-- return;
-- }
--
-- final int minLevel = 33 - (toStatus.ordinal() - 1);
-- final int radius = toStatus.ordinal() - 1;
-- final Long chunkReference = addTicket ? Long.valueOf(++chunkLoadCounter) : null;
-- final ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ);
--
-- if (addTicket) {
-- level.chunkSource.addTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
-- }
-- level.chunkSource.runDistanceManagerUpdates();
--
-- final Consumer<LevelChunk> loadCallback = (final LevelChunk chunk) -> {
-- try {
-- if (onComplete != null) {
-- onComplete.accept(chunk);
-- }
-- } catch (final Throwable thr) {
-- LOGGER.error("Exception handling chunk load callback", thr);
-- SneakyThrow.sneaky(thr);
-- } finally {
-- if (addTicket) {
-- level.chunkSource.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, minLevel, chunkPos);
-- level.chunkSource.removeTicketAtLevel(CHUNK_LOAD, chunkPos, minLevel, chunkReference);
-- }
-- }
-- };
--
-- final ChunkHolder holder = level.chunkSource.chunkMap.updatingChunkMap.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
--
-- if (holder == null || holder.getTicketLevel() > minLevel) {
-- loadCallback.accept(null);
-- return;
-- }
--
-- final CompletableFuture<ChunkResult<LevelChunk>> tickingState;
-- switch (toStatus) {
-- case FULL: {
-- tickingState = holder.getFullChunkFuture();
-- break;
-- }
-- case BLOCK_TICKING: {
-- tickingState = holder.getTickingChunkFuture();
-- break;
-- }
-- case ENTITY_TICKING: {
-- tickingState = holder.getEntityTickingChunkFuture();
-- break;
-- }
-- default: {
-- throw new IllegalStateException("Cannot reach here");
-- }
-- }
--
-- if (tickingState.isDone()) {
-- loadCallback.accept(tickingState.join().orElse(null));
-- return;
-- }
--
-- tickingState.whenCompleteAsync((final ChunkResult<LevelChunk> result, final Throwable thr) -> {
-- if (thr != null) {
-- loadCallback.accept(null);
-- return;
-- }
-- loadCallback.accept(result.orElse(null));
-- }, (final Runnable r) -> {
-- scheduleChunkTask(level, chunkX, chunkZ, r, PrioritisedExecutor.Priority.HIGHEST);
-- });
-+ ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.scheduleTickingState(level, chunkX, chunkZ, toStatus, addTicket, priority, onComplete); // Paper - reroute
- }
-
- public static List<ChunkHolder> getVisibleChunkHolders(final ServerLevel level) {
-- return new ArrayList<>(level.chunkSource.chunkMap.visibleChunkMap.values());
-+ return ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.getVisibleChunkHolders(level); // Paper - reroute
- }
-
- public static List<ChunkHolder> getUpdatingChunkHolders(final ServerLevel level) {
-- return new ArrayList<>(level.chunkSource.chunkMap.updatingChunkMap.values());
-+ return ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.getUpdatingChunkHolders(level); // Paper - reroute
- }
-
- public static int getVisibleChunkHolderCount(final ServerLevel level) {
-- return level.chunkSource.chunkMap.visibleChunkMap.size();
-+ return ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.getVisibleChunkHolderCount(level); // Paper - reroute
- }
-
- public static int getUpdatingChunkHolderCount(final ServerLevel level) {
-- return level.chunkSource.chunkMap.updatingChunkMap.size();
-+ return ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.getUpdatingChunkHolderCount(level); // Paper - reroute
- }
-
- public static boolean hasAnyChunkHolders(final ServerLevel level) {
-@@ -268,27 +123,19 @@ public final class ChunkSystem {
- }
-
- public static ChunkHolder getUnloadingChunkHolder(final ServerLevel level, final int chunkX, final int chunkZ) {
-- return level.chunkSource.chunkMap.getUnloadingChunkHolder(chunkX, chunkZ);
-+ return ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.getUnloadingChunkHolder(level, chunkX, chunkZ); // Paper - reroute
- }
-
- public static int getSendViewDistance(final ServerPlayer player) {
-- return getLoadViewDistance(player);
-+ return ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.getSendViewDistance(player); // Paper - reroute
- }
-
- public static int getLoadViewDistance(final ServerPlayer player) {
-- final ServerLevel level = player.serverLevel();
-- if (level == null) {
-- return Bukkit.getViewDistance();
-- }
-- return level.chunkSource.chunkMap.getPlayerViewDistance(player);
-+ return ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.getLoadViewDistance(player); // Paper - reroute
- }
-
- public static int getTickViewDistance(final ServerPlayer player) {
-- final ServerLevel level = player.serverLevel();
-- if (level == null) {
-- return Bukkit.getSimulationDistance();
-- }
-- return level.chunkSource.chunkMap.distanceManager.simulationDistance;
-+ return ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.getTickViewDistance(player); // Paper - reroute
- }
-
- private ChunkSystem() {
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
index 46bf42d5ea9e7b046f962531c5962d287cf44a41..362765d977aaa1996f9cef3404c0676d7bbddf38 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
@@ -25666,132 +22314,6 @@ index 0000000000000000000000000000000000000000..8424cf9d4617b4732d44cc460d25b044
+ }
+
+}
-diff --git a/src/main/java/io/papermc/paper/util/TickThread.java b/src/main/java/io/papermc/paper/util/TickThread.java
-index 73e83d56a340f0c7dcb8ff737d621003e72c6de4..d05297d77147ab68f8c5bb08f13a1f882a686c4f 100644
---- a/src/main/java/io/papermc/paper/util/TickThread.java
-+++ b/src/main/java/io/papermc/paper/util/TickThread.java
-@@ -6,7 +6,7 @@ import net.minecraft.world.entity.Entity;
- import org.bukkit.Bukkit;
- import java.util.concurrent.atomic.AtomicInteger;
-
--public final class TickThread extends Thread {
-+public class TickThread extends Thread {
-
- public static final boolean STRICT_THREAD_CHECKS = Boolean.getBoolean("paper.strict-thread-checks");
-
-@@ -16,6 +16,10 @@ public final class TickThread extends Thread {
- }
- }
-
-+ /**
-+ * @deprecated
-+ */
-+ @Deprecated
- public static void softEnsureTickThread(final String reason) {
- if (!STRICT_THREAD_CHECKS) {
- return;
-@@ -23,6 +27,10 @@ public final class TickThread extends Thread {
- ensureTickThread(reason);
- }
-
-+ /**
-+ * @deprecated
-+ */
-+ @Deprecated
- public static void ensureTickThread(final String reason) {
- if (!isTickThread()) {
- MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
-@@ -30,6 +38,21 @@ public final class TickThread extends Thread {
- }
- }
-
-+ public static void ensureTickThread(final ServerLevel world, final net.minecraft.core.BlockPos pos, final String reason) {
-+ if (!isTickThreadFor(world, pos)) {
-+ MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
-+ throw new IllegalStateException(reason);
-+ }
-+ }
-+
-+ public static void ensureTickThread(final ServerLevel world, final net.minecraft.world.level.ChunkPos pos, final String reason) {
-+ if (!isTickThreadFor(world, pos)) {
-+ MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
-+ throw new IllegalStateException(reason);
-+ }
-+ }
-+
-+
- public static void ensureTickThread(final ServerLevel world, final int chunkX, final int chunkZ, final String reason) {
- if (!isTickThreadFor(world, chunkX, chunkZ)) {
- MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
-@@ -44,6 +67,21 @@ public final class TickThread extends Thread {
- }
- }
-
-+ public static void ensureTickThread(final ServerLevel world, final net.minecraft.world.phys.AABB aabb, final String reason) {
-+ if (!isTickThreadFor(world, aabb)) {
-+ MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
-+ throw new IllegalStateException(reason);
-+ }
-+ }
-+
-+ public static void ensureTickThread(final ServerLevel world, final double blockX, final double blockZ, final String reason) {
-+ if (!isTickThreadFor(world, blockX, blockZ)) {
-+ MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable());
-+ throw new IllegalStateException(reason);
-+ }
-+ }
-+
-+
- 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,13 +104,45 @@ public final class TickThread extends Thread {
- }
-
- public static boolean isTickThread() {
-- return Bukkit.isPrimaryThread();
-+ return Thread.currentThread() instanceof TickThread;
-+ }
-+
-+ public static boolean isShutdownThread() {
-+ return false;
-+ }
-+
-+ public static boolean isTickThreadFor(final ServerLevel world, final net.minecraft.core.BlockPos pos) {
-+ return isTickThread();
-+ }
-+
-+ public static boolean isTickThreadFor(final ServerLevel world, final net.minecraft.world.level.ChunkPos pos) {
-+ return isTickThread();
-+ }
-+
-+ public static boolean isTickThreadFor(final ServerLevel world, final net.minecraft.world.phys.Vec3 pos) {
-+ return isTickThread();
- }
-
- public static boolean isTickThreadFor(final ServerLevel world, final int chunkX, final int chunkZ) {
- return isTickThread();
- }
-
-+ public static boolean isTickThreadFor(final ServerLevel world, final net.minecraft.world.phys.AABB aabb) {
-+ return isTickThread();
-+ }
-+
-+ public static boolean isTickThreadFor(final ServerLevel world, final double blockX, final double blockZ) {
-+ return isTickThread();
-+ }
-+
-+ public static boolean isTickThreadFor(final ServerLevel world, final net.minecraft.world.phys.Vec3 position, final net.minecraft.world.phys.Vec3 deltaMovement, final int buffer) {
-+ return isTickThread();
-+ }
-+
-+ public static boolean isTickThreadFor(final ServerLevel world, final int fromChunkX, final int fromChunkZ, final int toChunkX, final int toChunkZ) {
-+ 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/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java
index 03c45ee77276462818a6f774b5945b25924aa3f0..f15dd2ccb99ade10ac1e49b63e6f4080bd39b3c9 100644
--- a/src/main/java/net/minecraft/core/Direction.java
@@ -25914,7 +22436,7 @@ index c33f85b570f159ab465b5a10a8044a81f2797f43..244a19ecd0234fa1d7a6ecfea2075159
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::createFromGameruleRadius);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index e14c0e1ccf526f81e28db5545d9e2351641e1bc8..91cc3eb6db2875710064f6b31413ccc84af56bb2 100644
+index c97fb8eec949c693d4e822d8cf2e666a0858f20c..4a4ce372dd105d07f58d7d93d856cb3969969806 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -198,7 +198,7 @@ import org.bukkit.event.server.ServerLoadEvent;
@@ -25931,7 +22453,7 @@ index e14c0e1ccf526f81e28db5545d9e2351641e1bc8..91cc3eb6db2875710064f6b31413ccc8
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
- Thread thread = new Thread(() -> {
-+ Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
++ Thread thread = new ca.spottedleaf.moonrise.common.util.TickThread(() -> { // Paper - rewrite chunk system
((MinecraftServer) atomicreference.get()).runServer();
}, "Server thread");
@@ -26103,7 +22625,7 @@ index e14c0e1ccf526f81e28db5545d9e2351641e1bc8..91cc3eb6db2875710064f6b31413ccc8
return true;
} else {
boolean ret = false; // Paper - force execution of all worlds, do not just bias the first
-@@ -1594,7 +1667,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1593,7 +1666,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 -> {
@@ -26112,14 +22634,14 @@ index e14c0e1ccf526f81e28db5545d9e2351641e1bc8..91cc3eb6db2875710064f6b31413ccc8
if (entity.isRemoved()) {
continue;
}
-@@ -2656,6 +2729,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2655,6 +2728,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
+ // Paper start - rewrite chunk system
+ @Override
+ public boolean isSameThread() {
-+ return io.papermc.paper.util.TickThread.isTickThread();
++ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThread();
+ }
+ // Paper end - rewrite chunk system
+
@@ -26165,7 +22687,7 @@ index 0761d5bc5f2813bb4a9f664ac7a05b9744d0a778..7d2896918ff5fed37e5de5a22c37b0c7
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
-index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..9bc59697fc71d4e3c226aa7fe958f57193fc4bd4 100644
+index d0866b2c2f729b6c251eaade3758e94de4d05d6d..63b5286e315ed620ce74c9d67ac99a8708b4c0a7 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -32,28 +32,20 @@ import net.minecraft.world.level.lighting.LevelLightEngine;
@@ -26209,7 +22731,7 @@ index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..9bc59697fc71d4e3c226aa7fe958f571
+ private ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder newChunkHolder;
+
+ private static final ServerPlayer[] EMPTY_PLAYER_ARRAY = new ServerPlayer[0];
-+ private final ca.spottedleaf.moonrise.common.list.ReferenceList<ServerPlayer> playersSentChunkTo = new ca.spottedleaf.moonrise.common.list.ReferenceList<>(EMPTY_PLAYER_ARRAY, 0);
++ private final ca.spottedleaf.moonrise.common.list.ReferenceList<ServerPlayer> playersSentChunkTo = new ca.spottedleaf.moonrise.common.list.ReferenceList<>(EMPTY_PLAYER_ARRAY);
+
+ private ChunkMap getChunkMap() {
+ return (ChunkMap)this.playerProvider;
@@ -26550,7 +23072,7 @@ index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..9bc59697fc71d4e3c226aa7fe958f571
- chunkResult.ifSuccess(chunk -> {
- if (ChunkHolder.this.fullChunkCreateCount == expectCreateCount) {
- ChunkHolder.this.isFullChunkReady = true;
-- io.papermc.paper.chunk.system.ChunkSystem.onChunkBorder(chunk, this);
+- ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkBorder(chunk, this);
- }
- });
- });
@@ -26561,7 +23083,7 @@ index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..9bc59697fc71d4e3c226aa7fe958f571
- if (flag && !flag1) {
- // Paper start
- if (this.isFullChunkReady) {
-- io.papermc.paper.chunk.system.ChunkSystem.onChunkNotBorder(this.fullChunkFuture.join().orElseThrow(IllegalStateException::new), this); // Paper
+- ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkNotBorder(this.fullChunkFuture.join().orElseThrow(IllegalStateException::new), this); // Paper
- }
- // Paper end
- this.fullChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK);
@@ -26579,7 +23101,7 @@ index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..9bc59697fc71d4e3c226aa7fe958f571
- chunkResult.ifSuccess(chunk -> {
- // note: Here is a very good place to add callbacks to logic waiting on this.
- ChunkHolder.this.isTickingReady = true;
-- io.papermc.paper.chunk.system.ChunkSystem.onChunkTicking(chunk, this);
+- ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkTicking(chunk, this);
- });
- });
- // Paper end
@@ -26589,7 +23111,7 @@ index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..9bc59697fc71d4e3c226aa7fe958f571
- if (flag2 && !flag3) {
- // Paper start
- if (this.isTickingReady) {
-- io.papermc.paper.chunk.system.ChunkSystem.onChunkNotTicking(this.tickingChunkFuture.join().orElseThrow(IllegalStateException::new), this); // Paper
+- ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkNotTicking(this.tickingChunkFuture.join().orElseThrow(IllegalStateException::new), this); // Paper
- }
- // Paper end
- this.tickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); this.isTickingReady = false; // Paper - cache chunk ticking stage
@@ -26610,7 +23132,7 @@ index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..9bc59697fc71d4e3c226aa7fe958f571
- this.entityTickingChunkFuture.thenAccept(chunkResult -> {
- chunkResult.ifSuccess(chunk -> {
- ChunkHolder.this.isEntityTickingReady = true;
-- io.papermc.paper.chunk.system.ChunkSystem.onChunkEntityTicking(chunk, this);
+- ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkEntityTicking(chunk, this);
- });
- });
- // Paper end
@@ -26620,7 +23142,7 @@ index c643bb0daa5cd264fd6ebab7acf0a2bdd7fe7029..9bc59697fc71d4e3c226aa7fe958f571
- if (flag4 && !flag5) {
- // Paper start
- if (this.isEntityTickingReady) {
-- io.papermc.paper.chunk.system.ChunkSystem.onChunkNotEntityTicking(this.entityTickingChunkFuture.join().orElseThrow(IllegalStateException::new), this);
+- ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkNotEntityTicking(this.entityTickingChunkFuture.join().orElseThrow(IllegalStateException::new), this);
- }
- // Paper end
- this.entityTickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); this.isEntityTickingReady = false; // Paper - cache chunk ticking stage
@@ -26704,7 +23226,7 @@ index d9ad32acdf46a43a649334a3b736aeb7b3af21d1..fae17a075d7efaf24d916877dd5968eb
public static final int RADIUS_AROUND_FULL_CHUNK = FULL_CHUNK_STEP.accumulatedDependencies().getRadius();
public static final int MAX_LEVEL = 33 + RADIUS_AROUND_FULL_CHUNK;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed18617193568f0d 100644
+index 56ef427af5cdfa9b673089cabc43167012b343bc..edb36dee707433d4f9419aef6ac6cc0bec5f285e 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -122,10 +122,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -26745,14 +23267,13 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
// CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback()
public final CallbackExecutor callbackExecutor = new CallbackExecutor();
-@@ -198,23 +193,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- // Paper end
+@@ -174,22 +169,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+
// Paper start
public final ChunkHolder getUnloadingChunkHolder(int chunkX, int chunkZ) {
-- return this.pendingUnloads.get(io.papermc.paper.util.CoordinateUtils.getChunkKey(chunkX, chunkZ));
+- return this.pendingUnloads.get(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkKey(chunkX, chunkZ));
+ return null; // Paper - rewrite chunk system
}
- public final io.papermc.paper.util.player.NearbyPlayers nearbyPlayers;
// Paper end
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) {
@@ -26772,7 +23293,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
Path path = session.getDimensionPath(world.dimension());
this.storageName = path.getFileName().toString();
-@@ -245,15 +238,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -220,15 +213,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.chunkStatusListener = chunkStatusChangeListener;
ProcessorMailbox<Runnable> threadedmailbox1 = ProcessorMailbox.create(executor, "light");
@@ -26788,10 +23309,10 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
this.setServerViewDistance(viewDistance);
- this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine, this.mainThreadMailbox);
+ this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine, null); // Paper - rewrite chunk system
- // Paper start
- this.nearbyPlayers = new io.papermc.paper.util.player.NearbyPlayers(this.level);
- // Paper end
-@@ -292,23 +283,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ }
+
+ // Paper start
+@@ -259,23 +250,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
boolean isChunkTracked(ServerPlayer player, int chunkX, int chunkZ) {
@@ -26817,7 +23338,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
}
protected ThreadedLevelLightEngine getLightEngine() {
-@@ -317,20 +296,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -284,20 +263,22 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@Nullable
protected ChunkHolder getUpdatingChunkIfPresent(long pos) {
@@ -26847,7 +23368,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
}
public String getChunkDebugData(ChunkPos chunkPos) {
-@@ -359,55 +340,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -326,55 +307,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
private CompletableFuture<ChunkResult<List<ChunkAccess>>> getChunkRangeFuture(ChunkHolder centerChunk, int margin, IntFunction<ChunkStatus> distanceToStatus) {
@@ -26904,7 +23425,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
}
public ReportedException debugFuturesAndCreateReportedException(IllegalStateException exception, String details) {
-@@ -437,93 +370,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -404,93 +337,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public CompletableFuture<ChunkResult<LevelChunk>> prepareEntityTickingChunk(ChunkHolder holder) {
@@ -26942,7 +23463,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
- } else {
- holder = new ChunkHolder(new ChunkPos(pos), level, this.level, this.lightEngine, this.queueSorter, this);
- // Paper start
-- io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderCreate(this.level, holder);
+- ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkHolderCreate(this.level, holder);
- // Paper end
- }
-
@@ -26972,7 +23493,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
protected void saveAllChunks(boolean flush) {
- if (flush) {
-- List<ChunkHolder> list = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).toList(); // Paper
+- List<ChunkHolder> list = ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.level).stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).toList(); // Paper
- MutableBoolean mutableboolean = new MutableBoolean();
-
- do {
@@ -26995,7 +23516,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
- });
- this.flushWorker();
- } else {
-- io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).forEach(this::saveChunkIfNeeded);
+- ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.level).forEach(this::saveChunkIfNeeded);
- }
-
+ ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.saveAllChunks(
@@ -27004,11 +23525,11 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
}
protected void tick(BooleanSupplier shouldKeepTicking) {
-@@ -540,134 +403,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -507,134 +370,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public boolean hasWork() {
-- return this.lightEngine.hasLightWork() || !this.pendingUnloads.isEmpty() || io.papermc.paper.chunk.system.ChunkSystem.hasAnyChunkHolders(this.level) || this.poiManager.hasWork() || !this.toDrop.isEmpty() || !this.unloadQueue.isEmpty() || this.queueSorter.hasWork() || this.distanceManager.hasTickets(); // Paper
+- return this.lightEngine.hasLightWork() || !this.pendingUnloads.isEmpty() || ca.spottedleaf.moonrise.common.util.ChunkSystem.hasAnyChunkHolders(this.level) || this.poiManager.hasWork() || !this.toDrop.isEmpty() || !this.unloadQueue.isEmpty() || this.queueSorter.hasWork() || this.distanceManager.hasTickets(); // Paper
+ throw new UnsupportedOperationException(); // Paper - rewrite chunk system
}
@@ -27046,7 +23567,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
- }
-
- int l = 0;
-- Iterator<ChunkHolder> objectiterator = io.papermc.paper.chunk.system.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper
+- Iterator<ChunkHolder> objectiterator = ca.spottedleaf.moonrise.common.util.ChunkSystem.getVisibleChunkHolders(this.level).iterator(); // Paper
-
- while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) {
- if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) {
@@ -27069,7 +23590,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
- // Paper start
- boolean removed;
- if ((removed = this.pendingUnloads.remove(pos, holder)) && ichunkaccess != null) {
-- io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderDelete(this.level, holder);
+- ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkHolderDelete(this.level, holder);
- // Paper end
- LevelChunk chunk;
-
@@ -27089,7 +23610,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
- this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null);
- this.chunkSaveCooldowns.remove(ichunkaccess.getPos().toLong());
- } else if (removed) { // Paper start
-- io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderDelete(this.level, holder);
+- ca.spottedleaf.moonrise.common.util.ChunkSystem.onChunkHolderDelete(this.level, holder);
- } // Paper end
-
- }
@@ -27145,7 +23666,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
}
private static boolean isChunkDataValid(CompoundTag nbt) {
-@@ -727,137 +481,44 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -694,137 +448,44 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@Override
public GenerationChunkHolder acquireGeneration(long pos) {
@@ -27292,7 +23813,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
}
public int getTickingGenerated() {
-@@ -865,135 +526,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -832,135 +493,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
private boolean saveChunkIfNeeded(ChunkHolder chunkHolder) {
@@ -27416,7 +23937,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
public int getPlayerViewDistance(ServerPlayer player) { // Paper - public
- return Mth.clamp(player.requestedViewDistance(), 2, this.serverViewDistance);
-+ return ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.getSendViewDistance(player); // Paper - rewrite chunk system
++ return ca.spottedleaf.moonrise.common.util.ChunkSystem.getSendViewDistance(player); // Paper - rewrite chunk system
}
private void markChunkPendingToSend(ServerPlayer player, ChunkPos pos) {
@@ -27480,7 +24001,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
@Nullable
public LevelChunk getChunkToSend(long pos) {
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
-@@ -1059,7 +669,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1026,7 +636,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
// CraftBukkit start
@@ -27489,25 +24010,31 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
return this.upgradeChunkTag(this.level.getTypeKey(), this.overworldDataStorage, nbttagcompound, this.generator().getTypeNameForDataFixer(), chunkcoordintpair, this.level);
// CraftBukkit end
}
-@@ -1153,7 +763,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1117,19 +727,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ this.updatePlayerPos(player);
+ if (!flag1) {
+ this.distanceManager.addPlayer(SectionPos.of((EntityAccess) player), player);
++ ((ca.spottedleaf.moonrise.patches.chunk_tick_iteration.ChunkTickDistanceManager)this.distanceManager).moonrise$addPlayer(player, SectionPos.of(player)); // Paper - chunk tick iteration optimisation
}
player.setChunkTrackingView(ChunkTrackingView.EMPTY);
- this.updateChunkTracking(player);
-+ ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.addPlayerToDistanceMaps(this.level, player); // Paper - rewrite chunk system
- this.addPlayerToDistanceMaps(player); // Paper - distance maps
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.addPlayerToDistanceMaps(this.level, player); // Paper - rewrite chunk system
} else {
SectionPos sectionposition = player.getLastSectionPos();
-@@ -1164,7 +774,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+
+ this.playerMap.removePlayer(player);
+ if (!flag2) {
+ this.distanceManager.removePlayer(sectionposition, player);
++ ((ca.spottedleaf.moonrise.patches.chunk_tick_iteration.ChunkTickDistanceManager)this.distanceManager).moonrise$removePlayer(player, SectionPos.of(player)); // Paper - chunk tick iteration optimisation
}
- this.removePlayerFromDistanceMaps(player); // Paper - distance maps
- this.applyChunkTrackingView(player, ChunkTrackingView.EMPTY);
-+ ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.removePlayerFromDistanceMaps(this.level, player); // Paper - rewrite chunk system
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.removePlayerFromDistanceMaps(this.level, player); // Paper - rewrite chunk system
}
}
-@@ -1176,17 +786,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1141,17 +753,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public void move(ServerPlayer player) {
@@ -27526,7 +24053,15 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
SectionPos sectionposition = player.getLastSectionPos();
SectionPos sectionposition1 = SectionPos.of((EntityAccess) player);
-@@ -1212,71 +812,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1161,6 +763,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+
+ if (flag2 || flag != flag1) {
+ this.updatePlayerPos(player);
++ ((ca.spottedleaf.moonrise.patches.chunk_tick_iteration.ChunkTickDistanceManager)this.distanceManager).moonrise$updatePlayer(player, sectionposition, sectionposition1, flag, flag1); // Paper - chunk tick iteration optimisation
+ if (!flag) {
+ this.distanceManager.removePlayer(sectionposition, player);
+ }
+@@ -1177,70 +780,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.playerMap.unIgnorePlayer(player);
}
@@ -27534,8 +24069,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
+ // Paper - rewrite chunk system
}
- this.updateMaps(player); // Paper - distance maps
-+ ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.updateMaps(this.level, player); // Paper - rewrite chunk system
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.updateMaps(this.level, player); // Paper - rewrite chunk system
}
private void updateChunkTracking(ServerPlayer player) {
@@ -27609,7 +24143,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
}
public void addEntity(Entity entity) {
-@@ -1304,6 +864,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1268,6 +831,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
@@ -27622,7 +24156,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
playerchunkmap_entitytracker.updatePlayers(this.level.players());
if (entity instanceof ServerPlayer) {
ServerPlayer entityplayer = (ServerPlayer) entity;
-@@ -1344,16 +910,49 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1308,16 +877,49 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker1.broadcastRemoved();
}
entity.tracker = null; // Paper - We're no longer tracked
@@ -27677,7 +24211,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
-@@ -1460,27 +1059,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1424,27 +1026,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public void waitForLightBeforeSending(ChunkPos centerPos, int radius) {
@@ -27715,7 +24249,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
}
@Nullable
-@@ -1496,7 +1093,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1460,7 +1060,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -27724,7 +24258,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
public final ServerEntity serverEntity;
final Entity entity;
-@@ -1504,6 +1101,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1468,6 +1068,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
SectionPos lastSectionPos;
public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
@@ -27774,7 +24308,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
+ public final void moonrise$removeNonTickThreadPlayers() {
+ boolean foundToRemove = false;
+ for (final ServerPlayerConnection conn : this.seenBy) {
-+ if (!io.papermc.paper.util.TickThread.isTickThreadFor(conn.getPlayer())) {
++ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(conn.getPlayer())) {
+ foundToRemove = true;
+ break;
+ }
@@ -27786,7 +24320,7 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
+
+ for (final ServerPlayerConnection conn : new java.util.ArrayList<>(this.seenBy)) {
+ ServerPlayer player = conn.getPlayer();
-+ if (!io.papermc.paper.util.TickThread.isTickThreadFor(player)) {
++ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(player)) {
+ this.removePlayer(player);
+ }
+ }
@@ -27810,15 +24344,15 @@ index a03385b1b0a2f9b98319137b87d917856d3c632c..d843bc04ae93d11d7820cab5ed186171
this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast, this.seenBy); // CraftBukkit
this.entity = entity;
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
-index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0201aab62 100644
+index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..6d0e396e148557e401939860cd7af0baefaf9f19 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
-@@ -36,66 +36,36 @@ import net.minecraft.world.level.ChunkPos;
+@@ -36,66 +36,60 @@ import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.chunk.LevelChunk;
import org.slf4j.Logger;
-public abstract class DistanceManager {
-+public abstract class DistanceManager implements ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkSystemDistanceManager { // Paper - rewrite chunk system
++public abstract class DistanceManager implements ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkSystemDistanceManager, ca.spottedleaf.moonrise.patches.chunk_tick_iteration.ChunkTickDistanceManager { // Paper - rewrite chunk system // Paper - chunk tick iteration optimisation
static final Logger LOGGER = LogUtils.getLogger();
static final int PLAYER_TICKET_LEVEL = ChunkLevel.byStatus(FullChunkStatus.ENTITY_TICKING);
@@ -27826,8 +24360,7 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
final Long2ObjectMap<ObjectSet<ServerPlayer>> playersPerChunk = new Long2ObjectOpenHashMap();
- public final Long2ObjectOpenHashMap<SortedArraySet<Ticket<?>>> tickets = new Long2ObjectOpenHashMap();
- private final DistanceManager.ChunkTicketTracker ticketTracker = new DistanceManager.ChunkTicketTracker();
-+ // Paper - rewrite chunk system
- private final DistanceManager.FixedPlayerDistanceChunkTracker naturalSpawnChunkCounter = new DistanceManager.FixedPlayerDistanceChunkTracker(8);
+- private final DistanceManager.FixedPlayerDistanceChunkTracker naturalSpawnChunkCounter = new DistanceManager.FixedPlayerDistanceChunkTracker(8);
- private final TickingTracker tickingTicketsTracker = new TickingTracker();
- private final DistanceManager.PlayerTicketTracker playerTicketManager = new DistanceManager.PlayerTicketTracker(32);
- final Set<ChunkHolder> chunksToUpdateFutures = Sets.newHashSet();
@@ -27837,6 +24370,8 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
- final LongSet ticketsToRelease = new LongOpenHashSet();
- final Executor mainThreadExecutor;
+ // Paper - rewrite chunk system
++ // Paper - chunk tick iteration optimisation
++ // Paper - rewrite chunk system
private long ticketTickCounter;
- public int simulationDistance = 10;
+ // Paper - rewrite chunk system
@@ -27847,6 +24382,30 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
+ return ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.moonrise$getChunkMap().level).moonrise$getChunkTaskScheduler().chunkHolderManager;
+ }
+ // Paper end - rewrite chunk system
++ // Paper start - chunk tick iteration optimisation
++ private final ca.spottedleaf.moonrise.common.misc.PositionCountingAreaMap<ServerPlayer> spawnChunkTracker = new ca.spottedleaf.moonrise.common.misc.PositionCountingAreaMap<>();
++
++ @Override
++ public final void moonrise$addPlayer(final ServerPlayer player, final SectionPos pos) {
++ this.spawnChunkTracker.add(player, pos.x(), pos.z(), ca.spottedleaf.moonrise.patches.chunk_tick_iteration.ChunkTickConstants.PLAYER_SPAWN_TRACK_RANGE);
++ }
++
++ @Override
++ public final void moonrise$removePlayer(final ServerPlayer player, final SectionPos pos) {
++ this.spawnChunkTracker.remove(player);
++ }
++
++ @Override
++ public final void moonrise$updatePlayer(final ServerPlayer player,
++ final SectionPos oldPos, final SectionPos newPos,
++ final boolean oldIgnore, final boolean newIgnore) {
++ if (newIgnore) {
++ this.spawnChunkTracker.remove(player);
++ } else {
++ this.spawnChunkTracker.addOrUpdate(player, newPos.x(), newPos.z(), ca.spottedleaf.moonrise.patches.chunk_tick_iteration.ChunkTickConstants.PLAYER_SPAWN_TRACK_RANGE);
++ }
++ }
++ // Paper end - chunk tick iteration optimisation
+
protected DistanceManager(Executor workerExecutor, Executor mainThreadExecutor, ChunkMap chunkMap) {
Objects.requireNonNull(mainThreadExecutor);
@@ -27892,7 +24451,7 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
}
-@@ -112,86 +82,15 @@ public abstract class DistanceManager {
+@@ -112,86 +106,15 @@ public abstract class DistanceManager {
protected abstract ChunkHolder updateChunkScheduling(long pos, int level, @Nullable ChunkHolder holder, int k);
public boolean runAllUpdates(ChunkMap chunkLoadingManager) {
@@ -27982,7 +24541,7 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
}
public <T> void addTicket(TicketType<T> type, ChunkPos pos, int level, T argument) {
-@@ -210,13 +109,7 @@ public abstract class DistanceManager {
+@@ -210,13 +133,7 @@ public abstract class DistanceManager {
}
public <T> boolean addRegionTicketAtDistance(TicketType<T> tickettype, ChunkPos chunkcoordintpair, int i, T t0) {
@@ -27997,7 +24556,7 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
}
public <T> void removeRegionTicket(TicketType<T> type, ChunkPos pos, int radius, T argument) {
-@@ -225,32 +118,21 @@ public abstract class DistanceManager {
+@@ -225,32 +142,21 @@ public abstract class DistanceManager {
}
public <T> boolean removeRegionTicketAtDistance(TicketType<T> tickettype, ChunkPos chunkcoordintpair, int i, T t0) {
@@ -28036,22 +24595,26 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
}
-@@ -262,8 +144,7 @@ public abstract class DistanceManager {
+@@ -261,9 +167,8 @@ public abstract class DistanceManager {
+ ((ObjectSet) this.playersPerChunk.computeIfAbsent(i, (j) -> {
return new ObjectOpenHashSet();
})).add(player);
- this.naturalSpawnChunkCounter.update(i, 0, true);
+- this.naturalSpawnChunkCounter.update(i, 0, true);
- this.playerTicketManager.update(i, 0, true);
- this.tickingTicketsTracker.addTicket(TicketType.PLAYER, chunkcoordintpair, this.getPlayerTicketLevel(), chunkcoordintpair);
++ // Paper - chunk tick iteration optimisation
+ // Paper - rewrite chunk system
}
public void removePlayer(SectionPos pos, ServerPlayer player) {
-@@ -276,39 +157,39 @@ public abstract class DistanceManager {
+@@ -275,151 +180,81 @@ public abstract class DistanceManager {
+ if (objectset != null) objectset.remove(player); // Paper - some state corruption happens here, don't crash, clean up gracefully
if (objectset == null || objectset.isEmpty()) { // Paper
this.playersPerChunk.remove(i);
- this.naturalSpawnChunkCounter.update(i, Integer.MAX_VALUE, false);
+- this.naturalSpawnChunkCounter.update(i, Integer.MAX_VALUE, false);
- this.playerTicketManager.update(i, Integer.MAX_VALUE, false);
- this.tickingTicketsTracker.removeTicket(TicketType.PLAYER, chunkcoordintpair, this.getPlayerTicketLevel(), chunkcoordintpair);
++ // Paper - chunk tick iteration optimisation
+ // Paper - rewrite chunk system
}
@@ -28099,7 +24662,16 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
}
-@@ -323,103 +204,35 @@ public abstract class DistanceManager {
+ public int getNaturalSpawnChunkCount() {
+- this.naturalSpawnChunkCounter.runAllUpdates();
+- return this.naturalSpawnChunkCounter.chunks.size();
++ return this.spawnChunkTracker.getTotalPositions(); // Paper - chunk tick iteration optimisation
+ }
+
+ public boolean hasPlayersNearby(long chunkPos) {
+- this.naturalSpawnChunkCounter.runAllUpdates();
+- return this.naturalSpawnChunkCounter.chunks.containsKey(chunkPos);
++ return this.spawnChunkTracker.hasObjectsNear(ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkX(chunkPos), ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkZ(chunkPos)); // Paper - chunk tick iteration optimisation
}
public String getDebugStatus() {
@@ -28210,7 +24782,7 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
private class ChunkTicketTracker extends ChunkTracker {
private static final int MAX_LEVEL = ChunkLevel.MAX_LEVEL + 1;
-@@ -465,7 +278,7 @@ public abstract class DistanceManager {
+@@ -465,7 +300,7 @@ public abstract class DistanceManager {
public int runDistanceUpdates(int distance) {
return this.runUpdates(distance);
}
@@ -28219,7 +24791,7 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
private class FixedPlayerDistanceChunkTracker extends ChunkTracker {
-@@ -545,6 +358,7 @@ public abstract class DistanceManager {
+@@ -545,6 +380,7 @@ public abstract class DistanceManager {
}
}
@@ -28227,7 +24799,7 @@ index cbabbfbb9967ddf9a56f3be24a88e0fcd4415aa2..71abe25cfb73af3857cbc85980aa32d0
private class PlayerTicketTracker extends DistanceManager.FixedPlayerDistanceChunkTracker {
private int viewDistance = 0;
-@@ -639,5 +453,5 @@ public abstract class DistanceManager {
+@@ -639,5 +475,5 @@ public abstract class DistanceManager {
private boolean haveTicketFor(int distance) {
return distance <= this.viewDistance;
}
@@ -28561,7 +25133,7 @@ index 3dc1daa3c6a04d3ff1a2353773b465fc380994a2..3575782f13a7f3c52e64dc5046803305
}
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda54f9b6c3 100644
+index 60f678c26fb5144386d8697ddfd5b6d841563b6f..9aec513f05b10e78579f79ccda6acf285f13222e 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -46,7 +46,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp
@@ -28573,7 +25145,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
public static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger(); // Paper
private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
-@@ -73,6 +73,61 @@ public class ServerChunkCache extends ChunkSource {
+@@ -71,6 +71,61 @@ public class ServerChunkCache extends ChunkSource {
private final ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable<net.minecraft.world.level.chunk.LevelChunk> fullChunks = new ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable<>();
long chunkFutureAwaitCounter;
// Paper end
@@ -28602,7 +25174,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
+ completable::complete
+ );
+
-+ if (io.papermc.paper.util.TickThread.isTickThreadFor(this.level, chunkX, chunkZ)) {
++ if (ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level, chunkX, chunkZ)) {
+ ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.pushChunkWait(this.level, chunkX, chunkZ);
+ this.mainThreadProcessor.managedBlock(completable::isDone);
+ ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.popChunkWait();
@@ -28635,7 +25207,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
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;
-@@ -99,13 +154,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -97,13 +152,7 @@ public class ServerChunkCache extends ChunkSource {
}
// CraftBukkit end
// Paper start
@@ -28650,7 +25222,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
@Nullable
public ChunkAccess getChunkAtImmediately(int x, int z) {
-@@ -176,63 +225,25 @@ public class ServerChunkCache extends ChunkSource {
+@@ -174,63 +223,25 @@ public class ServerChunkCache extends ChunkSource {
@Nullable
@Override
public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
@@ -28724,7 +25296,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
}
private void clearCache() {
-@@ -263,56 +274,59 @@ public class ServerChunkCache extends ChunkSource {
+@@ -261,56 +272,59 @@ public class ServerChunkCache extends ChunkSource {
}
private CompletableFuture<ChunkResult<ChunkAccess>> getChunkFutureMainThread(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
@@ -28733,7 +25305,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
- int l = ChunkLevel.byStatus(leastStatus);
- ChunkHolder playerchunk = this.getVisibleChunkIfPresent(k);
+ // Paper start - rewrite chunk system
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.level, chunkX, chunkZ, "Scheduling chunk load off-main");
++ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.level, chunkX, chunkZ, "Scheduling chunk load off-main");
- // CraftBukkit start - don't add new ticket for currently unloading chunk
- boolean currentlyUnloading = false;
@@ -28820,7 +25392,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
}
@Override
-@@ -325,16 +339,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -323,16 +337,7 @@ public class ServerChunkCache extends ChunkSource {
}
public boolean runDistanceManagerUpdates() { // Paper - public
@@ -28838,7 +25410,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
}
// Paper start
-@@ -344,13 +349,14 @@ public class ServerChunkCache extends ChunkSource {
+@@ -342,13 +347,14 @@ public class ServerChunkCache extends ChunkSource {
// Paper end
public boolean isPositionTicking(long pos) {
@@ -28857,7 +25429,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings
this.chunkMap.saveAllChunks(flush);
} // Paper - Timings
-@@ -363,12 +369,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -361,12 +367,7 @@ public class ServerChunkCache extends ChunkSource {
}
public void close(boolean save) throws IOException {
@@ -28871,7 +25443,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
}
// CraftBukkit start - modelled on below
-@@ -396,6 +397,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -394,6 +395,7 @@ public class ServerChunkCache extends ChunkSource {
this.level.getProfiler().popPush("chunks");
if (tickChunks) {
this.level.timings.chunks.startTiming(); // Paper - timings
@@ -28879,7 +25451,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
this.tickChunks();
this.level.timings.chunks.stopTiming(); // Paper - timings
this.chunkMap.tick();
-@@ -410,6 +412,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -408,6 +410,7 @@ public class ServerChunkCache extends ChunkSource {
}
private void tickChunks() {
@@ -28887,7 +25459,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
long i = this.level.getGameTime();
long j = i - this.lastInhabitedUpdate;
-@@ -462,14 +465,19 @@ public class ServerChunkCache extends ChunkSource {
+@@ -460,14 +463,19 @@ public class ServerChunkCache extends ChunkSource {
LevelChunk chunk1 = chunkproviderserver_a.chunk;
ChunkPos chunkcoordintpair = chunk1.getPos();
@@ -28909,7 +25481,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
}
}
}
-@@ -495,11 +503,12 @@ public class ServerChunkCache extends ChunkSource {
+@@ -493,11 +501,12 @@ public class ServerChunkCache extends ChunkSource {
}
private void getFullChunk(long pos, Consumer<LevelChunk> chunkConsumer) {
@@ -28926,7 +25498,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
}
-@@ -593,6 +602,12 @@ public class ServerChunkCache extends ChunkSource {
+@@ -591,6 +600,12 @@ public class ServerChunkCache extends ChunkSource {
this.chunkMap.setServerViewDistance(watchDistance);
}
@@ -28939,7 +25511,7 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
public void setSimulationDistance(int simulationDistance) {
this.distanceManager.updateSimulationDistance(simulationDistance);
}
-@@ -671,16 +686,14 @@ public class ServerChunkCache extends ChunkSource {
+@@ -669,21 +684,19 @@ public class ServerChunkCache extends ChunkSource {
@Override
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
public boolean pollTask() {
@@ -28961,6 +25533,12 @@ index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda
// CraftBukkit end
}
}
+
+- private static record ChunkAndHolder(LevelChunk chunk, ChunkHolder holder) {
++ public static record ChunkAndHolder(LevelChunk chunk, ChunkHolder holder) { // Paper - rewrite chunk system - public
+
+ }
+ }
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 1d849ce4e2c85f149af25318b8ffb6dcef6c6788..12d86f27d04bffed8c3844e36b42fbc2f84dacff 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -28978,7 +25556,7 @@ index 1d849ce4e2c85f149af25318b8ffb6dcef6c6788..12d86f27d04bffed8c3844e36b42fbc2
if (!list.equals(this.lastPassengers)) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5824a841f 100644
+index c97292f22a3402dbd59cef4af554954dc1d4f91a..c759555241649cf5b355268066375341a54477f2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -184,7 +184,7 @@ import org.bukkit.event.weather.LightningStrikeEvent;
@@ -28999,7 +25577,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
private final GameEventDispatcher gameEventDispatcher;
public boolean noSave;
private final SleepStatus sleepStatus;
-@@ -339,6 +339,176 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -339,6 +339,195 @@ public class ServerLevel extends Level implements WorldGenLevel {
return player != null && player.level() == this ? player : null;
}
// Paper end - optimise getPlayerByUUID
@@ -29014,6 +25592,10 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
+ private long lastMidTickFailure;
+ private long tickedBlocksOrFluids;
+ private final ca.spottedleaf.moonrise.common.misc.NearbyPlayers nearbyPlayers = new ca.spottedleaf.moonrise.common.misc.NearbyPlayers((ServerLevel)(Object)this);
++ private static final ServerChunkCache.ChunkAndHolder[] EMPTY_CHUNK_AND_HOLDERS = new ServerChunkCache.ChunkAndHolder[0];
++ private final ca.spottedleaf.moonrise.common.list.ReferenceList<net.minecraft.server.level.ServerChunkCache.ChunkAndHolder> loadedChunks = new ca.spottedleaf.moonrise.common.list.ReferenceList<>(EMPTY_CHUNK_AND_HOLDERS);
++ private final ca.spottedleaf.moonrise.common.list.ReferenceList<net.minecraft.server.level.ServerChunkCache.ChunkAndHolder> tickingChunks = new ca.spottedleaf.moonrise.common.list.ReferenceList<>(EMPTY_CHUNK_AND_HOLDERS);
++ private final ca.spottedleaf.moonrise.common.list.ReferenceList<net.minecraft.server.level.ServerChunkCache.ChunkAndHolder> entityTickingChunks = new ca.spottedleaf.moonrise.common.list.ReferenceList<>(EMPTY_CHUNK_AND_HOLDERS);
+
+ @Override
+ public final LevelChunk moonrise$getFullChunkIfLoaded(final int chunkX, final int chunkZ) {
@@ -29172,11 +25754,26 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
+ public final ca.spottedleaf.moonrise.common.misc.NearbyPlayers moonrise$getNearbyPlayers() {
+ return this.nearbyPlayers;
+ }
++
++ @Override
++ public final ca.spottedleaf.moonrise.common.list.ReferenceList<net.minecraft.server.level.ServerChunkCache.ChunkAndHolder> moonrise$getLoadedChunks() {
++ return this.loadedChunks;
++ }
++
++ @Override
++ public final ca.spottedleaf.moonrise.common.list.ReferenceList<net.minecraft.server.level.ServerChunkCache.ChunkAndHolder> moonrise$getTickingChunks() {
++ return this.tickingChunks;
++ }
++
++ @Override
++ public final ca.spottedleaf.moonrise.common.list.ReferenceList<net.minecraft.server.level.ServerChunkCache.ChunkAndHolder> moonrise$getEntityTickingChunks() {
++ return this.entityTickingChunks;
++ }
+ // Paper end - rewrite chunk system
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
-@@ -385,14 +555,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -385,14 +574,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
DataFixer datafixer = minecraftserver.getFixerUpper();
EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(new SimpleRegionStorage(new RegionStorageInfo(convertable_conversionsession.getLevelId(), resourcekey, "entities"), convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, DataFixTypes.ENTITY_CHUNK), this, minecraftserver);
@@ -29194,7 +25791,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
return minecraftserver.overworld().getDataStorage();
});
this.chunkSource.getGeneratorState().ensureStructuresGenerated();
-@@ -420,6 +589,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -420,6 +608,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.randomSequences = (RandomSequences) Objects.requireNonNullElseGet(randomsequences, () -> {
return (RandomSequences) this.getDataStorage().computeIfAbsent(RandomSequences.factory(l), "random_sequences");
});
@@ -29214,7 +25811,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
}
-@@ -553,7 +735,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -553,7 +754,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.push("checkDespawn");
entity.checkDespawn();
gameprofilerfiller.pop();
@@ -29223,7 +25820,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
Entity entity1 = entity.getVehicle();
if (entity1 != null) {
-@@ -578,13 +760,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -578,13 +779,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
gameprofilerfiller.push("entityManagement");
@@ -29242,7 +25839,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
}
protected void tickTime() {
-@@ -626,6 +811,63 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -626,6 +830,63 @@ public class ServerLevel extends Level implements WorldGenLevel {
});
}
@@ -29306,7 +25903,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
ChunkPos chunkcoordintpair = chunk.getPos();
boolean flag = this.isRaining();
-@@ -675,35 +917,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -675,35 +936,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.popPush("tickBlocks");
timings.chunkTicksBlocks.startTiming(); // Paper
if (randomTickSpeed > 0) {
@@ -29343,7 +25940,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
}
timings.chunkTicksBlocks.stopTiming(); // Paper
-@@ -976,6 +1190,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -976,6 +1209,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (fluid1.is(fluid)) {
fluid1.tick(this, pos);
}
@@ -29355,7 +25952,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
}
-@@ -985,6 +1204,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -985,6 +1223,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (iblockdata.is(block)) {
iblockdata.tick(this, pos, this.random);
}
@@ -29367,7 +25964,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
}
-@@ -1061,6 +1285,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1061,6 +1304,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void save(@Nullable ProgressListener progressListener, boolean flush, boolean savingDisabled) {
@@ -29379,7 +25976,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
ServerChunkCache chunkproviderserver = this.getChunkSource();
if (!savingDisabled) {
-@@ -1076,16 +1305,21 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1076,16 +1324,21 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
timings.worldSaveChunks.startTiming(); // Paper
@@ -29407,7 +26004,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
// CraftBukkit start - moved from MinecraftServer.saveChunks
ServerLevel worldserver1 = this;
-@@ -1218,7 +1452,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1218,7 +1471,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED);
}
@@ -29416,7 +26013,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
}
// CraftBukkit start
-@@ -1249,7 +1483,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1249,7 +1502,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
// CraftBukkit end
@@ -29425,7 +26022,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
}
}
-@@ -1260,11 +1494,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1260,11 +1513,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public boolean tryAddFreshEntityWithPassengers(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
// CraftBukkit end
@@ -29438,7 +26035,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
return false;
} else {
this.addFreshEntityWithPassengers(entity, reason); // CraftBukkit
-@@ -1850,7 +2080,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1850,7 +2099,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
@@ -29447,7 +26044,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
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()));
-@@ -1899,7 +2129,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1899,7 +2148,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
BufferedWriter bufferedwriter2 = Files.newBufferedWriter(path1);
try {
@@ -29456,7 +26053,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
} catch (Throwable throwable4) {
if (bufferedwriter2 != null) {
try {
-@@ -1920,7 +2150,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1920,7 +2169,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
BufferedWriter bufferedwriter3 = Files.newBufferedWriter(path2);
try {
@@ -29465,7 +26062,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
} catch (Throwable throwable6) {
if (bufferedwriter3 != null) {
try {
-@@ -2062,7 +2292,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2062,7 +2311,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@VisibleForTesting
public String getWatchdogStats() {
@@ -29474,7 +26071,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
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());
}
-@@ -2092,15 +2322,25 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2092,15 +2341,25 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public LevelEntityGetter<Entity> getEntities() {
org.spigotmc.AsyncCatcher.catchOp("Chunk getEntities call"); // Spigot
@@ -29503,7 +26100,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
}
public void startTickingChunk(LevelChunk chunk) {
-@@ -2120,34 +2360,47 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2120,34 +2379,47 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public void close() throws IOException {
super.close();
@@ -29558,7 +26155,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
}
@Override
-@@ -2173,7 +2426,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2173,7 +2445,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
CrashReportCategory crashreportsystemdetails = super.fillReportDetails(report);
crashreportsystemdetails.setDetail("Loaded entity count", () -> {
@@ -29568,7 +26165,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..bb3826481d6165991f4201ed39d56fa5
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 191dfbd0f15c3a21278f3c4f9ce29f1698e0836c..ba64e42a58b4b760815f54228ebf7a46fd14734e 100644
+index 7f83f40c76eac2ce5b053dc651224c44701613ea..fd61e10fd3151bf8cc206a93d4ede22a7c681dbf 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -199,7 +199,7 @@ import org.bukkit.event.player.PlayerToggleSneakEvent;
@@ -29580,7 +26177,7 @@ index 191dfbd0f15c3a21278f3c4f9ce29f1698e0836c..ba64e42a58b4b760815f54228ebf7a46
private static final Logger LOGGER = LogUtils.getLogger();
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32;
-@@ -297,6 +297,36 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+@@ -296,6 +296,36 @@ public class ServerPlayer extends net.minecraft.world.entity.player.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
@@ -30643,7 +27240,7 @@ index 2e2101274f3afebbae783fa119f5cae8104de45d..4f4b7e738fe604808d837a38d23bf437
@Override
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
-index fb63036d26d2b5370472b741b23bebd71e247463..274ddf479d38495d84838f9cd73c13d2841c3b44 100644
+index fb63036d26d2b5370472b741b23bebd71e247463..d7a6eab60bf26916f78f858e224573560e581fef 100644
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
@@ -38,12 +38,153 @@ import net.minecraft.world.level.chunk.storage.RegionStorageInfo;
@@ -30684,7 +27281,7 @@ index fb63036d26d2b5370472b741b23bebd71e247463..274ddf479d38495d84838f9cd73c13d2
+ final int chunkY = ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkSectionY(pos);
+ final int chunkZ = ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkSectionZ(pos);
+
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Accessing poi chunk off-main");
++ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Accessing poi chunk off-main");
+
+ final ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkHolderManager manager = ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.world).moonrise$getChunkTaskScheduler().chunkHolderManager;
+ final ca.spottedleaf.moonrise.patches.chunk_system.level.poi.PoiChunk ret = manager.getPoiChunkIfLoaded(chunkX, chunkZ, true);
@@ -30698,7 +27295,7 @@ index fb63036d26d2b5370472b741b23bebd71e247463..274ddf479d38495d84838f9cd73c13d2
+ final int chunkY = ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkSectionY(pos);
+ final int chunkZ = ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkSectionZ(pos);
+
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Accessing poi chunk off-main");
++ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Accessing poi chunk off-main");
+
+ final ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkHolderManager manager = ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.world).moonrise$getChunkTaskScheduler().chunkHolderManager;
+
@@ -30720,7 +27317,7 @@ index fb63036d26d2b5370472b741b23bebd71e247463..274ddf479d38495d84838f9cd73c13d2
+ final int chunkY = ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkSectionY(pos);
+ final int chunkZ = ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkSectionZ(pos);
+
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Accessing poi chunk off-main");
++ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Accessing poi chunk off-main");
+
+ final ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkHolderManager manager = ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.world).moonrise$getChunkTaskScheduler().chunkHolderManager;
+
@@ -30741,7 +27338,7 @@ index fb63036d26d2b5370472b741b23bebd71e247463..274ddf479d38495d84838f9cd73c13d2
+ public final void moonrise$onUnload(final long coordinate) { // Paper - rewrite chunk system
+ final int chunkX = ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkX(coordinate);
+ final int chunkZ = ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkZ(coordinate);
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Unloading poi chunk off-main");
++ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Unloading poi chunk off-main");
+ for (int section = this.levelHeightAccessor.getMinSection(); section < this.levelHeightAccessor.getMaxSection(); ++section) {
+ final long sectionPos = SectionPos.asLong(chunkX, section, chunkZ);
+ this.updateDistanceTracking(sectionPos);
@@ -30752,7 +27349,7 @@ index fb63036d26d2b5370472b741b23bebd71e247463..274ddf479d38495d84838f9cd73c13d2
+ public final void moonrise$loadInPoiChunk(final ca.spottedleaf.moonrise.patches.chunk_system.level.poi.PoiChunk poiChunk) {
+ final int chunkX = poiChunk.chunkX;
+ final int chunkZ = poiChunk.chunkZ;
-+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Loading poi chunk off-main");
++ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this.world, chunkX, chunkZ, "Loading poi chunk off-main");
+ for (int sectionY = this.levelHeightAccessor.getMinSection(); sectionY < this.levelHeightAccessor.getMaxSection(); ++sectionY) {
+ final PoiSection section = poiChunk.getSection(sectionY);
+ if (section != null && !((ca.spottedleaf.moonrise.patches.chunk_system.level.poi.ChunkSystemPoiSection)section).moonrise$isEmpty()) {
@@ -31539,7 +28136,7 @@ index bff83fe413c7baef4ba56a3270ea4463a58c792f..a248d859cbce48f4a34c4771a7acffc1
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index e27d3547d1e19c137e05e6b8d075127a8bafb237..c4c2dc649e69d6097fbf6884ce82a34efb3e0e4d 100644
+index e27d3547d1e19c137e05e6b8d075127a8bafb237..a016fb2140d6a43172c3fbc623b23f6d57798d9e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -81,6 +81,7 @@ import net.minecraft.world.level.storage.LevelData;
@@ -32112,7 +28709,7 @@ index e27d3547d1e19c137e05e6b8d075127a8bafb237..c4c2dc649e69d6097fbf6884ce82a34e
// Paper end - Perf: Optimize capturedTileEntities lookup
// CraftBukkit end
- return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, LevelChunk.EntityCreationType.IMMEDIATE));
-+ return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && !io.papermc.paper.util.TickThread.isTickThread() ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, LevelChunk.EntityCreationType.IMMEDIATE)); // Paper - rewrite chunk system
++ return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && !ca.spottedleaf.moonrise.common.util.TickThread.isTickThread() ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, LevelChunk.EntityCreationType.IMMEDIATE)); // Paper - rewrite chunk system
}
public void setBlockEntity(BlockEntity blockEntity) {
@@ -32744,7 +29341,7 @@ index 365074be989aa4a178114fd5e9810f1a68640196..4af698930712389881601069a921f054
@Override
public BlockEntity getBlockEntity(BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..214bb6759d2670042d87b2fd0aae41df600a95ee 100644
+index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..3fa7bfa09b9d529b5cb9cad923f21343159cfa35 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -53,7 +53,7 @@ import net.minecraft.world.ticks.LevelChunkTicks;
@@ -32771,17 +29368,28 @@ index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..214bb6759d2670042d87b2fd0aae41df
}
// CraftBukkit start
-@@ -119,6 +127,28 @@ public class LevelChunk extends ChunkAccess {
+@@ -119,6 +127,39 @@ public class LevelChunk extends ChunkAccess {
// Paper start
boolean loadedTicketLevel;
// Paper end
+ // Paper start - rewrite chunk system
+ private boolean postProcessingDone;
++ private net.minecraft.server.level.ServerChunkCache.ChunkAndHolder chunkAndHolder;
+
+ @Override
+ public final boolean moonrise$isPostProcessingDone() {
+ return this.postProcessingDone;
+ }
++
++ @Override
++ public final net.minecraft.server.level.ServerChunkCache.ChunkAndHolder moonrise$getChunkAndHolder() {
++ return this.chunkAndHolder;
++ }
++
++ @Override
++ public final void moonrise$setChunkAndHolder(final net.minecraft.server.level.ServerChunkCache.ChunkAndHolder holder) {
++ this.chunkAndHolder = holder;
++ }
+ // Paper end - rewrite chunk system
+ // Paper start - get block chunk optimisation
+ private static final BlockState AIR_BLOCKSTATE = Blocks.AIR.defaultBlockState();
@@ -32800,7 +29408,7 @@ index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..214bb6759d2670042d87b2fd0aae41df
public LevelChunk(ServerLevel world, ProtoChunk protoChunk, @Nullable LevelChunk.PostLoadProcessor entityLoader) {
this(world, protoChunk.getPos(), protoChunk.getUpgradeData(), protoChunk.unpackBlockTicks(), protoChunk.unpackFluidTicks(), protoChunk.getInhabitedTime(), protoChunk.getSections(), entityLoader, protoChunk.getBlendingData());
-@@ -148,13 +178,19 @@ public class LevelChunk extends ChunkAccess {
+@@ -148,13 +189,19 @@ public class LevelChunk extends ChunkAccess {
}
}
@@ -32821,7 +29429,7 @@ index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..214bb6759d2670042d87b2fd0aae41df
}
@Override
-@@ -337,7 +373,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -337,7 +384,7 @@ public class LevelChunk extends ChunkAccess {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
gameprofilerfiller.push("updateSkyLightSources");
@@ -32830,7 +29438,7 @@ index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..214bb6759d2670042d87b2fd0aae41df
gameprofilerfiller.popPush("queueCheckLight");
this.level.getChunkSource().getLightEngine().checkBlock(blockposition);
gameprofilerfiller.pop();
-@@ -597,11 +633,12 @@ public class LevelChunk extends ChunkAccess {
+@@ -597,11 +644,12 @@ public class LevelChunk extends ChunkAccess {
// CraftBukkit start
public void loadCallback() {
@@ -32844,7 +29452,7 @@ index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..214bb6759d2670042d87b2fd0aae41df
if (server != null) {
/*
* If it's a new world, the first few chunks are generated inside
-@@ -610,6 +647,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -610,6 +658,7 @@ public class LevelChunk extends ChunkAccess {
*/
org.bukkit.Chunk bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this);
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(bukkitChunk, this.needsDecoration));
@@ -32852,7 +29460,7 @@ index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..214bb6759d2670042d87b2fd0aae41df
if (this.needsDecoration) {
try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper
-@@ -638,13 +676,15 @@ public class LevelChunk extends ChunkAccess {
+@@ -638,13 +687,15 @@ public class LevelChunk extends ChunkAccess {
}
public void unloadCallback() {
@@ -32870,7 +29478,7 @@ index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..214bb6759d2670042d87b2fd0aae41df
// Paper start
this.loadedTicketLevel = false;
// Paper end
-@@ -652,8 +692,27 @@ public class LevelChunk extends ChunkAccess {
+@@ -652,8 +703,27 @@ public class LevelChunk extends ChunkAccess {
@Override
public boolean isUnsaved() {
@@ -32899,7 +29507,7 @@ index 602ad80c2b93d320bf2a25832d25a58cb8c72e4b..214bb6759d2670042d87b2fd0aae41df
// CraftBukkit end
public boolean isEmpty() {
-@@ -759,6 +818,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -759,6 +829,7 @@ public class LevelChunk extends ChunkAccess {
this.pendingBlockEntities.clear();
this.upgradeData.upgrade(this);
@@ -33344,7 +29952,7 @@ index f6e08a8334633ff1532616d051bed46b702d0091..4e56398a6fb8b97199f4c74ebebc1055
private final ChunkStatus status;
@Nullable
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 d42585bccb03f8ee1be5e37cfbe8520af4cc5454..977bebe8657abc5cb84ede8276d6781cde20e847 100644
+index d42585bccb03f8ee1be5e37cfbe8520af4cc5454..cb5196f0ff7b9a59927c60b9d24c987a150e69f1 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
@@ -165,7 +165,7 @@ public class ChunkSerializer {
@@ -33372,7 +29980,7 @@ index d42585bccb03f8ee1be5e37cfbe8520af4cc5454..977bebe8657abc5cb84ede8276d6781c
+ // Paper start - async chunk saving
+ // must be called sync
+ public static ca.spottedleaf.moonrise.patches.chunk_system.async_save.AsyncChunkSaveData getAsyncSaveData(ServerLevel world, ChunkAccess chunk) {
-+ io.papermc.paper.util.TickThread.ensureTickThread(world, chunk.locX, chunk.locZ, "Preparing async chunk save data");
++ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(world, chunk.locX, chunk.locZ, "Preparing async chunk save data");
+
+ final CompoundTag tickLists = new CompoundTag();
+ ChunkSerializer.saveTicks(world, tickLists, chunk.getTicksForSerialization());
@@ -36052,7 +32660,7 @@ index 69c7fe5bf5b914276a9f7a0e57ce668e569d91f9..33322b57b4c6922f4daad0f584733f0f
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 77f3ac4e45a691181a94831cf49f7840c9f88e3a..05e44a1448f30ceb8cecba2bed76f51aac5543f9 100644
+index 2f7119ca17cf0df445c0c34804e40acb209a5b0d..06215f56f1cae5197c827b8100432ab2ef9aa976 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1419,7 +1419,7 @@ public final class CraftServer implements Server {
@@ -36078,12 +32686,12 @@ index 77f3ac4e45a691181a94831cf49f7840c9f88e3a..05e44a1448f30ceb8cecba2bed76f51a
@Override
public boolean isPrimaryThread() {
- return Thread.currentThread().equals(this.console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog)
-+ return io.papermc.paper.util.TickThread.isTickThread(); // Paper - rewrite chunk system
++ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThread(); // Paper - rewrite chunk system
}
// Paper start - Adventure
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 8f88ccec6b8947ca2738dc07c23aebe258145c83..cdc704364cf339084537d089e654f6078f8be783 100644
+index 94640aa827c9b2e1d0174eb012fdb37c0851f501..5ad2ceb1274648631689215702a12463c681152c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -456,10 +456,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -36185,16 +32793,10 @@ index 8f88ccec6b8947ca2738dc07c23aebe258145c83..cdc704364cf339084537d089e654f607
// 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 3480f06d4476c5c200246e6200e2eda2a5de1a5a..62bfde27a182be24710eb3b72448e82da58afc8f 100644
+index 65a6952d48f40f3fd73d6693b61be9d29741f2f6..4e7da1be4acf1028022e62a652df3e262a85fa0f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -3492,12 +3492,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
-
- @Override
- public int getViewDistance() {
-- return io.papermc.paper.chunk.system.ChunkSystem.getLoadViewDistance(this.getHandle());
-+ return io.papermc.paper.chunk.system.ChunkSystem.getLoadViewDistance(this.getHandle()) - 1; // Paper - rewrite chunk system - TODO do this better
- }
+@@ -3497,7 +3497,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setViewDistance(final int viewDistance) {
@@ -36257,20 +32859,20 @@ index fceed3d08ee6f4c171685986bb19d2be592eedc6..bf18f9ad7dec2b09ebfcb5ec6566f255
// Paper end
}
diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java
-index e8e3cc48cf1c58bd8151d1f28df28781859cd0e3..67c8e90d3a2a93d858371d7fc1c3aaac3fdef71c 100644
+index ef2598760458833021ef1bee92137f42c9fe591f..1f23e775eba1c34e01145bd91b0ce26fed6ca9de 100644
--- a/src/main/java/org/spigotmc/AsyncCatcher.java
+++ b/src/main/java/org/spigotmc/AsyncCatcher.java
@@ -9,7 +9,7 @@ public class AsyncCatcher
public static void catchOp(String reason)
{
-- if ( (AsyncCatcher.enabled || io.papermc.paper.util.TickThread.STRICT_THREAD_CHECKS) && Thread.currentThread() != MinecraftServer.getServer().serverThread ) // Paper
-+ if (!io.papermc.paper.util.TickThread.isTickThread()) // Paper // Paper - rewrite chunk system
+- if ( AsyncCatcher.enabled && Thread.currentThread() != MinecraftServer.getServer().serverThread )
++ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThread()) // Paper // Paper - rewrite chunk system
{
MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); // Paper
throw new IllegalStateException( "Asynchronous " + reason + "!" );
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
-index ad282d34919716b75acd10426cd071da9d064a51..bab2bd91528a8b2e9e74a3f9eb061d52619102f6 100644
+index ad282d34919716b75acd10426cd071da9d064a51..529df2a41dd93d6e1505053bd04032dbf0cdaa31 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -8,7 +8,7 @@ import java.util.logging.Logger;
@@ -36278,7 +32880,7 @@ index ad282d34919716b75acd10426cd071da9d064a51..bab2bd91528a8b2e9e74a3f9eb061d52
import org.bukkit.Bukkit;
-public class WatchdogThread extends Thread
-+public class WatchdogThread extends io.papermc.paper.util.TickThread // Paper - rewrite chunk system
++public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThread // Paper - rewrite chunk system
{
private static WatchdogThread instance;
diff --git a/patches/server/0990-Rewrite-dataconverter-system.patch b/patches/server/0989-Rewrite-dataconverter-system.patch
index ea19e60350..ea19e60350 100644
--- a/patches/server/0990-Rewrite-dataconverter-system.patch
+++ b/patches/server/0989-Rewrite-dataconverter-system.patch
diff --git a/patches/server/0991-disable-forced-empty-world-ticks.patch b/patches/server/0990-disable-forced-empty-world-ticks.patch
index a9fa9f8360..747f78f9fd 100644
--- a/patches/server/0991-disable-forced-empty-world-ticks.patch
+++ b/patches/server/0990-disable-forced-empty-world-ticks.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] disable forced empty world ticks
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index bb3826481d6165991f4201ed39d56fa5824a841f..2e30f8a12391222e612a9c1bf56e93625f52a8dc 100644
+index c759555241649cf5b355268066375341a54477f2..7da9729a6ac0684624f900a9e47f24e35bd3f3d9 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -710,7 +710,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -729,7 +729,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.handlingTick = false;
gameprofilerfiller.pop();
diff --git a/patches/server/0992-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch b/patches/server/0991-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch
index 229e45202f..ed5debe49c 100644
--- a/patches/server/0992-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch
+++ b/patches/server/0991-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch
@@ -29,7 +29,7 @@ index 02367ef1371dde94ff6c4cd40bd32e800d6ccaaf..7b0fc7135bc107103dcaed6dc0707b18
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 c4c2dc649e69d6097fbf6884ce82a34efb3e0e4d..2dcd2f9085de19a91f32f161b89572ec1fbe4805 100644
+index a016fb2140d6a43172c3fbc623b23f6d57798d9e..5b893b93a3495b13ae266fb8054d0a454cf02660 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -824,7 +824,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
diff --git a/patches/server/0993-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/0992-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch
index f2c0d4389a..fe409f5c40 100644
--- a/patches/server/0993-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch
+++ b/patches/server/0992-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch
@@ -13,10 +13,10 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 2e30f8a12391222e612a9c1bf56e93625f52a8dc..162671f8e370c84832b18697a1ef787981e1632d 100644
+index 7da9729a6ac0684624f900a9e47f24e35bd3f3d9..978208f74b6f1d3f859165e951d41013a5f00256 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2518,6 +2518,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -2537,6 +2537,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
{
if ( iter.next().player == entity )
{
diff --git a/patches/server/0994-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch b/patches/server/0993-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch
index 6f9e63f228..23a10511a6 100644
--- a/patches/server/0994-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch
+++ b/patches/server/0993-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 2dcd2f9085de19a91f32f161b89572ec1fbe4805..2809990109e624db95d400aba7a1cc588bc767c2 100644
+index 5b893b93a3495b13ae266fb8054d0a454cf02660..77b7c252d27f527d9b51e8419abe7af1d4b51d29 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -816,10 +816,87 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
diff --git a/patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/server/0994-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
index f51a3d8642..f51a3d8642 100644
--- a/patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
+++ b/patches/server/0994-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
diff --git a/patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch b/patches/server/0995-Allow-Saving-of-Oversized-Chunks.patch
index 4eef25929e..4eef25929e 100644
--- a/patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch
+++ b/patches/server/0995-Allow-Saving-of-Oversized-Chunks.patch
diff --git a/patches/server/0997-Flat-bedrock-generator-settings.patch b/patches/server/0996-Flat-bedrock-generator-settings.patch
index da68e7d65b..da68e7d65b 100644
--- a/patches/server/0997-Flat-bedrock-generator-settings.patch
+++ b/patches/server/0996-Flat-bedrock-generator-settings.patch
diff --git a/patches/server/0998-Entity-Activation-Range-2.0.patch b/patches/server/0997-Entity-Activation-Range-2.0.patch
index 588b66fec0..59596a9c67 100644
--- a/patches/server/0998-Entity-Activation-Range-2.0.patch
+++ b/patches/server/0997-Entity-Activation-Range-2.0.patch
@@ -17,7 +17,7 @@ Adds villagers as separate config
public net.minecraft.world.entity.Entity isInsidePortal
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 162671f8e370c84832b18697a1ef787981e1632d..8b6a1a80a3bf95e7f17c6b64d0949d6732352f0c 100644
+index 978208f74b6f1d3f859165e951d41013a5f00256..1196eb573317ad01b6df0ae2d38aa17a72da2535 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2,7 +2,6 @@ package net.minecraft.server.level;
@@ -28,7 +28,7 @@ index 162671f8e370c84832b18697a1ef787981e1632d..8b6a1a80a3bf95e7f17c6b64d0949d67
import com.google.common.collect.Lists;
import com.mojang.datafixers.DataFixer;
import com.mojang.datafixers.util.Pair;
-@@ -1216,17 +1215,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1235,17 +1234,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
++TimingHistory.entityTicks; // Paper - timings
// Spigot start
co.aikar.timings.Timing timer; // Paper
@@ -50,7 +50,7 @@ index 162671f8e370c84832b18697a1ef787981e1632d..8b6a1a80a3bf95e7f17c6b64d0949d67
try {
// Paper end - timings
entity.setOldPosAndRot();
-@@ -1237,9 +1236,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1256,9 +1255,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString();
});
gameprofilerfiller.incrementCounter("tickNonPassenger");
@@ -64,7 +64,7 @@ index 162671f8e370c84832b18697a1ef787981e1632d..8b6a1a80a3bf95e7f17c6b64d0949d67
Iterator iterator = entity.getPassengers().iterator();
while (iterator.hasNext()) {
-@@ -1247,13 +1250,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1266,13 +1269,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.tickPassenger(entity, entity1);
}
@@ -84,7 +84,7 @@ index 162671f8e370c84832b18697a1ef787981e1632d..8b6a1a80a3bf95e7f17c6b64d0949d67
passenger.setOldPosAndRot();
++passenger.tickCount;
ProfilerFiller gameprofilerfiller = this.getProfiler();
-@@ -1262,8 +1270,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1281,8 +1289,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString();
});
gameprofilerfiller.incrementCounter("tickPassenger");
@@ -102,7 +102,7 @@ index 162671f8e370c84832b18697a1ef787981e1632d..8b6a1a80a3bf95e7f17c6b64d0949d67
gameprofilerfiller.pop();
Iterator iterator = passenger.getPassengers().iterator();
-@@ -1273,6 +1290,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1292,6 +1309,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.tickPassenger(passenger, entity2);
}
@@ -340,7 +340,7 @@ index 0b7f52021441d633c37543e8ae485e81c292b747..d7f8464bf3eed0e42a5fc7f14a5b243d
+
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 2809990109e624db95d400aba7a1cc588bc767c2..bd1f7cf95288a15b2a06a93878303b03ac603e5e 100644
+index 77b7c252d27f527d9b51e8419abe7af1d4b51d29..ecf2f478932c9ccc5a7ac47c8f17bd44217c703b 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -157,6 +157,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
diff --git a/patches/server/0999-Optional-per-player-mob-spawns.patch b/patches/server/0998-Optional-per-player-mob-spawns.patch
index 807e87ea3f..a5b1729654 100644
--- a/patches/server/0999-Optional-per-player-mob-spawns.patch
+++ b/patches/server/0998-Optional-per-player-mob-spawns.patch
@@ -5,13 +5,13 @@ 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 d843bc04ae93d11d7820cab5ed18617193568f0d..152cd6b1671785b495caeb7e535f58df864ce24c 100644
+index edb36dee707433d4f9419aef6ac6cc0bec5f285e..c282566ee45d79b4fb3297989e054c803873a294 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -256,8 +256,26 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- return this.nearbyPlayers;
+@@ -223,8 +223,26 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
+ // Paper start
+ // Paper start - Optional per player mob spawns
+ public void updatePlayerMobTypeMap(final Entity entity) {
+ if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) {
@@ -19,14 +19,14 @@ index d843bc04ae93d11d7820cab5ed18617193568f0d..152cd6b1671785b495caeb7e535f58df
+ }
+ final int index = entity.getType().getCategory().ordinal();
+
-+ final com.destroystokyo.paper.util.maplist.ReferenceList<ServerPlayer> inRange =
-+ this.getNearbyPlayers().getPlayers(entity.chunkPosition(), io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.TICK_VIEW_DISTANCE);
++ final ca.spottedleaf.moonrise.common.list.ReferenceList<ServerPlayer> inRange =
++ this.level.moonrise$getNearbyPlayers().getPlayers(entity.chunkPosition(), ca.spottedleaf.moonrise.common.misc.NearbyPlayers.NearbyMapType.TICK_VIEW_DISTANCE);
+ if (inRange == null) {
+ return;
+ }
-+ final Object[] backingSet = inRange.getRawData();
++ final ServerPlayer[] backingSet = inRange.getRawDataUnchecked();
+ for (int i = 0, len = inRange.size(); i < len; i++) {
-+ ++((ServerPlayer)backingSet[i]).mobCounts[index];
++ ++(backingSet[i].mobCounts[index]);
+ }
+ }
public int getMobCountNear(final ServerPlayer player, final net.minecraft.world.entity.MobCategory mobCategory) {
@@ -37,10 +37,10 @@ index d843bc04ae93d11d7820cab5ed18617193568f0d..152cd6b1671785b495caeb7e535f58df
// Paper end
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index d2cb358c340bcf7532fd25eccdd33c6945d16de4..2211c054f55e962082eac82aedf5ca625e5b25f2 100644
+index 9aec513f05b10e78579f79ccda6acf285f13222e..96a03770d47c47e07615815bcc3d474d6cd7711b 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -439,7 +439,19 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -437,7 +437,19 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
gameprofilerfiller.popPush("naturalSpawnCount");
this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
int k = this.distanceManager.getNaturalSpawnChunkCount();
@@ -62,7 +62,7 @@ index d2cb358c340bcf7532fd25eccdd33c6945d16de4..2211c054f55e962082eac82aedf5ca62
this.lastSpawnState = spawnercreature_d;
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index ba64e42a58b4b760815f54228ebf7a46fd14734e..6277ec3353c6e552b898b525ce2af76a0c84943d 100644
+index fd61e10fd3151bf8cc206a93d4ede22a7c681dbf..23ddb7735623e502eda2b7b3029c6597f4b0f9a0 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -275,6 +275,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
@@ -77,7 +77,7 @@ index ba64e42a58b4b760815f54228ebf7a46fd14734e..6277ec3353c6e552b898b525ce2af76a
// CraftBukkit start
public CraftPlayer.TransferCookieConnection transferCookieConnection;
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
-index ea6533c1ac218aa075da3401807a06fcb7892321..0679636530ca1afd077c43b0fa605a2ac74e0522 100644
+index ea6533c1ac218aa075da3401807a06fcb7892321..364510c0d0667e67aa3b25099a021f5f856fc113 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -67,6 +67,12 @@ public final class NaturalSpawner {
@@ -123,12 +123,12 @@ index ea6533c1ac218aa075da3401807a06fcb7892321..0679636530ca1afd077c43b0fa605a2a
+
+ if (world.paperConfig().entities.spawning.perPlayerMobSpawns) {
+ int minDiff = Integer.MAX_VALUE;
-+ final com.destroystokyo.paper.util.maplist.ReferenceList<net.minecraft.server.level.ServerPlayer> inRange =
-+ world.chunkSource.chunkMap.getNearbyPlayers().getPlayers(chunk.getPos(), io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.TICK_VIEW_DISTANCE);
++ final ca.spottedleaf.moonrise.common.list.ReferenceList<net.minecraft.server.level.ServerPlayer> inRange =
++ world.moonrise$getNearbyPlayers().getPlayers(chunk.getPos(), ca.spottedleaf.moonrise.common.misc.NearbyPlayers.NearbyMapType.TICK_VIEW_DISTANCE);
+ if (inRange != null) {
-+ final Object[] backingSet = inRange.getRawData();
++ final net.minecraft.server.level.ServerPlayer[] backingSet = inRange.getRawDataUnchecked();
+ for (int k = 0, len = inRange.size(); k < len; k++) {
-+ minDiff = Math.min(limit - world.getChunkSource().chunkMap.getMobCountNear((net.minecraft.server.level.ServerPlayer)backingSet[k], enumcreaturetype), minDiff);
++ minDiff = Math.min(limit - world.getChunkSource().chunkMap.getMobCountNear(backingSet[k], enumcreaturetype), minDiff);
+ }
+ }
+ difference = (minDiff == Integer.MAX_VALUE) ? 0 : minDiff;
diff --git a/patches/server/1000-Anti-Xray.patch b/patches/server/0999-Anti-Xray.patch
index bacd340c00..ad8ecc1c7a 100644
--- a/patches/server/1000-Anti-Xray.patch
+++ b/patches/server/0999-Anti-Xray.patch
@@ -1104,10 +1104,10 @@ index 183b2191fa1c1b27adedf39593e1b5a223fb1279..8ead66c134688b11dca15f6509147e72
private ClientboundLevelChunkWithLightPacket(RegistryFriendlyByteBuf buf) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 8b6a1a80a3bf95e7f17c6b64d0949d6732352f0c..6a844382882a69bfc690b956fa8d59c2d0ea0bd3 100644
+index 1196eb573317ad01b6df0ae2d38aa17a72da2535..a5320b96148d79f8d2493060718688786466e6dd 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -515,7 +515,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -534,7 +534,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
@@ -1168,7 +1168,7 @@ index 9b1a6d8351fb473eec75a2fd08fb892b770e3586..0d0b07c9199be9ca0d5ac3feb1d44f14
}
// Paper end - Send empty chunk
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index bd1f7cf95288a15b2a06a93878303b03ac603e5e..d077b7be012af2092caa6fe9c56f4ac712d27874 100644
+index ecf2f478932c9ccc5a7ac47c8f17bd44217c703b..ae7cd8df617dba09abb9ca1108aff719a9c3304f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -172,6 +172,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1231,7 +1231,7 @@ index a7fc4b027cee8e1ed2678be7060040494a65682a..75c8125e20b70433fe9d143a3193d821
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-index 214bb6759d2670042d87b2fd0aae41df600a95ee..d4429eedd9164d4b7c367345a8c662a1129d0430 100644
+index 3fa7bfa09b9d529b5cb9cad923f21343159cfa35..8c865cd4e50ad55679a8bd89835caa40cc101f35 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -91,7 +91,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -1510,7 +1510,7 @@ index 9a2bf744abd8916d492e901be889223591bac3fd..1dd415c96d17eff8e7555c33d3c52e57
int getSerializedSize();
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 977bebe8657abc5cb84ede8276d6781cde20e847..6d461849da76894244e6212a75da0c6e4fb459c3 100644
+index cb5196f0ff7b9a59927c60b9d24c987a150e69f1..711541a9b12b823c1da779ed6027a53e9078a733 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
@@ -73,7 +73,7 @@ import org.slf4j.Logger;
@@ -1574,7 +1574,7 @@ index 33322b57b4c6922f4daad0f584733f0f24083911..45e262308aebafa377a2353661acdd12
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 05e44a1448f30ceb8cecba2bed76f51aac5543f9..caf6ff33b42472d30f28629470e12889f50490cc 100644
+index 06215f56f1cae5197c827b8100432ab2ef9aa976..81fa2bab6841ab375ff310d0fbbe6349fd44872a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2677,7 +2677,7 @@ public final class CraftServer implements Server {
@@ -1587,7 +1587,7 @@ index 05e44a1448f30ceb8cecba2bed76f51aac5543f9..caf6ff33b42472d30f28629470e12889
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index cdc704364cf339084537d089e654f6078f8be783..fe9e8d1d4ae1f7a4e8f4cf5688004fc969422b3c 100644
+index 5ad2ceb1274648631689215702a12463c681152c..86ed89a2eae5f36d902cd8dc4bd0389e066b4bba 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -465,11 +465,16 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/1001-Eigencraft-redstone-implementation.patch b/patches/server/1000-Eigencraft-redstone-implementation.patch
index b3e3db6504..b3e3db6504 100644
--- a/patches/server/1001-Eigencraft-redstone-implementation.patch
+++ b/patches/server/1000-Eigencraft-redstone-implementation.patch
diff --git a/patches/server/1002-Add-Alternate-Current-redstone-implementation.patch b/patches/server/1001-Add-Alternate-Current-redstone-implementation.patch
index 3aeaef70d8..17df7da36c 100644
--- a/patches/server/1002-Add-Alternate-Current-redstone-implementation.patch
+++ b/patches/server/1001-Add-Alternate-Current-redstone-implementation.patch
@@ -2009,7 +2009,7 @@ index 0000000000000000000000000000000000000000..33cd90c30c22200a4e1ae64f40a0bf78
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 6a844382882a69bfc690b956fa8d59c2d0ea0bd3..a994456adb0034c0662151f4ae28c1c06f91333e 100644
+index a5320b96148d79f8d2493060718688786466e6dd..472655c55b1f5c213da9b6c1940a353bafdac509 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -228,6 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -2020,7 +2020,7 @@ index 6a844382882a69bfc690b956fa8d59c2d0ea0bd3..a994456adb0034c0662151f4ae28c1c0
public LevelChunk getChunkIfLoaded(int x, int z) {
return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately
-@@ -2449,6 +2450,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -2468,6 +2469,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
return crashreportsystemdetails;
}
@@ -2035,7 +2035,7 @@ index 6a844382882a69bfc690b956fa8d59c2d0ea0bd3..a994456adb0034c0662151f4ae28c1c0
EntityCallbacks() {}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index d077b7be012af2092caa6fe9c56f4ac712d27874..20a7971b75ee39bceedf7670a5c600fd014db4cb 100644
+index ae7cd8df617dba09abb9ca1108aff719a9c3304f..9501a2527bb0db91dd5494ccb4066b9629993e59 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -2013,4 +2013,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
diff --git a/patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch
index 83f592b0c7..e670998b87 100644
--- a/patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch
+++ b/patches/server/1002-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch
@@ -6,11 +6,11 @@ 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 152cd6b1671785b495caeb7e535f58df864ce24c..344966d3deb640eb99bc9c9e318e6e6780421907 100644
+index c282566ee45d79b4fb3297989e054c803873a294..dc64227e3b0d7855ef8870935aa437b78eea2407 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -273,8 +273,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- ++((ServerPlayer)backingSet[i]).mobCounts[index];
+@@ -240,8 +240,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ ++(backingSet[i].mobCounts[index]);
}
}
+ // Paper start - per player mob count backoff
@@ -19,14 +19,14 @@ index 152cd6b1671785b495caeb7e535f58df864ce24c..344966d3deb640eb99bc9c9e318e6e67
+ return;
+ }
+ int idx = mobCategory.ordinal();
-+ final com.destroystokyo.paper.util.maplist.ReferenceList<ServerPlayer> inRange =
-+ this.getNearbyPlayers().getPlayersByChunk(chunkX, chunkZ, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.TICK_VIEW_DISTANCE);
++ final ca.spottedleaf.moonrise.common.list.ReferenceList<ServerPlayer> inRange =
++ this.level.moonrise$getNearbyPlayers().getPlayersByChunk(chunkX, chunkZ, ca.spottedleaf.moonrise.common.misc.NearbyPlayers.NearbyMapType.TICK_VIEW_DISTANCE);
+ if (inRange == null) {
+ return;
+ }
-+ final Object[] backingSet = inRange.getRawData();
++ final ServerPlayer[] backingSet = inRange.getRawDataUnchecked();
+ for (int i = 0, len = inRange.size(); i < len; i++) {
-+ ++((ServerPlayer)backingSet[i]).mobBackoffCounts[idx];
++ ++(backingSet[i].mobBackoffCounts[idx]);
+ }
+ }
+ // Paper end - per player mob count backoff
@@ -37,10 +37,10 @@ index 152cd6b1671785b495caeb7e535f58df864ce24c..344966d3deb640eb99bc9c9e318e6e67
}
// Paper end
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 2211c054f55e962082eac82aedf5ca625e5b25f2..61e222fb129c5733411ce95aaa5f035dbd95b01a 100644
+index 96a03770d47c47e07615815bcc3d474d6cd7711b..5f195875564822f422127462fbbeea5df4a4e1cb 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -445,7 +445,17 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -443,7 +443,17 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
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) {
@@ -60,7 +60,7 @@ index 2211c054f55e962082eac82aedf5ca625e5b25f2..61e222fb129c5733411ce95aaa5f035d
spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, null, true);
} else {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 6277ec3353c6e552b898b525ce2af76a0c84943d..9d1e68c09fa7093cf0f6fa636f90cb15a44cbb38 100644
+index 23ddb7735623e502eda2b7b3029c6597f4b0f9a0..13ec84754b4fb5e8442fe305d70a24e420945181 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -279,6 +279,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
@@ -72,7 +72,7 @@ index 6277ec3353c6e552b898b525ce2af76a0c84943d..9d1e68c09fa7093cf0f6fa636f90cb15
// CraftBukkit start
public CraftPlayer.TransferCookieConnection transferCookieConnection;
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
-index 0679636530ca1afd077c43b0fa605a2ac74e0522..ed8032495af9ce9c23419224814b8d27e4a97c17 100644
+index 364510c0d0667e67aa3b25099a021f5f856fc113..e524b27d185da3e88668f8ef107517272860bd66 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -272,6 +272,11 @@ public final class NaturalSpawner {
diff --git a/patches/server/1004-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/1003-Use-Velocity-compression-and-cipher-natives.patch
index 276343645a..276343645a 100644
--- a/patches/server/1004-Use-Velocity-compression-and-cipher-natives.patch
+++ b/patches/server/1003-Use-Velocity-compression-and-cipher-natives.patch
diff --git a/patches/server/1005-Optimize-Collision-to-not-load-chunks.patch b/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch
index d48dec5878..d48dec5878 100644
--- a/patches/server/1005-Optimize-Collision-to-not-load-chunks.patch
+++ b/patches/server/1004-Optimize-Collision-to-not-load-chunks.patch
diff --git a/patches/server/1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch
index 1f46712639..65f5e3531e 100644
--- a/patches/server/1006-Optimize-GoalSelector-Goal.Flag-Set-operations.patch
+++ b/patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch
@@ -7,7 +7,7 @@ Optimise the stream.anyMatch statement to move to a bitset
where we can replace the call with a single bitwise operation.
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java b/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java
-index 16f9a98b8a939e5ca7e2dc04f87134a7ed66736b..dd423302b1baa64ef86ded87a29659342e28c142 100644
+index 16f9a98b8a939e5ca7e2dc04f87134a7ed66736b..47741efa48258c3c30b1d59504bf3121c236cadb 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java
@@ -4,7 +4,16 @@ import java.util.EnumSet;
@@ -16,12 +16,12 @@ index 16f9a98b8a939e5ca7e2dc04f87134a7ed66736b..dd423302b1baa64ef86ded87a2965934
public abstract class Goal {
- private final EnumSet<Goal.Flag> flags = EnumSet.noneOf(Goal.Flag.class);
+ private final EnumSet<Goal.Flag> flags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
-+ private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
++ private final ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
+
+ // Paper start - remove streams from pathfindergoalselector; make sure types are not empty
+ public Goal() {
+ if (this.goalTypes.size() == 0) {
-+ this.goalTypes.add(Flag.UNKNOWN_BEHAVIOR);
++ this.goalTypes.addUnchecked(Flag.UNKNOWN_BEHAVIOR);
+ }
+ }
+ // Paper end - remove streams from pathfindergoalselector
@@ -36,9 +36,9 @@ index 16f9a98b8a939e5ca7e2dc04f87134a7ed66736b..dd423302b1baa64ef86ded87a2965934
- this.flags.addAll(controls);
+ // Paper start - remove streams from pathfindergoalselector
+ this.goalTypes.clear();
-+ this.goalTypes.addAll(controls);
++ this.goalTypes.addAllUnchecked(controls);
+ if (this.goalTypes.size() == 0) {
-+ this.goalTypes.add(Flag.UNKNOWN_BEHAVIOR);
++ this.goalTypes.addUnchecked(Flag.UNKNOWN_BEHAVIOR);
+ }
+ // Paper end - remove streams from pathfindergoalselector
}
@@ -51,14 +51,14 @@ index 16f9a98b8a939e5ca7e2dc04f87134a7ed66736b..dd423302b1baa64ef86ded87a2965934
- public EnumSet<Goal.Flag> getFlags() {
- return this.flags;
+ // Paper start - remove streams from pathfindergoalselector
-+ public com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<Goal.Flag> getFlags() {
++ public ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<Goal.Flag> getFlags() {
+ return this.goalTypes;
+ // Paper end - remove streams from pathfindergoalselector
}
protected int adjustedTickDelay(int ticks) {
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
-index 074ef807258139f818e30494126585262c2f33c0..74d4f653d5c7f1923c59019effd78337402f7025 100644
+index 074ef807258139f818e30494126585262c2f33c0..9bdbf3e9453bc3ce96d52d04b8cde0d05f7356d8 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -25,7 +25,8 @@ public class GoalSelector {
@@ -67,7 +67,7 @@ index 074ef807258139f818e30494126585262c2f33c0..74d4f653d5c7f1923c59019effd78337
private final Supplier<ProfilerFiller> profiler;
- private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class);
+ private static final Goal.Flag[] GOAL_FLAG_VALUES = Goal.Flag.values(); // Paper - remove streams from pathfindergoalselector
-+ private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
++ private final ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
private int curRate;
public GoalSelector(Supplier<ProfilerFiller> profiler) {
@@ -84,7 +84,7 @@ index 074ef807258139f818e30494126585262c2f33c0..74d4f653d5c7f1923c59019effd78337
-
- return false;
+ // Paper start
-+ private static boolean goalContainsAnyFlags(WrappedGoal goal, com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<Goal.Flag> controls) {
++ private static boolean goalContainsAnyFlags(WrappedGoal goal, ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<Goal.Flag> controls) {
+ return goal.getFlags().hasCommonElements(controls);
}
@@ -94,7 +94,7 @@ index 074ef807258139f818e30494126585262c2f33c0..74d4f653d5c7f1923c59019effd78337
+ int wrappedGoalSize = goal.getFlags().size();
+ for (int i = 0; i < wrappedGoalSize; ++i) {
+ final Goal.Flag flag = GOAL_FLAG_VALUES[Long.numberOfTrailingZeros(flagIterator)];
-+ flagIterator ^= io.papermc.paper.util.IntegerUtil.getTrailingBit(flagIterator);
++ flagIterator ^= ca.spottedleaf.concurrentutil.util.IntegerUtil.getTrailingBit(flagIterator);
+ // Paper end
if (!goalsByControl.getOrDefault(flag, NO_GOAL).canBeReplacedBy(goal)) {
return false;
@@ -123,7 +123,7 @@ index 074ef807258139f818e30494126585262c2f33c0..74d4f653d5c7f1923c59019effd78337
+ int wrappedGoalSize = wrappedGoal2.getFlags().size();
+ for (int i = 0; i < wrappedGoalSize; ++i) {
+ final Goal.Flag flag = GOAL_FLAG_VALUES[Long.numberOfTrailingZeros(flagIterator)];
-+ flagIterator ^= io.papermc.paper.util.IntegerUtil.getTrailingBit(flagIterator);
++ flagIterator ^= ca.spottedleaf.concurrentutil.util.IntegerUtil.getTrailingBit(flagIterator);
+ // Paper end
WrappedGoal wrappedGoal3 = this.lockedFlags.getOrDefault(flag, NO_GOAL);
wrappedGoal3.stop();
@@ -133,17 +133,17 @@ index 074ef807258139f818e30494126585262c2f33c0..74d4f653d5c7f1923c59019effd78337
public void disableControlFlag(Goal.Flag control) {
- this.disabledFlags.add(control);
-+ this.goalTypes.add(control); // Paper - remove streams from pathfindergoalselector
++ this.goalTypes.addUnchecked(control); // Paper - remove streams from pathfindergoalselector
}
public void enableControlFlag(Goal.Flag control) {
- this.disabledFlags.remove(control);
-+ this.goalTypes.remove(control); // Paper - remove streams from pathfindergoalselector
++ this.goalTypes.removeUnchecked(control); // Paper - remove streams from pathfindergoalselector
}
public void setControlFlag(Goal.Flag control, boolean enabled) {
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/WrappedGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/WrappedGoal.java
-index b02d3deb550830245c8945ef17d3073ea930fdda..65ccdbaa5230c02d44a5959bca0f6fc30237a6fd 100644
+index b02d3deb550830245c8945ef17d3073ea930fdda..8cf2e0db6b2f7d3a50f2ac1c3f4f0c6c2434b5ba 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/WrappedGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/WrappedGoal.java
@@ -69,8 +69,10 @@ public class WrappedGoal extends Goal {
@@ -152,7 +152,7 @@ index b02d3deb550830245c8945ef17d3073ea930fdda..65ccdbaa5230c02d44a5959bca0f6fc3
@Override
- public EnumSet<Goal.Flag> getFlags() {
+ // Paper start - remove streams from pathfindergoalselector
-+ public com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<Goal.Flag> getFlags() {
++ public ca.spottedleaf.moonrise.common.set.OptimizedSmallEnumSet<Goal.Flag> getFlags() {
return this.goal.getFlags();
+ // Paper end - remove streams from pathfindergoalselector
}
diff --git a/patches/server/1007-Optimize-Hoppers.patch b/patches/server/1006-Optimize-Hoppers.patch
index 7203ad1a95..dc55a79c71 100644
--- a/patches/server/1007-Optimize-Hoppers.patch
+++ b/patches/server/1006-Optimize-Hoppers.patch
@@ -50,10 +50,10 @@ index 0000000000000000000000000000000000000000..5c42823726e70ce6c9d0121d07431548
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 91cc3eb6db2875710064f6b31413ccc84af56bb2..17b0e570016504d1b7704bbfa9ff2e3233b45d09 100644
+index 4a4ce372dd105d07f58d7d93d856cb3969969806..fb3dcce4e1888f96fdd260740d9d955962d879fc 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1722,6 +1722,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1721,6 +1721,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ServerLevel worldserver = (ServerLevel) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
diff --git a/patches/server/1008-Entity-load-save-limit-per-chunk.patch b/patches/server/1007-Entity-load-save-limit-per-chunk.patch
index 380beda077..380beda077 100644
--- a/patches/server/1008-Entity-load-save-limit-per-chunk.patch
+++ b/patches/server/1007-Entity-load-save-limit-per-chunk.patch
diff --git a/patches/server/1009-Optimize-Voxel-Shape-Merging.patch b/patches/server/1008-Optimize-Voxel-Shape-Merging.patch
index 114ee7cb28..114ee7cb28 100644
--- a/patches/server/1009-Optimize-Voxel-Shape-Merging.patch
+++ b/patches/server/1008-Optimize-Voxel-Shape-Merging.patch
diff --git a/patches/server/1010-Optimize-Bit-Operations-by-inlining.patch b/patches/server/1009-Optimize-Bit-Operations-by-inlining.patch
index b7d93a56b9..b7d93a56b9 100644
--- a/patches/server/1010-Optimize-Bit-Operations-by-inlining.patch
+++ b/patches/server/1009-Optimize-Bit-Operations-by-inlining.patch
diff --git a/patches/server/1011-Remove-streams-from-hot-code.patch b/patches/server/1010-Remove-streams-from-hot-code.patch
index 4c6d94f7bf..4c6d94f7bf 100644
--- a/patches/server/1011-Remove-streams-from-hot-code.patch
+++ b/patches/server/1010-Remove-streams-from-hot-code.patch
diff --git a/patches/server/1012-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/1011-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch
index 6fc4445bbf..6fc4445bbf 100644
--- a/patches/server/1012-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch
+++ b/patches/server/1011-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch
diff --git a/patches/server/1013-Custom-table-implementation-for-blockstate-state-loo.patch b/patches/server/1012-Custom-table-implementation-for-blockstate-state-loo.patch
index 96d90abea3..96d90abea3 100644
--- a/patches/server/1013-Custom-table-implementation-for-blockstate-state-loo.patch
+++ b/patches/server/1012-Custom-table-implementation-for-blockstate-state-loo.patch
diff --git a/patches/server/1014-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/1013-Fix-entity-type-tags-suggestions-in-selectors.patch
index a8e41e99e4..a8e41e99e4 100644
--- a/patches/server/1014-Fix-entity-type-tags-suggestions-in-selectors.patch
+++ b/patches/server/1013-Fix-entity-type-tags-suggestions-in-selectors.patch
diff --git a/patches/server/1015-Handle-Oversized-block-entities-in-chunks.patch b/patches/server/1014-Handle-Oversized-block-entities-in-chunks.patch
index d3283fd63f..d3283fd63f 100644
--- a/patches/server/1015-Handle-Oversized-block-entities-in-chunks.patch
+++ b/patches/server/1014-Handle-Oversized-block-entities-in-chunks.patch
diff --git a/patches/server/1016-API-for-checking-sent-chunks.patch b/patches/server/1015-API-for-checking-sent-chunks.patch
index 5129c9a08a..ea42e9e7d9 100644
--- a/patches/server/1016-API-for-checking-sent-chunks.patch
+++ b/patches/server/1015-API-for-checking-sent-chunks.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] API for checking sent chunks
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
-index f063ab3ff122b920bcc4aa4f5bf9a442a8eb32fd..95d2d4417591b921d1ddf73025565cff6aabddd7 100644
+index 244674dc44d80ee5ce78d2ed2c6ab94fd5d3d07f..bdf9244ab7e62f5d6cdd6e21e1a5daee1ddb37f4 100644
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
@@ -1072,5 +1072,10 @@ public final class RegionizedPlayerChunkLoader {
@@ -20,7 +20,7 @@ index f063ab3ff122b920bcc4aa4f5bf9a442a8eb32fd..95d2d4417591b921d1ddf73025565cff
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 62bfde27a182be24710eb3b72448e82da58afc8f..d01b45a48d412e3cb591acee101730704574448a 100644
+index 4e7da1be4acf1028022e62a652df3e262a85fa0f..a62ed0a348c22c1f315ca0deba63f7c2d09b709e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3484,6 +3484,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/1017-Check-distance-in-entity-interactions.patch b/patches/server/1016-Check-distance-in-entity-interactions.patch
index 64fd802e0e..64fd802e0e 100644
--- a/patches/server/1017-Check-distance-in-entity-interactions.patch
+++ b/patches/server/1016-Check-distance-in-entity-interactions.patch
diff --git a/patches/server/1018-Configurable-Sand-Duping.patch b/patches/server/1017-Configurable-Sand-Duping.patch
index cbc52697db..cbc52697db 100644
--- a/patches/server/1018-Configurable-Sand-Duping.patch
+++ b/patches/server/1017-Configurable-Sand-Duping.patch
diff --git a/patches/server/1019-Optimise-general-POI-access.patch b/patches/server/1018-Optimise-general-POI-access.patch
index f8e4fb9c3d..b3636fe591 100644
--- a/patches/server/1019-Optimise-general-POI-access.patch
+++ b/patches/server/1018-Optimise-general-POI-access.patch
@@ -32,12 +32,14 @@ had to be specifically modified.
diff --git a/src/main/java/io/papermc/paper/util/PoiAccess.java b/src/main/java/io/papermc/paper/util/PoiAccess.java
new file mode 100644
-index 0000000000000000000000000000000000000000..d8190b56d216b0e48bfc2d5739bdf533bf95b425
+index 0000000000000000000000000000000000000000..f39294b1f83c4022be5ced4da781103a1eee2daf
--- /dev/null
+++ b/src/main/java/io/papermc/paper/util/PoiAccess.java
-@@ -0,0 +1,804 @@
+@@ -0,0 +1,806 @@
+package io.papermc.paper.util;
+
++import ca.spottedleaf.moonrise.common.util.CoordinateUtils;
++import ca.spottedleaf.moonrise.common.util.WorldUtil;
+import com.mojang.datafixers.util.Pair;
+import it.unimi.dsi.fastutil.doubles.Double2ObjectMap;
+import it.unimi.dsi.fastutil.doubles.Double2ObjectRBTreeMap;
@@ -884,7 +886,7 @@ index d5a549f08b98c80a5cf0eef02cb8a389c32dfecb..92731b6b593289e9f583c9b705b219e8
BlockPos blockPos = path.getTarget();
Optional<Holder<PoiType>> optional = poiManager.getType(blockPos);
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
-index 274ddf479d38495d84838f9cd73c13d2841c3b44..0be7346f9c5e89ea03c69f7c8ba4733d2c7759fc 100644
+index d7a6eab60bf26916f78f858e224573560e581fef..a908bf1dc5e821dcf6981a8c21076fb0bdc6516d 100644
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
@@ -268,36 +268,45 @@ public class PoiManager extends SectionStorage<PoiSection> implements ca.spotted
diff --git a/patches/server/1020-Improve-performance-of-mass-crafts.patch b/patches/server/1019-Improve-performance-of-mass-crafts.patch
index 15701b21e0..15701b21e0 100644
--- a/patches/server/1020-Improve-performance-of-mass-crafts.patch
+++ b/patches/server/1019-Improve-performance-of-mass-crafts.patch
diff --git a/patches/server/1021-Properly-resend-entities.patch b/patches/server/1020-Properly-resend-entities.patch
index 6e61a43375..6e61a43375 100644
--- a/patches/server/1021-Properly-resend-entities.patch
+++ b/patches/server/1020-Properly-resend-entities.patch
diff --git a/patches/server/1022-Registry-Modification-API.patch b/patches/server/1021-Registry-Modification-API.patch
index dc555c750d..dc555c750d 100644
--- a/patches/server/1022-Registry-Modification-API.patch
+++ b/patches/server/1021-Registry-Modification-API.patch
diff --git a/patches/server/1023-Add-registry-entry-and-builders.patch b/patches/server/1022-Add-registry-entry-and-builders.patch
index 1b920c14d0..1b920c14d0 100644
--- a/patches/server/1023-Add-registry-entry-and-builders.patch
+++ b/patches/server/1022-Add-registry-entry-and-builders.patch
diff --git a/patches/server/1024-Improved-Watchdog-Support.patch b/patches/server/1023-Improved-Watchdog-Support.patch
index 2e3fc383a2..2a66e33d6e 100644
--- a/patches/server/1024-Improved-Watchdog-Support.patch
+++ b/patches/server/1023-Improved-Watchdog-Support.patch
@@ -71,7 +71,7 @@ index 589a8bf75be6ccc59f1e5dd5d8d9afed41c4772d..b24265573fdef5d9a964bcd76146f345
cause = cause.getCause();
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 17b0e570016504d1b7704bbfa9ff2e3233b45d09..5d41801c2378ac27b67b977a8ab30158b717d4d3 100644
+index fb3dcce4e1888f96fdd260740d9d955962d879fc..25300f6011c213b67876552abcb12c290d586fe4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -307,7 +307,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -92,7 +92,7 @@ index 17b0e570016504d1b7704bbfa9ff2e3233b45d09..5d41801c2378ac27b67b977a8ab30158
+
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
- Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
+ Thread thread = new ca.spottedleaf.moonrise.common.util.TickThread(() -> { // Paper - rewrite chunk system
@@ -1005,6 +1008,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start
private boolean hasStopped = false;
@@ -203,7 +203,7 @@ index 17b0e570016504d1b7704bbfa9ff2e3233b45d09..5d41801c2378ac27b67b977a8ab30158
return new TickTask(this.tickCount, runnable);
}
-@@ -2267,7 +2310,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2266,7 +2309,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.worldData.setDataConfiguration(worlddataconfiguration);
this.resources.managers.updateRegistryTags();
this.potionBrewing = this.potionBrewing.reload(this.worldData.enabledFeatures()); // Paper - Custom Potion Mixes
@@ -278,7 +278,7 @@ index 2510589400b3012b827efcab477c6483d9d55901..43487a9ee202c5b0e5a416519939111f
}
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 20a7971b75ee39bceedf7670a5c600fd014db4cb..bbb0d543197001fe8bb5179dde7201327fec4274 100644
+index 9501a2527bb0db91dd5494ccb4066b9629993e59..211fa580238bbbecf29d9b39551f0cab5a3d3bcd 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1419,6 +1419,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -290,10 +290,10 @@ index 20a7971b75ee39bceedf7670a5c600fd014db4cb..bbb0d543197001fe8bb5179dde720132
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, throwable);
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-index d4429eedd9164d4b7c367345a8c662a1129d0430..db55e9cc3d42ba01f75f6697924baaeccb564b90 100644
+index 8c865cd4e50ad55679a8bd89835caa40cc101f35..5453b7051337908ac1c8201827c1b5eec9e1608b 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -1028,6 +1028,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -1039,6 +1039,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
gameprofilerfiller.pop();
} catch (Throwable throwable) {
@@ -348,18 +348,18 @@ index 39e56b95aaafbcd8ebe68fdefaace83702e9510d..3ba27955548a26367a87d6b87c3c61be
String[] split = restartScript.split( " " );
if ( split.length > 0 && new File( split[0] ).isFile() )
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
-index bab2bd91528a8b2e9e74a3f9eb061d52619102f6..8ef5c345b7ba5ef869a1b0468f431c0f47cf2319 100644
+index 529df2a41dd93d6e1505053bd04032dbf0cdaa31..c9e17225bc52fe5e7b2dc0908db225a86c6e94d1 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -11,6 +11,7 @@ import org.bukkit.Bukkit;
- public class WatchdogThread extends io.papermc.paper.util.TickThread // Paper - rewrite chunk system
+ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThread // Paper - rewrite chunk system
{
+ public static final boolean DISABLE_WATCHDOG = Boolean.getBoolean("disable.watchdog"); // Paper - Improved watchdog support
private static WatchdogThread instance;
private long timeoutTime;
private boolean restart;
-@@ -39,6 +40,7 @@ public class WatchdogThread extends io.papermc.paper.util.TickThread // Paper -
+@@ -39,6 +40,7 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
{
if ( WatchdogThread.instance == null )
{
@@ -367,7 +367,7 @@ index bab2bd91528a8b2e9e74a3f9eb061d52619102f6..8ef5c345b7ba5ef869a1b0468f431c0f
WatchdogThread.instance = new WatchdogThread( timeoutTime * 1000L, restart );
WatchdogThread.instance.start();
} else
-@@ -70,12 +72,13 @@ public class WatchdogThread extends io.papermc.paper.util.TickThread // Paper -
+@@ -70,12 +72,13 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
// Paper start
Logger log = Bukkit.getServer().getLogger();
long currentTime = WatchdogThread.monotonicMillis();
@@ -384,7 +384,7 @@ index bab2bd91528a8b2e9e74a3f9eb061d52619102f6..8ef5c345b7ba5ef869a1b0468f431c0f
lastEarlyWarning = currentTime;
if (isLongTimeout) {
// Paper end
-@@ -136,9 +139,24 @@ public class WatchdogThread extends io.papermc.paper.util.TickThread // Paper -
+@@ -136,9 +139,24 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
if ( isLongTimeout )
{
diff --git a/patches/server/1025-Proxy-ItemStack-to-CraftItemStack.patch b/patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch
index eb49cbe5f4..eb49cbe5f4 100644
--- a/patches/server/1025-Proxy-ItemStack-to-CraftItemStack.patch
+++ b/patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch
diff --git a/patches/server/1026-Make-a-PDC-view-accessible-directly-from-ItemStack.patch b/patches/server/1025-Make-a-PDC-view-accessible-directly-from-ItemStack.patch
index bb97ac9fc5..bb97ac9fc5 100644
--- a/patches/server/1026-Make-a-PDC-view-accessible-directly-from-ItemStack.patch
+++ b/patches/server/1025-Make-a-PDC-view-accessible-directly-from-ItemStack.patch
diff --git a/patches/server/1027-Prioritize-Minecraft-commands-in-function-parsing-an.patch b/patches/server/1026-Prioritize-Minecraft-commands-in-function-parsing-an.patch
index 6e36d9a7b3..6e36d9a7b3 100644
--- a/patches/server/1027-Prioritize-Minecraft-commands-in-function-parsing-an.patch
+++ b/patches/server/1026-Prioritize-Minecraft-commands-in-function-parsing-an.patch
diff --git a/patches/server/1028-optimize-dirt-and-snow-spreading.patch b/patches/server/1027-optimize-dirt-and-snow-spreading.patch
index 49de7fcab9..49de7fcab9 100644
--- a/patches/server/1028-optimize-dirt-and-snow-spreading.patch
+++ b/patches/server/1027-optimize-dirt-and-snow-spreading.patch
diff --git a/patches/server/1029-Fix-NPE-for-Jukebox-setRecord.patch b/patches/server/1028-Fix-NPE-for-Jukebox-setRecord.patch
index e15a77ee75..e15a77ee75 100644
--- a/patches/server/1029-Fix-NPE-for-Jukebox-setRecord.patch
+++ b/patches/server/1028-Fix-NPE-for-Jukebox-setRecord.patch
diff --git a/patches/server/1030-Fix-CraftWorld-isChunkGenerated.patch b/patches/server/1029-Fix-CraftWorld-isChunkGenerated.patch
index f91e8b2bd0..48ae6e61ad 100644
--- a/patches/server/1030-Fix-CraftWorld-isChunkGenerated.patch
+++ b/patches/server/1029-Fix-CraftWorld-isChunkGenerated.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Fix CraftWorld#isChunkGenerated
The upstream implementation is returning true for non-full chunks.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index fe9e8d1d4ae1f7a4e8f4cf5688004fc969422b3c..8045d6c9398d1c88595da6e41aa1ed27fb6fbad0 100644
+index 86ed89a2eae5f36d902cd8dc4bd0389e066b4bba..362ca138a5cd5ad19f1300015c2571794adc3649 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -367,11 +367,28 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -28,7 +28,7 @@ index fe9e8d1d4ae1f7a4e8f4cf5688004fc969422b3c..8045d6c9398d1c88595da6e41aa1ed27
+ return chunk instanceof ImposterProtoChunk || chunk instanceof net.minecraft.world.level.chunk.LevelChunk;
}
+ final java.util.concurrent.CompletableFuture<ChunkAccess> future = new java.util.concurrent.CompletableFuture<>();
-+ ca.spottedleaf.moonrise.patches.chunk_system.ChunkSystem.scheduleChunkLoad(
++ ca.spottedleaf.moonrise.common.util.ChunkSystem.scheduleChunkLoad(
+ this.world, x, z, false, ChunkStatus.EMPTY, true, ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority.NORMAL, future::complete
+ );
+ world.getChunkSource().mainThreadProcessor.managedBlock(future::isDone);
diff --git a/patches/server/1031-Add-debug-for-chunk-system-unload-crash.patch b/patches/server/1030-Add-debug-for-chunk-system-unload-crash.patch
index 401b927f05..206968f773 100644
--- a/patches/server/1031-Add-debug-for-chunk-system-unload-crash.patch
+++ b/patches/server/1030-Add-debug-for-chunk-system-unload-crash.patch
@@ -14,10 +14,10 @@ on chunk holder remove if the holder is present in the unload queue
and log the stacktrace.
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
-index d5fc5756ea960096ff23376a6b7ac68a2a462d22..0715514c8bb49c805b04f42ff37903a7d590aaa8 100644
+index 1dfddea4fd7e89fb6fd9fa49f7ab5e6f48e6ef3c..4068138e4ec0ccb02f5925f8b5a31381882f08e0 100644
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
-@@ -748,9 +748,22 @@ public final class NewChunkHolder {
+@@ -749,9 +749,22 @@ public final class NewChunkHolder {
/** Unloaded from chunk map */
private boolean unloaded;
@@ -40,7 +40,7 @@ index d5fc5756ea960096ff23376a6b7ac68a2a462d22..0715514c8bb49c805b04f42ff37903a7
}
private boolean inUnloadQueue = false;
-@@ -768,12 +781,14 @@ public final class NewChunkHolder {
+@@ -769,12 +782,14 @@ public final class NewChunkHolder {
// ensure in unload queue
if (!this.inUnloadQueue) {
this.inUnloadQueue = true;
diff --git a/patches/server/1032-fix-horse-inventories.patch b/patches/server/1031-fix-horse-inventories.patch
index e8388a0c72..e8388a0c72 100644
--- a/patches/server/1032-fix-horse-inventories.patch
+++ b/patches/server/1031-fix-horse-inventories.patch
diff --git a/patches/server/1033-Only-call-EntityDamageEvents-before-actuallyHurt.patch b/patches/server/1032-Only-call-EntityDamageEvents-before-actuallyHurt.patch
index 1b7439c07a..1b7439c07a 100644
--- a/patches/server/1033-Only-call-EntityDamageEvents-before-actuallyHurt.patch
+++ b/patches/server/1032-Only-call-EntityDamageEvents-before-actuallyHurt.patch
diff --git a/patches/server/1034-Fix-entity-tracker-desync-when-new-players-are-added.patch b/patches/server/1033-Fix-entity-tracker-desync-when-new-players-are-added.patch
index 024bf5125d..5dfbf91a2f 100644
--- a/patches/server/1034-Fix-entity-tracker-desync-when-new-players-are-added.patch
+++ b/patches/server/1033-Fix-entity-tracker-desync-when-new-players-are-added.patch
@@ -48,10 +48,10 @@ index 1a5e73fd97781f3903e5ef13aa0352c64fbc2cc1..4126d82e83810126eb4a41b4587dc993
entityTrackerEntry.getLastSentYRot(),
entity.getType(),
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 344966d3deb640eb99bc9c9e318e6e6780421907..6df79aab2f0a75bbe347dc92e9ed5d62ceec7983 100644
+index dc64227e3b0d7855ef8870935aa437b78eea2407..4799af2ce8f44e8f99365323d57f099c551a5eb7 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1302,6 +1302,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1269,6 +1269,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.serverEntity.addPairing(player);
}
// Paper end - entity tracking events
diff --git a/patches/server/1035-Lag-compensation-ticks.patch b/patches/server/1034-Lag-compensation-ticks.patch
index 34a7372bd6..ad77998efa 100644
--- a/patches/server/1035-Lag-compensation-ticks.patch
+++ b/patches/server/1034-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 5d41801c2378ac27b67b977a8ab30158b717d4d3..c0935474538849b9274fab8fad13b8aa56b58f1f 100644
+index 25300f6011c213b67876552abcb12c290d586fe4..3431a075cdfcd21a236f3350decb46068fd2e6b8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -322,6 +322,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -19,7 +19,7 @@ index 5d41801c2378ac27b67b977a8ab30158b717d4d3..c0935474538849b9274fab8fad13b8aa
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
-@@ -1766,6 +1767,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1765,6 +1766,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
@@ -28,11 +28,11 @@ index 5d41801c2378ac27b67b977a8ab30158b717d4d3..c0935474538849b9274fab8fad13b8aa
this.profiler.push(() -> {
String s = String.valueOf(worldserver);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index a994456adb0034c0662151f4ae28c1c06f91333e..bee76ffe45e97c9c03430cf5a52d279421bc6536 100644
+index 472655c55b1f5c213da9b6c1940a353bafdac509..86288143a54e1d786672a81c05698b37fa5d8de2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -509,6 +509,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
- return this.nearbyPlayers;
+@@ -528,6 +528,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+ return this.entityTickingChunks;
}
// Paper end - rewrite chunk system
+ // Paper start - lag compensation
diff --git a/patches/server/1036-Detail-more-information-in-watchdog-dumps.patch b/patches/server/1035-Detail-more-information-in-watchdog-dumps.patch
index e629b56acf..23700d6582 100644
--- a/patches/server/1036-Detail-more-information-in-watchdog-dumps.patch
+++ b/patches/server/1035-Detail-more-information-in-watchdog-dumps.patch
@@ -76,10 +76,10 @@ index d0d36a57ec4896bcb74970f8fb24d8f3e17db133..e2c24813f59c2fd075c740ac1842a38f
});
throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index bee76ffe45e97c9c03430cf5a52d279421bc6536..e4cdbbf8a37f1363711ecd23f9c0eadcc95f7209 100644
+index 86288143a54e1d786672a81c05698b37fa5d8de2..1d74a728c03e2c6ffe0e795a5f24eac471a75157 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1223,7 +1223,26 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1242,7 +1242,26 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
@@ -97,7 +97,7 @@ index bee76ffe45e97c9c03430cf5a52d279421bc6536..e4cdbbf8a37f1363711ecd23f9c0eadc
+
public void tickNonPassenger(Entity entity) {
+ // Paper start - log detailed entity tick information
-+ io.papermc.paper.util.TickThread.ensureTickThread("Cannot tick an entity off-main");
++ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot tick an entity off-main");
+ try {
+ if (currentlyTickingEntity.get() == null) {
+ currentlyTickingEntity.lazySet(entity);
@@ -106,7 +106,7 @@ index bee76ffe45e97c9c03430cf5a52d279421bc6536..e4cdbbf8a37f1363711ecd23f9c0eadc
++TimingHistory.entityTicks; // Paper - timings
// Spigot start
co.aikar.timings.Timing timer; // Paper
-@@ -1263,7 +1282,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1282,7 +1301,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.tickPassenger(entity, entity1);
}
// } finally { timer.stopTiming(); } // Paper - timings - move up
@@ -122,7 +122,7 @@ index bee76ffe45e97c9c03430cf5a52d279421bc6536..e4cdbbf8a37f1363711ecd23f9c0eadc
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 5608576f461ce9dec9827f9f581adc5d5757baf1..be9976a994dd04cf53048567576dd3484facf625 100644
+index 5608576f461ce9dec9827f9f581adc5d5757baf1..f0eb2fcbaadb5796cb48050d2f9f88a6100bdb4a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1086,8 +1086,43 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -157,7 +157,7 @@ index 5608576f461ce9dec9827f9f581adc5d5757baf1..be9976a994dd04cf53048567576dd348
public void move(MoverType movementType, Vec3 movement) {
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
+ // Paper start - detailed watchdog information
-+ io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
++ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
+ synchronized (this.posLock) {
+ this.moveStartX = this.getX();
+ this.moveStartY = this.getY();
@@ -204,10 +204,10 @@ index 5608576f461ce9dec9827f9f581adc5d5757baf1..be9976a994dd04cf53048567576dd348
int j = Mth.floor(y);
int k = Mth.floor(z);
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
-index 8ef5c345b7ba5ef869a1b0468f431c0f47cf2319..5e583d7226ce60d965ce9f019900793d45742d30 100644
+index c9e17225bc52fe5e7b2dc0908db225a86c6e94d1..f7a4fee9bb25ff256dc2e5ea26bfbceca6a49167 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
-@@ -22,6 +22,78 @@ public class WatchdogThread extends io.papermc.paper.util.TickThread // Paper -
+@@ -22,6 +22,78 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
private volatile long lastTick;
private volatile boolean stopping;
@@ -286,7 +286,7 @@ index 8ef5c345b7ba5ef869a1b0468f431c0f47cf2319..5e583d7226ce60d965ce9f019900793d
private WatchdogThread(long timeoutTime, boolean restart)
{
super( "Paper Watchdog Thread" );
-@@ -119,6 +191,7 @@ public class WatchdogThread extends io.papermc.paper.util.TickThread // Paper -
+@@ -119,6 +191,7 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
log.log( Level.SEVERE, "------------------------------" );
log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(MinecraftServer.getServer(), isLongTimeout); // Paper - rewrite chunk system
diff --git a/patches/server/1037-Write-SavedData-IO-async.patch b/patches/server/1036-Write-SavedData-IO-async.patch
index 1565f5f4e4..8f31373c74 100644
--- a/patches/server/1037-Write-SavedData-IO-async.patch
+++ b/patches/server/1036-Write-SavedData-IO-async.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Write SavedData IO async
Co-Authored-By: Shane Freeder <[email protected]>
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 61e222fb129c5733411ce95aaa5f035dbd95b01a..3575fe6f57457ab865a29d20836512f6f5a98115 100644
+index 5f195875564822f422127462fbbeea5df4a4e1cb..5149f7a5f0ee8620df582dcf26151e5842463cae 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -370,6 +370,13 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -368,6 +368,13 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
public void close(boolean save) throws IOException {
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.close(save, true); // Paper - rewrite chunk system
@@ -24,10 +24,10 @@ index 61e222fb129c5733411ce95aaa5f035dbd95b01a..3575fe6f57457ab865a29d20836512f6
// CraftBukkit start - modelled on below
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index e4cdbbf8a37f1363711ecd23f9c0eadcc95f7209..9b463cd43bcf763faab04012137695a575f16729 100644
+index 1d74a728c03e2c6ffe0e795a5f24eac471a75157..46e8dd8dae25e1b2124e9c8031844fbe96eb6e1a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1354,7 +1354,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1373,7 +1373,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
}
@@ -36,7 +36,7 @@ index e4cdbbf8a37f1363711ecd23f9c0eadcc95f7209..9b463cd43bcf763faab04012137695a5
if (progressListener != null) {
progressListener.progressStage(Component.translatable("menu.savingChunks"));
}
-@@ -1385,12 +1385,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1404,12 +1404,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// CraftBukkit end
}
diff --git a/patches/server/1038-Correctly-call-PlayerItemBreakEvent.patch b/patches/server/1037-Correctly-call-PlayerItemBreakEvent.patch
index 6637cd6cd0..6637cd6cd0 100644
--- a/patches/server/1038-Correctly-call-PlayerItemBreakEvent.patch
+++ b/patches/server/1037-Correctly-call-PlayerItemBreakEvent.patch
diff --git a/patches/server/1039-Add-ItemType-getItemRarity.patch b/patches/server/1038-Add-ItemType-getItemRarity.patch
index 35ebf5036b..35ebf5036b 100644
--- a/patches/server/1039-Add-ItemType-getItemRarity.patch
+++ b/patches/server/1038-Add-ItemType-getItemRarity.patch
diff --git a/patches/server/1040-Incremental-chunk-and-player-saving.patch b/patches/server/1039-Incremental-chunk-and-player-saving.patch
index f6f0f055f9..9f7aaf836e 100644
--- a/patches/server/1040-Incremental-chunk-and-player-saving.patch
+++ b/patches/server/1039-Incremental-chunk-and-player-saving.patch
@@ -5,7 +5,7 @@ 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 c0935474538849b9274fab8fad13b8aa56b58f1f..aeae4f8d4ead24db315631c3d2c0b930d0d51e02 100644
+index 3431a075cdfcd21a236f3350decb46068fd2e6b8..86f890280bfabac3b14b771ae67d28653ab2e3e8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -992,7 +992,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -52,14 +52,14 @@ index c0935474538849b9274fab8fad13b8aa56b58f1f..aeae4f8d4ead24db315631c3d2c0b930
}
+ this.profiler.pop();
+ // Paper end - Incremental chunk and player saving
- io.papermc.paper.util.CachedLists.reset(); // Paper
// Paper start - move executeAll() into full server tick timing
try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
+ this.runAllTasks();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 9b463cd43bcf763faab04012137695a575f16729..b3ca52c0a1c4c9c2f4d86b83ad2d6308e3ba9e7c 100644
+index 46e8dd8dae25e1b2124e9c8031844fbe96eb6e1a..2766ec28f028c0bd672009928bf64c1a6e5d07d6 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1339,6 +1339,35 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1358,6 +1358,35 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos);
}
@@ -96,7 +96,7 @@ index 9b463cd43bcf763faab04012137695a575f16729..b3ca52c0a1c4c9c2f4d86b83ad2d6308
// Paper start - 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 9d1e68c09fa7093cf0f6fa636f90cb15a44cbb38..71882332ee61023d656a6de3955ca34fcef1f536 100644
+index 13ec84754b4fb5e8442fe305d70a24e420945181..0b6ce3b157c8822c39c492161571c0887ab26262 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -202,6 +202,7 @@ import org.bukkit.inventory.MainHand;
diff --git a/patches/server/1041-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/1040-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch
index 086d5b0db1..3b391d165a 100644
--- a/patches/server/1041-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch
+++ b/patches/server/1040-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch
@@ -10,7 +10,7 @@ hoping that at least then we don't swap chunks, and maybe recover
them all.
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 6d461849da76894244e6212a75da0c6e4fb459c3..ecf7ba97d397e15e4fcaf4c1e1f48bb7972e60dc 100644
+index 711541a9b12b823c1da779ed6027a53e9078a733..4bd048387651250135f963303c78c17f8473cfee 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
@@ -72,6 +72,18 @@ import net.minecraft.world.ticks.ProtoChunkTicks;