aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-01-24 13:07:40 +0100
committerNassim Jahnke <[email protected]>2024-01-24 13:42:24 +0100
commitad2cf68a7fb98f1ecdb766cc5a69ab86953a21f3 (patch)
treed3dd57ebed22efd67c5917db75258a201265a64a
parent51bef80755a18eb3fa58ba42b1926174d5e7a76d (diff)
downloadPaper-ad2cf68a7fb98f1ecdb766cc5a69ab86953a21f3.tar.gz
Paper-ad2cf68a7fb98f1ecdb766cc5a69ab86953a21f3.zip
[ci skip] Move chunk system patch back a bit
-rw-r--r--patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch (renamed from patches/server/0019-Add-command-line-option-to-load-extra-plugin-jars-no.patch)4
-rw-r--r--patches/server/0019-Support-components-in-ItemMeta.patch (renamed from patches/server/0399-Support-components-in-ItemMeta.patch)10
-rw-r--r--patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch2
-rw-r--r--patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch16
-rw-r--r--patches/server/0029-Add-version-history-to-version-command.patch2
-rw-r--r--patches/server/0030-Player-affects-spawning-API.patch10
-rw-r--r--patches/server/0031-Only-refresh-abilities-if-needed.patch4
-rw-r--r--patches/server/0032-fix-ItemMeta-removing-CustomModelData.patch2
-rw-r--r--patches/server/0033-Entity-Origin-API.patch10
-rw-r--r--patches/server/0034-Prevent-block-entity-and-entity-crashes.patch8
-rw-r--r--patches/server/0035-Configurable-top-of-nether-void-damage.patch4
-rw-r--r--patches/server/0037-Always-tick-falling-blocks.patch2
-rw-r--r--patches/server/0038-Configurable-end-credits.patch4
-rw-r--r--patches/server/0040-Optimize-explosions.patch6
-rw-r--r--patches/server/0042-Disable-thunder.patch4
-rw-r--r--patches/server/0043-Disable-ice-and-snow.patch4
-rw-r--r--patches/server/0045-Implement-PlayerLocaleChangeEvent.patch10
-rw-r--r--patches/server/0047-Configurable-container-update-tick-rate.patch4
-rw-r--r--patches/server/0049-Disable-spigot-tick-limiters.patch4
-rw-r--r--patches/server/0050-Add-PlayerInitialSpawnEvent.patch2
-rw-r--r--patches/server/0052-Improve-Player-chat-API-handling.patch12
-rw-r--r--patches/server/0053-All-chunks-are-slime-spawn-chunks-toggle.patch4
-rw-r--r--patches/server/0054-Expose-server-CommandMap.patch2
-rw-r--r--patches/server/0056-Player-Tab-List-and-Title-APIs.patch4
-rw-r--r--patches/server/0057-Add-configurable-portal-search-radius.patch6
-rw-r--r--patches/server/0058-Add-velocity-warnings.patch45
-rw-r--r--patches/server/0059-Configurable-inter-world-teleportation-safety.patch4
-rw-r--r--patches/server/0060-Add-exception-reporting-event.patch16
-rw-r--r--patches/server/0061-Disable-Scoreboards-for-non-players-by-default.patch4
-rw-r--r--patches/server/0063-Chunk-Save-Reattempt.patch43
-rw-r--r--patches/server/0064-Complete-resource-pack-API.patch4
-rw-r--r--patches/server/0065-Default-loading-permissions.yml-before-plugins.patch2
-rw-r--r--patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch2
-rw-r--r--patches/server/0067-Remove-Metadata-on-reload.patch2
-rw-r--r--patches/server/0068-Handle-Item-Meta-Inconsistencies.patch8
-rw-r--r--patches/server/0070-Add-World-Util-Methods.patch2
-rw-r--r--patches/server/0071-Custom-replacement-for-eaten-items.patch2
-rw-r--r--patches/server/0072-handle-NaN-health-absorb-values-and-repair-bad-data.patch4
-rw-r--r--patches/server/0073-Use-a-Shared-Random-for-Entities.patch4
-rw-r--r--patches/server/0074-Configurable-spawn-chances-for-skeleton-horses.patch4
-rw-r--r--patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch10
-rw-r--r--patches/server/0076-Entity-AddTo-RemoveFrom-World-Events.patch6
-rw-r--r--patches/server/0077-Configurable-Chunk-Inhabited-Time.patch4
-rw-r--r--patches/server/0079-Sanitise-RegionFileCache-and-make-configurable.patch12
-rw-r--r--patches/server/0081-Add-PlayerUseUnknownEntityEvent.patch4
-rw-r--r--patches/server/0083-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch4
-rw-r--r--patches/server/0086-Configurable-Player-Collision.patch4
-rw-r--r--patches/server/0091-remove-null-possibility-for-getServer-singleton.patch4
-rw-r--r--patches/server/0093-LootTable-API-and-replenishable-lootables.patch2
-rw-r--r--patches/server/0094-System-property-for-disabling-watchdoge.patch4
-rw-r--r--patches/server/0095-Async-GameProfileCache-saving.patch8
-rw-r--r--patches/server/0097-Faster-redstone-torch-rapid-clock-removal.patch2
-rw-r--r--patches/server/0098-Add-server-name-parameter.patch2
-rw-r--r--patches/server/0099-Fix-global-sound-handling.patch13
-rw-r--r--patches/server/0102-Add-setting-for-proxy-online-mode-status.patch6
-rw-r--r--patches/server/0104-Configurable-packet-in-spam-threshold.patch4
-rw-r--r--patches/server/0105-Configurable-flying-kick-messages.patch2
-rw-r--r--patches/server/0107-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch2
-rw-r--r--patches/server/0109-Allow-Reloading-of-Command-Aliases.patch2
-rw-r--r--patches/server/0113-Optimize-Level.hasChunkAt-BlockPosition-Z.patch2
-rw-r--r--patches/server/0114-Bound-Treasure-Maps-to-World-Border.patch2
-rw-r--r--patches/server/0117-String-based-Action-Bar-API.patch4
-rw-r--r--patches/server/0118-Properly-fix-item-duplication-bug.patch4
-rw-r--r--patches/server/0121-Provide-E-TE-Chunk-count-stat-methods.patch4
-rw-r--r--patches/server/0122-Enforce-Sync-Player-Saves.patch2
-rw-r--r--patches/server/0123-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch2
-rw-r--r--patches/server/0124-Cap-Entity-Collisions.patch2
-rw-r--r--patches/server/0126-Properly-handle-async-calls-to-restart-the-server.patch8
-rw-r--r--patches/server/0127-Add-option-to-make-parrots-stay-on-shoulders-despite.patch4
-rw-r--r--patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch2
-rw-r--r--patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch12
-rw-r--r--patches/server/0131-Item-canEntityPickup.patch2
-rw-r--r--patches/server/0135-Basic-PlayerProfile-API.patch12
-rw-r--r--patches/server/0136-Add-UnknownCommandEvent.patch2
-rw-r--r--patches/server/0140-Entity-fromMobSpawner.patch6
-rw-r--r--patches/server/0144-ProfileWhitelistVerifyEvent.patch2
-rw-r--r--patches/server/0145-Fix-this-stupid-bullshit.patch2
-rw-r--r--patches/server/0148-Reset-spawner-timer-when-spawner-event-is-cancelled.patch2
-rw-r--r--patches/server/0152-Add-PlayerJumpEvent.patch4
-rw-r--r--patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch4
-rw-r--r--patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch6
-rw-r--r--patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch4
-rw-r--r--patches/server/0161-API-to-get-a-BlockState-without-a-snapshot.patch2
-rw-r--r--patches/server/0162-AsyncTabCompleteEvent.patch10
-rw-r--r--patches/server/0164-Ability-to-apply-mending-to-XP-API.patch4
-rw-r--r--patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch16
-rw-r--r--patches/server/0167-PreCreatureSpawnEvent.patch2
-rw-r--r--patches/server/0170-Add-ArmorStand-Item-Meta.patch4
-rw-r--r--patches/server/0175-Implement-extended-PaperServerListPingEvent.patch4
-rw-r--r--patches/server/0177-Player.setPlayerProfile-API.patch20
-rw-r--r--patches/server/0178-getPlayerUniqueId-API.patch2
-rw-r--r--patches/server/0182-Flag-to-disable-the-channel-limit.patch4
-rw-r--r--patches/server/0187-Block-Enderpearl-Travel-Exploit.patch4
-rw-r--r--patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch8
-rw-r--r--patches/server/0203-Add-EntityKnockbackByEntityEvent-and-EntityPushedByE.patch4
-rw-r--r--patches/server/0204-Expand-Explosions-API.patch4
-rw-r--r--patches/server/0208-Implement-World.getEntity-UUID-API.patch4
-rw-r--r--patches/server/0209-InventoryCloseEvent-Reason-API.patch26
-rw-r--r--patches/server/0211-Refresh-player-inventory-when-cancelling-PlayerInter.patch4
-rw-r--r--patches/server/0213-add-more-information-to-Entity.toString.patch4
-rw-r--r--patches/server/0218-Option-to-prevent-armor-stands-from-doing-entity-loo.patch4
-rw-r--r--patches/server/0219-Vanished-players-don-t-have-rights.patch2
-rw-r--r--patches/server/0221-SkeletonHorse-Additions.patch4
-rw-r--r--patches/server/0226-Break-up-and-make-tab-spam-limits-configurable.patch2
-rw-r--r--patches/server/0229-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch12
-rw-r--r--patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch34
-rw-r--r--patches/server/0231-Use-ConcurrentHashMap-in-JsonList.patch2
-rw-r--r--patches/server/0232-Use-a-Queue-for-Queueing-Commands.patch10
-rw-r--r--patches/server/0233-Ability-to-get-block-entities-from-a-chunk-without-s.patch6
-rw-r--r--patches/server/0243-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch4
-rw-r--r--patches/server/0245-Expose-attack-cooldown-methods-for-Player.patch4
-rw-r--r--patches/server/0246-Improve-death-events.patch12
-rw-r--r--patches/server/0249-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch14
-rw-r--r--patches/server/0257-PreSpawnerSpawnEvent.patch2
-rw-r--r--patches/server/0259-Add-sun-related-API.patch4
-rw-r--r--patches/server/0260-Catch-JsonParseException-in-entity-and-block-entity-.patch6
-rw-r--r--patches/server/0262-Call-player-spectator-target-events-and-improve-impl.patch4
-rw-r--r--patches/server/0265-Add-option-to-prevent-players-from-moving-into-unloa.patch6
-rw-r--r--patches/server/0266-Reset-players-airTicks-on-respawn.patch4
-rw-r--r--patches/server/0268-Improve-Server-Thread-Pool-and-Thread-Priorities.patch2
-rw-r--r--patches/server/0269-Optimize-World-Time-Updates.patch4
-rw-r--r--patches/server/0272-Don-t-allow-digging-into-unloaded-chunks.patch4
-rw-r--r--patches/server/0273-Make-the-default-permission-message-configurable.patch6
-rw-r--r--patches/server/0275-force-entity-dismount-during-teleportation.patch10
-rw-r--r--patches/server/0276-Add-more-Zombie-API.patch2
-rw-r--r--patches/server/0277-Book-Size-Limits.patch4
-rw-r--r--patches/server/0279-Replace-OfflinePlayer-getLastPlayed.patch12
-rw-r--r--patches/server/0280-Workaround-for-vehicle-tracking-issue-on-disconnect.patch4
-rw-r--r--patches/server/0281-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch4
-rw-r--r--patches/server/0282-BlockDestroyEvent.patch4
-rw-r--r--patches/server/0283-Async-command-map-building.patch4
-rw-r--r--patches/server/0284-Brigadier-Mojang-API.patch6
-rw-r--r--patches/server/0286-Limit-Client-Sign-length-more.patch4
-rw-r--r--patches/server/0287-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch2
-rw-r--r--patches/server/0288-Entity-getEntitySpawnReason.patch10
-rw-r--r--patches/server/0290-Add-PlayerPostRespawnEvent.patch2
-rw-r--r--patches/server/0292-Server-Tick-Events.patch6
-rw-r--r--patches/server/0293-PlayerDeathEvent-getItemsToKeep.patch6
-rw-r--r--patches/server/0294-Optimize-Captured-BlockEntity-Lookup.patch6
-rw-r--r--patches/server/0295-Add-Heightmap-API.patch2
-rw-r--r--patches/server/0296-Mob-Spawner-API-Enhancements.patch2
-rw-r--r--patches/server/0300-Configurable-Keep-Spawn-Loaded-range-per-world.patch10
-rw-r--r--patches/server/0301-Expose-the-internal-current-tick.patch2
-rw-r--r--patches/server/0311-Duplicate-UUID-Resolve-Option.patch14
-rw-r--r--patches/server/0312-PlayerDeathEvent-shouldDropExperience.patch4
-rw-r--r--patches/server/0315-Optimise-EntityGetter-getPlayerByUUID.patch6
-rw-r--r--patches/server/0316-Fix-items-not-falling-correctly.patch4
-rw-r--r--patches/server/0317-Optimize-call-to-getFluid-for-explosions.patch2
-rw-r--r--patches/server/0319-Guard-against-serializing-mismatching-chunk-coordina.patch32
-rw-r--r--patches/server/0321-Tracking-Range-Improvements.patch4
-rw-r--r--patches/server/0322-Fix-items-vanishing-through-end-portal.patch4
-rw-r--r--patches/server/0325-Optimise-getChunkAt-calls-for-loaded-chunks.patch8
-rw-r--r--patches/server/0326-Add-debug-for-sync-chunk-loads.patch28
-rw-r--r--patches/server/0327-Improve-java-version-check.patch2
-rw-r--r--patches/server/0330-Add-option-to-nerf-pigmen-from-nether-portals.patch6
-rw-r--r--patches/server/0335-Configurable-chance-of-villager-zombie-infection.patch2
-rw-r--r--patches/server/0336-Optimise-Chunk-getFluid.patch6
-rw-r--r--patches/server/0338-Add-tick-times-API-and-mspt-command.patch8
-rw-r--r--patches/server/0339-Expose-MinecraftServer-isRunning.patch2
-rw-r--r--patches/server/0341-Pillager-patrol-spawn-settings-and-per-player-option.patch2
-rw-r--r--patches/server/0342-Remote-Connections-shouldn-t-hold-up-shutdown.patch2
-rw-r--r--patches/server/0344-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch10
-rw-r--r--patches/server/0345-Don-t-tick-dead-players.patch4
-rw-r--r--patches/server/0347-Don-t-move-existing-players-to-world-spawn.patch8
-rw-r--r--patches/server/0351-Prevent-opening-inventories-when-frozen.patch6
-rw-r--r--patches/server/0353-Implement-Player-Client-Options-API.patch12
-rw-r--r--patches/server/0354-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch6
-rw-r--r--patches/server/0355-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch8
-rw-r--r--patches/server/0356-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch6
-rw-r--r--patches/server/0360-Fix-item-duplication-and-teleport-issues.patch12
-rw-r--r--patches/server/0362-Validate-PickItem-Packet-and-kick-for-invalid.patch4
-rw-r--r--patches/server/0363-Expose-game-version.patch2
-rw-r--r--patches/server/0364-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch2
-rw-r--r--patches/server/0365-misc-debugging-dumps.patch10
-rw-r--r--patches/server/0366-Prevent-teleporting-dead-entities.patch4
-rw-r--r--patches/server/0367-Deobfuscate-stacktraces-in-log-messages-crash-report.patch30
-rw-r--r--patches/server/0368-Implement-Mob-Goal-API.patch2
-rw-r--r--patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch6
-rw-r--r--patches/server/0385-Prevent-position-desync-causing-tp-exploit.patch4
-rw-r--r--patches/server/0388-Add-PlayerRecipeBookClickEvent.patch4
-rw-r--r--patches/server/0390-Add-permission-for-command-blocks.patch6
-rw-r--r--patches/server/0391-Ensure-Entity-position-and-AABB-are-never-invalid.patch14
-rw-r--r--patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch22
-rw-r--r--patches/server/0393-Paper-dumpitem-command.patch6
-rw-r--r--patches/server/0395-Add-Plugin-Tickets-to-API-Chunk-Methods.patch8
-rw-r--r--patches/server/0396-incremental-chunk-and-player-saving.patch22
-rw-r--r--patches/server/0398-Convert-legacy-attributes-in-Item-Meta.patch2
-rw-r--r--patches/server/0399-Rewrite-chunk-system.patch (renamed from patches/server/0018-Rewrite-chunk-system.patch)418
-rw-r--r--patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch14
-rw-r--r--patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch10
-rw-r--r--patches/server/0677-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch10
-rw-r--r--patches/server/0818-Add-paper-dumplisteners-command.patch6
-rw-r--r--patches/server/0908-Only-capture-actual-tree-growth.patch8
-rw-r--r--patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch6
-rw-r--r--patches/server/0999-Allow-Saving-of-Oversized-Chunks.patch4
-rw-r--r--patches/server/1000-Fix-World-isChunkGenerated-calls.patch4
-rw-r--r--patches/server/1003-Optional-per-player-mob-spawns.patch4
-rw-r--r--patches/server/1004-Anti-Xray.patch10
-rw-r--r--patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch4
-rw-r--r--patches/server/1006-Write-SavedData-IO-async.patch4
-rw-r--r--patches/server/1009-Improved-Watchdog-Support.patch6
-rw-r--r--patches/server/1021-Execute-chunk-tasks-mid-tick.patch8
-rw-r--r--patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch8
-rw-r--r--patches/server/1025-Detail-more-information-in-watchdog-dumps.patch6
-rw-r--r--patches/server/1030-Add-Alternate-Current-redstone-implementation.patch8
-rw-r--r--patches/server/1036-Optimise-chunk-tick-iteration.patch8
-rw-r--r--scripts/moveback.py4
207 files changed, 892 insertions, 869 deletions
diff --git a/patches/server/0019-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch
index 66ff9dd820..82fbad0ae7 100644
--- a/patches/server/0019-Add-command-line-option-to-load-extra-plugin-jars-no.patch
+++ b/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch
@@ -7,7 +7,7 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index cf05dd46b17e69e09b97d955e9c2198e78ba7f1f..668263f6b58e04461564687f75ae75504beb1996 100644
+index f7ff043c99268d5d8d139e2a4d8cd0817b7bb96b..67129bf8c109486b65504536224666b1cb033b44 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -422,6 +422,35 @@ public final class CraftServer implements Server {
@@ -47,7 +47,7 @@ index cf05dd46b17e69e09b97d955e9c2198e78ba7f1f..668263f6b58e04461564687f75ae7550
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 ff503ab0ef9f3245d8ead4519507936f1c2288cf..3436351140383f53404d37b8f974181724d13627 100644
+index 5158d536de16c93358d1b335b0fcfbe0d6ce848e..c312c450055965d63db0ccdee8aa8e34e7051d0b 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/0399-Support-components-in-ItemMeta.patch b/patches/server/0019-Support-components-in-ItemMeta.patch
index 1a69417723..5488d0c2d0 100644
--- a/patches/server/0399-Support-components-in-ItemMeta.patch
+++ b/patches/server/0019-Support-components-in-ItemMeta.patch
@@ -5,10 +5,10 @@ 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 6a3a8c4cc09a045134a7c3751b33f2763e5a4953..ad3a289af7922bfc8d503eb1da93db72b31a03f6 100644
+index fcef34d7c88f7f8e21f9789ce3d0962e64d2f092..aad1bfb515556ed98a55b181057d3ebb178ee52d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-@@ -879,11 +879,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -768,11 +768,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return CraftChatMessage.fromJSONComponent(this.displayName);
}
@@ -32,7 +32,7 @@ index 6a3a8c4cc09a045134a7c3751b33f2763e5a4953..ad3a289af7922bfc8d503eb1da93db72
@Override
public boolean hasDisplayName() {
return this.displayName != null;
-@@ -1024,6 +1036,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -913,6 +925,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.lore == null ? null : new ArrayList<String>(Lists.transform(this.lore, CraftChatMessage::fromJSONComponent));
}
@@ -47,7 +47,7 @@ index 6a3a8c4cc09a045134a7c3751b33f2763e5a4953..ad3a289af7922bfc8d503eb1da93db72
@Override
public void setLore(List<String> lore) {
if (lore == null || lore.isEmpty()) {
-@@ -1038,6 +1058,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -927,6 +947,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
}
@@ -69,7 +69,7 @@ index 6a3a8c4cc09a045134a7c3751b33f2763e5a4953..ad3a289af7922bfc8d503eb1da93db72
@Override
public boolean hasCustomModelData() {
return this.customModelData != null;
-@@ -1506,6 +1541,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1362,6 +1397,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
for (Object object : addFrom) {
diff --git a/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch b/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch
index e18525c452..84bcfe5318 100644
--- a/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch
+++ b/patches/server/0025-Allow-for-toggling-of-spawn-chunks.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Allow for toggling of spawn chunks
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index d3a7de8d3fd92d36d3df257cae5686fc7f61d3c3..0d3ce1ad077128585bb8960d2d6d38b567bbe5d3 100644
+index aa22d4024cdd0ecb1c0442ecdeae00822597362e..9cfc60863caeaa1fd0df153889cadd88fef9e111 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -264,6 +264,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
index b38ef455b6..2a2bd44930 100644
--- a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
+++ b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 75b39c8a8471bc37add3a012453c74217357535a..44715334bc69cc9b12f53cecb64381b8aef6fae3 100644
+index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..de8b12b5014e653cb96d422c74307c7fbfd1b5b5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1546,7 +1546,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1552,7 +1552,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {
@@ -19,7 +19,7 @@ index 75b39c8a8471bc37add3a012453c74217357535a..44715334bc69cc9b12f53cecb64381b8
public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index c41e0fe3421a9066a4a32e74fcc3a414d7006bbd..452fcc1106e25db87c1dd29fb839c45c63a0ce89 100644
+index 67129bf8c109486b65504536224666b1cb033b44..58c0fc6c0d5df7cd8331d742dc93aad37d6139c9 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -261,7 +261,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
@@ -63,10 +63,10 @@ index c312c450055965d63db0ccdee8aa8e34e7051d0b..9f4c5a6f22719ae30d88ca02a1db4a3f
net.minecraft.server.Main.main(options);
} catch (Throwable t) {
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
-index 7621bf889ef765ed57af221edf95b07346f4ae43..cacbde8ac27a70b5e3bcd76ad90bc667abee3817 100644
+index c4bf7053d83d207caca0e13e19f5c1afa7062de3..231b4e3552b17f7803815a433a5ece440c227cc6 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
-@@ -19,7 +19,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+@@ -19,7 +19,7 @@ public class WatchdogThread extends Thread
private WatchdogThread(long timeoutTime, boolean restart)
{
@@ -75,7 +75,7 @@ index 7621bf889ef765ed57af221edf95b07346f4ae43..cacbde8ac27a70b5e3bcd76ad90bc667
this.timeoutTime = timeoutTime;
this.restart = restart;
}
-@@ -65,14 +65,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+@@ -65,14 +65,14 @@ public class WatchdogThread extends Thread
{
Logger log = Bukkit.getServer().getLogger();
log.log( Level.SEVERE, "------------------------------" );
@@ -93,12 +93,12 @@ index 7621bf889ef765ed57af221edf95b07346f4ae43..cacbde8ac27a70b5e3bcd76ad90bc667
//
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
{
-@@ -82,7 +82,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+@@ -82,7 +82,7 @@ public class WatchdogThread extends Thread
}
//
log.log( Level.SEVERE, "------------------------------" );
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Spigot!):" );
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
- io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
log.log( Level.SEVERE, "------------------------------" );
+ //
diff --git a/patches/server/0029-Add-version-history-to-version-command.patch b/patches/server/0029-Add-version-history-to-version-command.patch
index b6afc3dbac..bddc3de96d 100644
--- a/patches/server/0029-Add-version-history-to-version-command.patch
+++ b/patches/server/0029-Add-version-history-to-version-command.patch
@@ -209,7 +209,7 @@ index 0000000000000000000000000000000000000000..660b2ec6b63a4ceffee44ab11f54dfa7
+ }
+}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index 0f516d126ce834adadd6a57a762e34c996403ab2..69e8a7551762ab6de03f43d823e2149f5f9eca70 100644
+index dfb37ddb89c2f43d9f9a34a6b2d38616575eb39b..10bf1f9237436b68b855fb63b83a4aeeddf0f0c0 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -190,6 +190,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
diff --git a/patches/server/0030-Player-affects-spawning-API.patch b/patches/server/0030-Player-affects-spawning-API.patch
index cadd2053d6..d20d31285c 100644
--- a/patches/server/0030-Player-affects-spawning-API.patch
+++ b/patches/server/0030-Player-affects-spawning-API.patch
@@ -98,10 +98,10 @@ index d156f7e3430685947d2b4c30aa867e8002ca70ad..e888cf862662ae6baa6d0de8188aa74a
public void clientTick(Level world, BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
-index 2ec2b1d9d987c7f31c685aec3d3c87f42758c94b..1872de0804862be1986b4eb2e6cfe28f952fdde6 100644
+index b6a3c75b84d9f768afee33aa0f226207b307c1c0..07e7851ca27ea0f8166be52b086a6504c0deea09 100644
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
-@@ -82,6 +82,11 @@ public interface EntityGetter {
+@@ -70,6 +70,11 @@ public interface EntityGetter {
}
}
@@ -113,7 +113,7 @@ index 2ec2b1d9d987c7f31c685aec3d3c87f42758c94b..1872de0804862be1986b4eb2e6cfe28f
@Nullable
default Player getNearestPlayer(double x, double y, double z, double maxDistance, @Nullable Predicate<Entity> targetPredicate) {
double d = -1.0D;
-@@ -111,6 +116,20 @@ public interface EntityGetter {
+@@ -99,6 +104,20 @@ public interface EntityGetter {
return this.getNearestPlayer(x, y, z, maxDistance, predicate);
}
@@ -135,10 +135,10 @@ index 2ec2b1d9d987c7f31c685aec3d3c87f42758c94b..1872de0804862be1986b4eb2e6cfe28f
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 29cefb53474080d5e524ae54e9295dd11aa6546d..e1647bc92cc3a7e887cacb8d204ffb120114ff05 100644
+index cf8a5b3ba642d4829725bc488c074b1b3b142867..aefd38e71c7c664e3eaa366b5546bb1999c2f2c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2312,6 +2312,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2270,6 +2270,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.getHandle().language;
}
diff --git a/patches/server/0031-Only-refresh-abilities-if-needed.patch b/patches/server/0031-Only-refresh-abilities-if-needed.patch
index cc292acbab..227e06994d 100644
--- a/patches/server/0031-Only-refresh-abilities-if-needed.patch
+++ b/patches/server/0031-Only-refresh-abilities-if-needed.patch
@@ -5,10 +5,10 @@ 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 e1647bc92cc3a7e887cacb8d204ffb120114ff05..7aa9787b96862e427cfd0011bccc0895b0c8f4cd 100644
+index aefd38e71c7c664e3eaa366b5546bb1999c2f2c8..eb021cd3d2eb1d4c3f4f2f42b9dbb69572fe98de 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1984,12 +1984,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1942,12 +1942,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setFlying(boolean value) {
diff --git a/patches/server/0032-fix-ItemMeta-removing-CustomModelData.patch b/patches/server/0032-fix-ItemMeta-removing-CustomModelData.patch
index e76034d354..5d5438460c 100644
--- a/patches/server/0032-fix-ItemMeta-removing-CustomModelData.patch
+++ b/patches/server/0032-fix-ItemMeta-removing-CustomModelData.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] fix ItemMeta removing CustomModelData
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index fcef34d7c88f7f8e21f9789ce3d0962e64d2f092..814c4cf3f3b0fee53cbad9855525fb18e6631748 100644
+index aad1bfb515556ed98a55b181057d3ebb178ee52d..9e11d7bccd04b4c2e6913de56a299190c22aa9c1 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -353,7 +353,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
diff --git a/patches/server/0033-Entity-Origin-API.patch b/patches/server/0033-Entity-Origin-API.patch
index b3c68af9ba..ec30ee3e45 100644
--- a/patches/server/0033-Entity-Origin-API.patch
+++ b/patches/server/0033-Entity-Origin-API.patch
@@ -5,10 +5,10 @@ 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 ded164bbc983a058c944ebf43d2f46f3deeb59da..ef26da06b13254b2b745e7e62540f78615c81252 100644
+index d00b789d8deb0163726acbcb10edb0965ac9f326..5b304c0c701a74398ba46ef8766a3d707bbe6a07 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2403,6 +2403,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2149,6 +2149,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.updateDynamicGameEventListener(DynamicGameEventListener::add);
entity.inWorld = true; // CraftBukkit - Mark entity as in world
entity.valid = true; // CraftBukkit
@@ -25,7 +25,7 @@ index ded164bbc983a058c944ebf43d2f46f3deeb59da..ef26da06b13254b2b745e7e62540f786
public void onTrackingEnd(Entity entity) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 80affc349b03d3eba394b6d882d29efb4bbbf4a2..3afb2a7b02e10976eca5bcd9cf9f29223326a1cd 100644
+index 8811646495f37587e7976edd8b9558cda412edb1..b58b5b5fa710dc453966f7ff0dea6ac16a88c99d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -319,7 +319,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -56,7 +56,7 @@ index 80affc349b03d3eba394b6d882d29efb4bbbf4a2..3afb2a7b02e10976eca5bcd9cf9f2922
public float getBukkitYaw() {
return this.yRot;
}
-@@ -2095,6 +2115,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2043,6 +2063,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.bukkitEntity.storeBukkitValues(nbttagcompound);
}
// CraftBukkit end
@@ -72,7 +72,7 @@ index 80affc349b03d3eba394b6d882d29efb4bbbf4a2..3afb2a7b02e10976eca5bcd9cf9f2922
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
-@@ -2222,6 +2251,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2170,6 +2199,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
// CraftBukkit end
diff --git a/patches/server/0034-Prevent-block-entity-and-entity-crashes.patch b/patches/server/0034-Prevent-block-entity-and-entity-crashes.patch
index 19eb8dc502..302f19b864 100644
--- a/patches/server/0034-Prevent-block-entity-and-entity-crashes.patch
+++ b/patches/server/0034-Prevent-block-entity-and-entity-crashes.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Prevent block entity and entity crashes
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 0d3ce1ad077128585bb8960d2d6d38b567bbe5d3..99133791afe8a8b5edfbe45eadfa3e0f4e4484a7 100644
+index 9cfc60863caeaa1fd0df153889cadd88fef9e111..dfe8eea789a6dd5476da0c194236dba3868a2cb7 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -739,11 +739,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -734,11 +734,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try {
tickConsumer.accept(entity);
} catch (Throwable throwable) {
@@ -44,10 +44,10 @@ index b300d12e9e00519028b53aca9c3fb01f589eaa91..66757716b401d4f5b690c895effbbaa4
}
}
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 a664126bbcd29026e9d6770e362aa04c2c0b3fc8..ae62ef9bad1774cc6aecb686660ef19244bd1365 100644
+index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..e7cfac251ebef4eda9105c4f64783a9bc3e0e59e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -1159,11 +1159,11 @@ public class LevelChunk extends ChunkAccess {
+@@ -1069,11 +1069,11 @@ public class LevelChunk extends ChunkAccess {
gameprofilerfiller.pop();
} catch (Throwable throwable) {
diff --git a/patches/server/0035-Configurable-top-of-nether-void-damage.patch b/patches/server/0035-Configurable-top-of-nether-void-damage.patch
index 29e69553ea..778ca74fbf 100644
--- a/patches/server/0035-Configurable-top-of-nether-void-damage.patch
+++ b/patches/server/0035-Configurable-top-of-nether-void-damage.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Configurable top of nether void damage
Co-authored-by: Jake Potrebic <[email protected]>
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 3afb2a7b02e10976eca5bcd9cf9f29223326a1cd..47dc48fcf1e0d3a717479ce2738bfb79961bbed3 100644
+index b58b5b5fa710dc453966f7ff0dea6ac16a88c99d..8e4f8849acfede8eec04527b67a3405ae805633d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -722,7 +722,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -670,7 +670,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public void checkBelowWorld() {
diff --git a/patches/server/0037-Always-tick-falling-blocks.patch b/patches/server/0037-Always-tick-falling-blocks.patch
index 7a7d5ab515..24f946fa58 100644
--- a/patches/server/0037-Always-tick-falling-blocks.patch
+++ b/patches/server/0037-Always-tick-falling-blocks.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Always tick falling blocks
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
-index a5ab3e1d52ff68730a4b9069e6d25a3d31c25da5..2cb5bbe371333f566b4d6d3ee8016857986e9af0 100644
+index a5da6c1cae0afbde684be250e2fc3c0c32a1265b..e5ff35531a933268f2b8b6c15c234de4482931d5 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -92,6 +92,7 @@ public class ActivationRange
diff --git a/patches/server/0038-Configurable-end-credits.patch b/patches/server/0038-Configurable-end-credits.patch
index f21417dc70..e20735f6d6 100644
--- a/patches/server/0038-Configurable-end-credits.patch
+++ b/patches/server/0038-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 682388297375ea43515388bbdf9f7d2b949a7a62..11d2a3fd4e7baa00276f358c9b97752dbc6a76fd 100644
+index 61d4afb6b76fdffdda9f01af5005f005e21f4807..c1006a1991e294fa69b1eb35f4224154b064671b 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1074,6 +1074,7 @@ public class ServerPlayer extends Player {
+@@ -1030,6 +1030,7 @@ public class ServerPlayer extends Player {
this.unRide();
this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
if (!this.wonGame) {
diff --git a/patches/server/0040-Optimize-explosions.patch b/patches/server/0040-Optimize-explosions.patch
index 229a5f849d..aba69e531a 100644
--- a/patches/server/0040-Optimize-explosions.patch
+++ b/patches/server/0040-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 44715334bc69cc9b12f53cecb64381b8aef6fae3..bb66ed2fa4bbf4e8836022b210ca754b821adf95 100644
+index de8b12b5014e653cb96d422c74307c7fbfd1b5b5..cb7dcb4dc310f1857600b340e4101e2829fcf6b6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1420,6 +1420,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1426,6 +1426,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop();
this.profiler.pop();
@@ -120,7 +120,7 @@ index c5d644876e0c92a444a574ee7571227e19b28482..4e382cfae7a3a1889bc36bad24c6ea38
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 99133791afe8a8b5edfbe45eadfa3e0f4e4484a7..6c1fe1f24f79c28508e41c55d34b7a5c6c8f5d28 100644
+index dfe8eea789a6dd5476da0c194236dba3868a2cb7..7ead83d46e7bb3ee3586acf695b08f197f61f04a 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -170,6 +170,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0042-Disable-thunder.patch b/patches/server/0042-Disable-thunder.patch
index 7f2c330269..ac0e1ec072 100644
--- a/patches/server/0042-Disable-thunder.patch
+++ b/patches/server/0042-Disable-thunder.patch
@@ -5,10 +5,10 @@ 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 ef26da06b13254b2b745e7e62540f78615c81252..6a3caf6107430e210ee1e689af2cd6d44d9c3713 100644
+index 5b304c0c701a74398ba46ef8766a3d707bbe6a07..40287f5dbdfb5526f4cba901ded9740009e29b00 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -846,7 +846,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -609,7 +609,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
ProfilerFiller gameprofilerfiller = this.getProfiler();
gameprofilerfiller.push("thunder");
diff --git a/patches/server/0043-Disable-ice-and-snow.patch b/patches/server/0043-Disable-ice-and-snow.patch
index 15a411e5eb..4ec16311b0 100644
--- a/patches/server/0043-Disable-ice-and-snow.patch
+++ b/patches/server/0043-Disable-ice-and-snow.patch
@@ -5,10 +5,10 @@ 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 6a3caf6107430e210ee1e689af2cd6d44d9c3713..a09299befdab37bfd3ceb42f9608e285eae5fde6 100644
+index 40287f5dbdfb5526f4cba901ded9740009e29b00..4b6fc197c6e0544f2ec993ea863e9dd560b05f11 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -876,11 +876,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -639,11 +639,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.popPush("iceandsnow");
diff --git a/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch b/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch
index 6687981a36..f91b88be6f 100644
--- a/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch
+++ b/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Implement PlayerLocaleChangeEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index ee35514f0bfb0499e8aab7ce702bd2e2ef09d5db..917175e54ac8979659bbfb2c2cf06431f63e01df 100644
+index c1006a1991e294fa69b1eb35f4224154b064671b..b0a548ed0abbe08df2cae771248a811fba3891da 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -222,7 +222,7 @@ public class ServerPlayer extends Player {
@@ -17,7 +17,7 @@ index ee35514f0bfb0499e8aab7ce702bd2e2ef09d5db..917175e54ac8979659bbfb2c2cf06431
public java.util.Locale adventure$locale = java.util.Locale.US; // Paper
@Nullable
private Vec3 startingToFallPosition;
-@@ -316,7 +316,7 @@ public class ServerPlayer extends Player {
+@@ -272,7 +272,7 @@ public class ServerPlayer extends Player {
this.lastActionTime = Util.getMillis();
this.recipeBook = new ServerRecipeBook();
this.requestedViewDistance = 2;
@@ -26,7 +26,7 @@ index ee35514f0bfb0499e8aab7ce702bd2e2ef09d5db..917175e54ac8979659bbfb2c2cf06431
this.lastSectionPos = SectionPos.of(0, 0, 0);
this.chunkTrackingView = ChunkTrackingView.EMPTY;
this.respawnDimension = Level.OVERWORLD;
-@@ -1964,9 +1964,10 @@ public class ServerPlayer extends Player {
+@@ -1920,9 +1920,10 @@ public class ServerPlayer extends Player {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), this.getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT);
this.server.server.getPluginManager().callEvent(event);
}
@@ -39,10 +39,10 @@ index ee35514f0bfb0499e8aab7ce702bd2e2ef09d5db..917175e54ac8979659bbfb2c2cf06431
// CraftBukkit end
this.language = clientOptions.language();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 7aa9787b96862e427cfd0011bccc0895b0c8f4cd..49d0e2988d2267c4721d8ce37a96eb1d3944ea5a 100644
+index eb021cd3d2eb1d4c3f4f2f42b9dbb69572fe98de..70a5ced9e39d6ce0e38f9ee04883584f40d49971 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2310,7 +2310,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2268,7 +2268,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public String getLocale() {
diff --git a/patches/server/0047-Configurable-container-update-tick-rate.patch b/patches/server/0047-Configurable-container-update-tick-rate.patch
index 7bcb87ec73..15658964ad 100644
--- a/patches/server/0047-Configurable-container-update-tick-rate.patch
+++ b/patches/server/0047-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 94571a63353b014f7aa30d8d0453332265c1d53f..ca511ec40965eb33f1e0e5c257ed9ae4e3d26d62 100644
+index b0a548ed0abbe08df2cae771248a811fba3891da..7e777ab6998203e031fb8387b1521bff3d86f11a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -247,6 +247,7 @@ public class ServerPlayer extends Player {
@@ -16,7 +16,7 @@ index 94571a63353b014f7aa30d8d0453332265c1d53f..ca511ec40965eb33f1e0e5c257ed9ae4
// CraftBukkit start
public String displayName;
-@@ -683,7 +684,12 @@ public class ServerPlayer extends Player {
+@@ -639,7 +640,12 @@ public class ServerPlayer extends Player {
--this.invulnerableTime;
}
diff --git a/patches/server/0049-Disable-spigot-tick-limiters.patch b/patches/server/0049-Disable-spigot-tick-limiters.patch
index 1d5c8ca844..4326d4ee93 100644
--- a/patches/server/0049-Disable-spigot-tick-limiters.patch
+++ b/patches/server/0049-Disable-spigot-tick-limiters.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index fcf3be628e5ee6155ebc4e73c24043731f2f7894..f7407f5204a2cbfcc46987d5e0a34770b2e5abbf 100644
+index 7ead83d46e7bb3ee3586acf695b08f197f61f04a..6fbadd278138743f87fcf6b3c3d3c57af41d437c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -712,9 +712,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -707,9 +707,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
boolean flag = this.tickRateManager().runsNormally();
int tilesThisCycle = 0;
diff --git a/patches/server/0050-Add-PlayerInitialSpawnEvent.patch b/patches/server/0050-Add-PlayerInitialSpawnEvent.patch
index 657f196ed2..52241d8e84 100644
--- a/patches/server/0050-Add-PlayerInitialSpawnEvent.patch
+++ b/patches/server/0050-Add-PlayerInitialSpawnEvent.patch
@@ -12,7 +12,7 @@ improve setPosition to use raw
public net.minecraft.world.entity.Entity setRot(FF)V
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index fdf3bf3decb14378f5e59e41bab26e965bc7be14..ffd73624360e76caef477aeb0074fc8eba13c1c6 100644
+index f5a4191977e8675952fc689744c8a39e86f62a07..e870be760f00bac1d5eb32ed6d22c4dc8a8ebf78 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -227,7 +227,7 @@ public abstract class PlayerList {
diff --git a/patches/server/0052-Improve-Player-chat-API-handling.patch b/patches/server/0052-Improve-Player-chat-API-handling.patch
index cdc107e9f9..fc2300f202 100644
--- a/patches/server/0052-Improve-Player-chat-API-handling.patch
+++ b/patches/server/0052-Improve-Player-chat-API-handling.patch
@@ -17,10 +17,10 @@ Co-authored-by: Jake Potrebic <[email protected]>
Co-authored-by: SoSeDiK <[email protected]>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index e8e5773776060b7b6861c80ec736bc5740a262c8..64b5af3745642d2a2e2075cb70ef4defbee64d15 100644
+index ce7caf08865df9ff032ba6c42308ea3ce4de6226..04e68886a5385234701962f2502948052074515e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1937,7 +1937,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1930,7 +1930,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
OutgoingChatMessage outgoing = OutgoingChatMessage.create(original);
@@ -29,7 +29,7 @@ index e8e5773776060b7b6861c80ec736bc5740a262c8..64b5af3745642d2a2e2075cb70ef4def
this.handleCommand(s);
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin
-@@ -2024,7 +2024,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -2017,7 +2017,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
}
@@ -40,7 +40,7 @@ index e8e5773776060b7b6861c80ec736bc5740a262c8..64b5af3745642d2a2e2075cb70ef4def
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 73ed8a00ed83a0f7da7a5f69e743850d7a5b76cc..7e7dfec65f1756e21eb79359e13d429fe1955bba 100644
+index 58c0fc6c0d5df7cd8331d742dc93aad37d6139c9..c370a3be48d3582eb23e0831a3e21798ade9affd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -885,7 +885,7 @@ public final class CraftServer implements Server {
@@ -53,10 +53,10 @@ index 73ed8a00ed83a0f7da7a5f69e743850d7a5b76cc..7e7dfec65f1756e21eb79359e13d429f
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 49d0e2988d2267c4721d8ce37a96eb1d3944ea5a..1ebbd53d545d4b9ac3341c6a68ec97a2f468fb48 100644
+index 70a5ced9e39d6ce0e38f9ee04883584f40d49971..d37ff41c7266f6811988272e32e035469fe30f46 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -498,7 +498,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -456,7 +456,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (this.getHandle().connection == null) return;
diff --git a/patches/server/0053-All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/0053-All-chunks-are-slime-spawn-chunks-toggle.patch
index f6eb2e9da2..55c1f1b35b 100644
--- a/patches/server/0053-All-chunks-are-slime-spawn-chunks-toggle.patch
+++ b/patches/server/0053-All-chunks-are-slime-spawn-chunks-toggle.patch
@@ -18,10 +18,10 @@ index 8b2206c5c56341ecd96837bdb3e0c6ab7c874af5..897c815fb448d1e9ca75b7f8b93b4021
if (random.nextInt(10) == 0 && flag && pos.getY() < 40) {
return checkMobSpawnRules(type, world, spawnReason, pos, random);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
-index 7687a81bfa420e8377308fea3d6738141bc945d3..df02963faaf8f514f4175d394e67d2df10c8a3ea 100644
+index b1aeb021e53a233bfb0439d38f1a889ed6fc301d..491416754e1c5e8c2b345b57f45289906c7932ba 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
-@@ -171,7 +171,7 @@ public class CraftChunk implements Chunk {
+@@ -215,7 +215,7 @@ public class CraftChunk implements Chunk {
@Override
public boolean isSlimeChunk() {
// 987234911L is deterimined in EntitySlime when seeing if a slime can spawn in a chunk
diff --git a/patches/server/0054-Expose-server-CommandMap.patch b/patches/server/0054-Expose-server-CommandMap.patch
index 7d752e224e..70890ea453 100644
--- a/patches/server/0054-Expose-server-CommandMap.patch
+++ b/patches/server/0054-Expose-server-CommandMap.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 7e7dfec65f1756e21eb79359e13d429fe1955bba..6cd22b11b1fec22087dca1b8dcfbc9c19a499399 100644
+index c370a3be48d3582eb23e0831a3e21798ade9affd..fa77a985087acf3398f65b58be7c1d12ea8f7f66 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2112,6 +2112,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0056-Player-Tab-List-and-Title-APIs.patch b/patches/server/0056-Player-Tab-List-and-Title-APIs.patch
index 012f9a673e..8776c8880a 100644
--- a/patches/server/0056-Player-Tab-List-and-Title-APIs.patch
+++ b/patches/server/0056-Player-Tab-List-and-Title-APIs.patch
@@ -64,7 +64,7 @@ index 7bb08db97c324d13836303cc8a4623c71d6c8a2c..5e9045f7722481e1f83a3d36d7b3d86e
// Paper end
buf.writeComponent(this.text);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 054ada5455c6570f86d9a010fcb8eaf57bf7151d..6d8b46743473832b2c7c604b3023541a22e3abc9 100644
+index d37ff41c7266f6811988272e32e035469fe30f46..cfa95917b39b32917bf32b2e97211d232d9037fd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,5 +1,6 @@
@@ -74,7 +74,7 @@ index 054ada5455c6570f86d9a010fcb8eaf57bf7151d..6d8b46743473832b2c7c604b3023541a
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.BaseEncoding;
-@@ -340,6 +341,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -298,6 +299,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}
diff --git a/patches/server/0057-Add-configurable-portal-search-radius.patch b/patches/server/0057-Add-configurable-portal-search-radius.patch
index e36f7677d6..08a6e3a71c 100644
--- a/patches/server/0057-Add-configurable-portal-search-radius.patch
+++ b/patches/server/0057-Add-configurable-portal-search-radius.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add configurable portal search radius
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 16fa26878fc7bcf5d22d779ce7b37a59582ba033..927428f11e005fff28f01cfb584a2789aad02afb 100644
+index 8e4f8849acfede8eec04527b67a3405ae805633d..bef8f3574ecb0d957f9041639b56c94b41913f99 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -3233,7 +3233,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3181,7 +3181,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
double d0 = DimensionType.getTeleportationScale(this.level().dimensionType(), destination.dimensionType());
BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0);
// CraftBukkit start
@@ -24,7 +24,7 @@ index 16fa26878fc7bcf5d22d779ce7b37a59582ba033..927428f11e005fff28f01cfb584a2789
return null;
}
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
-index 0762bb248b3bd43a06e89aa1893a6189f0e13866..431f1cf004471dbfb149f697300c3c7fe6bfda4d 100644
+index 550b7bc694d861c084769265f6c49c4d44033296..afdd4ecbff21e2172b390bcbdf74f3c1bbddafcc 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
@@ -43,7 +43,7 @@ public class PortalForcer {
diff --git a/patches/server/0058-Add-velocity-warnings.patch b/patches/server/0058-Add-velocity-warnings.patch
index 92bc6070df..eaab2c92bc 100644
--- a/patches/server/0058-Add-velocity-warnings.patch
+++ b/patches/server/0058-Add-velocity-warnings.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add velocity warnings
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 236bbec16b90a71d42d7b55fb5fedbf1a8b350dc..95e864de78b7e1825c4899295ee7c1970f888b14 100644
+index fa77a985087acf3398f65b58be7c1d12ea8f7f66..b7707cccbdc1b55f49cc70218949aacdceeb2651 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -298,6 +298,7 @@ public final class CraftServer implements Server {
@@ -17,7 +17,7 @@ index 236bbec16b90a71d42d7b55fb5fedbf1a8b350dc..95e864de78b7e1825c4899295ee7c197
static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index acfe67911d052933bbf62e5c68181f4472b6e4c9..9ff8190002d25a13e6166e076b54a006cff0b47d 100644
+index 49294a8d580d891f21d8d4cbae14ae477c01ff8d..74937603e7b8308fd314d650d9d966e8abd2c725 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -128,10 +128,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -62,27 +62,24 @@ index acfe67911d052933bbf62e5c68181f4472b6e4c9..9ff8190002d25a13e6166e076b54a006
public double getHeight() {
return this.getHandle().getBbHeight();
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
-index cacbde8ac27a70b5e3bcd76ad90bc667abee3817..b5a2cbc21165e80820d6f7e2690e6e18de54c420 100644
+index 231b4e3552b17f7803815a433a5ece440c227cc6..fd3fe8f00981230f1115ad6821a6be9c9f09f7d3 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
-@@ -80,7 +80,19 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
- log.log( Level.SEVERE, "During the run of the server, a physics stackoverflow was supressed" );
- log.log( Level.SEVERE, "near " + net.minecraft.world.level.Level.lastPhysicsProblem );
- }
-- //
-+ // Paper start - Warn in watchdog if an excessive velocity was ever set
-+ if ( org.bukkit.craftbukkit.CraftServer.excessiveVelEx != null )
-+ {
-+ log.log( Level.SEVERE, "------------------------------" );
-+ log.log( Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity" );
-+ log.log( Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated" );
-+ log.log( Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
-+ for ( StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace() )
-+ {
-+ log.log( Level.SEVERE, "\t\t" + stack );
-+ }
-+ }
-+ // Paper end
- log.log( Level.SEVERE, "------------------------------" );
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
- io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
+@@ -130,6 +130,17 @@ public class WatchdogThread extends Thread
+ }
+ log.log( Level.SEVERE, "\tStack:" );
+ //
++ // Paper start - Warn in watchdog if an excessive velocity was ever set
++ if (org.bukkit.craftbukkit.CraftServer.excessiveVelEx != null) {
++ log.log(Level.SEVERE, "------------------------------");
++ log.log(Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity");
++ log.log(Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated");
++ log.log(Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
++ for (StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace()) {
++ log.log( Level.SEVERE, "\t\t" + stack );
++ }
++ }
++ // Paper end
+ for ( StackTraceElement stack : thread.getStackTrace() )
+ {
+ log.log( Level.SEVERE, "\t\t" + stack );
diff --git a/patches/server/0059-Configurable-inter-world-teleportation-safety.patch b/patches/server/0059-Configurable-inter-world-teleportation-safety.patch
index d2b98f50be..3d04ecd59b 100644
--- a/patches/server/0059-Configurable-inter-world-teleportation-safety.patch
+++ b/patches/server/0059-Configurable-inter-world-teleportation-safety.patch
@@ -16,10 +16,10 @@ The wanted destination was on top of the emerald block however the player ended
This only is the case if the player is teleporting between worlds.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 1cb9dbb01a320081188320048d36f61434efa109..73b6740cf50d878b98438f58c2291c0d13f412b7 100644
+index cfa95917b39b32917bf32b2e97211d232d9037fd..2de70507a03e662afa45dd9f2e3c28c857a8037c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1168,7 +1168,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1126,7 +1126,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
entity.connection.teleport(to);
} else {
// The respawn reason should never be used if the passed location is non null.
diff --git a/patches/server/0060-Add-exception-reporting-event.patch b/patches/server/0060-Add-exception-reporting-event.patch
index 0f11c822c3..ce97e0a5ba 100644
--- a/patches/server/0060-Add-exception-reporting-event.patch
+++ b/patches/server/0060-Add-exception-reporting-event.patch
@@ -88,7 +88,7 @@ index c6fb4c33d7ea52b88d8fc0d90748cbab7387c565..2b5b2869589991be37a4f128faabbff5
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 19f1be39c5e245c7e999ade36e53bff8d011dedb..0023f4f4572261e38136d3629cc35679454294f5 100644
+index 6fbadd278138743f87fcf6b3c3d3c57af41d437c..aee40ef7ae18ad00d8af88dd1e2397fe8df78309 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1,5 +1,10 @@
@@ -102,7 +102,7 @@ index 19f1be39c5e245c7e999ade36e53bff8d011dedb..0023f4f4572261e38136d3629cc35679
import com.google.common.collect.Lists;
import com.mojang.serialization.Codec;
import java.io.IOException;
-@@ -741,6 +746,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -736,6 +741,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper start - Prevent block entity and entity crashes
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);
@@ -131,7 +131,7 @@ index 5d65baba605dd83e5f74d526aeda36d8ede8c014..604766a286d00bb4b40c20482376fe80
}
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 ae62ef9bad1774cc6aecb686660ef19244bd1365..54aed742984809601d64f22ccf5db2d68b3831a2 100644
+index e7cfac251ebef4eda9105c4f64783a9bc3e0e59e..30c0f59d521de5e7c9d5bbc0a7f1f272e165f389 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -1,6 +1,7 @@
@@ -142,7 +142,7 @@ index ae62ef9bad1774cc6aecb686660ef19244bd1365..54aed742984809601d64f22ccf5db2d6
import com.google.common.collect.Maps;
import com.google.common.collect.UnmodifiableIterator;
import com.mojang.logging.LogUtils;
-@@ -581,10 +582,16 @@ public class LevelChunk extends ChunkAccess {
+@@ -580,10 +581,16 @@ public class LevelChunk extends ChunkAccess {
// CraftBukkit start
} else {
@@ -163,7 +163,7 @@ index ae62ef9bad1774cc6aecb686660ef19244bd1365..54aed742984809601d64f22ccf5db2d6
// CraftBukkit end
}
}
-@@ -1162,6 +1169,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -1072,6 +1079,7 @@ public class LevelChunk extends ChunkAccess {
// Paper start - Prevent block entity and entity crashes
final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
@@ -172,10 +172,10 @@ index ae62ef9bad1774cc6aecb686660ef19244bd1365..54aed742984809601d64f22ccf5db2d6
// Paper end - Prevent block entity and entity crashes
// Spigot start
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
-index 5103081e8469dd5a393595eae00c6f6c9d0a5028..9623a7bac79af37016ba5a5b37d4ef0b3dcb7312 100644
+index d9daf07132c46548964a75588b69d7a74680e917..66994aa135037919219e0bbcabe7de9f6f2c9dcd 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
-@@ -275,6 +275,7 @@ public class RegionFile implements AutoCloseable {
+@@ -274,6 +274,7 @@ public class RegionFile implements AutoCloseable {
return true;
}
} catch (IOException ioexception) {
@@ -183,7 +183,7 @@ index 5103081e8469dd5a393595eae00c6f6c9d0a5028..9623a7bac79af37016ba5a5b37d4ef0b
return false;
}
}
-@@ -356,6 +357,7 @@ public class RegionFile implements AutoCloseable {
+@@ -355,6 +356,7 @@ public class RegionFile implements AutoCloseable {
((java.nio.Buffer) buf).position(5); // CraftBukkit - decompile error
filechannel.write(buf);
} catch (Throwable throwable) {
diff --git a/patches/server/0061-Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/0061-Disable-Scoreboards-for-non-players-by-default.patch
index f9694767e4..2ec136b21c 100644
--- a/patches/server/0061-Disable-Scoreboards-for-non-players-by-default.patch
+++ b/patches/server/0061-Disable-Scoreboards-for-non-players-by-default.patch
@@ -11,10 +11,10 @@ So avoid looking up scoreboards and short circuit to the "not on a team"
logic which is most likely to be true.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 927428f11e005fff28f01cfb584a2789aad02afb..939707c42db4509aa71ccd43bbfe4c17e6bc2c3f 100644
+index bef8f3574ecb0d957f9041639b56c94b41913f99..c4168fa278dacf9f50058bb7dc98bb12aef717f2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2860,6 +2860,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2808,6 +2808,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@Nullable
public PlayerTeam getTeam() {
diff --git a/patches/server/0063-Chunk-Save-Reattempt.patch b/patches/server/0063-Chunk-Save-Reattempt.patch
index 9d576223e0..466e625684 100644
--- a/patches/server/0063-Chunk-Save-Reattempt.patch
+++ b/patches/server/0063-Chunk-Save-Reattempt.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Chunk Save Reattempt
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
-index 9623a7bac79af37016ba5a5b37d4ef0b3dcb7312..f3d169436ce05f1c56599cfe15a56671b7d13516 100644
+index 66994aa135037919219e0bbcabe7de9f6f2c9dcd..140d6e455c1729f6e31e95facba5520b75ad838c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
-@@ -275,7 +275,7 @@ public class RegionFile implements AutoCloseable {
+@@ -274,7 +274,7 @@ public class RegionFile implements AutoCloseable {
return true;
}
} catch (IOException ioexception) {
@@ -19,33 +19,38 @@ index 9623a7bac79af37016ba5a5b37d4ef0b3dcb7312..f3d169436ce05f1c56599cfe15a56671
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-index 2b6ba2e30c9a4682d6deb2ab750d6923ad8469e4..fa592d5db10dbd4824de74658655ef61230ed431 100644
+index 1988063a0cac0350ae3b3388b8f2a0c95b8b259f..a7bf0ce6eefa60ba61975afb8885fc1857fb7959 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-@@ -209,6 +209,7 @@ public class RegionFileStorage implements AutoCloseable {
- }
- // Paper end - rewrite chunk system
- try { // Paper
-+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper - Chunk save reattempt
+@@ -132,6 +132,12 @@ public class RegionFileStorage implements AutoCloseable {
+
+ protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
+ RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit
++ // Paper start - Chunk save reattempt
++ int attempts = 0;
++ Exception lastException = null;
++ while (attempts++ < 5) {
++ try {
++ // Paper end - Chunk save reattempt
if (nbt == null) {
regionfile.clear(pos);
-@@ -233,7 +234,18 @@ public class RegionFileStorage implements AutoCloseable {
+@@ -156,7 +162,18 @@ public class RegionFileStorage implements AutoCloseable {
dataoutputstream.close();
}
}
+ // Paper start - Chunk save reattempt
-+ return;
-+ } catch (Exception ex) {
-+ laste = ex;
-+ }
++ return;
++ } catch (Exception ex) {
++ lastException = ex;
++ }
+ }
-+ if (laste != null) {
-+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste);
-+ net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk " + pos, laste);
++ if (lastException != null) {
++ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(lastException);
++ net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk {}", pos, lastException);
+ }
+ // Paper end - Chunk save reattempt
- } finally { // Paper start
- regionfile.fileLock.unlock();
- } // Paper end
+ }
+
+ public void close() throws IOException {
diff --git a/patches/server/0064-Complete-resource-pack-API.patch b/patches/server/0064-Complete-resource-pack-API.patch
index b39c097a10..0e8f9bbf86 100644
--- a/patches/server/0064-Complete-resource-pack-API.patch
+++ b/patches/server/0064-Complete-resource-pack-API.patch
@@ -22,7 +22,7 @@ index c8041492b7b2a1ff67b95d9944cfccd476b3ee1d..66497960995dc30abe60d26200979a78
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 533aad9a2ed3e9f49307696146b34e0a1bf61cf4..5fef370f164e78a336cfe598aee15e277dd6b946 100644
+index 2de70507a03e662afa45dd9f2e3c28c857a8037c..5042d57ae8bf8cadcb22c89f6bb80724a0480f96 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -189,6 +189,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -33,7 +33,7 @@ index 533aad9a2ed3e9f49307696146b34e0a1bf61cf4..5fef370f164e78a336cfe598aee15e27
public CraftPlayer(CraftServer server, ServerPlayer entity) {
super(server, entity);
-@@ -1997,6 +1998,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1955,6 +1956,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end - adventure
diff --git a/patches/server/0065-Default-loading-permissions.yml-before-plugins.patch b/patches/server/0065-Default-loading-permissions.yml-before-plugins.patch
index fdc1648dbe..14939ea379 100644
--- a/patches/server/0065-Default-loading-permissions.yml-before-plugins.patch
+++ b/patches/server/0065-Default-loading-permissions.yml-before-plugins.patch
@@ -16,7 +16,7 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe
A config option has been added for those who depend on the previous behavior, but I don't expect that.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 95e864de78b7e1825c4899295ee7c1970f888b14..fb2b1c13538ed7123beb3d1bc9169a2b313e87ea 100644
+index b7707cccbdc1b55f49cc70218949aacdceeb2651..64541619b92f58a9e2621f754c8494ab5c7014c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -456,6 +456,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch
index 1a9455734f..34e3208f3e 100644
--- a/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch
+++ b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 41422f3a54e5ee749b7389bfe761b4430e24f274..f03bacff1963650327bc94664b1ac00eb12d362d 100644
+index 64541619b92f58a9e2621f754c8494ab5c7014c8..73e29dc1cce2999e81d250a9cc8fae55df97698a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2709,5 +2709,23 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0067-Remove-Metadata-on-reload.patch b/patches/server/0067-Remove-Metadata-on-reload.patch
index 1ae8646f4e..b4e8ffba2f 100644
--- a/patches/server/0067-Remove-Metadata-on-reload.patch
+++ b/patches/server/0067-Remove-Metadata-on-reload.patch
@@ -7,7 +7,7 @@ Metadata is not meant to persist reload as things break badly with non primitive
This will remove metadata on reload so it does not crash everything if a plugin uses it.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 4eb1a2bbdb03973e38ec7cdc93601ddab3e44f8e..1d08a65fa782d8150bc6253d11f0a9ffa25ea325 100644
+index 73e29dc1cce2999e81d250a9cc8fae55df97698a..7555a74c90082d4164fbfda9d467514ccf7815bb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -952,8 +952,16 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0068-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0068-Handle-Item-Meta-Inconsistencies.patch
index edad16891d..a10f0935ad 100644
--- a/patches/server/0068-Handle-Item-Meta-Inconsistencies.patch
+++ b/patches/server/0068-Handle-Item-Meta-Inconsistencies.patch
@@ -168,7 +168,7 @@ index cba729914a3adaee2507e2916a4cfb585869746d..a05f01ca9a9bc88e414c8cf89c01c7e9
static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index fcef34d7c88f7f8e21f9789ce3d0962e64d2f092..9dbadab7134c7bb56572cf8c89148b6c743e9bcd 100644
+index 9e11d7bccd04b4c2e6913de56a299190c22aa9c1..c76fe9599b4f2458cac6e2477f1f963451b357b4 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
@@ -254,7 +254,7 @@ index fcef34d7c88f7f8e21f9789ce3d0962e64d2f092..9dbadab7134c7bb56572cf8c89148b6c
for (Map.Entry<?, ?> entry : ench.entrySet()) {
// Doctor older enchants
String enchantKey = entry.getKey().toString();
-@@ -833,14 +836,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -845,14 +848,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override
public Map<Enchantment, Integer> getEnchants() {
@@ -271,7 +271,7 @@ index fcef34d7c88f7f8e21f9789ce3d0962e64d2f092..9dbadab7134c7bb56572cf8c89148b6c
}
if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) {
-@@ -1227,7 +1230,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1262,7 +1265,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
clone.customModelData = this.customModelData;
clone.blockData = this.blockData;
if (this.enchantments != null) {
@@ -280,7 +280,7 @@ index fcef34d7c88f7f8e21f9789ce3d0962e64d2f092..9dbadab7134c7bb56572cf8c89148b6c
}
if (this.hasAttributeModifiers()) {
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
-@@ -1469,4 +1472,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1509,4 +1512,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return CraftMetaItem.HANDLED_TAGS;
}
}
diff --git a/patches/server/0070-Add-World-Util-Methods.patch b/patches/server/0070-Add-World-Util-Methods.patch
index bd3012b249..b2f3d139e0 100644
--- a/patches/server/0070-Add-World-Util-Methods.patch
+++ b/patches/server/0070-Add-World-Util-Methods.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 813a79866794bad9d0da105345641a6e9136ddf8..e8b2e1f45ecd13ac4bfc2c3eb09f2d397b997b78 100644
+index aee40ef7ae18ad00d8af88dd1e2397fe8df78309..c48e62063609634a0660c75b9305e9d73e10b4aa 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -352,6 +352,22 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0071-Custom-replacement-for-eaten-items.patch b/patches/server/0071-Custom-replacement-for-eaten-items.patch
index 65d34ff7a1..19948631fa 100644
--- a/patches/server/0071-Custom-replacement-for-eaten-items.patch
+++ b/patches/server/0071-Custom-replacement-for-eaten-items.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index a43539db71a7344e9477918dc5c7b07d46903bea..08ffa37aaf23c410c670ed1703c5eb2c10efa0f4 100644
+index 3eeb40c2176a80b9e2a472d43671ae0fe087d9e7..3179fc1b33f503b0cdd462ad160edee760b5a7eb 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3698,10 +3698,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
diff --git a/patches/server/0072-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0072-handle-NaN-health-absorb-values-and-repair-bad-data.patch
index 72f6bccd8e..89e4f5707b 100644
--- a/patches/server/0072-handle-NaN-health-absorb-values-and-repair-bad-data.patch
+++ b/patches/server/0072-handle-NaN-health-absorb-values-and-repair-bad-data.patch
@@ -44,10 +44,10 @@ index 3179fc1b33f503b0cdd462ad160edee760b5a7eb..428a9d21b24e9c349bf766c16172ffd9
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 1d48824c4cfd99ced6a70284aa3b7bce46af81fa..b15df5f55dc12c358df74df500f210976eaba048 100644
+index 5042d57ae8bf8cadcb22c89f6bb80724a0480f96..bfbd69635c4a2565cc9a72147ff9585efe40e861 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2232,6 +2232,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2190,6 +2190,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setRealHealth(double health) {
diff --git a/patches/server/0073-Use-a-Shared-Random-for-Entities.patch b/patches/server/0073-Use-a-Shared-Random-for-Entities.patch
index 111b8eab95..c5c3e67cfe 100644
--- a/patches/server/0073-Use-a-Shared-Random-for-Entities.patch
+++ b/patches/server/0073-Use-a-Shared-Random-for-Entities.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Use a Shared Random for Entities
Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 939707c42db4509aa71ccd43bbfe4c17e6bc2c3f..6d3c575d12b3c1cc7c06a4cf1b671a2de894892a 100644
+index c4168fa278dacf9f50058bb7dc98bb12aef717f2..b5138df02005e30c1788c97bd9dcbcf2c5fb5d34 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -165,6 +165,79 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -89,7 +89,7 @@ index 939707c42db4509aa71ccd43bbfe4c17e6bc2c3f..6d3c575d12b3c1cc7c06a4cf1b671a2d
private CraftEntity bukkitEntity;
public CraftEntity getBukkitEntity() {
-@@ -413,7 +486,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -361,7 +434,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.bb = Entity.INITIAL_AABB;
this.stuckSpeedMultiplier = Vec3.ZERO;
this.nextStep = 1.0F;
diff --git a/patches/server/0074-Configurable-spawn-chances-for-skeleton-horses.patch b/patches/server/0074-Configurable-spawn-chances-for-skeleton-horses.patch
index 0dfd24368a..d7d438869c 100644
--- a/patches/server/0074-Configurable-spawn-chances-for-skeleton-horses.patch
+++ b/patches/server/0074-Configurable-spawn-chances-for-skeleton-horses.patch
@@ -5,10 +5,10 @@ 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 5a5bb0daf8074a428f18e01bb522a46e4672b2a6..817e0ddc8821dd112fc5aa72bbbe11fdd1b56488 100644
+index 4b6fc197c6e0544f2ec993ea863e9dd560b05f11..22f6260ffa7b9fb2f5f226e505e81b3e29760437 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -851,7 +851,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -614,7 +614,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
diff --git a/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
index 655b355b57..004b7f442f 100644
--- a/patches/server/0075-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
+++ b/patches/server/0075-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 bb66ed2fa4bbf4e8836022b210ca754b821adf95..b7854ac5fc753302cf1ab171c561e073cc2fb3e3 100644
+index cb7dcb4dc310f1857600b340e4101e2829fcf6b6..07bd44752a8af3e44577484416b89c9acaa3769b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1388,6 +1388,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1394,6 +1394,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
@@ -18,7 +18,7 @@ index bb66ed2fa4bbf4e8836022b210ca754b821adf95..b7854ac5fc753302cf1ab171c561e073
this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 6283b7ef17a7c128efb24206fe4f7201fcc48a3e..b389c99d6c19f4d63a3bf220aa165052ea28bf7d 100644
+index 22f6260ffa7b9fb2f5f226e505e81b3e29760437..b4fdcfa28347beafe75339782d6e0cd7fc0b6256 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -221,6 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -30,10 +30,10 @@ index 6283b7ef17a7c128efb24206fe4f7201fcc48a3e..b389c99d6c19f4d63a3bf220aa165052
public LevelChunk getChunkIfLoaded(int x, int z) {
return this.chunkSource.getChunk(x, z, false);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index feaa6e1eaaa8f99f9d68b2da98be63b583e09b68..4f7d59c32db29ac95f237124c19d5a29272c8d42 100644
+index c48e62063609634a0660c75b9305e9d73e10b4aa..a617c69054523dda56b78f175fc8b9c134b60ae2 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -506,7 +506,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -501,7 +501,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
CraftWorld world = ((ServerLevel) this).getWorld();
diff --git a/patches/server/0076-Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/0076-Entity-AddTo-RemoveFrom-World-Events.patch
index 68b738f152..61e1e7d0ae 100644
--- a/patches/server/0076-Entity-AddTo-RemoveFrom-World-Events.patch
+++ b/patches/server/0076-Entity-AddTo-RemoveFrom-World-Events.patch
@@ -5,10 +5,10 @@ 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 b389c99d6c19f4d63a3bf220aa165052ea28bf7d..31439413aa5ed26b7983ac22fe9ac44786fe0e33 100644
+index b4fdcfa28347beafe75339782d6e0cd7fc0b6256..f5c271c604dc74d9d82b44591ffc09e04567e3ab 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2415,6 +2415,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2161,6 +2161,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.setOrigin(entity.getOriginVector().toLocation(getWorld()));
}
// Paper end - Entity origin API
@@ -16,7 +16,7 @@ index b389c99d6c19f4d63a3bf220aa165052ea28bf7d..31439413aa5ed26b7983ac22fe9ac447
}
public void onTrackingEnd(Entity entity) {
-@@ -2490,6 +2491,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2236,6 +2237,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
// CraftBukkit end
diff --git a/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch b/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch
index 26ea434b4b..4e2e1411a2 100644
--- a/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch
+++ b/patches/server/0077-Configurable-Chunk-Inhabited-Time.patch
@@ -11,10 +11,10 @@ For people who want all chunks to be treated equally, you can chose a fixed valu
This allows to fine-tune vanilla gameplay.
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 7208b7b916ff179e8dbe9925fb246e3652b4f9c2..31d2de67d3facf00491814f775ef1468b33eb51b 100644
+index 30c0f59d521de5e7c9d5bbc0a7f1f272e165f389..8288be49fc0fbedefef799cb1038d5f79b7cf0a3 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -277,6 +277,13 @@ public class LevelChunk extends ChunkAccess {
+@@ -276,6 +276,13 @@ public class LevelChunk extends ChunkAccess {
return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks);
}
diff --git a/patches/server/0079-Sanitise-RegionFileCache-and-make-configurable.patch b/patches/server/0079-Sanitise-RegionFileCache-and-make-configurable.patch
index 1748da6f30..39c74417d0 100644
--- a/patches/server/0079-Sanitise-RegionFileCache-and-make-configurable.patch
+++ b/patches/server/0079-Sanitise-RegionFileCache-and-make-configurable.patch
@@ -11,15 +11,15 @@ The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap).
The maximum size of the RegionFileCache is also made configurable.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-index fa592d5db10dbd4824de74658655ef61230ed431..e9cfbee008c1dda2eeac55196d490984fa62ab09 100644
+index a7bf0ce6eefa60ba61975afb8885fc1857fb7959..50f8e12c964a7a0f388568e4df512ddffdda4a64 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-@@ -92,7 +92,7 @@ public class RegionFileStorage implements AutoCloseable {
- return null;
- }
- // Paper end - cache regionfile does not exist state
+@@ -37,7 +37,7 @@ public class RegionFileStorage implements AutoCloseable {
+ if (regionfile != null) {
+ return regionfile;
+ } else {
- if (this.regionCache.size() >= 256) {
-+ if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - Sanitise RegionFileCache and make configurable.
++ if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - Sanitise RegionFileCache and make configurable
((RegionFile) this.regionCache.removeLast()).close();
}
diff --git a/patches/server/0081-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0081-Add-PlayerUseUnknownEntityEvent.patch
index 72bae5c5bd..948630759c 100644
--- a/patches/server/0081-Add-PlayerUseUnknownEntityEvent.patch
+++ b/patches/server/0081-Add-PlayerUseUnknownEntityEvent.patch
@@ -28,10 +28,10 @@ index 644a0fdea6576647539b96528717dbaeab498d93..221e64a66ff12a8de5c75992fc26a54a
+ // Paper end - PlayerUseUnknownEntityEvent
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 64b5af3745642d2a2e2075cb70ef4defbee64d15..21d3b837b6875dd9833a70f6f8bca2070016c5a0 100644
+index 04e68886a5385234701962f2502948052074515e..a91ba515265c869529776521345887574e1d4076 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2407,8 +2407,38 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -2400,8 +2400,38 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
});
}
}
diff --git a/patches/server/0083-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/patches/server/0083-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
index a0dfb79bea..164408279e 100644
--- a/patches/server/0083-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
+++ b/patches/server/0083-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
@@ -5,10 +5,10 @@ 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 449f2ebc77a1850fc948bffc66e605f7bdc8efdd..ad9b4e88e2aaa5d7e70f65536c86742beafc91df 100644
+index f5c271c604dc74d9d82b44591ffc09e04567e3ab..dcf2b9820eb9ad92dc7dc559e509a694d3949f02 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1623,6 +1623,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1384,6 +1384,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public void updateNeighborsAt(BlockPos pos, Block sourceBlock) {
diff --git a/patches/server/0086-Configurable-Player-Collision.patch b/patches/server/0086-Configurable-Player-Collision.patch
index 7647d8059a..2ba0e44020 100644
--- a/patches/server/0086-Configurable-Player-Collision.patch
+++ b/patches/server/0086-Configurable-Player-Collision.patch
@@ -18,7 +18,7 @@ index 3d2a689d11bfa230bab61a2a65c6051328f6b78d..cf31771648549ab6d7e4e38b30409ca4
buf.writeComponent(this.playerPrefix);
buf.writeComponent(this.playerSuffix);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 53a135f9f61a29ddfff5aa7eb20b96a2f0fc1fdf..9697e189cf79994ed7d231c7801761791c128310 100644
+index 07bd44752a8af3e44577484416b89c9acaa3769b..8d81dcd07a5a9d32d19ff5b4d246dae503651ebd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -621,6 +621,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -43,7 +43,7 @@ index 53a135f9f61a29ddfff5aa7eb20b96a2f0fc1fdf..9697e189cf79994ed7d231c780176179
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.connection.acceptConnections();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index ffd73624360e76caef477aeb0074fc8eba13c1c6..e3195f03ac449e6e4870489d530ef40918cd5556 100644
+index e870be760f00bac1d5eb32ed6d22c4dc8a8ebf78..a8a0b00a6bcc52a94b99d520915c21cc3155bb06 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -156,6 +156,7 @@ public abstract class PlayerList {
diff --git a/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch b/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch
index 7746d0d0a5..161ba56244 100644
--- a/patches/server/0091-remove-null-possibility-for-getServer-singleton.patch
+++ b/patches/server/0091-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 e7e892234d4ff95f628e1c368161345f47fa1efc..b27c991d4b7615d0305d01155c908cfcaa8cd4ab 100644
+index 8d81dcd07a5a9d32d19ff5b4d246dae503651ebd..635fdf6f809667d3981ca88e1c71bdeff4c80030 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -190,6 +190,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
@@ -25,7 +25,7 @@ index e7e892234d4ff95f628e1c368161345f47fa1efc..b27c991d4b7615d0305d01155c908cfc
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
this.profiler = this.metricsRecorder.getProfiler();
this.onMetricsRecordingStopped = (methodprofilerresults) -> {
-@@ -2361,9 +2363,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2367,9 +2369,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return false;
}
diff --git a/patches/server/0093-LootTable-API-and-replenishable-lootables.patch b/patches/server/0093-LootTable-API-and-replenishable-lootables.patch
index 2fa90ad76a..57a27d0768 100644
--- a/patches/server/0093-LootTable-API-and-replenishable-lootables.patch
+++ b/patches/server/0093-LootTable-API-and-replenishable-lootables.patch
@@ -504,7 +504,7 @@ index 0000000000000000000000000000000000000000..9cfa5d36a6991067a3866e0d437749fa
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 6d3c575d12b3c1cc7c06a4cf1b671a2de894892a..34bd4a3f8639295d4980d2b36fe07e2be0ec0d1e 100644
+index b5138df02005e30c1788c97bd9dcbcf2c5fb5d34..a914d2906ae7433164d7f439a0f2f0d781b14747 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -238,6 +238,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
diff --git a/patches/server/0094-System-property-for-disabling-watchdoge.patch b/patches/server/0094-System-property-for-disabling-watchdoge.patch
index ce15780e36..f789f1a006 100644
--- a/patches/server/0094-System-property-for-disabling-watchdoge.patch
+++ b/patches/server/0094-System-property-for-disabling-watchdoge.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] System property for disabling watchdoge
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
-index b5a2cbc21165e80820d6f7e2690e6e18de54c420..e2bafc68e88c733873638ce7695b684d119f55da 100644
+index fd3fe8f00981230f1115ad6821a6be9c9f09f7d3..ab3279be007553cface478795ace34e455615c7b 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
-@@ -61,7 +61,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+@@ -61,7 +61,7 @@ public class WatchdogThread extends Thread
while ( !this.stopping )
{
//
diff --git a/patches/server/0095-Async-GameProfileCache-saving.patch b/patches/server/0095-Async-GameProfileCache-saving.patch
index 67a19c70bb..1ee3311398 100644
--- a/patches/server/0095-Async-GameProfileCache-saving.patch
+++ b/patches/server/0095-Async-GameProfileCache-saving.patch
@@ -5,10 +5,10 @@ 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 da845f0e07e1541514c60252192d49a85163b1a8..3410a2b68146f34f37446c9daeb20f8860b37292 100644
+index 635fdf6f809667d3981ca88e1c71bdeff4c80030..730dab49d8216ed458a8d75e873cf5e949b4e4c0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -960,7 +960,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -979,7 +979,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} catch (java.lang.InterruptedException ignored) {} // Paper
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
MinecraftServer.LOGGER.info("Saving usercache.json");
@@ -16,9 +16,9 @@ index da845f0e07e1541514c60252192d49a85163b1a8..3410a2b68146f34f37446c9daeb20f88
+ this.getProfileCache().save(false); // Paper - Perf: Async GameProfileCache saving
}
// Spigot end
- io.papermc.paper.chunk.system.io.RegionFileIOThread.close(true); // Paper // Paper - rewrite chunk system
+
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index 69e8a7551762ab6de03f43d823e2149f5f9eca70..1df4c9b12852ac05652260678597d13ced40f80d 100644
+index 10bf1f9237436b68b855fb63b83a4aeeddf0f0c0..726bb3fcb25321d80caa5967cca86733a234b939 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -242,7 +242,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
diff --git a/patches/server/0097-Faster-redstone-torch-rapid-clock-removal.patch b/patches/server/0097-Faster-redstone-torch-rapid-clock-removal.patch
index 21d0fce448..62bc01e41e 100644
--- a/patches/server/0097-Faster-redstone-torch-rapid-clock-removal.patch
+++ b/patches/server/0097-Faster-redstone-torch-rapid-clock-removal.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Faster redstone torch rapid clock removal
Only resize the the redstone torch list once, since resizing arrays / lists is costly
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index c6c8e76a2820b3bd4724344db5e6852a745e663a..28ff413396312df9de73805e06da70a6fc0e8201 100644
+index a617c69054523dda56b78f175fc8b9c134b60ae2..7c977fad2084a849266caf8e424d0e8e24e8626f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -176,6 +176,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0098-Add-server-name-parameter.patch b/patches/server/0098-Add-server-name-parameter.patch
index a78c444de3..19c35fe6e6 100644
--- a/patches/server/0098-Add-server-name-parameter.patch
+++ b/patches/server/0098-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 2134330bafb9312a26f0259b8410f608d87d8247..faf58b6263f45a3b36014eaf628c2dac23a0ccde 100644
+index 9f4c5a6f22719ae30d88ca02a1db4a3f39957943..4fb377d967d13ed920ea1246e84b3b94cda25be6 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -167,6 +167,14 @@ public class Main {
diff --git a/patches/server/0099-Fix-global-sound-handling.patch b/patches/server/0099-Fix-global-sound-handling.patch
index 9957b1408a..810087d965 100644
--- a/patches/server/0099-Fix-global-sound-handling.patch
+++ b/patches/server/0099-Fix-global-sound-handling.patch
@@ -11,10 +11,10 @@ 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 ad9b4e88e2aaa5d7e70f65536c86742beafc91df..87cd4d17d618cd9d69a38838a05dbe5d0fe807d4 100644
+index dcf2b9820eb9ad92dc7dc559e509a694d3949f02..54b3103d558adacba5f7a7b9fd230649623c7702 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1557,7 +1557,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1318,7 +1318,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public void levelEvent(@Nullable Player player, int eventId, BlockPos pos, int data) {
@@ -81,14 +81,13 @@ index 5bc68514a1e8a212e2681f06b918548c0ec565b6..1977e702f6af39ebf100c1f2f2edc2d1
double deltaLength = Math.sqrt(distanceSquared);
double relativeX = player.getX() + (deltaX / deltaLength) * viewDistance;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index d57235720e701f765dffeafaad644cf2d7207d28..945c620d9ab369d798d1abb03ad8fa4eb02cfb5a 100644
+index 7c977fad2084a849266caf8e424d0e8e24e8626f..bffd24f48e509c9049d4c35687bfd35b505db255 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -1289,4 +1289,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
- return ret;
+@@ -1273,4 +1273,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+
+ private ExplosionInteraction() {}
}
- // Paper end
-+
+ // Paper start - respect global sound events gamerule
+ public List<net.minecraft.server.level.ServerPlayer> getPlayersForGlobalSoundGamerule() {
+ return this.getGameRules().getBoolean(GameRules.RULE_GLOBAL_SOUND_EVENTS) ? ((ServerLevel) this).getServer().getPlayerList().players : ((ServerLevel) this).players();
diff --git a/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch b/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch
index e55de5ec29..e93ba583d2 100644
--- a/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch
+++ b/patches/server/0102-Add-setting-for-proxy-online-mode-status.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Add setting for proxy online mode status
TODO: Add isProxyOnlineMode check to Metrics
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index 1df4c9b12852ac05652260678597d13ced40f80d..eb740abb5f51b9423f76faae1701dca4cc127569 100644
+index 726bb3fcb25321d80caa5967cca86733a234b939..1e73010b292b4d46daaa33ea5b9480bf00944390 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-@@ -584,7 +584,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+@@ -557,7 +557,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
public boolean enforceSecureProfile() {
DedicatedServerProperties dedicatedserverproperties = this.getProperties();
@@ -60,7 +60,7 @@ index b3c6e76105ee26a79a84a203935530f859460652..e697b8f7b165d2394d8155cbee7453e2
} else {
String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index f8613718893c778cac3396fcedba1cf8144f0f0e..6d45d5f149211eaad9a07019290dac2c3d04084c 100644
+index 7555a74c90082d4164fbfda9d467514ccf7815bb..b765da78ff380ffdf6472f850eab73d75fd6f469 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1821,7 +1821,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0104-Configurable-packet-in-spam-threshold.patch b/patches/server/0104-Configurable-packet-in-spam-threshold.patch
index b23494003a..632d6bbe9b 100644
--- a/patches/server/0104-Configurable-packet-in-spam-threshold.patch
+++ b/patches/server/0104-Configurable-packet-in-spam-threshold.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Configurable packet in spam threshold
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 21d3b837b6875dd9833a70f6f8bca2070016c5a0..9d23e60b166caf31856b2592f844af7d6ac68469 100644
+index a91ba515265c869529776521345887574e1d4076..4440648589d28d006dee314b6199d005ae17d7f8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1536,13 +1536,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1529,13 +1529,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot start - limit place/interactions
private int limitedPackets;
private long lastLimitedPacket = -1;
diff --git a/patches/server/0105-Configurable-flying-kick-messages.patch b/patches/server/0105-Configurable-flying-kick-messages.patch
index 69bb594e2c..261f981c0c 100644
--- a/patches/server/0105-Configurable-flying-kick-messages.patch
+++ b/patches/server/0105-Configurable-flying-kick-messages.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable flying kick messages
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 9d23e60b166caf31856b2592f844af7d6ac68469..4c689d2a794e53a2d9915f1ba46435c41bfa74e9 100644
+index 4440648589d28d006dee314b6199d005ae17d7f8..63b2028bc880b39e679637228ba86c2cc470490f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -338,7 +338,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
diff --git a/patches/server/0107-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch b/patches/server/0107-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch
index e97386237d..30f320dca0 100644
--- a/patches/server/0107-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch
+++ b/patches/server/0107-Filter-bad-block-entity-nbt-data-from-falling-blocks.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Filter bad block entity nbt data from falling blocks
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
-index 6c4224e4752b655710c5b992d9acf9563b183483..ffed5f2295f60416535015a28635975aa2d211dd 100644
+index 67088152004caeecf4a678618be19419862e7ff1..1b9dfc32ce13dc9ec2fab60750dc1184dbddc5bd 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -334,7 +334,7 @@ public class FallingBlockEntity extends Entity {
diff --git a/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch b/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch
index 5898ce0516..855b74ef98 100644
--- a/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch
+++ b/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index ae361c8a5350b1072df5f672a8208a562b6a4312..914e551d7b2bc383c7247f1f584c6ea4f541887f 100644
+index b765da78ff380ffdf6472f850eab73d75fd6f469..b8eac20a5df37408321d3b05f4c55f091f808f50 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2735,5 +2735,24 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0113-Optimize-Level.hasChunkAt-BlockPosition-Z.patch b/patches/server/0113-Optimize-Level.hasChunkAt-BlockPosition-Z.patch
index 94ca9a49cb..a18ca9a73c 100644
--- a/patches/server/0113-Optimize-Level.hasChunkAt-BlockPosition-Z.patch
+++ b/patches/server/0113-Optimize-Level.hasChunkAt-BlockPosition-Z.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Optimize Level.hasChunkAt(BlockPosition)Z
Reduce method invocations for World.isLoaded(BlockPosition)Z
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 945c620d9ab369d798d1abb03ad8fa4eb02cfb5a..b25505d7053aa6cbe8e2c10e27d9c810dd7c9529 100644
+index bffd24f48e509c9049d4c35687bfd35b505db255..0a9b7693a19179a2e8903da76266adf589ae7abb 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -353,6 +353,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0114-Bound-Treasure-Maps-to-World-Border.patch b/patches/server/0114-Bound-Treasure-Maps-to-World-Border.patch
index 2154e105ae..99e596d2e8 100644
--- a/patches/server/0114-Bound-Treasure-Maps-to-World-Border.patch
+++ b/patches/server/0114-Bound-Treasure-Maps-to-World-Border.patch
@@ -34,7 +34,7 @@ index 52325a99ea38530ad69a39ac0215233139f35268..bf5ac907507bf3b5bfcef45b566c0bc1
return (double) pos.getMaxBlockX() > this.getMinX() && (double) pos.getMinBlockX() < this.getMaxX() && (double) pos.getMaxBlockZ() > this.getMinZ() && (double) pos.getMinBlockZ() < this.getMaxZ();
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
-index e124ae2711bcd4681fe0b41bd266de67bef8344f..1eacb6998f99833441dd1dcb8301f25759675f53 100644
+index b2f9429e0d437cf70bf56410e163e957b80ebdf1..3e57142dd9cb23d43857d5a4cb30962e4b696b74 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -217,6 +217,7 @@ public abstract class ChunkGenerator {
diff --git a/patches/server/0117-String-based-Action-Bar-API.patch b/patches/server/0117-String-based-Action-Bar-API.patch
index 25324073ee..c075009575 100644
--- a/patches/server/0117-String-based-Action-Bar-API.patch
+++ b/patches/server/0117-String-based-Action-Bar-API.patch
@@ -26,10 +26,10 @@ index cb88a3a4e4c87a6d6c838183c1640b13d82c9344..0b391b0dc6262ef482c4a253a074b593
// Paper end
buf.writeComponent(this.text);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index b15df5f55dc12c358df74df500f210976eaba048..028be33a35e2630cdd49aa03b58e3cf32e565d49 100644
+index bfbd69635c4a2565cc9a72147ff9585efe40e861..53d33699b8389a46d27e897b1c24fb250ae025f8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -343,6 +343,29 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -301,6 +301,29 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper start
diff --git a/patches/server/0118-Properly-fix-item-duplication-bug.patch b/patches/server/0118-Properly-fix-item-duplication-bug.patch
index a4ee97b784..6c85bd6ab9 100644
--- a/patches/server/0118-Properly-fix-item-duplication-bug.patch
+++ b/patches/server/0118-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 ac0b8d569a71098f92aa3d02f1f3d459e20755ab..ede3afab5c2a1d175a5beea85ffa362a3481a857 100644
+index 7e777ab6998203e031fb8387b1521bff3d86f11a..5197fc02a080c3f603030d5c4fa59e10f8c0e3b6 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2495,7 +2495,7 @@ public class ServerPlayer extends Player {
+@@ -2451,7 +2451,7 @@ public class ServerPlayer extends Player {
@Override
public boolean isImmobile() {
diff --git a/patches/server/0121-Provide-E-TE-Chunk-count-stat-methods.patch b/patches/server/0121-Provide-E-TE-Chunk-count-stat-methods.patch
index d95b774acb..6aeb136428 100644
--- a/patches/server/0121-Provide-E-TE-Chunk-count-stat-methods.patch
+++ b/patches/server/0121-Provide-E-TE-Chunk-count-stat-methods.patch
@@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 537d532a2663a0f0384a4af1ffe008dfa395cb38..4e1b8ce73f07b8ea12f9f2b7883cd994aed73648 100644
+index 0a9b7693a19179a2e8903da76266adf589ae7abb..1a23790dea064d0e19b58858f9693cb5ec5e5552 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -119,7 +119,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -20,7 +20,7 @@ index 537d532a2663a0f0384a4af1ffe008dfa395cb38..4e1b8ce73f07b8ea12f9f2b7883cd994
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 3c7fdf150f39a75794a6927bd545c3eb9c480d6f..e60992a618f05174f887ce85741a127161cef408 100644
+index 68a7db9c840f101950435b386058f4cf409bfc05..27f7b2cacd3113289b852c767e379d9769a9fa01 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -157,6 +157,56 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0122-Enforce-Sync-Player-Saves.patch b/patches/server/0122-Enforce-Sync-Player-Saves.patch
index 4caf5c398d..3a87480826 100644
--- a/patches/server/0122-Enforce-Sync-Player-Saves.patch
+++ b/patches/server/0122-Enforce-Sync-Player-Saves.patch
@@ -7,7 +7,7 @@ Saving players async is extremely dangerous. This will force it to main
the same way we handle async chunk loads.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index e3195f03ac449e6e4870489d530ef40918cd5556..e93b9c103e9b48fc4eab4ca41ce77c807d3d11ed 100644
+index a8a0b00a6bcc52a94b99d520915c21cc3155bb06..18d1056b9a3d936a851f7e7a49981dd4bb203f1d 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1061,11 +1061,13 @@ public abstract class PlayerList {
diff --git a/patches/server/0123-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/0123-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
index c6a7fb9ad2..16a57c51f8 100644
--- a/patches/server/0123-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
+++ b/patches/server/0123-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
@@ -247,7 +247,7 @@ index d4d1cad7963a5adcc8c32e1bc02104eb70514331..0321b4bb622930bfe57661b0e6b893d7
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
-index af6829c25fcd186adc3575d50cab6d46db9a2fac..5c77992e0c49eb217dd66657b35164225b400518 100644
+index 8b27b5118cbeeb0b25fb6a23056e51899be32035..94bdd467108bc5fd0211f67a792787ef7c356619 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -522,7 +522,7 @@ public class FishingHook extends Projectile {
diff --git a/patches/server/0124-Cap-Entity-Collisions.patch b/patches/server/0124-Cap-Entity-Collisions.patch
index a202546f48..a075418955 100644
--- a/patches/server/0124-Cap-Entity-Collisions.patch
+++ b/patches/server/0124-Cap-Entity-Collisions.patch
@@ -12,7 +12,7 @@ just as it does in Vanilla, but entity pushing logic will be capped.
You can set this to 0 to disable collisions.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 5a69e9b6872426e94d8b4d7a47790e4fd051f157..5903cbf0b5fe99453c74e2abc4e07415507d70dc 100644
+index a914d2906ae7433164d7f439a0f2f0d781b14747..05cb13a5636f82d48bf0bd8b9d27abdd80a8df71 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -393,6 +393,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
diff --git a/patches/server/0126-Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/0126-Properly-handle-async-calls-to-restart-the-server.patch
index 98b711f313..d7fb293ae3 100644
--- a/patches/server/0126-Properly-handle-async-calls-to-restart-the-server.patch
+++ b/patches/server/0126-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 3410a2b68146f34f37446c9daeb20f8860b37292..5ab790ed036215d8b09f63f4f13a32a4af07e1c6 100644
+index 730dab49d8216ed458a8d75e873cf5e949b4e4c0..0b4b9b0dc80db7cc0287ccdfcdc0cb73dd15bef4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -236,6 +236,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -41,7 +41,7 @@ index 3410a2b68146f34f37446c9daeb20f8860b37292..5ab790ed036215d8b09f63f4f13a32a4
private boolean stopped;
private int tickCount;
private int ticksUntilAutosave;
-@@ -928,7 +929,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -918,7 +919,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.playerList != null) {
MinecraftServer.LOGGER.info("Saving players");
this.playerList.saveAll();
@@ -50,7 +50,7 @@ index 3410a2b68146f34f37446c9daeb20f8860b37292..5ab790ed036215d8b09f63f4f13a32a4
try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets
}
-@@ -979,6 +980,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -998,6 +999,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void halt(boolean waitForShutdown) {
@@ -64,7 +64,7 @@ index 3410a2b68146f34f37446c9daeb20f8860b37292..5ab790ed036215d8b09f63f4f13a32a4
if (waitForShutdown) {
try {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index e93b9c103e9b48fc4eab4ca41ce77c807d3d11ed..b38496b2a4d10c7f51667fca2a19129ac7db0016 100644
+index 18d1056b9a3d936a851f7e7a49981dd4bb203f1d..40af2325afea3e4831a9d8795ce1932a6a5663bf 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1175,8 +1175,15 @@ public abstract class PlayerList {
diff --git a/patches/server/0127-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/patches/server/0127-Add-option-to-make-parrots-stay-on-shoulders-despite.patch
index 5537260d85..3bda195d94 100644
--- a/patches/server/0127-Add-option-to-make-parrots-stay-on-shoulders-despite.patch
+++ b/patches/server/0127-Add-option-to-make-parrots-stay-on-shoulders-despite.patch
@@ -14,10 +14,10 @@ To be converted into a Paper-API event at some point in the future?
public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 4c689d2a794e53a2d9915f1ba46435c41bfa74e9..03bc7ae947360a721fef5a772ecadb4a18ac73b2 100644
+index 63b2028bc880b39e679637228ba86c2cc470490f..2f34ff72f8932a8cac9af48003dfa505f19f07d0 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2184,6 +2184,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -2177,6 +2177,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
switch (packet.getAction()) {
case PRESS_SHIFT_KEY:
this.player.setShiftKeyDown(true);
diff --git a/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch
index b932c92135..60d7a14107 100644
--- a/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch
+++ b/patches/server/0128-Add-configuration-option-to-prevent-player-names-fro.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Add configuration option to prevent player names from being
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 914e551d7b2bc383c7247f1f584c6ea4f541887f..e5c3ee4c53dd1c09e35f1d1a47f4467a6a06ae71 100644
+index b8eac20a5df37408321d3b05f4c55f091f808f50..83eb0a8aec7b54f15af033a1018d6cd7901e6ce7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2754,5 +2754,10 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch
index 55cfa13cf6..ca065d6a9a 100644
--- a/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch
+++ b/patches/server/0129-Use-TerminalConsoleAppender-for-console-improvements.patch
@@ -250,7 +250,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 1aed25e485a45c6bf77f0baebc1a7745f441af5b..1e1c6f8b22da3e51d001db11392f3ea8d3d3573d 100644
+index 0b4b9b0dc80db7cc0287ccdfcdc0cb73dd15bef4..e63fc78259cc802251450e6d73f9837ebcd2f4e6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -155,7 +155,7 @@ import org.slf4j.Logger;
@@ -289,7 +289,7 @@ index 1aed25e485a45c6bf77f0baebc1a7745f441af5b..1e1c6f8b22da3e51d001db11392f3ea8
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
// CraftBukkit end
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
-@@ -1113,7 +1116,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1124,7 +1127,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
org.spigotmc.WatchdogThread.doStop(); // Spigot
// CraftBukkit start - Restore terminal to original settings
try {
@@ -298,7 +298,7 @@ index 1aed25e485a45c6bf77f0baebc1a7745f441af5b..1e1c6f8b22da3e51d001db11392f3ea8
} catch (Exception ignored) {
}
// CraftBukkit end
-@@ -1616,7 +1619,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1622,7 +1625,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override
public void sendSystemMessage(Component message) {
@@ -308,7 +308,7 @@ index 1aed25e485a45c6bf77f0baebc1a7745f441af5b..1e1c6f8b22da3e51d001db11392f3ea8
public KeyPair getKeyPair() {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index eb740abb5f51b9423f76faae1701dca4cc127569..5b64c7f2f36bdf03f8a764d6c8d77524a0774ad1 100644
+index 1e73010b292b4d46daaa33ea5b9480bf00944390..6aede562955799fae90a1234b6300ba3a91ba2f2 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -98,6 +98,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -372,7 +372,7 @@ index 75083eeb9b413e6dd5375007360dce6857a08fff..d292fdb165436f0b9b46b32110f5e09a
if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeLater(() -> {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index b38496b2a4d10c7f51667fca2a19129ac7db0016..466ca062eaeb9108c59f308a8212cbaf79ad0fc3 100644
+index 40af2325afea3e4831a9d8795ce1932a6a5663bf..db4480778e4b917a073c61f29cd45663ed859597 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -160,8 +160,7 @@ public abstract class PlayerList {
@@ -386,7 +386,7 @@ index b38496b2a4d10c7f51667fca2a19129ac7db0016..466ca062eaeb9108c59f308a8212cbaf
this.bans = new UserBanList(PlayerList.USERBANLIST_FILE);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index e5c3ee4c53dd1c09e35f1d1a47f4467a6a06ae71..44cb33b24fa9d9b8ed42e0fab5b8bd8a3f6ff8ea 100644
+index 83eb0a8aec7b54f15af033a1018d6cd7901e6ce7..42b2ec78b8a4089c4d35e92a5450b95a97e057ed 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -42,7 +42,7 @@ import java.util.logging.Level;
diff --git a/patches/server/0131-Item-canEntityPickup.patch b/patches/server/0131-Item-canEntityPickup.patch
index 67309fbb0b..89bfcac35f 100644
--- a/patches/server/0131-Item-canEntityPickup.patch
+++ b/patches/server/0131-Item-canEntityPickup.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Item#canEntityPickup
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index 3d054cfa5050f4b75eab4a18035655c1bfd9290b..374a91e712c2a6a8ad87d1047bb07d44eaa9908a 100644
+index 3fcd93f6d5a7553b032b44e7e919838ad2120dc9..15ad425b9c091ee27965fe166f9021509199aa18 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -670,6 +670,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
diff --git a/patches/server/0135-Basic-PlayerProfile-API.patch b/patches/server/0135-Basic-PlayerProfile-API.patch
index 99a99366e8..71ae995dc6 100644
--- a/patches/server/0135-Basic-PlayerProfile-API.patch
+++ b/patches/server/0135-Basic-PlayerProfile-API.patch
@@ -546,7 +546,7 @@ index 0000000000000000000000000000000000000000..7ac27392a8647ef7d0dc78efe78703e9
+ @NotNull GameProfile buildGameProfile();
+}
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
-index 3a00e24d78acb99d226289ccb9ba419dfc607a45..209594863c2aa965055412adb7db009cca4795a8 100644
+index 6d60bb9f77198de3f0692c24b3b0ae085f3a80d0..e5a7a77fda0c7e81c8535ef8cfaca2222b0d79fb 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -1,5 +1,7 @@
@@ -557,15 +557,15 @@ index 3a00e24d78acb99d226289ccb9ba419dfc607a45..209594863c2aa965055412adb7db009c
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import io.papermc.paper.math.BlockPosition;
import io.papermc.paper.math.FinePosition;
-@@ -30,6 +32,7 @@ import net.minecraft.world.level.chunk.ChunkAccess;
- import net.minecraft.world.level.chunk.ChunkStatus;
+@@ -17,6 +19,7 @@ import net.minecraft.world.level.ClipContext;
+ import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import org.apache.commons.lang.exception.ExceptionUtils;
+import com.mojang.authlib.GameProfile;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.CraftWorld;
-@@ -377,6 +380,10 @@ public final class MCUtil {
+@@ -361,6 +364,10 @@ public final class MCUtil {
return run.get();
}
@@ -577,7 +577,7 @@ index 3a00e24d78acb99d226289ccb9ba419dfc607a45..209594863c2aa965055412adb7db009c
* Calculates distance between 2 entities
* @param e1
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
-index 9ead836c08ff48430bc6d3ba225864f48d335eee..0c9f6443663bc567a181393b13311a909602f4a4 100644
+index ba58580f4c60205d1c7a7b7dfcdc22c4fafc9bc6..5374a6b70a9780cfe9f62207b290b9a3ab82c7e9 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -176,7 +176,7 @@ public class Main {
@@ -612,7 +612,7 @@ index adb472c175cc6f6ced7075a37423d6c898fd5ccb..1ec0f3a7148c2f412421772f6e1dff0b
String s1 = name.toLowerCase(Locale.ROOT);
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 44cb33b24fa9d9b8ed42e0fab5b8bd8a3f6ff8ea..6e5f7936ff7e2838ca88990343e553a6f1213821 100644
+index 42b2ec78b8a4089c4d35e92a5450b95a97e057ed..0ba93b1fe563a76dae12cef93ae4a33ca92ff4e6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -260,6 +260,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
diff --git a/patches/server/0136-Add-UnknownCommandEvent.patch b/patches/server/0136-Add-UnknownCommandEvent.patch
index 38cfb8b04d..abf3e9736f 100644
--- a/patches/server/0136-Add-UnknownCommandEvent.patch
+++ b/patches/server/0136-Add-UnknownCommandEvent.patch
@@ -100,7 +100,7 @@ index 495a7b713a7ab9c19aad34512b76523bad43b89d..15a5059994371da4850adcf726034a71
return null;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index f06afed5f786aad4415cd369903d97a0912dfac7..b56bfa447a15d56bf24c1bb4c05f74584cf37ad3 100644
+index 0ba93b1fe563a76dae12cef93ae4a33ca92ff4e6..24fe763be314cd80b37f929a20a1af8da12ae9e8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -527,6 +527,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0140-Entity-fromMobSpawner.patch b/patches/server/0140-Entity-fromMobSpawner.patch
index 8b3cbe0a70..7fdfeefda9 100644
--- a/patches/server/0140-Entity-fromMobSpawner.patch
+++ b/patches/server/0140-Entity-fromMobSpawner.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Entity#fromMobSpawner()
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 5903cbf0b5fe99453c74e2abc4e07415507d70dc..23f233adc1a3910237bb065a41e5d3d074d5bfd0 100644
+index 05cb13a5636f82d48bf0bd8b9d27abdd80a8df71..d96fc02a8b84dbcfc17496ca476a5dee8821b785 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -394,6 +394,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -16,7 +16,7 @@ index 5903cbf0b5fe99453c74e2abc4e07415507d70dc..23f233adc1a3910237bb065a41e5d3d0
// Paper start - Entity origin API
@javax.annotation.Nullable
private org.bukkit.util.Vector origin;
-@@ -2202,6 +2203,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2150,6 +2151,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
}
@@ -27,7 +27,7 @@ index 5903cbf0b5fe99453c74e2abc4e07415507d70dc..23f233adc1a3910237bb065a41e5d3d0
// Paper end
return nbttagcompound;
} catch (Throwable throwable) {
-@@ -2342,6 +2347,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2290,6 +2295,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.originWorld = originWorld;
origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2));
}
diff --git a/patches/server/0144-ProfileWhitelistVerifyEvent.patch b/patches/server/0144-ProfileWhitelistVerifyEvent.patch
index 48f4648d0a..b792b6feaf 100644
--- a/patches/server/0144-ProfileWhitelistVerifyEvent.patch
+++ b/patches/server/0144-ProfileWhitelistVerifyEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 466ca062eaeb9108c59f308a8212cbaf79ad0fc3..38329fe27594c3047d948aaf091fcea33ab270dd 100644
+index db4480778e4b917a073c61f29cd45663ed859597..7552d1b9e6c286daaa6b094af0fdebc2b300272a 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -631,9 +631,9 @@ public abstract class PlayerList {
diff --git a/patches/server/0145-Fix-this-stupid-bullshit.patch b/patches/server/0145-Fix-this-stupid-bullshit.patch
index 0c9ffa507d..1abc5b13f3 100644
--- a/patches/server/0145-Fix-this-stupid-bullshit.patch
+++ b/patches/server/0145-Fix-this-stupid-bullshit.patch
@@ -31,7 +31,7 @@ index 8ff786c366332588a2df053438f23cc9fb7e2b84..c887d34171f89c731d76c4ca92c70be2
Bootstrap.isBootstrapped = true;
Instant instant = Instant.now();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 09164f4c446d3e80708f1bcb9da333821ee5733d..4d2ebb7af055d1c78a648914c5a1862fe9bc8b8f 100644
+index 659b32d49016a23475f3bbda1548a78101b468ce..623c7304a6849e994e22cd559177d9de0dd2f4c4 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -258,10 +258,12 @@ public class Main {
diff --git a/patches/server/0148-Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/patches/server/0148-Reset-spawner-timer-when-spawner-event-is-cancelled.patch
index 876e3e1533..8062dad17c 100644
--- a/patches/server/0148-Reset-spawner-timer-when-spawner-event-is-cancelled.patch
+++ b/patches/server/0148-Reset-spawner-timer-when-spawner-event-is-cancelled.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Reset spawner timer when spawner event is cancelled
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
-index 1a5fb001e28997a113ad8133e9dc946206b85c35..393b77043cbaf58200fca6e56c22c36aa2aa2cfb 100644
+index 487e4211d6486d2b3052c931c27cee9729e7841b..fdd1fd084c46b0220c9e7e0389e9b52e782d2878 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -168,6 +168,7 @@ public abstract class BaseSpawner {
diff --git a/patches/server/0152-Add-PlayerJumpEvent.patch b/patches/server/0152-Add-PlayerJumpEvent.patch
index 6e62818a62..d305d17f35 100644
--- a/patches/server/0152-Add-PlayerJumpEvent.patch
+++ b/patches/server/0152-Add-PlayerJumpEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerJumpEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 03bc7ae947360a721fef5a772ecadb4a18ac73b2..dd1de1632900fd3a3771241c5f3ce69c673f64d7 100644
+index 2f34ff72f8932a8cac9af48003dfa505f19f07d0..ba2628f22907b386fe5638220e5f10e39bc1f80b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1225,7 +1225,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1218,7 +1218,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
boolean flag = d7 > 0.0D;
if (this.player.onGround() && !packet.isOnGround() && flag) {
diff --git a/patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch b/patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch
index 63dabebf9b..dd5398aac0 100644
--- a/patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch
+++ b/patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch
@@ -90,10 +90,10 @@ index ce51bde4db395ff30c7d75e3badd68d6395fa40f..3dfec4462d85f3223071b4e78465587d
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 028be33a35e2630cdd49aa03b58e3cf32e565d49..f35a53f6e4af319a4ce6f8e5dc8eb65edb47b6ed 100644
+index 53d33699b8389a46d27e897b1c24fb250ae025f8..c3eb39a30a70d7e289caba49749cf1f9c812be90 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -289,6 +289,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -247,6 +247,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}
diff --git a/patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch b/patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch
index eec57ecdcb..fb3a45d1ce 100644
--- a/patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch
+++ b/patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: Block entity unload lag spike
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 4e55288250fdefcd55d98f94b58ce8c2411fe1b4..6e3b4a0ace95331e318ce587cb3e03670a1f5c9d 100644
+index 1a23790dea064d0e19b58858f9693cb5ec5e5552..2c135093e8eee614e23676a2f07ee4a22ca8203c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -739,6 +739,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -734,6 +734,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
boolean flag = this.tickRateManager().runsNormally();
int tilesThisCycle = 0;
@@ -17,7 +17,7 @@ index 4e55288250fdefcd55d98f94b58ce8c2411fe1b4..6e3b4a0ace95331e318ce587cb3e0367
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
-@@ -747,12 +749,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -742,12 +744,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity.isRemoved()) {
// Spigot start
tilesThisCycle--;
diff --git a/patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch b/patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch
index 13230fb7a8..f017e35ca3 100644
--- a/patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch
+++ b/patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch
@@ -18,7 +18,7 @@ the blockstate that will be valid for restoration, as opposed to dropping
information on restoration when the event is cancelled.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 6e3b4a0ace95331e318ce587cb3e03670a1f5c9d..9d2cf866cf4f0c93dea028e3673d9a51615059af 100644
+index 2c135093e8eee614e23676a2f07ee4a22ca8203c..19d6a829edb977d064c5d5a42ae3cab4fc806bb6 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -157,7 +157,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -49,7 +49,7 @@ index 6e3b4a0ace95331e318ce587cb3e03670a1f5c9d..9d2cf866cf4f0c93dea028e3673d9a51
this.capturedBlockStates.put(pos.immutable(), blockstate);
captured = true;
}
-@@ -621,7 +622,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -616,7 +617,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public BlockState getBlockState(BlockPos pos) {
// CraftBukkit start - tree generation
if (this.captureTreeGeneration) {
diff --git a/patches/server/0161-API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/0161-API-to-get-a-BlockState-without-a-snapshot.patch
index 71620cdbbd..423d453874 100644
--- a/patches/server/0161-API-to-get-a-BlockState-without-a-snapshot.patch
+++ b/patches/server/0161-API-to-get-a-BlockState-without-a-snapshot.patch
@@ -13,7 +13,7 @@ also Avoid NPE during CraftBlockEntityState load if could not get TE
If Tile Entity was null, correct Sign to return empty lines instead of null
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
-index 63acd109a79ed752a05df3d4f1b99309297c2055..d156f7cc71050f13b2feca00c52ca6b64572b60e 100644
+index 66757716b401d4f5b690c895effbbaa46f169238..53443b472d21633f49c102b330c8406c92f09d8d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -44,6 +44,7 @@ public abstract class BlockEntity {
diff --git a/patches/server/0162-AsyncTabCompleteEvent.patch b/patches/server/0162-AsyncTabCompleteEvent.patch
index 4e3a23dd1a..fd28484e3e 100644
--- a/patches/server/0162-AsyncTabCompleteEvent.patch
+++ b/patches/server/0162-AsyncTabCompleteEvent.patch
@@ -16,10 +16,10 @@ Also adds isCommand and getLocation to the sync TabCompleteEvent
Co-authored-by: Aikar <[email protected]>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index dd1de1632900fd3a3771241c5f3ce69c673f64d7..14e891458fad814e374f14ef5710a352efb9dac4 100644
+index ba2628f22907b386fe5638220e5f10e39bc1f80b..2d633b9921e04dac21d705ffdf0f5a92b41c2e30 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -688,12 +688,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -688,27 +688,58 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
@@ -37,10 +37,6 @@ index dd1de1632900fd3a3771241c5f3ce69c673f64d7..14e891458fad814e374f14ef5710a352
+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam"))); // Paper - AsyncTabCompleteEvent
return;
}
- // Paper start
-@@ -704,18 +708,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
- }
- // Paper end
// CraftBukkit end
+ // Paper start - AsyncTabCompleteEvent
+ TAB_COMPLETE_EXECUTOR.execute(() -> {
@@ -91,7 +87,7 @@ index dd1de1632900fd3a3771241c5f3ce69c673f64d7..14e891458fad814e374f14ef5710a352
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index b56bfa447a15d56bf24c1bb4c05f74584cf37ad3..9bc095ccb142e83e419a7f88591bf1219d09bacb 100644
+index 24fe763be314cd80b37f929a20a1af8da12ae9e8..26a5e44fdb0078b2711228ac4f0eb827fe03f037 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2227,7 +2227,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch b/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch
index c9b5761eb0..0fd436a80a 100644
--- a/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch
+++ b/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch
@@ -14,10 +14,10 @@ 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 f35a53f6e4af319a4ce6f8e5dc8eb65edb47b6ed..62c531603c68597add75de31749943bd47e4580f 100644
+index c3eb39a30a70d7e289caba49749cf1f9c812be90..ee5d14413f27e61df0adc8c151cee438a912e6cf 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1543,7 +1543,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1501,7 +1501,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override
diff --git a/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch
index 602f2252d2..3106e55513 100644
--- a/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch
+++ b/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch
@@ -9,10 +9,10 @@ from triggering monster spawns on a server.
Also a highly more effecient way to blanket block spawns in a world
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 2a52f5fc867f35b9d94b813d5cdd92249c60ee8b..b2d679ba18e5f095d1c3e0249022fc564b1a553e 100644
+index ed095afdf8be843b9a608130040739c0b21dbe0a..57b344459b670742edc81a5046f1dfc2dae52c9f 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -704,7 +704,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1212,7 +1212,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 2a52f5fc867f35b9d94b813d5cdd92249c60ee8b..b2d679ba18e5f095d1c3e0249022fc56
// Spigot end
if (!this.distanceManager.hasPlayersNearby(chunkcoordintpair.toLong())) {
return false;
-@@ -719,6 +721,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1227,6 +1229,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
entityplayer = (ServerPlayer) iterator.next();
@@ -40,10 +40,10 @@ index 2a52f5fc867f35b9d94b813d5cdd92249c60ee8b..b2d679ba18e5f095d1c3e0249022fc56
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 1ad6b62ee53e2ee4a710211dfc750780519004f9..de1d5da6318958e11a9da56ddd8fef1174d0a537 100644
+index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..5fc48485aa2045c19c5ec2ba9cb6fafabb1ae8f1 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -557,6 +557,15 @@ public class ServerChunkCache extends ChunkSource {
+@@ -710,6 +710,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,7 +60,7 @@ index 1ad6b62ee53e2ee4a710211dfc750780519004f9..de1d5da6318958e11a9da56ddd8fef11
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 ede3afab5c2a1d175a5beea85ffa362a3481a857..708d1033306da34844827854edaf8a68ed67a936 100644
+index 5197fc02a080c3f603030d5c4fa59e10f8c0e3b6..d51244c634d0209efb98be965ce7318480220b96 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -265,6 +265,7 @@ public class ServerPlayer extends Player {
@@ -69,5 +69,5 @@ index ede3afab5c2a1d175a5beea85ffa362a3481a857..708d1033306da34844827854edaf8a68
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
+ public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
- // Paper start - replace player chunk loader
- private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
+ public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
+ super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
diff --git a/patches/server/0167-PreCreatureSpawnEvent.patch b/patches/server/0167-PreCreatureSpawnEvent.patch
index 979a740ce6..a9c1c29612 100644
--- a/patches/server/0167-PreCreatureSpawnEvent.patch
+++ b/patches/server/0167-PreCreatureSpawnEvent.patch
@@ -97,7 +97,7 @@ index f0d5e45d0d6ac51106379d20690d34a032a24c39..bfd156acbae31619234fffb180472609
}
}
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
-index 393b77043cbaf58200fca6e56c22c36aa2aa2cfb..db4beb22cf54bb3b53561ec0fe06209c478977ff 100644
+index fdd1fd084c46b0220c9e7e0389e9b52e782d2878..28f63a211f4ae207b2400d16b1725808ad87f334 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -130,6 +130,27 @@ public abstract class BaseSpawner {
diff --git a/patches/server/0170-Add-ArmorStand-Item-Meta.patch b/patches/server/0170-Add-ArmorStand-Item-Meta.patch
index c718255889..eadb53308d 100644
--- a/patches/server/0170-Add-ArmorStand-Item-Meta.patch
+++ b/patches/server/0170-Add-ArmorStand-Item-Meta.patch
@@ -255,10 +255,10 @@ index b77f5832265be5aaf96d95fcac4737919720fa6e..e15723080445b09852512132039ca2cd
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index 9dbadab7134c7bb56572cf8c89148b6c743e9bcd..ff199678850d848c5d2ce76270d674738eec58f7 100644
+index c76fe9599b4f2458cac6e2477f1f963451b357b4..76982348d76ecbcc3db1d81ebb5d2a8805b81e94 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-@@ -1462,6 +1462,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1502,6 +1502,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CraftMetaCrossbow.CHARGED.NBT,
CraftMetaCrossbow.CHARGED_PROJECTILES.NBT,
CraftMetaSuspiciousStew.EFFECTS.NBT,
diff --git a/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch b/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch
index a6f11ff3e2..cfcace7005 100644
--- a/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch
+++ b/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch
@@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..6b0bdc266109cdfb874f08bf74323603
+
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 1e1c6f8b22da3e51d001db11392f3ea8d3d3573d..3d066e2a985ed46bc73d9856490d4aa692de26f3 100644
+index e63fc78259cc802251450e6d73f9837ebcd2f4e6..1f5f8c7398e974fc8771265b1bc27f68065f944a 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;
@@ -194,7 +194,7 @@ index 1e1c6f8b22da3e51d001db11392f3ea8d3d3573d..3d066e2a985ed46bc73d9856490d4aa6
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
-@@ -1364,7 +1367,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1370,7 +1373,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.hidesOnlinePlayers()) {
return new ServerStatus.Players(i, list.size(), List.of());
} else {
diff --git a/patches/server/0177-Player.setPlayerProfile-API.patch b/patches/server/0177-Player.setPlayerProfile-API.patch
index efbd55b0ed..46bea5337c 100644
--- a/patches/server/0177-Player.setPlayerProfile-API.patch
+++ b/patches/server/0177-Player.setPlayerProfile-API.patch
@@ -9,10 +9,10 @@ This can be useful for changing name or skins after a player has logged in.
public-f net.minecraft.world.entity.player.Player gameProfile
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 14e891458fad814e374f14ef5710a352efb9dac4..51d5bed032f89333917accca242772a09ee98d93 100644
+index 2d633b9921e04dac21d705ffdf0f5a92b41c2e30..32724550974616c1a17ee3c58fb34fed45898c36 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1468,7 +1468,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1461,7 +1461,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.emptySet());
}
@@ -40,7 +40,7 @@ index c05c4258c48d967be7bde8570ac7bd91a9f3bdda..b23b7560854a9904e28bbd06afccf5bb
playerName = gameprofile.getName();
uniqueId = gameprofile.getId();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 38329fe27594c3047d948aaf091fcea33ab270dd..99ba7c82f8a8db9d5841cce18ed5f39439b512b0 100644
+index 7552d1b9e6c286daaa6b094af0fdebc2b300272a..9f8a95c8f46a11f36ff16863922a91a8d81d0bb3 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -862,10 +862,16 @@ public abstract class PlayerList {
@@ -77,10 +77,10 @@ index 477d3245facb5ae59c786d4f696f64226cb540a6..e8490a58dd4d9bc39a5bb2f9fc109526
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 62c531603c68597add75de31749943bd47e4580f..8c64222f2b0d725c54543911efb0f7d9e98b7bd1 100644
+index ee5d14413f27e61df0adc8c151cee438a912e6cf..0f78ff8b4a7143388416563d964c467d29617b36 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -272,11 +272,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -230,11 +230,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.server.getPlayer(this.getUniqueId()) != null;
}
@@ -92,7 +92,7 @@ index 62c531603c68597add75de31749943bd47e4580f..8c64222f2b0d725c54543911efb0f7d9
@Override
public InetSocketAddress getAddress() {
if (this.getHandle().connection == null) return null;
-@@ -1693,8 +1688,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1651,8 +1646,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private void untrackAndHideEntity(org.bukkit.entity.Entity entity) {
// Remove this entity from the hidden player's EntityTrackerEntry
@@ -109,7 +109,7 @@ index 62c531603c68597add75de31749943bd47e4580f..8c64222f2b0d725c54543911efb0f7d9
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
if (entry != null) {
entry.removePlayer(this.getHandle());
-@@ -1707,8 +1709,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1665,8 +1667,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID())));
}
}
@@ -118,7 +118,7 @@ index 62c531603c68597add75de31749943bd47e4580f..8c64222f2b0d725c54543911efb0f7d9
}
void resetAndHideEntity(org.bukkit.entity.Entity entity) {
-@@ -1773,12 +1773,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1731,12 +1731,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
private void trackAndShowEntity(org.bukkit.entity.Entity entity) {
@@ -144,7 +144,7 @@ index 62c531603c68597add75de31749943bd47e4580f..8c64222f2b0d725c54543911efb0f7d9
}
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
-@@ -1788,6 +1801,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1746,6 +1759,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
}
@@ -184,7 +184,7 @@ index 62c531603c68597add75de31749943bd47e4580f..8c64222f2b0d725c54543911efb0f7d9
void resetAndShowEntity(org.bukkit.entity.Entity entity) {
// SPIGOT-7312: Can't show/hide self
-@@ -1799,6 +1845,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1757,6 +1803,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.trackAndShowEntity(entity);
}
}
diff --git a/patches/server/0178-getPlayerUniqueId-API.patch b/patches/server/0178-getPlayerUniqueId-API.patch
index 73d33c7f0b..25219f9e9d 100644
--- a/patches/server/0178-getPlayerUniqueId-API.patch
+++ b/patches/server/0178-getPlayerUniqueId-API.patch
@@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 9bc095ccb142e83e419a7f88591bf1219d09bacb..8c987d3a3042fadee01508ad0a62eb9878e8dd54 100644
+index 26a5e44fdb0078b2711228ac4f0eb827fe03f037..43406c5d7fdd3cd7c88aad5a86252eab28a88c0b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1826,6 +1826,25 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0182-Flag-to-disable-the-channel-limit.patch b/patches/server/0182-Flag-to-disable-the-channel-limit.patch
index 1e9b411ae5..d721760e58 100644
--- a/patches/server/0182-Flag-to-disable-the-channel-limit.patch
+++ b/patches/server/0182-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 8c64222f2b0d725c54543911efb0f7d9e98b7bd1..bcbe11807186d2d79a155f6be7bda029ca5f555d 100644
+index 0f78ff8b4a7143388416563d964c467d29617b36..e0ce56ab1a1980800402e55ee49df3b896afee60 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -190,6 +190,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -20,7 +20,7 @@ index 8c64222f2b0d725c54543911efb0f7d9e98b7bd1..bcbe11807186d2d79a155f6be7bda029
public CraftPlayer(CraftServer server, ServerPlayer entity) {
super(server, entity);
-@@ -2160,7 +2161,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2118,7 +2119,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void addChannel(String channel) {
diff --git a/patches/server/0187-Block-Enderpearl-Travel-Exploit.patch b/patches/server/0187-Block-Enderpearl-Travel-Exploit.patch
index 00de4c971e..213dc36f8e 100644
--- a/patches/server/0187-Block-Enderpearl-Travel-Exploit.patch
+++ b/patches/server/0187-Block-Enderpearl-Travel-Exploit.patch
@@ -16,10 +16,10 @@ 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 87cd4d17d618cd9d69a38838a05dbe5d0fe807d4..f27472e03a6dc0781168c5862c57b501f7ae2dc9 100644
+index 54b3103d558adacba5f7a7b9fd230649623c7702..85e63061856a49c8e531eb0de8d1ca7b9805f424 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2368,6 +2368,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2114,6 +2114,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void onTickingEnd(Entity entity) {
ServerLevel.this.entityTickList.remove(entity);
diff --git a/patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch b/patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch
index 87f4720737..25289ea1b6 100644
--- a/patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch
+++ b/patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch
@@ -10,10 +10,10 @@ 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 f27472e03a6dc0781168c5862c57b501f7ae2dc9..6c6ccdf7fb1cab27af720b2c8ef9d68b4521a20d 100644
+index 85e63061856a49c8e531eb0de8d1ca7b9805f424..aa9d514f26fbe70edf3a8b7443fbaf577cf3a030 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1742,12 +1742,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1503,12 +1503,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public <T extends ParticleOptions> int sendParticles(ServerPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) {
@@ -34,10 +34,10 @@ index f27472e03a6dc0781168c5862c57b501f7ae2dc9..6c6ccdf7fb1cab27af720b2c8ef9d68b
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 e60992a618f05174f887ce85741a127161cef408..6abf000543cb842ff43f0adbde035fff595e553d 100644
+index 27f7b2cacd3113289b852c767e379d9769a9fa01..8fbc232ce409951d67eee1dbe34bc5bf4d069d01 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -1948,13 +1948,20 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1919,13 +1919,20 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
diff --git a/patches/server/0203-Add-EntityKnockbackByEntityEvent-and-EntityPushedByE.patch b/patches/server/0203-Add-EntityKnockbackByEntityEvent-and-EntityPushedByE.patch
index 33062124b9..f13d3359c8 100644
--- a/patches/server/0203-Add-EntityKnockbackByEntityEvent-and-EntityPushedByE.patch
+++ b/patches/server/0203-Add-EntityKnockbackByEntityEvent-and-EntityPushedByE.patch
@@ -9,10 +9,10 @@ Co-authored-by: aerulion <[email protected]>
This event is called when an entity receives knockback by another entity.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 23f233adc1a3910237bb065a41e5d3d074d5bfd0..fad0460ac5d6792384fa46ff9741fee1887e792c 100644
+index d96fc02a8b84dbcfc17496ca476a5dee8821b785..94c6914a7af6329e4bed8a8d470563b7901fb248 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -1909,8 +1909,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -1857,8 +1857,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public void push(double deltaX, double deltaY, double deltaZ) {
diff --git a/patches/server/0204-Expand-Explosions-API.patch b/patches/server/0204-Expand-Explosions-API.patch
index 23a102686c..c91ea25247 100644
--- a/patches/server/0204-Expand-Explosions-API.patch
+++ b/patches/server/0204-Expand-Explosions-API.patch
@@ -6,10 +6,10 @@ 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 6abf000543cb842ff43f0adbde035fff595e553d..fd73f71cf9ab267c8904012062fc6030897d0de4 100644
+index 8fbc232ce409951d67eee1dbe34bc5bf4d069d01..4f631eced3403df0339d3d7b4a49b5c8f68408dd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -719,6 +719,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -729,6 +729,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) {
return !this.world.explode(source == null ? null : ((CraftEntity) source).getHandle(), x, y, z, power, setFire, breakBlocks ? net.minecraft.world.level.Level.ExplosionInteraction.MOB : net.minecraft.world.level.Level.ExplosionInteraction.NONE).wasCanceled;
}
diff --git a/patches/server/0208-Implement-World.getEntity-UUID-API.patch b/patches/server/0208-Implement-World.getEntity-UUID-API.patch
index ad2a2f2673..5f8874e80e 100644
--- a/patches/server/0208-Implement-World.getEntity-UUID-API.patch
+++ b/patches/server/0208-Implement-World.getEntity-UUID-API.patch
@@ -5,10 +5,10 @@ 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 fd73f71cf9ab267c8904012062fc6030897d0de4..ca6bc987d0bbff0a835fe7b28a2692e1a8d27a6d 100644
+index 4f631eced3403df0339d3d7b4a49b5c8f68408dd..845e16bec244a59a89d790363ddd5fe1d7bfdbf7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -1048,6 +1048,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1058,6 +1058,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return list;
}
diff --git a/patches/server/0209-InventoryCloseEvent-Reason-API.patch b/patches/server/0209-InventoryCloseEvent-Reason-API.patch
index 0f69229863..ac95b596ec 100644
--- a/patches/server/0209-InventoryCloseEvent-Reason-API.patch
+++ b/patches/server/0209-InventoryCloseEvent-Reason-API.patch
@@ -7,10 +7,10 @@ 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 e85390265dca2a55d0bb6f8dd4682d5a8a6cf478..518a900888b0ab51646f12e6b43a3cc12de55564 100644
+index aa9d514f26fbe70edf3a8b7443fbaf577cf3a030..35ed4ba377eadb72d59a7984bc40f3834136174c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1474,7 +1474,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1235,7 +1235,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) {
if (tileentity instanceof net.minecraft.world.Container) {
for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((net.minecraft.world.Container) tileentity).getViewers())) {
@@ -19,7 +19,7 @@ index e85390265dca2a55d0bb6f8dd4682d5a8a6cf478..518a900888b0ab51646f12e6b43a3cc1
}
}
}
-@@ -2458,7 +2458,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2204,7 +2204,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) {
@@ -29,10 +29,10 @@ index e85390265dca2a55d0bb6f8dd4682d5a8a6cf478..518a900888b0ab51646f12e6b43a3cc1
}
// 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 eadc58dd6ccec5e2f1604b94709181a0754d9802..6c31597821e087f690941c997096153ed06e9707 100644
+index d51244c634d0209efb98be965ce7318480220b96..33108a55c1cc305d44238d0862755af874f19395 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -692,7 +692,7 @@ public class ServerPlayer extends Player {
+@@ -648,7 +648,7 @@ public class ServerPlayer extends Player {
}
// Paper end - Configurable container update tick rate
if (!this.level().isClientSide && !this.containerMenu.stillValid(this)) {
@@ -41,7 +41,7 @@ index eadc58dd6ccec5e2f1604b94709181a0754d9802..6c31597821e087f690941c997096153e
this.containerMenu = this.inventoryMenu;
}
-@@ -885,7 +885,7 @@ public class ServerPlayer extends Player {
+@@ -841,7 +841,7 @@ public class ServerPlayer extends Player {
// SPIGOT-943 - only call if they have an inventory open
if (this.containerMenu != this.inventoryMenu) {
@@ -50,7 +50,7 @@ index eadc58dd6ccec5e2f1604b94709181a0754d9802..6c31597821e087f690941c997096153e
}
net.kyori.adventure.text.Component deathMessage = event.deathMessage() != null ? event.deathMessage() : net.kyori.adventure.text.Component.empty(); // Paper - Adventure
-@@ -1509,7 +1509,7 @@ public class ServerPlayer extends Player {
+@@ -1465,7 +1465,7 @@ public class ServerPlayer extends Player {
}
// CraftBukkit end
if (this.containerMenu != this.inventoryMenu) {
@@ -59,7 +59,7 @@ index eadc58dd6ccec5e2f1604b94709181a0754d9802..6c31597821e087f690941c997096153e
}
// this.nextContainerCounter(); // CraftBukkit - moved up
-@@ -1537,7 +1537,13 @@ public class ServerPlayer extends Player {
+@@ -1493,7 +1493,13 @@ public class ServerPlayer extends Player {
@Override
public void closeContainer() {
@@ -75,7 +75,7 @@ index eadc58dd6ccec5e2f1604b94709181a0754d9802..6c31597821e087f690941c997096153e
this.doCloseContainer();
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 51d5bed032f89333917accca242772a09ee98d93..678c46517757e3f37d5051fc88c481cbe8bf861b 100644
+index 32724550974616c1a17ee3c58fb34fed45898c36..1e40b7933e9e984ae4b3683c7cf82a564a723048 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -219,6 +219,7 @@ import org.bukkit.event.inventory.ClickType;
@@ -86,7 +86,7 @@ index 51d5bed032f89333917accca242772a09ee98d93..678c46517757e3f37d5051fc88c481cb
import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.inventory.SmithItemEvent;
-@@ -2538,10 +2539,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -2531,10 +2532,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleContainerClose(ServerboundContainerClosePacket packet) {
@@ -104,7 +104,7 @@ index 51d5bed032f89333917accca242772a09ee98d93..678c46517757e3f37d5051fc88c481cb
this.player.doCloseContainer();
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 99ba7c82f8a8db9d5841cce18ed5f39439b512b0..5517f873e709b6f3b9206f0ad0212a9524f2c691 100644
+index 9f8a95c8f46a11f36ff16863922a91a8d81d0bb3..e68a0c86f73325189a67186b058062509663f6e7 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -518,7 +518,7 @@ public abstract class PlayerList {
@@ -173,10 +173,10 @@ index 092d2bfab7e8fd9840e853f09adc85311ab29046..af6f8d11f0384c353332f5c5bb0967e5
@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 bcbe11807186d2d79a155f6be7bda029ca5f555d..91ca962588fffc486ca44289f2eb0bac6fcd808d 100644
+index e0ce56ab1a1980800402e55ee49df3b896afee60..28b51b1ecf54f9a43678d21cd1b40da32a63d645 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -1194,7 +1194,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1152,7 +1152,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Close any foreign inventory
if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) {
diff --git a/patches/server/0211-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/patches/server/0211-Refresh-player-inventory-when-cancelling-PlayerInter.patch
index f1f1fc7a9b..a1258297a4 100644
--- a/patches/server/0211-Refresh-player-inventory-when-cancelling-PlayerInter.patch
+++ b/patches/server/0211-Refresh-player-inventory-when-cancelling-PlayerInter.patch
@@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is
cancelled to avoid this problem.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 678c46517757e3f37d5051fc88c481cbe8bf861b..90574b9bd5eb9dcb89baf280e0a9503d7b975c01 100644
+index 1e40b7933e9e984ae4b3683c7cf82a564a723048..7080f19eab36df503ee285ed81a00624c12e056f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2419,6 +2419,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -2412,6 +2412,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
if (event.isCancelled()) {
diff --git a/patches/server/0213-add-more-information-to-Entity.toString.patch b/patches/server/0213-add-more-information-to-Entity.toString.patch
index e6cbd7263b..dfdc050609 100644
--- a/patches/server/0213-add-more-information-to-Entity.toString.patch
+++ b/patches/server/0213-add-more-information-to-Entity.toString.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] add more information to Entity.toString()
UUID, ticks lived, valid, dead
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index d6437a6b6b90ceb6fe7d2375ab2fc9e28b469c9b..47ba1f8fbbe3e5a052028ee1dbff31844bc61f78 100644
+index 94c6914a7af6329e4bed8a8d470563b7901fb248..7abb4ba10029ad8df5ed520d1d3deb9d2819ca8d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -3202,7 +3202,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3150,7 +3150,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public String toString() {
String s = this.level() == null ? "~NULL~" : this.level().toString();
diff --git a/patches/server/0218-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/patches/server/0218-Option-to-prevent-armor-stands-from-doing-entity-loo.patch
index c622fec25e..f5343cf47f 100644
--- a/patches/server/0218-Option-to-prevent-armor-stands-from-doing-entity-loo.patch
+++ b/patches/server/0218-Option-to-prevent-armor-stands-from-doing-entity-loo.patch
@@ -17,10 +17,10 @@ index d04d0b9cbf91beb57da7e37e72f8e7c98cf6cf4c..e6e3a7ae08f7346ccbce02b9d3623948
Iterator iterator = list.iterator();
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 0ce0bdf8de679998a32cf8c6e07be2ed56f10edb..18b6094ecd36ac50fc616e24f6d197352ae78e91 100644
+index 19d6a829edb977d064c5d5a42ae3cab4fc806bb6..0ead21982ff57ba748eb6b4169e9e1a8c32bf34e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -777,6 +777,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -772,6 +772,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end - Prevent block entity and entity crashes
}
}
diff --git a/patches/server/0219-Vanished-players-don-t-have-rights.patch b/patches/server/0219-Vanished-players-don-t-have-rights.patch
index 6d33d035a7..3cf0d4e228 100644
--- a/patches/server/0219-Vanished-players-don-t-have-rights.patch
+++ b/patches/server/0219-Vanished-players-don-t-have-rights.patch
@@ -39,7 +39,7 @@ index a6638e626600e4304a973497a39e3fac52203b16..c19069f65a9ecbc9000ea4333417a2df
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(state), defaultReturn);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 9cd032be21a5239a268d41fa2d3db0f7ee2680fd..2a849e7125e2a6294aab49a436eeab8e4201fd15 100644
+index 0ead21982ff57ba748eb6b4169e9e1a8c32bf34e..e85e47b5fd8f59a298afd8962986dfc4fa956a10 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -276,6 +276,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0221-SkeletonHorse-Additions.patch b/patches/server/0221-SkeletonHorse-Additions.patch
index 16f74f0083..15761af470 100644
--- a/patches/server/0221-SkeletonHorse-Additions.patch
+++ b/patches/server/0221-SkeletonHorse-Additions.patch
@@ -32,10 +32,10 @@ index 8f20239f3ef7ebe41fac8ee6e024c36dafec33c4..d00fb16ae3b94dfcb10fd1a7c1671595
this.horse.setTrap(false);
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
-index 36d793b492d9776ee36f8285b5bab09e6463cdce..a25497eec004add7408a63b1a0f09e3fa443b324 100644
+index 07e7851ca27ea0f8166be52b086a6504c0deea09..e7b6f97d8519a5797903664e5ba2a793e37a4bfc 100644
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
-@@ -105,6 +105,28 @@ public interface EntityGetter {
+@@ -93,6 +93,28 @@ public interface EntityGetter {
return player;
}
diff --git a/patches/server/0226-Break-up-and-make-tab-spam-limits-configurable.patch b/patches/server/0226-Break-up-and-make-tab-spam-limits-configurable.patch
index 6c6aef1e4a..8b8618059a 100644
--- a/patches/server/0226-Break-up-and-make-tab-spam-limits-configurable.patch
+++ b/patches/server/0226-Break-up-and-make-tab-spam-limits-configurable.patch
@@ -22,7 +22,7 @@ to take the burden of this into their own hand without having to rely on
plugins doing unsafe things.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 90574b9bd5eb9dcb89baf280e0a9503d7b975c01..f0470d4711a7451ca0d524a7b8a90b8d08fa4632 100644
+index 7080f19eab36df503ee285ed81a00624c12e056f..a93d34bee92a2d1b48ddfa7a764d4038fb7af787 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -257,6 +257,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
diff --git a/patches/server/0229-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/0229-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
index 9710674d3e..0b164f15bf 100644
--- a/patches/server/0229-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
+++ b/patches/server/0229-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index b2d679ba18e5f095d1c3e0249022fc564b1a553e..304e3c177488773d488e5b82f65a7c16a3750a29 100644
+index 57b344459b670742edc81a5046f1dfc2dae52c9f..fbac26f913476242c8dd1310426a1d66275f6567 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -882,6 +882,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1434,6 +1434,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 b2d679ba18e5f095d1c3e0249022fc564b1a553e..304e3c177488773d488e5b82f65a7c16
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
playerchunkmap_entitytracker.updatePlayers(this.level.players());
if (entity instanceof ServerPlayer) {
-@@ -924,7 +925,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1476,7 +1477,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.broadcastRemoved();
}
@@ -26,10 +26,10 @@ index b2d679ba18e5f095d1c3e0249022fc564b1a553e..304e3c177488773d488e5b82f65a7c16
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 d993f6421e17a24bd6c371298ae78c2bc2f8a7ac..b818ac80bd9d68f6058e4dc6ee447645083dc177 100644
+index 35ed4ba377eadb72d59a7984bc40f3834136174c..46b71a140ab8a1b997415184db09cb8a3ea39c52 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1436,6 +1436,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1197,6 +1197,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit start
private boolean addEntity(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
@@ -43,7 +43,7 @@ index d993f6421e17a24bd6c371298ae78c2bc2f8a7ac..b818ac80bd9d68f6058e4dc6ee447645
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 47ba1f8fbbe3e5a052028ee1dbff31844bc61f78..72478a84e1dca85bb9694ea9816a1acc09c8ff5f 100644
+index 7abb4ba10029ad8df5ed520d1d3deb9d2819ca8d..227df91e28d11cad778b5190432c6eb5fb0312e5 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -241,6 +241,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
diff --git a/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch
index 2df0c53f19..a242c74228 100644
--- a/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch
+++ b/patches/server/0230-Add-Early-Warning-Feature-to-WatchDog.patch
@@ -9,10 +9,10 @@ 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 3d066e2a985ed46bc73d9856490d4aa692de26f3..46311cff83a7219508f74d862623b3c27eb8abea 100644
+index 1f5f8c7398e974fc8771265b1bc27f68065f944a..bfd405397f685021fdba7780e3709e29ccc89bec 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1023,6 +1023,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1040,6 +1040,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.status = this.buildServerStatus();
// Spigot start
@@ -21,7 +21,7 @@ index 3d066e2a985ed46bc73d9856490d4aa692de26f3..46311cff83a7219508f74d862623b3c2
long tickSection = Util.getMillis(), tickCount = 1;
while (this.running) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index 5b64c7f2f36bdf03f8a764d6c8d77524a0774ad1..6025b3ce5a4aee45061dfb72a089deff889fe823 100644
+index 6aede562955799fae90a1234b6300ba3a91ba2f2..333647f4328c29afffdc2b0de5abeec731959c59 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -198,6 +198,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -33,7 +33,7 @@ index 5b64c7f2f36bdf03f8a764d6c8d77524a0774ad1..6025b3ce5a4aee45061dfb72a089deff
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 0c97374ac2a0839387f3576b77fb9470f773c040..7f8400f452a684a5dd20723ff76312f7d52a670c 100644
+index 43406c5d7fdd3cd7c88aad5a86252eab28a88c0b..0e18637f9ac0cf69f370d46081664456b4b30c4c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -915,6 +915,7 @@ public final class CraftServer implements Server {
@@ -66,10 +66,10 @@ index 9c5c19ab9dc14d844631f47a93f3349409efdf43..56dbc23f10d946a7ec992b08fd868f3e
public static boolean bungee;
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
-index e2bafc68e88c733873638ce7695b684d119f55da..230d55820778e84c1c8aa2b013ae0e5e35568ea1 100644
+index ab3279be007553cface478795ace34e455615c7b..703787fd9392685c7d8ff9635a29a0b057e2ea5c 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
-@@ -14,6 +14,10 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+@@ -14,6 +14,10 @@ public class WatchdogThread extends Thread
private static WatchdogThread instance;
private long timeoutTime;
private boolean restart;
@@ -80,7 +80,7 @@ index e2bafc68e88c733873638ce7695b684d119f55da..230d55820778e84c1c8aa2b013ae0e5e
private volatile long lastTick;
private volatile boolean stopping;
-@@ -22,6 +26,8 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+@@ -22,6 +26,8 @@ public class WatchdogThread extends Thread
super( "Paper Watchdog Thread" );
this.timeoutTime = timeoutTime;
this.restart = restart;
@@ -89,7 +89,7 @@ index e2bafc68e88c733873638ce7695b684d119f55da..230d55820778e84c1c8aa2b013ae0e5e
}
private static long monotonicMillis()
-@@ -61,9 +67,18 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+@@ -61,9 +67,18 @@ public class WatchdogThread extends Thread
while ( !this.stopping )
{
//
@@ -110,10 +110,21 @@ index e2bafc68e88c733873638ce7695b684d119f55da..230d55820778e84c1c8aa2b013ae0e5e
log.log( Level.SEVERE, "------------------------------" );
log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Paper bug." ); // Paper
log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" );
-@@ -93,30 +108,46 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
- }
+@@ -81,29 +96,56 @@ public class WatchdogThread extends Thread
+ log.log( Level.SEVERE, "near " + net.minecraft.world.level.Level.lastPhysicsProblem );
}
- // Paper end
+ //
++ // Paper start - Warn in watchdog if an excessive velocity was ever set
++ if (org.bukkit.craftbukkit.CraftServer.excessiveVelEx != null) {
++ log.log( Level.SEVERE, "------------------------------" );
++ log.log( Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity" );
++ log.log( Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated" );
++ log.log( Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
++ for (StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace()) {
++ log.log(Level.SEVERE, "\t\t" + stack);
++ }
++ }
++ // Paper end
+ } else
+ {
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---");
@@ -122,7 +133,6 @@ index e2bafc68e88c733873638ce7695b684d119f55da..230d55820778e84c1c8aa2b013ae0e5e
+ // Paper end - Different message for short timeout
log.log( Level.SEVERE, "------------------------------" );
log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
- io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
log.log( Level.SEVERE, "------------------------------" );
//
diff --git a/patches/server/0231-Use-ConcurrentHashMap-in-JsonList.patch b/patches/server/0231-Use-ConcurrentHashMap-in-JsonList.patch
index 78b0f1759b..9977232428 100644
--- a/patches/server/0231-Use-ConcurrentHashMap-in-JsonList.patch
+++ b/patches/server/0231-Use-ConcurrentHashMap-in-JsonList.patch
@@ -23,7 +23,7 @@ Modified isEmpty to use the isEmpty() method instead of the slightly confusing s
The point of this is readability, but does have a side-benefit of a small microptimization
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 5517f873e709b6f3b9206f0ad0212a9524f2c691..e927448d7df9a99bf1d5184557ed57b8c32a2773 100644
+index e68a0c86f73325189a67186b058062509663f6e7..455f14d758551229d15d703990bb5225fff37700 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -634,7 +634,7 @@ public abstract class PlayerList {
diff --git a/patches/server/0232-Use-a-Queue-for-Queueing-Commands.patch b/patches/server/0232-Use-a-Queue-for-Queueing-Commands.patch
index ec2467d0f9..2d825430b6 100644
--- a/patches/server/0232-Use-a-Queue-for-Queueing-Commands.patch
+++ b/patches/server/0232-Use-a-Queue-for-Queueing-Commands.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Use a Queue for Queueing Commands
Lists are bad as Queues mmmkay.
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index 6025b3ce5a4aee45061dfb72a089deff889fe823..a7d7c676f1ab8c47395b91aea028f143837b8801 100644
+index 333647f4328c29afffdc2b0de5abeec731959c59..47b12535d2cb146155044cc20b14bb5a432f83d5 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -69,7 +69,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -18,10 +18,10 @@ index 6025b3ce5a4aee45061dfb72a089deff889fe823..a7d7c676f1ab8c47395b91aea028f143
@Nullable
private QueryThreadGs4 queryThreadGs4;
// private final RemoteControlCommandListener rconConsoleSource; // CraftBukkit - remove field
-@@ -439,13 +439,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
- return;
- }
- // Paper end - rewrite chunk system
+@@ -412,13 +412,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+ }
+
+ public void handleConsoleInput(String command, CommandSourceStack commandSource) {
- this.consoleInput.add(new ConsoleInput(command, commandSource));
+ this.serverCommandQueue.add(new ConsoleInput(command, commandSource)); // Paper - Perf: use proper queue
}
diff --git a/patches/server/0233-Ability-to-get-block-entities-from-a-chunk-without-s.patch b/patches/server/0233-Ability-to-get-block-entities-from-a-chunk-without-s.patch
index 5ae7d9508f..cebc69de1b 100644
--- a/patches/server/0233-Ability-to-get-block-entities-from-a-chunk-without-s.patch
+++ b/patches/server/0233-Ability-to-get-block-entities-from-a-chunk-without-s.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Ability to get block entities from a chunk without snapshots
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
-index df02963faaf8f514f4175d394e67d2df10c8a3ea..545b14f02ac72dda30891d681eba585d19fd5e1d 100644
+index 491416754e1c5e8c2b345b57f45289906c7932ba..e38643853220cabeac6c30912a9ae4bc1c018d5f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
-@@ -127,6 +127,13 @@ public class CraftChunk implements Chunk {
+@@ -171,6 +171,13 @@ public class CraftChunk implements Chunk {
@Override
public BlockState[] getTileEntities() {
@@ -22,7 +22,7 @@ index df02963faaf8f514f4175d394e67d2df10c8a3ea..545b14f02ac72dda30891d681eba585d
if (!this.isLoaded()) {
this.getWorld().getChunkAt(this.x, this.z); // Transient load for this tick
}
-@@ -136,7 +143,29 @@ public class CraftChunk implements Chunk {
+@@ -180,7 +187,29 @@ public class CraftChunk implements Chunk {
BlockState[] entities = new BlockState[chunk.blockEntities.size()];
for (BlockPos position : chunk.blockEntities.keySet()) {
diff --git a/patches/server/0243-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/patches/server/0243-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch
index ab8493a315..b249c98d2a 100644
--- a/patches/server/0243-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch
+++ b/patches/server/0243-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch
@@ -6,10 +6,10 @@ 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 ca6bc987d0bbff0a835fe7b28a2692e1a8d27a6d..9f0e22fde4965cae806c92892d0711d8edc099c8 100644
+index 845e16bec244a59a89d790363ddd5fe1d7bfdbf7..e0cb72d826168f3c22c5be4c2c8e6d760edafb97 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -403,7 +403,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -400,7 +400,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean loadChunk(int x, int z, boolean generate) {
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
diff --git a/patches/server/0245-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0245-Expose-attack-cooldown-methods-for-Player.patch
index dceee4dd11..77a374f53f 100644
--- a/patches/server/0245-Expose-attack-cooldown-methods-for-Player.patch
+++ b/patches/server/0245-Expose-attack-cooldown-methods-for-Player.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 91ca962588fffc486ca44289f2eb0bac6fcd808d..9d04b97afbbc9e4a8c1ab17b067bd766451c5281 100644
+index 28b51b1ecf54f9a43678d21cd1b40da32a63d645..5f6c911cc2573be616f80faa609e372f9195ed81 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2871,6 +2871,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2829,6 +2829,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.adventure$pointers;
}
diff --git a/patches/server/0246-Improve-death-events.patch b/patches/server/0246-Improve-death-events.patch
index 1579ed7e7a..e5c7c6d987 100644
--- a/patches/server/0246-Improve-death-events.patch
+++ b/patches/server/0246-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 6c31597821e087f690941c997096153ed06e9707..3a56e7a63618939a55694b0cd481a4f708db8614 100644
+index 33108a55c1cc305d44238d0862755af874f19395..1042b19c906e40d4a4e9ef76d69228149e84e3c5 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -248,6 +248,10 @@ public class ServerPlayer extends Player {
@@ -33,7 +33,7 @@ index 6c31597821e087f690941c997096153ed06e9707..3a56e7a63618939a55694b0cd481a4f7
// CraftBukkit start
public String displayName;
-@@ -854,7 +858,7 @@ public class ServerPlayer extends Player {
+@@ -810,7 +814,7 @@ public class ServerPlayer extends Player {
@Override
public void die(DamageSource damageSource) {
@@ -42,7 +42,7 @@ index 6c31597821e087f690941c997096153ed06e9707..3a56e7a63618939a55694b0cd481a4f7
boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
// CraftBukkit start - fire PlayerDeathEvent
if (this.isRemoved()) {
-@@ -882,6 +886,16 @@ public class ServerPlayer extends Player {
+@@ -838,6 +842,16 @@ public class ServerPlayer extends Player {
String deathmessage = defaultMessage.getString();
this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, PaperAdventure.asAdventure(defaultMessage), keepInventory); // Paper - Adventure
@@ -59,7 +59,7 @@ index 6c31597821e087f690941c997096153ed06e9707..3a56e7a63618939a55694b0cd481a4f7
// SPIGOT-943 - only call if they have an inventory open
if (this.containerMenu != this.inventoryMenu) {
-@@ -1030,8 +1044,17 @@ public class ServerPlayer extends Player {
+@@ -986,8 +1000,17 @@ public class ServerPlayer extends Player {
}
}
}
@@ -402,10 +402,10 @@ index ecce8036e58a9ed1408e110e75980bf77c18779a..ddd512e1d7608ec051fb5adf6ec2c6bb
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 9d04b97afbbc9e4a8c1ab17b067bd766451c5281..17ee1e953de98c56e06e97d995b0781c8aa5ecb0 100644
+index 5f6c911cc2573be616f80faa609e372f9195ed81..c3af502148a700892ac86d56bcb4f05703d98160 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2408,7 +2408,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2366,7 +2366,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void sendHealthUpdate() {
FoodData foodData = this.getHandle().getFoodData();
diff --git a/patches/server/0249-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch b/patches/server/0249-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch
index dd3283f691..ca8562d868 100644
--- a/patches/server/0249-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch
+++ b/patches/server/0249-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add API for CanPlaceOn and CanDestroy NBT values
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index ff199678850d848c5d2ce76270d674738eec58f7..1ecea757fffb480af0d27c3326093d79cb93c73b 100644
+index 76982348d76ecbcc3db1d81ebb5d2a8805b81e94..ed50a1e492643842a094fc90fb52cbec4e8f5f3d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -85,6 +85,12 @@ import org.bukkit.persistence.PersistentDataContainer;
@@ -181,7 +181,7 @@ index ff199678850d848c5d2ce76270d674738eec58f7..1ecea757fffb480af0d27c3326093d79
}
// Paper start
-@@ -1181,7 +1289,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1216,7 +1324,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
&& (this.hideFlag == that.hideFlag)
&& (this.isUnbreakable() == that.isUnbreakable())
&& (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage())
@@ -194,7 +194,7 @@ index ff199678850d848c5d2ce76270d674738eec58f7..1ecea757fffb480af0d27c3326093d79
}
/**
-@@ -1216,6 +1328,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1251,6 +1363,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
hash = 61 * hash + (this.hasDamage() ? this.damage : 0);
hash = 61 * hash + (this.hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0);
hash = 61 * hash + this.version;
@@ -205,7 +205,7 @@ index ff199678850d848c5d2ce76270d674738eec58f7..1ecea757fffb480af0d27c3326093d79
return hash;
}
-@@ -1240,6 +1356,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1275,6 +1391,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
clone.unbreakable = this.unbreakable;
clone.damage = this.damage;
clone.version = this.version;
@@ -220,7 +220,7 @@ index ff199678850d848c5d2ce76270d674738eec58f7..1ecea757fffb480af0d27c3326093d79
return clone;
} catch (CloneNotSupportedException e) {
throw new Error(e);
-@@ -1297,6 +1421,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1332,6 +1456,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
builder.put(CraftMetaItem.DAMAGE.BUKKIT, this.damage);
}
@@ -244,7 +244,7 @@ index ff199678850d848c5d2ce76270d674738eec58f7..1ecea757fffb480af0d27c3326093d79
final Map<String, Tag> internalTags = new HashMap<String, Tag>(this.unhandledTags);
this.serializeInternal(internalTags);
if (!internalTags.isEmpty()) {
-@@ -1469,6 +1610,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1509,6 +1650,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CraftMetaArmorStand.SHOW_ARMS.NBT,
CraftMetaArmorStand.SMALL.NBT,
CraftMetaArmorStand.MARKER.NBT,
@@ -253,7 +253,7 @@ index ff199678850d848c5d2ce76270d674738eec58f7..1ecea757fffb480af0d27c3326093d79
// Paper end
CraftMetaCompass.LODESTONE_DIMENSION.NBT,
CraftMetaCompass.LODESTONE_POS.NBT,
-@@ -1498,4 +1641,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
+@@ -1538,4 +1681,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
// Paper end
diff --git a/patches/server/0257-PreSpawnerSpawnEvent.patch b/patches/server/0257-PreSpawnerSpawnEvent.patch
index c822f9ddbf..a1dd3dc9db 100644
--- a/patches/server/0257-PreSpawnerSpawnEvent.patch
+++ b/patches/server/0257-PreSpawnerSpawnEvent.patch
@@ -9,7 +9,7 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for
spawners.
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
-index db4beb22cf54bb3b53561ec0fe06209c478977ff..388a66e37c9f1d9c62e0c8977a2d5b9068c58fe7 100644
+index 28f63a211f4ae207b2400d16b1725808ad87f334..1b0093a23011f7d1c0da88c0a934d94ad4d6b3e2 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -136,11 +136,11 @@ public abstract class BaseSpawner {
diff --git a/patches/server/0259-Add-sun-related-API.patch b/patches/server/0259-Add-sun-related-API.patch
index cd4f462cc7..31139b29c1 100644
--- a/patches/server/0259-Add-sun-related-API.patch
+++ b/patches/server/0259-Add-sun-related-API.patch
@@ -7,10 +7,10 @@ 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 9f0e22fde4965cae806c92892d0711d8edc099c8..377c85f458e3e3ce7c7532fb991627b32590a691 100644
+index e0cb72d826168f3c22c5be4c2c8e6d760edafb97..400dbd72c576590ccdbab9c52a3960acb457102f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -695,6 +695,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -705,6 +705,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
}
}
diff --git a/patches/server/0260-Catch-JsonParseException-in-entity-and-block-entity-.patch b/patches/server/0260-Catch-JsonParseException-in-entity-and-block-entity-.patch
index 458c71b953..8ff9ed7c54 100644
--- a/patches/server/0260-Catch-JsonParseException-in-entity-and-block-entity-.patch
+++ b/patches/server/0260-Catch-JsonParseException-in-entity-and-block-entity-.patch
@@ -13,10 +13,10 @@ Shulkers) may need to be changed in order for it to re-save properly
No more crashing though.
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
-index 209594863c2aa965055412adb7db009cca4795a8..200ed770b57e1a9240abf0473968d4b85cbefe3c 100644
+index e5a7a77fda0c7e81c8535ef8cfaca2222b0d79fb..ff8a983e23bcf73ec3f7dd98c48640183647ad4d 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
-@@ -647,4 +647,19 @@ public final class MCUtil {
+@@ -537,4 +537,19 @@ public final class MCUtil {
public static int getTicketLevelFor(net.minecraft.world.level.chunk.ChunkStatus status) {
return net.minecraft.server.level.ChunkMap.MAX_VIEW_DISTANCE + net.minecraft.world.level.chunk.ChunkStatus.getDistance(status);
}
@@ -76,7 +76,7 @@ index 25764076fec05b1362aa9b9b608e03bd39817d90..fce3a45d09a93ca68a3d49f2e666afa4
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
-index 18349957bd6d1a4bc21aff781a791f912dddff1d..cd28ee0cbc69713a641a21c9a626c694a4bcbfc9 100644
+index f4e1dc338dd240371694dd7a3455c79d5cea251a..f3b9a692417dbfc67b939a753c29ad1c159e274b 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -389,7 +389,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
diff --git a/patches/server/0262-Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/0262-Call-player-spectator-target-events-and-improve-impl.patch
index cfe8b7543a..f9512688bf 100644
--- a/patches/server/0262-Call-player-spectator-target-events-and-improve-impl.patch
+++ b/patches/server/0262-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 4f1a7c0e4f9ca1706f51096fe9533dc49c460205..fc4eeefa8c4dbb76e9a98ba9d67a942314b243fa 100644
+index 1042b19c906e40d4a4e9ef76d69228149e84e3c5..8432081cb287dbdbc7e89572e91fa634437b9809 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2085,6 +2085,21 @@ public class ServerPlayer extends Player {
+@@ -2041,6 +2041,21 @@ public class ServerPlayer extends Player {
this.camera = (Entity) (entity == null ? this : entity);
if (entity1 != this.camera) {
diff --git a/patches/server/0265-Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/0265-Add-option-to-prevent-players-from-moving-into-unloa.patch
index a4bb753a26..4288d5cc98 100644
--- a/patches/server/0265-Add-option-to-prevent-players-from-moving-into-unloa.patch
+++ b/patches/server/0265-Add-option-to-prevent-players-from-moving-into-unloa.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index f0470d4711a7451ca0d524a7b8a90b8d08fa4632..4ac5ed4e7761b753c5eb60937ab325a72114a259 100644
+index a93d34bee92a2d1b48ddfa7a764d4038fb7af787..cce8a2a7d7b510f4741b28de89f505647d5673e8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -475,9 +475,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -39,7 +39,7 @@ index f0470d4711a7451ca0d524a7b8a90b8d08fa4632..4ac5ed4e7761b753c5eb60937ab325a7
if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
// CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
-@@ -1180,9 +1190,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1173,9 +1183,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} else {
this.awaitingTeleportTime = this.tickCount;
@@ -52,7 +52,7 @@ index f0470d4711a7451ca0d524a7b8a90b8d08fa4632..4ac5ed4e7761b753c5eb60937ab325a7
float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot()));
float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot()));
-@@ -1238,6 +1248,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1231,6 +1241,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} else {
speed = this.player.getAbilities().walkingSpeed * 10f;
}
diff --git a/patches/server/0266-Reset-players-airTicks-on-respawn.patch b/patches/server/0266-Reset-players-airTicks-on-respawn.patch
index db14554690..c4670e370f 100644
--- a/patches/server/0266-Reset-players-airTicks-on-respawn.patch
+++ b/patches/server/0266-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 fc4eeefa8c4dbb76e9a98ba9d67a942314b243fa..684cebce4bb611e3302d4fe0d26df96ee33dd228 100644
+index 8432081cb287dbdbc7e89572e91fa634437b9809..c201325314b27c7658d6c16ddc7311afa79ccb4e 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2560,6 +2560,7 @@ public class ServerPlayer extends Player {
+@@ -2516,6 +2516,7 @@ public class ServerPlayer extends Player {
this.setHealth(this.getMaxHealth());
this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset
diff --git a/patches/server/0268-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/0268-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
index 88202d444c..c8429932e8 100644
--- a/patches/server/0268-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
+++ b/patches/server/0268-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
@@ -92,7 +92,7 @@ index aa52b271bd556a29f774fde375b713d0d187521b..765e4bc00a0526aab6e263dae7233f63
return executorService;
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 46311cff83a7219508f74d862623b3c27eb8abea..2a41f670c5298fc7cf901af21d8ad280435d7909 100644
+index bfd405397f685021fdba7780e3709e29ccc89bec..6cac85b9a05a522d71e2fd91b3d8486c06ee976b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
diff --git a/patches/server/0269-Optimize-World-Time-Updates.patch b/patches/server/0269-Optimize-World-Time-Updates.patch
index 88845bfe55..663d4d1495 100644
--- a/patches/server/0269-Optimize-World-Time-Updates.patch
+++ b/patches/server/0269-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 2a41f670c5298fc7cf901af21d8ad280435d7909..738c2a2acecc35dbd65d922044ab3763dd9644b4 100644
+index 6cac85b9a05a522d71e2fd91b3d8486c06ee976b..2c2bdbdf7e4a27784d7b019accfe83987b4cf120 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1409,12 +1409,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1415,12 +1415,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/0272-Don-t-allow-digging-into-unloaded-chunks.patch b/patches/server/0272-Don-t-allow-digging-into-unloaded-chunks.patch
index 9f653f00f9..8fbd42bde3 100644
--- a/patches/server/0272-Don-t-allow-digging-into-unloaded-chunks.patch
+++ b/patches/server/0272-Don-t-allow-digging-into-unloaded-chunks.patch
@@ -59,10 +59,10 @@ index f56ba2973aaf0fd41a974d6b38c2b2797631959e..deef24ad28ecf7895aa03bf8dae08581
this.level.destroyBlockProgress(this.player.getId(), pos, -1);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 4ac5ed4e7761b753c5eb60937ab325a72114a259..e9103f58207353b416da2901ab9443810305ae8f 100644
+index cce8a2a7d7b510f4741b28de89f505647d5673e8..1b633a87dbec1152de74a4cd9eb60426d05a9e36 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1592,6 +1592,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1585,6 +1585,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
case START_DESTROY_BLOCK:
case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK:
diff --git a/patches/server/0273-Make-the-default-permission-message-configurable.patch b/patches/server/0273-Make-the-default-permission-message-configurable.patch
index afbda14bbc..fbdf1ac3e7 100644
--- a/patches/server/0273-Make-the-default-permission-message-configurable.patch
+++ b/patches/server/0273-Make-the-default-permission-message-configurable.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Make the default permission message configurable
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
-index 0dd48e4098191c8b6e29945d62bc473e9f3a1e77..ae51993e0de706cb62c96795ca9de7663893a5bf 100644
+index de0e1ad2c78e5132651494f198703533847c84bd..830978f3409888302ab857161628cee5869efa8f 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
-@@ -75,7 +75,7 @@ public final class PaperCommand extends Command {
+@@ -74,7 +74,7 @@ public final class PaperCommand extends Command {
if (sender.hasPermission(BASE_PERM + permission) || sender.hasPermission("bukkit.command.paper")) {
return true;
}
@@ -18,7 +18,7 @@ index 0dd48e4098191c8b6e29945d62bc473e9f3a1e77..ae51993e0de706cb62c96795ca9de766
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 7f8400f452a684a5dd20723ff76312f7d52a670c..c5f65257b2d4d1fa8ebf9f879e72a88dcc66b5a4 100644
+index 0e18637f9ac0cf69f370d46081664456b4b30c4c..c682abdd2b144dcd6260db6d63b0474b547f2cc6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2796,6 +2796,16 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0275-force-entity-dismount-during-teleportation.patch b/patches/server/0275-force-entity-dismount-during-teleportation.patch
index 685e2b80a5..e2199d7f7e 100644
--- a/patches/server/0275-force-entity-dismount-during-teleportation.patch
+++ b/patches/server/0275-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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 70e0ec6d33a2f6eaa3768b24d7a17bf30211c2e1..a11d100a3b0462b276c5b48f1fb2e5863dd98b81 100644
+index 227df91e28d11cad778b5190432c6eb5fb0312e5..5baf85f179c096a9e2be170d7def110d02952dae 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2605,11 +2605,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2553,11 +2553,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public void removeVehicle() {
@@ -41,7 +41,7 @@ index 70e0ec6d33a2f6eaa3768b24d7a17bf30211c2e1..a11d100a3b0462b276c5b48f1fb2e586
}
}
-@@ -2640,7 +2645,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2588,7 +2593,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
}
@@ -53,7 +53,7 @@ index 70e0ec6d33a2f6eaa3768b24d7a17bf30211c2e1..a11d100a3b0462b276c5b48f1fb2e586
if (entity.getVehicle() == this) {
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else {
-@@ -2650,7 +2658,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2598,7 +2606,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
VehicleExitEvent event = new VehicleExitEvent(
(Vehicle) this.getBukkitEntity(),
@@ -62,7 +62,7 @@ index 70e0ec6d33a2f6eaa3768b24d7a17bf30211c2e1..a11d100a3b0462b276c5b48f1fb2e586
);
// Suppress during worldgen
if (this.valid) {
-@@ -2663,7 +2671,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2611,7 +2619,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
}
diff --git a/patches/server/0276-Add-more-Zombie-API.patch b/patches/server/0276-Add-more-Zombie-API.patch
index f1f71256c4..99141e5971 100644
--- a/patches/server/0276-Add-more-Zombie-API.patch
+++ b/patches/server/0276-Add-more-Zombie-API.patch
@@ -7,7 +7,7 @@ Subject: [PATCH] Add more Zombie API
public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
-index 2aec8e2f45fe6ba56d84e5a51a6e30d36505df42..37730675250f03ff6786992949813d67583610b3 100644
+index 15ccde8ee8bac1f70c6047464595aff6db073646..2c8529540bf3644896f3c05d5f544bd848647807 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -96,6 +96,7 @@ public class Zombie extends Monster {
diff --git a/patches/server/0277-Book-Size-Limits.patch b/patches/server/0277-Book-Size-Limits.patch
index 3df0a28958..4109e72163 100644
--- a/patches/server/0277-Book-Size-Limits.patch
+++ b/patches/server/0277-Book-Size-Limits.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Book Size Limits
Puts some limits on the size of books.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index e9103f58207353b416da2901ab9443810305ae8f..4d907d43015b9a8aa5298ec9a641580f82058f1d 100644
+index 1b633a87dbec1152de74a4cd9eb60426d05a9e36..831281ab33e8d2ec4e31a03fe7dc18ce7928d3d6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1026,6 +1026,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1019,6 +1019,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleEditBook(ServerboundEditBookPacket packet) {
diff --git a/patches/server/0279-Replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0279-Replace-OfflinePlayer-getLastPlayed.patch
index 3448382697..2574970bc7 100644
--- a/patches/server/0279-Replace-OfflinePlayer-getLastPlayed.patch
+++ b/patches/server/0279-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 cdde8b79bcf8ad41b4b992a304984f4d3a0e6c89..15101171ed51e4b78fab53b98ea1ace4844a4bf7 100644
+index c201325314b27c7658d6c16ddc7311afa79ccb4e..f21d6a14fa7f7ea1581ba02bc3ca06e589281a58 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -248,6 +248,7 @@ public class ServerPlayer extends Player {
@@ -28,7 +28,7 @@ index cdde8b79bcf8ad41b4b992a304984f4d3a0e6c89..15101171ed51e4b78fab53b98ea1ace4
public boolean queueHealthUpdatePacket;
public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index e927448d7df9a99bf1d5184557ed57b8c32a2773..7a7abe0d87936d853ef32e85bd6a4ebb0dfa0ba7 100644
+index 455f14d758551229d15d703990bb5225fff37700..e2136ae52074f922a87ac30f5e34cb8035c70475 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -179,6 +179,7 @@ public abstract class PlayerList {
@@ -106,7 +106,7 @@ index e8490a58dd4d9bc39a5bb2f9fc109526e031b971..5f590575f95eff8bf0cdcafde7dee0e3
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 17ee1e953de98c56e06e97d995b0781c8aa5ecb0..e44fbfc43ac8e92d62f5ab8b13b45a3bfaf648ae 100644
+index c3af502148a700892ac86d56bcb4f05703d98160..24b08196d160feaa7b4409151fcd98cece19892e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -191,6 +191,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -117,7 +117,7 @@ index 17ee1e953de98c56e06e97d995b0781c8aa5ecb0..e44fbfc43ac8e92d62f5ab8b13b45a3b
public CraftPlayer(CraftServer server, ServerPlayer entity) {
super(server, entity);
-@@ -1953,6 +1954,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1911,6 +1912,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.firstPlayed = firstPlayed;
}
@@ -136,7 +136,7 @@ index 17ee1e953de98c56e06e97d995b0781c8aa5ecb0..e44fbfc43ac8e92d62f5ab8b13b45a3b
public void readExtraData(CompoundTag nbttagcompound) {
this.hasPlayedBefore = true;
if (nbttagcompound.contains("bukkit")) {
-@@ -1975,6 +1988,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1933,6 +1946,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setExtraData(CompoundTag nbttagcompound) {
@@ -145,7 +145,7 @@ index 17ee1e953de98c56e06e97d995b0781c8aa5ecb0..e44fbfc43ac8e92d62f5ab8b13b45a3b
if (!nbttagcompound.contains("bukkit")) {
nbttagcompound.put("bukkit", new CompoundTag());
}
-@@ -1989,6 +2004,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1947,6 +1962,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
data.putLong("firstPlayed", this.getFirstPlayed());
data.putLong("lastPlayed", System.currentTimeMillis());
data.putString("lastKnownName", handle.getScoreboardName());
diff --git a/patches/server/0280-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/patches/server/0280-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
index 902530fed7..634426aafc 100644
--- a/patches/server/0280-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
+++ b/patches/server/0280-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 7451883595155fdeb0714fb12b98a0dc33348359..ab59cfccd2addba45525a657df8c488664e10290 100644
+index f21d6a14fa7f7ea1581ba02bc3ca06e589281a58..6c68797a5a0b8453dde5aa8f1a875a032c1c56e3 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1749,6 +1749,13 @@ public class ServerPlayer extends Player {
+@@ -1705,6 +1705,13 @@ public class ServerPlayer extends Player {
public void disconnect() {
this.disconnected = true;
this.ejectPassengers();
diff --git a/patches/server/0281-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch b/patches/server/0281-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch
index f0d1fc3732..e08566577d 100644
--- a/patches/server/0281-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch
+++ b/patches/server/0281-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch
@@ -8,10 +8,10 @@ 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 e44fbfc43ac8e92d62f5ab8b13b45a3bfaf648ae..c279d53a9ec8c3b77c1734c9321e3642dd16c47c 100644
+index 24b08196d160feaa7b4409151fcd98cece19892e..1c8e4e3c53acc1c3043cb015cbe504f4cfb7a35c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -247,8 +247,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -205,8 +205,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void remove() {
diff --git a/patches/server/0282-BlockDestroyEvent.patch b/patches/server/0282-BlockDestroyEvent.patch
index 86ddeb2fab..d5cdb40c54 100644
--- a/patches/server/0282-BlockDestroyEvent.patch
+++ b/patches/server/0282-BlockDestroyEvent.patch
@@ -11,7 +11,7 @@ floating in the air.
This can replace many uses of BlockPhysicsEvent
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 097f4e01dc9dc391ea96e2f36f18f6575e344346..91f2bb15e2eea792f205f04422655fc7d80a6da2 100644
+index e85e47b5fd8f59a298afd8962986dfc4fa956a10..cea3b4744a45b100f0c5c5cef6ecd4b932a89b71 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -31,6 +31,7 @@ import net.minecraft.nbt.CompoundTag;
@@ -22,7 +22,7 @@ index 097f4e01dc9dc391ea96e2f36f18f6575e344346..91f2bb15e2eea792f205f04422655fc7
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.FullChunkStatus;
import net.minecraft.server.level.ServerLevel;
-@@ -591,9 +592,26 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -586,9 +587,26 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return false;
} else {
FluidState fluid = this.getFluidState(pos);
diff --git a/patches/server/0283-Async-command-map-building.patch b/patches/server/0283-Async-command-map-building.patch
index 708ff68700..3a56e3ca42 100644
--- a/patches/server/0283-Async-command-map-building.patch
+++ b/patches/server/0283-Async-command-map-building.patch
@@ -53,10 +53,10 @@ index 15a5059994371da4850adcf726034a715b80efba..af7cb518a32a4d550eae833fdd5bb17f
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 738c2a2acecc35dbd65d922044ab3763dd9644b4..f36d843201e47a02bc9323e7045e89e6c892753a 100644
+index 2c2bdbdf7e4a27784d7b019accfe83987b4cf120..71dc0ba14333f0e924dc61856799db94b0cd9651 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -925,6 +925,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -915,6 +915,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
MinecraftServer.LOGGER.info("Stopping server");
diff --git a/patches/server/0284-Brigadier-Mojang-API.patch b/patches/server/0284-Brigadier-Mojang-API.patch
index 803b533b39..3a2f0f8c64 100644
--- a/patches/server/0284-Brigadier-Mojang-API.patch
+++ b/patches/server/0284-Brigadier-Mojang-API.patch
@@ -131,10 +131,10 @@ index af7cb518a32a4d550eae833fdd5bb17fd4058717..40ff3090fb17fb0f01a9b52639fb783e
if (commandnode2.canUse(source)) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 4d907d43015b9a8aa5298ec9a641580f82058f1d..2d00a3d669bf76c2aba12cf258dcd43d90ad8c82 100644
+index 831281ab33e8d2ec4e31a03fe7dc18ce7928d3d6..addd76950902ee219bf73186d3ebac1a6f931e47 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -740,8 +740,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -733,8 +733,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
@@ -149,7 +149,7 @@ index 4d907d43015b9a8aa5298ec9a641580f82058f1d..2d00a3d669bf76c2aba12cf258dcd43d
});
});
}
-@@ -756,7 +760,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -749,7 +753,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip()));
}
});
diff --git a/patches/server/0286-Limit-Client-Sign-length-more.patch b/patches/server/0286-Limit-Client-Sign-length-more.patch
index 03a81ee975..9261e12d88 100644
--- a/patches/server/0286-Limit-Client-Sign-length-more.patch
+++ b/patches/server/0286-Limit-Client-Sign-length-more.patch
@@ -22,7 +22,7 @@ it only impacts data sent from the client.
Set -DPaper.maxSignLength=XX to change limit or -1 to disable
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 2d00a3d669bf76c2aba12cf258dcd43d90ad8c82..f3abc5552d058c5b96ed56fc49ffd9f420668d01 100644
+index addd76950902ee219bf73186d3ebac1a6f931e47..d9d983a15aa0e08f1a5e4ac8de485d40d42fac15 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -291,6 +291,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -33,7 +33,7 @@ index 2d00a3d669bf76c2aba12cf258dcd43d90ad8c82..f3abc5552d058c5b96ed56fc49ffd9f4
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
super(server, connection, clientData, player); // CraftBukkit
-@@ -3066,7 +3067,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -3059,7 +3060,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleSignUpdate(ServerboundSignUpdatePacket packet) {
diff --git a/patches/server/0287-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/patches/server/0287-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch
index c08c85dcb6..a9417173e8 100644
--- a/patches/server/0287-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch
+++ b/patches/server/0287-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 7a7abe0d87936d853ef32e85bd6a4ebb0dfa0ba7..a7119e1bccf009428e74cd3375bc61555062e408 100644
+index e2136ae52074f922a87ac30f5e34cb8035c70475..c137899597bf94b75b1ff80fae910db72f791bb8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1157,6 +1157,7 @@ public abstract class PlayerList {
diff --git a/patches/server/0288-Entity-getEntitySpawnReason.patch b/patches/server/0288-Entity-getEntitySpawnReason.patch
index f9df79e00f..6a4b62d765 100644
--- a/patches/server/0288-Entity-getEntitySpawnReason.patch
+++ b/patches/server/0288-Entity-getEntitySpawnReason.patch
@@ -22,10 +22,10 @@ index 2eddeb8d5239bbfeefbf4d3bd363f1ad083299b6..e2b44b8ddb8afc6e1f7dddadb434c226
});
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 71b07a08f8f1cc354ad04bff87423d0cde607e92..87062f8558518d996b1afaafcd7d9f8d04117e94 100644
+index 46b71a140ab8a1b997415184db09cb8a3ea39c52..c67ef9387f1d7ddfda89a096e764133118167175 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1442,6 +1442,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1203,6 +1203,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
return true;
}
// Paper end - extra debug info
@@ -34,7 +34,7 @@ index 71b07a08f8f1cc354ad04bff87423d0cde607e92..87062f8558518d996b1afaafcd7d9f8d
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index a7119e1bccf009428e74cd3375bc61555062e408..f4e1fe5e5a12e5a3547a2e0305814ea60160c3fc 100644
+index c137899597bf94b75b1ff80fae910db72f791bb8..6555d1e199f49c693270fb7068bc4c495038f77b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -223,6 +223,11 @@ public abstract class PlayerList {
@@ -59,7 +59,7 @@ index a7119e1bccf009428e74cd3375bc61555062e408..f4e1fe5e5a12e5a3547a2e0305814ea6
});
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index a11d100a3b0462b276c5b48f1fb2e5863dd98b81..8405726e0769a68eada678874441b8f6c184d538 100644
+index 5baf85f179c096a9e2be170d7def110d02952dae..c601bd02a75e10af7ad7040b3a4d974c585bbaaf 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -237,6 +237,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -70,7 +70,7 @@ index a11d100a3b0462b276c5b48f1fb2e5863dd98b81..8405726e0769a68eada678874441b8f6
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
private CraftEntity bukkitEntity;
-@@ -2359,6 +2360,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2307,6 +2308,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
diff --git a/patches/server/0290-Add-PlayerPostRespawnEvent.patch b/patches/server/0290-Add-PlayerPostRespawnEvent.patch
index e381e3f475..a7e32e98f6 100644
--- a/patches/server/0290-Add-PlayerPostRespawnEvent.patch
+++ b/patches/server/0290-Add-PlayerPostRespawnEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerPostRespawnEvent
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index f4e1fe5e5a12e5a3547a2e0305814ea60160c3fc..3f39d64fe673ae0f4b155a5f9e757c981ada96c1 100644
+index 6555d1e199f49c693270fb7068bc4c495038f77b..60e50ce92414515c22f4d71e517504a7377c7e64 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -751,9 +751,14 @@ public abstract class PlayerList {
diff --git a/patches/server/0292-Server-Tick-Events.patch b/patches/server/0292-Server-Tick-Events.patch
index 43ca956014..f29930ff8e 100644
--- a/patches/server/0292-Server-Tick-Events.patch
+++ b/patches/server/0292-Server-Tick-Events.patch
@@ -6,10 +6,10 @@ 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 f36d843201e47a02bc9323e7045e89e6c892753a..2a56a462ca8bd839bb373789b117945dc6372e03 100644
+index 71dc0ba14333f0e924dc61856799db94b0cd9651..8d70cbc6e11656d170bde37b5f101902b0b6ee2e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1288,6 +1288,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1294,6 +1294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
});
isOversleep = false;MinecraftTimings.serverOversleep.stopTiming();
// Paper end
@@ -17,7 +17,7 @@ index f36d843201e47a02bc9323e7045e89e6c892753a..2a56a462ca8bd839bb373789b117945d
++this.tickCount;
this.tickRateManager.tick();
-@@ -1314,6 +1315,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1320,6 +1321,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.runAllTasks();
}
// Paper end
diff --git a/patches/server/0293-PlayerDeathEvent-getItemsToKeep.patch b/patches/server/0293-PlayerDeathEvent-getItemsToKeep.patch
index 17aab8cd97..e974e64665 100644
--- a/patches/server/0293-PlayerDeathEvent-getItemsToKeep.patch
+++ b/patches/server/0293-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 ab59cfccd2addba45525a657df8c488664e10290..271d5a95aeb1e75a46b84dfa412ddb10d3159b54 100644
+index 6c68797a5a0b8453dde5aa8f1a875a032c1c56e3..a003df2d8d6be620d4ccfe34dd6a8a1fc9225daf 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -857,6 +857,46 @@ public class ServerPlayer extends Player {
+@@ -813,6 +813,46 @@ public class ServerPlayer extends Player {
});
}
@@ -61,7 +61,7 @@ index ab59cfccd2addba45525a657df8c488664e10290..271d5a95aeb1e75a46b84dfa412ddb10
@Override
public void die(DamageSource damageSource) {
// this.gameEvent(GameEvent.ENTITY_DIE); // Paper - move below event cancellation check
-@@ -941,7 +981,12 @@ public class ServerPlayer extends Player {
+@@ -897,7 +937,12 @@ public class ServerPlayer extends Player {
this.dropExperience();
// 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/0294-Optimize-Captured-BlockEntity-Lookup.patch b/patches/server/0294-Optimize-Captured-BlockEntity-Lookup.patch
index fa5dc54585..271921e7c3 100644
--- a/patches/server/0294-Optimize-Captured-BlockEntity-Lookup.patch
+++ b/patches/server/0294-Optimize-Captured-BlockEntity-Lookup.patch
@@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to
just do a get call since the value can never be null.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 91f2bb15e2eea792f205f04422655fc7d80a6da2..ee237d0e57cbb9b8fe2ae3c84fa7d7a964ad73b9 100644
+index cea3b4744a45b100f0c5c5cef6ecd4b932a89b71..3f1c0f3b879bf562db2b999dd39a3ce37759775d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -920,9 +920,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -915,9 +915,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@Nullable
public BlockEntity getBlockEntity(BlockPos blockposition, boolean validate) {
@@ -26,5 +26,5 @@ index 91f2bb15e2eea792f205f04422655fc7d80a6da2..ee237d0e57cbb9b8fe2ae3c84fa7d7a9
}
+ // Paper end - Perf: Optimize capturedTileEntities lookup
// CraftBukkit end
- 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 && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, LevelChunk.EntityCreationType.IMMEDIATE));
}
diff --git a/patches/server/0295-Add-Heightmap-API.patch b/patches/server/0295-Add-Heightmap-API.patch
index dc70728e70..e011e0d19e 100644
--- a/patches/server/0295-Add-Heightmap-API.patch
+++ b/patches/server/0295-Add-Heightmap-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add Heightmap API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 377c85f458e3e3ce7c7532fb991627b32590a691..50d0d854159396064ee8ee7de5a7f885d8cc13a4 100644
+index 400dbd72c576590ccdbab9c52a3960acb457102f..44b65087ec6f0cf9e29c4f4de94ddf7b6a7a7836 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -222,6 +222,29 @@ public class CraftWorld extends CraftRegionAccessor implements World {
diff --git a/patches/server/0296-Mob-Spawner-API-Enhancements.patch b/patches/server/0296-Mob-Spawner-API-Enhancements.patch
index 327e478176..a5c42c4663 100644
--- a/patches/server/0296-Mob-Spawner-API-Enhancements.patch
+++ b/patches/server/0296-Mob-Spawner-API-Enhancements.patch
@@ -9,7 +9,7 @@ public net.minecraft.world.level.BaseSpawner delay(Lnet/minecraft/world/level/Le
public net.minecraft.world.level.BaseSpawner setNextSpawnData(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/SpawnData;)V
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
-index 1bc11de2144bc8e0a313e753bbfeed571132d9d5..0c14b382e7660ce518096e9f26525ccea57a1bf9 100644
+index ef7da9043f2a6e2041d2a2850aaf19b7c95f706a..8e6d782f3a5a000217b7dcd27fc88aa340a58f47 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -235,7 +235,13 @@ public abstract class BaseSpawner {
diff --git a/patches/server/0300-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/0300-Configurable-Keep-Spawn-Loaded-range-per-world.patch
index 8d2a421d3c..20e6d4fab5 100644
--- a/patches/server/0300-Configurable-Keep-Spawn-Loaded-range-per-world.patch
+++ b/patches/server/0300-Configurable-Keep-Spawn-Loaded-range-per-world.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world
This lets you disable it for some worlds and lower it for others.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 2a56a462ca8bd839bb373789b117945dc6372e03..0e7ca77f5b66fcea190386f49b95e9314dede97c 100644
+index 8d70cbc6e11656d170bde37b5f101902b0b6ee2e..e8b3755dec8149282a2fc55bf0a3fbb788df0b2b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -767,30 +767,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -62,10 +62,10 @@ index 2a56a462ca8bd839bb373789b117945dc6372e03..0e7ca77f5b66fcea190386f49b95e931
// this.updateMobSpawningFlags();
worldserver.setSpawnSettings(this.isSpawningMonsters(), this.isSpawningAnimals());
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 87062f8558518d996b1afaafcd7d9f8d04117e94..5517a1869e9c7a745aeec3bc55722320e1c605c3 100644
+index c67ef9387f1d7ddfda89a096e764133118167175..bd41daf86f2a825a55ca685f4ea43a3df108b64a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1879,12 +1879,84 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1640,12 +1640,84 @@ public class ServerLevel extends Level implements WorldGenLevel {
return ((MapIndex) this.getServer().overworld().getDataStorage().computeIfAbsent(MapIndex.factory(), "idcounts")).getFreeAuxValueForMap();
}
@@ -190,10 +190,10 @@ index 4d2348df25410a0b5364eec066880326d6667dad..3754cda7e7731935893359d84f3ae061
this.maxCount = i * i;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 50d0d854159396064ee8ee7de5a7f885d8cc13a4..f72409e92cbf00c5665037bf4916ddbd352d66d5 100644
+index 44b65087ec6f0cf9e29c4f4de94ddf7b6a7a7836..92c19035e4e03530eb27d7dd96847f4546710d28 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -1407,15 +1407,21 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1378,15 +1378,21 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setKeepSpawnInMemory(boolean keepLoaded) {
diff --git a/patches/server/0301-Expose-the-internal-current-tick.patch b/patches/server/0301-Expose-the-internal-current-tick.patch
index 6ad7146d66..bc0180ff72 100644
--- a/patches/server/0301-Expose-the-internal-current-tick.patch
+++ b/patches/server/0301-Expose-the-internal-current-tick.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Expose the internal current tick
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index c5f65257b2d4d1fa8ebf9f879e72a88dcc66b5a4..ec4b391fa58d9884b97583aad3d6b63af486e94a 100644
+index c682abdd2b144dcd6260db6d63b0474b547f2cc6..e406157dd677f4dde226a30a7faed92c1744afd7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2842,5 +2842,10 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0311-Duplicate-UUID-Resolve-Option.patch b/patches/server/0311-Duplicate-UUID-Resolve-Option.patch
index a21df3ae41..68589f3b44 100644
--- a/patches/server/0311-Duplicate-UUID-Resolve-Option.patch
+++ b/patches/server/0311-Duplicate-UUID-Resolve-Option.patch
@@ -33,19 +33,19 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA
It is recommended you regenerate the entities, as these were legit entities, and deserve your love.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 304e3c177488773d488e5b82f65a7c16a3750a29..1ce59bd654cf4cb68d510b0f6a8d1a72d2761bf7 100644
+index fbac26f913476242c8dd1310426a1d66275f6567..f9df43a6e6239fe8a7abec9f9fce4c9eb01b89ae 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -537,6 +537,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -889,6 +889,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.discard();
needsRemoval = true;
}
+ checkDupeUUID(world, entity); // Paper - duplicate uuid resolving
return !needsRemoval;
- }), position); // Paper - rewrite chunk system
+ }));
// CraftBukkit end
-@@ -548,6 +549,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- throw new UnsupportedOperationException(); // Paper - rewrite chunk system
+@@ -939,6 +940,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ });
}
+ // Paper start - duplicate uuid resolving
@@ -88,5 +88,5 @@ index 304e3c177488773d488e5b82f65a7c16a3750a29..1ce59bd654cf4cb68d510b0f6a8d1a72
+ }
+ // Paper end - duplicate uuid resolving
public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> prepareTickingChunk(ChunkHolder holder) {
- throw new UnsupportedOperationException(); // Paper - rewrite chunk system
- }
+ CompletableFuture<Either<List<ChunkAccess>, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getChunkRangeFuture(holder, 1, (i) -> {
+ return ChunkStatus.FULL;
diff --git a/patches/server/0312-PlayerDeathEvent-shouldDropExperience.patch b/patches/server/0312-PlayerDeathEvent-shouldDropExperience.patch
index 4bee049e15..f11ba0a3ab 100644
--- a/patches/server/0312-PlayerDeathEvent-shouldDropExperience.patch
+++ b/patches/server/0312-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 271d5a95aeb1e75a46b84dfa412ddb10d3159b54..1d7955f8d3bd722bc4524b520e9c6862a4fd52da 100644
+index a003df2d8d6be620d4ccfe34dd6a8a1fc9225daf..d4d66bd96912592de499ef7e626f13de71714c93 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -978,7 +978,7 @@ public class ServerPlayer extends Player {
+@@ -934,7 +934,7 @@ public class ServerPlayer extends Player {
this.tellNeutralMobsThatIDied();
}
// SPIGOT-5478 must be called manually now
diff --git a/patches/server/0315-Optimise-EntityGetter-getPlayerByUUID.patch b/patches/server/0315-Optimise-EntityGetter-getPlayerByUUID.patch
index 2436a7ea78..2f5e7ce829 100644
--- a/patches/server/0315-Optimise-EntityGetter-getPlayerByUUID.patch
+++ b/patches/server/0315-Optimise-EntityGetter-getPlayerByUUID.patch
@@ -6,12 +6,12 @@ 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 7b7072dc81f745bd03c1e56e669c1b5e26f42d3f..c93269e0a6026870c13083cee0f86334c5c3fdb1 100644
+index bd41daf86f2a825a55ca685f4ea43a3df108b64a..989cd53db579408f89c3425d808e0a611194e896 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -555,6 +555,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
- });
+@@ -324,6 +324,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
+ // Paper end
+ // Paper start - optimise getPlayerByUUID
+ @Nullable
diff --git a/patches/server/0316-Fix-items-not-falling-correctly.patch b/patches/server/0316-Fix-items-not-falling-correctly.patch
index 4c7e19ae3c..dc83e6fd0b 100644
--- a/patches/server/0316-Fix-items-not-falling-correctly.patch
+++ b/patches/server/0316-Fix-items-not-falling-correctly.patch
@@ -28,10 +28,10 @@ index 9badb48b6004c5799132ed70ddcc767bdd72510c..7d12bedc4b80b9bcf50f468a9204191b
float f1 = 0.98F;
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
-index 2cb5bbe371333f566b4d6d3ee8016857986e9af0..f60eb4bf10c32d2d92fa24992ed20525f0f0f781 100644
+index e5ff35531a933268f2b8b6c15c234de4482931d5..90df7e83d9166c22a56a31db22d843768229b9ab 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
-@@ -260,7 +260,7 @@ public class ActivationRange
+@@ -254,7 +254,7 @@ public class ActivationRange
isActive = true;
}
// Add a little performance juice to active entities. Skip 1/4 if not immune.
diff --git a/patches/server/0317-Optimize-call-to-getFluid-for-explosions.patch b/patches/server/0317-Optimize-call-to-getFluid-for-explosions.patch
index cc693ed9f9..b552963246 100644
--- a/patches/server/0317-Optimize-call-to-getFluid-for-explosions.patch
+++ b/patches/server/0317-Optimize-call-to-getFluid-for-explosions.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Optimize call to getFluid for explosions
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
-index e59348b849a71ff5eba5bd74a9e2819a560787db..b1fdfae75aeea78ca77987e40242bf498447bc08 100644
+index 219f3abc6d3280077b53cfff97db7e724133f5a1..653036ca797ed4e87f0cc15898d55ede2ed96206 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -191,7 +191,7 @@ public class Explosion {
diff --git a/patches/server/0319-Guard-against-serializing-mismatching-chunk-coordina.patch b/patches/server/0319-Guard-against-serializing-mismatching-chunk-coordina.patch
index effa64fbb5..87113096c0 100644
--- a/patches/server/0319-Guard-against-serializing-mismatching-chunk-coordina.patch
+++ b/patches/server/0319-Guard-against-serializing-mismatching-chunk-coordina.patch
@@ -6,16 +6,16 @@ Subject: [PATCH] Guard against serializing mismatching chunk coordinate
Should help if something dumb happens
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 97cdd8cd7749185230471f34f7d1ce3abcd0fd11..7862caa0f787634cec14af81fe1f39803a43f115 100644
+index 24892ae367e19038625e243bcdf1bb694632ede5..b4ea37dfa90f0c19914ecd32ddedde586d9d5f78 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
-@@ -94,6 +94,18 @@ public class ChunkSerializer {
+@@ -94,8 +94,20 @@ public class ChunkSerializer {
public ChunkSerializer() {}
+ // Paper start - guard against serializing mismatching coordinates
+ // TODO Note: This needs to be re-checked each update
-+ public static ChunkPos getChunkCoordinate(CompoundTag chunkData) {
++ public static ChunkPos getChunkCoordinate(final CompoundTag chunkData) {
+ final int dataVersion = ChunkStorage.getVersion(chunkData);
+ if (dataVersion < 2842) { // Level tag is removed after this version
+ final CompoundTag levelData = chunkData.getCompound("Level");
@@ -25,33 +25,27 @@ index 97cdd8cd7749185230471f34f7d1ce3abcd0fd11..7862caa0f787634cec14af81fe1f3980
+ }
+ }
+ // Paper end - guard against serializing mismatching coordinates
- // Paper start
- public static final class InProgressChunkHolder {
-
-@@ -115,7 +127,7 @@ public class ChunkSerializer {
-
- public static InProgressChunkHolder loadChunk(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt, boolean distinguish) {
- // Paper end
+ public static ProtoChunk read(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) {
- ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos"));
+ ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos")); // Paper - guard against serializing mismatching coordinates; diff on change, see ChunkSerializer#getChunkCoordinate
if (!Objects.equals(chunkPos, chunkcoordintpair1)) {
ChunkSerializer.LOGGER.error("Chunk file at {} is in the wrong location; relocating. (Expected {}, got {})", new Object[]{chunkPos, chunkPos, chunkcoordintpair1});
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
-index b4e7c9b317d532d4915932f8f79dfebf2b63ff16..af8a8e85742497e8dac7a59a3cd5938e09580e45 100644
+index 6c0f87535ffa95cf82ab4b03bb7bf8f2132d275f..ab6b4491d4278b3839b7363d9890bd12a757e4cc 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
-@@ -178,6 +178,13 @@ public class ChunkStorage implements AutoCloseable {
+@@ -157,6 +157,13 @@ public class ChunkStorage implements AutoCloseable {
+ }
- // Paper start - async chunk io
- public void write(ChunkPos chunkPos, CompoundTag nbt) throws IOException {
+ public void write(ChunkPos chunkPos, CompoundTag nbt) {
+ // Paper start - guard against serializing mismatching coordinates
+ if (nbt != null && !chunkPos.equals(ChunkSerializer.getChunkCoordinate(nbt))) {
-+ String world = (this instanceof net.minecraft.server.level.ChunkMap) ? ((net.minecraft.server.level.ChunkMap)this).level.getWorld().getName() : null;
-+ throw new IllegalArgumentException("Chunk coordinate and serialized data do not have matching coordinates, trying to serialize coordinate " + chunkPos.toString()
-+ + " but compound says coordinate is " + ChunkSerializer.getChunkCoordinate(nbt).toString() + (world == null ? " for an unknown world" : (" for world: " + world)));
++ final String world = (this instanceof net.minecraft.server.level.ChunkMap) ? ((net.minecraft.server.level.ChunkMap) this).level.getWorld().getName() : null;
++ throw new IllegalArgumentException("Chunk coordinate and serialized data do not have matching coordinates, trying to serialize coordinate " + chunkPos
++ + " but compound says coordinate is " + ChunkSerializer.getChunkCoordinate(nbt) + (world == null ? " for an unknown world" : (" for world: " + world)));
+ }
+ // Paper end - guard against serializing mismatching coordinates
- this.regionFileCache.write(chunkPos, nbt);
- // Paper end - Async chunk loading
+ this.worker.store(chunkPos, nbt);
if (this.legacyStructureHandler != null) {
+ this.legacyStructureHandler.removeIndex(chunkPos.toLong());
diff --git a/patches/server/0321-Tracking-Range-Improvements.patch b/patches/server/0321-Tracking-Range-Improvements.patch
index e0feadd2bf..ebb35fc4fa 100644
--- a/patches/server/0321-Tracking-Range-Improvements.patch
+++ b/patches/server/0321-Tracking-Range-Improvements.patch
@@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
Also ignores Enderdragon, defaulting it to Mojang's setting
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 1ce59bd654cf4cb68d510b0f6a8d1a72d2761bf7..c96b20cdd87596b6ff73478d262acdf22361858b 100644
+index f9df43a6e6239fe8a7abec9f9fce4c9eb01b89ae..064b008c3869346315f7a9fb2ce7a111f5adf729 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1203,6 +1203,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1770,6 +1770,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/0322-Fix-items-vanishing-through-end-portal.patch b/patches/server/0322-Fix-items-vanishing-through-end-portal.patch
index f210200656..ba6886e945 100644
--- a/patches/server/0322-Fix-items-vanishing-through-end-portal.patch
+++ b/patches/server/0322-Fix-items-vanishing-through-end-portal.patch
@@ -13,10 +13,10 @@ Quickly loading the exact world spawn chunk before searching the
heightmap resolves the issue without having to load all spawn chunks.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 8405726e0769a68eada678874441b8f6c184d538..25fd84d4ff80511f41f479ca3c8e73e1edcdf31a 100644
+index c601bd02a75e10af7ad7040b3a4d974c585bbaaf..2aea992adeae1d51f224e76d104b031f46447a5d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -3396,6 +3396,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3344,6 +3344,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (flag1) {
blockposition1 = ServerLevel.END_SPAWN_POINT;
} else {
diff --git a/patches/server/0325-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/patches/server/0325-Optimise-getChunkAt-calls-for-loaded-chunks.patch
index eea0c2c464..268dd7416f 100644
--- a/patches/server/0325-Optimise-getChunkAt-calls-for-loaded-chunks.patch
+++ b/patches/server/0325-Optimise-getChunkAt-calls-for-loaded-chunks.patch
@@ -7,10 +7,10 @@ bypass the need to get a player chunk, then get the either,
then unwrap it...
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index de1d5da6318958e11a9da56ddd8fef1174d0a537..250f9821d400628c9431b07d1c02c379120e815a 100644
+index 5fc48485aa2045c19c5ec2ba9cb6fafabb1ae8f1..32a26eac53cfd4fb69ba117908acc82894deb1a0 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -268,6 +268,12 @@ public class ServerChunkCache extends ChunkSource {
+@@ -396,6 +396,12 @@ public class ServerChunkCache extends ChunkSource {
return this.getChunk(x, z, leastStatus, create);
}, this.mainThreadProcessor).join();
} else {
@@ -23,8 +23,8 @@ index de1d5da6318958e11a9da56ddd8fef1174d0a537..250f9821d400628c9431b07d1c02c379
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
gameprofilerfiller.incrementCounter("getChunk");
-@@ -311,39 +317,7 @@ public class ServerChunkCache extends ChunkSource {
- if (!io.papermc.paper.util.TickThread.isTickThread()) { // Paper - rewrite chunk system
+@@ -442,39 +448,7 @@ public class ServerChunkCache extends ChunkSource {
+ if (Thread.currentThread() != this.mainThread) {
return null;
} else {
- this.level.getProfiler().incrementCounter("getChunkNow");
diff --git a/patches/server/0326-Add-debug-for-sync-chunk-loads.patch b/patches/server/0326-Add-debug-for-sync-chunk-loads.patch
index f9aaf65978..12b94b3a47 100644
--- a/patches/server/0326-Add-debug-for-sync-chunk-loads.patch
+++ b/patches/server/0326-Add-debug-for-sync-chunk-loads.patch
@@ -194,14 +194,14 @@ index 0000000000000000000000000000000000000000..0bb4aaa546939b67a5d22865190f3047
+ }
+}
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
-index ae51993e0de706cb62c96795ca9de7663893a5bf..5bfa245a621a0bf7ef60cd01f4c04576b770384e 100644
+index 830978f3409888302ab857161628cee5869efa8f..ae51993e0de706cb62c96795ca9de7663893a5bf 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
-@@ -40,6 +40,7 @@ public final class PaperCommand extends Command {
+@@ -39,6 +39,7 @@ public final class PaperCommand extends Command {
+ commands.put(Set.of("version"), new VersionCommand());
commands.put(Set.of("dumpplugins"), new DumpPluginsCommand());
commands.put(Set.of("fixlight"), new FixLightCommand());
- commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
-+ commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
++ commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
return commands.entrySet().stream()
.flatMap(entry -> entry.getKey().stream().map(s -> Map.entry(s, entry.getValue())))
@@ -300,23 +300,23 @@ 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 250f9821d400628c9431b07d1c02c379120e815a..5bea335653d3cd45354dc67b160a6bf5ce907f41 100644
+index 32a26eac53cfd4fb69ba117908acc82894deb1a0..6bb0b24e8bc5cd031d192dd0b61a3afd248c62e4 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -292,6 +292,7 @@ public class ServerChunkCache extends ChunkSource {
- // Paper start - async chunk io/loading
- io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.pushChunkWait(this.level, x1, z1); // Paper - rewrite chunk system
- // Paper end
-+ com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x1, z1); // Paper - Add debug for sync chunk loads
+@@ -424,6 +424,7 @@ public class ServerChunkCache extends ChunkSource {
+
+ Objects.requireNonNull(completablefuture);
+ if (!completablefuture.isDone()) { // Paper
++ com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x, z); // Paper - Add debug for sync chunk loads
this.level.timings.syncChunkLoad.startTiming(); // Paper
chunkproviderserver_b.managedBlock(completablefuture::isDone);
- io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - async chunk debug // Paper - rewrite chunk system
+ 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 c93269e0a6026870c13083cee0f86334c5c3fdb1..8a7032d909452cec6c4b3e99b02fb00df5cea324 100644
+index 989cd53db579408f89c3425d808e0a611194e896..dd7071404555548c7f102737456f8773860b597b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -649,6 +649,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
- this.entityLookup = new io.papermc.paper.chunk.system.entity.EntityLookup(this, new EntityCallbacks()); // Paper - rewrite chunk system
+@@ -415,6 +415,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
+ this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
}
+ // Paper start
diff --git a/patches/server/0327-Improve-java-version-check.patch b/patches/server/0327-Improve-java-version-check.patch
index cb029274c1..e856678f3c 100644
--- a/patches/server/0327-Improve-java-version-check.patch
+++ b/patches/server/0327-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 4d2ebb7af055d1c78a648914c5a1862fe9bc8b8f..5030b865c84d84ed5be9f4987a7f0a829b8ea1e5 100644
+index 623c7304a6849e994e22cd559177d9de0dd2f4c4..ee9bb75f2850bf421cc8ff02aca5b230538d6503 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -201,23 +201,27 @@ public class Main {
diff --git a/patches/server/0330-Add-option-to-nerf-pigmen-from-nether-portals.patch b/patches/server/0330-Add-option-to-nerf-pigmen-from-nether-portals.patch
index 1307640b15..42b9ca56c6 100644
--- a/patches/server/0330-Add-option-to-nerf-pigmen-from-nether-portals.patch
+++ b/patches/server/0330-Add-option-to-nerf-pigmen-from-nether-portals.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add option to nerf pigmen from nether portals
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 25fd84d4ff80511f41f479ca3c8e73e1edcdf31a..4d0f9ee714ddcd93a5e6c53a81dacbe698507e6e 100644
+index 2aea992adeae1d51f224e76d104b031f46447a5d..99f9e96509800e2246e729400a1ac6de522d456a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -396,6 +396,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -16,7 +16,7 @@ index 25fd84d4ff80511f41f479ca3c8e73e1edcdf31a..4d0f9ee714ddcd93a5e6c53a81dacbe6
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
// Paper start - Entity origin API
@javax.annotation.Nullable
-@@ -2218,6 +2219,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2166,6 +2167,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (spawnedViaMobSpawner) {
nbttagcompound.putBoolean("Paper.FromMobSpawner", true);
}
@@ -26,7 +26,7 @@ index 25fd84d4ff80511f41f479ca3c8e73e1edcdf31a..4d0f9ee714ddcd93a5e6c53a81dacbe6
// Paper end
return nbttagcompound;
} catch (Throwable throwable) {
-@@ -2360,6 +2364,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2308,6 +2312,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
diff --git a/patches/server/0335-Configurable-chance-of-villager-zombie-infection.patch b/patches/server/0335-Configurable-chance-of-villager-zombie-infection.patch
index 5f99615d8e..66e2a4f6d4 100644
--- a/patches/server/0335-Configurable-chance-of-villager-zombie-infection.patch
+++ b/patches/server/0335-Configurable-chance-of-villager-zombie-infection.patch
@@ -8,7 +8,7 @@ This allows you to solve an issue in vanilla behavior where:
* On normal difficulty they will have a 50% of getting infected or dying.
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
-index 37730675250f03ff6786992949813d67583610b3..ac4916a898af8c3584d84088b18e8b38b5eb6b13 100644
+index 2c8529540bf3644896f3c05d5f544bd848647807..408cbb80df72cf67e5228a76b7f267281e1752ab 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -452,12 +452,8 @@ public class Zombie extends Monster {
diff --git a/patches/server/0336-Optimise-Chunk-getFluid.patch b/patches/server/0336-Optimise-Chunk-getFluid.patch
index 68b01c18b8..e5f03ef740 100644
--- a/patches/server/0336-Optimise-Chunk-getFluid.patch
+++ b/patches/server/0336-Optimise-Chunk-getFluid.patch
@@ -8,10 +8,10 @@ faster on its own, however removing the try catch makes it
easier to inline due to code size
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 a086e14729fbc3a7ad40807828a23594d41dabfb..673da3c93291c70ed83b1a06a068e4854fc4d32b 100644
+index 8288be49fc0fbedefef799cb1038d5f79b7cf0a3..84036969971a72129f98d5f524eecd237658b81f 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -377,18 +377,20 @@ public class LevelChunk extends ChunkAccess {
+@@ -376,18 +376,20 @@ public class LevelChunk extends ChunkAccess {
}
public FluidState getFluidState(int x, int y, int z) {
@@ -38,7 +38,7 @@ index a086e14729fbc3a7ad40807828a23594d41dabfb..673da3c93291c70ed83b1a06a068e485
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Getting fluid state");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Block being got");
-@@ -398,6 +400,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -397,6 +399,7 @@ public class LevelChunk extends ChunkAccess {
});
throw new ReportedException(crashreport);
}
diff --git a/patches/server/0338-Add-tick-times-API-and-mspt-command.patch b/patches/server/0338-Add-tick-times-API-and-mspt-command.patch
index a3a4e8b096..e5f094e4c0 100644
--- a/patches/server/0338-Add-tick-times-API-and-mspt-command.patch
+++ b/patches/server/0338-Add-tick-times-API-and-mspt-command.patch
@@ -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 0e7ca77f5b66fcea190386f49b95e9314dede97c..fe5041d05f93900a22049a2176cb59d226c263bf 100644
+index e8b3755dec8149282a2fc55bf0a3fbb788df0b2b..fcb8708276a73ab61e004f0113650b0a7415041c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -252,6 +252,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -140,7 +140,7 @@ index 0e7ca77f5b66fcea190386f49b95e9314dede97c..fe5041d05f93900a22049a2176cb59d2
@Nullable
private KeyPair keyPair;
@Nullable
-@@ -1333,6 +1338,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1339,6 +1344,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.smoothedTickTimeMillis = this.smoothedTickTimeMillis * 0.8F + (float) j / (float) TimeUtil.NANOSECONDS_PER_MILLISECOND * 0.19999999F;
long l = Util.getNanos();
@@ -152,7 +152,7 @@ index 0e7ca77f5b66fcea190386f49b95e9314dede97c..fe5041d05f93900a22049a2176cb59d2
this.logTickTime(l - i);
this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot
-@@ -2609,4 +2619,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2615,4 +2625,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) {
}
@@ -184,7 +184,7 @@ index 0e7ca77f5b66fcea190386f49b95e9314dede97c..fe5041d05f93900a22049a2176cb59d2
+ // Paper end - Add tick times API and /mspt command
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index ec4b391fa58d9884b97583aad3d6b63af486e94a..0cedd2ca42ccd4fa60dae500a596aef38401081e 100644
+index e406157dd677f4dde226a30a7faed92c1744afd7..bc81109da3e03a34b0684a6a5a0e67b22fda569e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2619,6 +2619,16 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0339-Expose-MinecraftServer-isRunning.patch b/patches/server/0339-Expose-MinecraftServer-isRunning.patch
index fbc1dc4290..88dd15dd20 100644
--- a/patches/server/0339-Expose-MinecraftServer-isRunning.patch
+++ b/patches/server/0339-Expose-MinecraftServer-isRunning.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Expose MinecraftServer#isRunning
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 0cedd2ca42ccd4fa60dae500a596aef38401081e..8239e6c4771b6e3399e0f2ecd0e26f86ea848a69 100644
+index bc81109da3e03a34b0684a6a5a0e67b22fda569e..e7cc65bd56b8526ca4f5a935872bc158fae22bb0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2857,5 +2857,10 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0341-Pillager-patrol-spawn-settings-and-per-player-option.patch b/patches/server/0341-Pillager-patrol-spawn-settings-and-per-player-option.patch
index 4e7f68854e..08c93f3fec 100644
--- a/patches/server/0341-Pillager-patrol-spawn-settings-and-per-player-option.patch
+++ b/patches/server/0341-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 f55fc8c9738ca5cd7868df69b7e32a23b95a6bce..ecd40e3b19d95d45f58349556a2c8e5f47a37c91 100644
+index d4d66bd96912592de499ef7e626f13de71714c93..b7111a76bac5f8d1bfa69a99b7c6bebf053c59bf 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -249,6 +249,7 @@ public class ServerPlayer extends Player {
diff --git a/patches/server/0342-Remote-Connections-shouldn-t-hold-up-shutdown.patch b/patches/server/0342-Remote-Connections-shouldn-t-hold-up-shutdown.patch
index 269d7f6be9..5a220197f7 100644
--- a/patches/server/0342-Remote-Connections-shouldn-t-hold-up-shutdown.patch
+++ b/patches/server/0342-Remote-Connections-shouldn-t-hold-up-shutdown.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Remote Connections shouldn't hold up shutdown
Bugs in the connection logic appears to leave stale connections even, preventing shutdown
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index a7d7c676f1ab8c47395b91aea028f143837b8801..9c7079d0c3c25bef970891b0579daa940fa61e33 100644
+index 47b12535d2cb146155044cc20b14bb5a432f83d5..567e642232cc698995def33d7cbe1f679ea7a871 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -390,11 +390,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
diff --git a/patches/server/0344-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/patches/server/0344-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
index c28fb6fce6..97cd7fd97e 100644
--- a/patches/server/0344-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
+++ b/patches/server/0344-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
@@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index c96b20cdd87596b6ff73478d262acdf22361858b..397fcc5f3835418bb31998b0b0cdce9427a017a2 100644
+index 064b008c3869346315f7a9fb2ce7a111f5adf729..b2bc8869c454eba5c55a45d5671e2e406a0d12a7 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -909,6 +909,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1461,6 +1461,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void addEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
@@ -25,10 +25,10 @@ index c96b20cdd87596b6ff73478d262acdf22361858b..397fcc5f3835418bb31998b0b0cdce94
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 bc4bac5607abc5146648a79419b28eb8ba1be0b2..faf704d805a1af037d0e8d4dd60a942a43e5b054 100644
+index dd7071404555548c7f102737456f8773860b597b..ecc716ce94f40ab8f85e5f57fecad68c08d4e85e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2478,7 +2478,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2224,7 +2224,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void onTrackingStart(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot
@@ -37,7 +37,7 @@ index bc4bac5607abc5146648a79419b28eb8ba1be0b2..faf704d805a1af037d0e8d4dd60a942a
if (entity instanceof ServerPlayer) {
ServerPlayer entityplayer = (ServerPlayer) entity;
-@@ -2513,6 +2513,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2259,6 +2259,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.updateDynamicGameEventListener(DynamicGameEventListener::add);
entity.inWorld = true; // CraftBukkit - Mark entity as in world
entity.valid = true; // CraftBukkit
diff --git a/patches/server/0345-Don-t-tick-dead-players.patch b/patches/server/0345-Don-t-tick-dead-players.patch
index 9b36f159d7..fb1381bc76 100644
--- a/patches/server/0345-Don-t-tick-dead-players.patch
+++ b/patches/server/0345-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 e28b4976341157b8dbc7245ee91024fd1e025b09..285a9badc1a8b6582b808f0d474bcd22821e2c71 100644
+index b7111a76bac5f8d1bfa69a99b7c6bebf053c59bf..2cfe7e0e48ee8dcfb4bbcb2a8f6454d01d31d817 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -728,7 +728,7 @@ public class ServerPlayer extends Player {
+@@ -684,7 +684,7 @@ public class ServerPlayer extends Player {
public void doTick() {
try {
diff --git a/patches/server/0347-Don-t-move-existing-players-to-world-spawn.patch b/patches/server/0347-Don-t-move-existing-players-to-world-spawn.patch
index 5597570f86..144c65f282 100644
--- a/patches/server/0347-Don-t-move-existing-players-to-world-spawn.patch
+++ b/patches/server/0347-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 285a9badc1a8b6582b808f0d474bcd22821e2c71..538fe865ad27796371d11123ce03602719a9be68 100644
+index 2cfe7e0e48ee8dcfb4bbcb2a8f6454d01d31d817..07b5a783ed9fec073f232f00c41f9e051f243efe 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -381,7 +381,7 @@ public class ServerPlayer extends Player {
+@@ -337,7 +337,7 @@ public class ServerPlayer extends Player {
this.stats = server.getPlayerList().getPlayerStats(this);
this.advancements = server.getPlayerList().getPlayerAdvancements(this);
this.setMaxUpStep(1.0F);
@@ -25,7 +25,7 @@ index 285a9badc1a8b6582b808f0d474bcd22821e2c71..538fe865ad27796371d11123ce036027
this.updateOptions(clientOptions);
this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
-@@ -615,7 +615,7 @@ public class ServerPlayer extends Player {
+@@ -571,7 +571,7 @@ public class ServerPlayer extends Player {
position = Vec3.atCenterOf(world.getSharedSpawnPos());
}
this.setLevel(world);
@@ -35,7 +35,7 @@ index 285a9badc1a8b6582b808f0d474bcd22821e2c71..538fe865ad27796371d11123ce036027
this.gameMode.setLevel((ServerLevel) world);
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 3f39d64fe673ae0f4b155a5f9e757c981ada96c1..c04db4712ac4127cffe250e404eed9198b377429 100644
+index 60e50ce92414515c22f4d71e517504a7377c7e64..4530ba80f7d3983cf4ed9908eb1109c58aa425f2 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -226,6 +226,7 @@ public abstract class PlayerList {
diff --git a/patches/server/0351-Prevent-opening-inventories-when-frozen.patch b/patches/server/0351-Prevent-opening-inventories-when-frozen.patch
index b26bd0f347..036d805389 100644
--- a/patches/server/0351-Prevent-opening-inventories-when-frozen.patch
+++ b/patches/server/0351-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 cdce839f310da5f7323b7d27120e7a7a81a52ee9..c58fb0d2937cc5534c4e81210f69cd5b09fa8bd5 100644
+index 07b5a783ed9fec073f232f00c41f9e051f243efe..f6d266c5b279a22dee273cda109866b627e706da 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -697,7 +697,7 @@ public class ServerPlayer extends Player {
+@@ -653,7 +653,7 @@ public class ServerPlayer extends Player {
containerUpdateDelay = this.level().paperConfig().tickRates.containerUpdate;
}
// Paper end - Configurable container update tick rate
@@ -17,7 +17,7 @@ index cdce839f310da5f7323b7d27120e7a7a81a52ee9..c58fb0d2937cc5534c4e81210f69cd5b
this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper - Inventory close reason
this.containerMenu = this.inventoryMenu;
}
-@@ -1552,7 +1552,7 @@ public class ServerPlayer extends Player {
+@@ -1508,7 +1508,7 @@ public class ServerPlayer extends Player {
} else {
// CraftBukkit start
this.containerMenu = container;
diff --git a/patches/server/0353-Implement-Player-Client-Options-API.patch b/patches/server/0353-Implement-Player-Client-Options-API.patch
index aadbb6c539..12e24a1ee2 100644
--- a/patches/server/0353-Implement-Player-Client-Options-API.patch
+++ b/patches/server/0353-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 2d8642f9a3dfa1a8a014fe773bbee93b86602677..86aa09683423b4beae9986250b12359077703f4f 100644
+index f6d266c5b279a22dee273cda109866b627e706da..6e3a791c4623ee904c3348ad7be5ede4b1657a12 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -382,7 +382,7 @@ public class ServerPlayer extends Player {
+@@ -338,7 +338,7 @@ public class ServerPlayer extends Player {
this.advancements = server.getPlayerList().getPlayerAdvancements(this);
this.setMaxUpStep(1.0F);
// this.fudgeSpawnLocation(world); // Paper - Don't move existing players to world spawn
@@ -99,7 +99,7 @@ index 2d8642f9a3dfa1a8a014fe773bbee93b86602677..86aa09683423b4beae9986250b123590
this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
-@@ -2048,7 +2048,23 @@ public class ServerPlayer extends Player {
+@@ -2004,7 +2004,23 @@ public class ServerPlayer extends Player {
}
}
@@ -123,7 +123,7 @@ index 2d8642f9a3dfa1a8a014fe773bbee93b86602677..86aa09683423b4beae9986250b123590
// CraftBukkit start
if (this.getMainArm() != clientOptions.mainHand()) {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), this.getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT);
-@@ -2060,6 +2076,11 @@ public class ServerPlayer extends Player {
+@@ -2016,6 +2032,11 @@ public class ServerPlayer extends Player {
this.server.server.getPluginManager().callEvent(new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), this.language, clientOptions.language())); // Paper
}
// CraftBukkit end
@@ -136,10 +136,10 @@ index 2d8642f9a3dfa1a8a014fe773bbee93b86602677..86aa09683423b4beae9986250b123590
this.adventure$locale = net.kyori.adventure.translation.Translator.parseLocale(this.language); // 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 c279d53a9ec8c3b77c1734c9321e3642dd16c47c..4de49a81238ca3d550f85fdcdf921c17f992f65a 100644
+index 1c8e4e3c53acc1c3043cb015cbe504f4cfb7a35c..549c14e2d861c0b4692ee56e1de5df13ef72f6f8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -609,6 +609,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -567,6 +567,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message);
}
}
diff --git a/patches/server/0354-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch b/patches/server/0354-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch
index fdccb38226..3f7dfaad06 100644
--- a/patches/server/0354-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch
+++ b/patches/server/0354-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch
@@ -7,10 +7,10 @@ Subject: [PATCH] Don't crash if player is attempted to be removed from
I suspect it deals with teleporting as it uses players current x/y/z
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
-index 36686a92bd7dc0e29049f72c0e953ff56c2645eb..c80a625f7289e3bb33c6851d2072957e153ca1fb 100644
+index 0bd05d7a8f2a388c28ddcf3f07db5b0648dddeea..1a9e6ed379c5fccfd82f4718c7fd2794978f63b4 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
-@@ -146,8 +146,8 @@ public abstract class DistanceManager {
+@@ -285,8 +285,8 @@ public abstract class DistanceManager {
ObjectSet<ServerPlayer> objectset = (ObjectSet) this.playersPerChunk.get(i);
if (objectset == null) return; // CraftBukkit - SPIGOT-6208
@@ -20,4 +20,4 @@ index 36686a92bd7dc0e29049f72c0e953ff56c2645eb..c80a625f7289e3bb33c6851d2072957e
+ if (objectset == null || objectset.isEmpty()) { // Paper
this.playersPerChunk.remove(i);
this.naturalSpawnChunkCounter.update(i, Integer.MAX_VALUE, false);
- //this.playerTicketManager.update(i, Integer.MAX_VALUE, false); // Paper - no longer used
+ this.playerTicketManager.update(i, Integer.MAX_VALUE, false);
diff --git a/patches/server/0355-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch b/patches/server/0355-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch
index 74a7ea85ee..593623bc6d 100644
--- a/patches/server/0355-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch
+++ b/patches/server/0355-Fire-PlayerJoinEvent-when-Player-is-actually-ready.patch
@@ -31,10 +31,10 @@ delays anymore.
public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 397fcc5f3835418bb31998b0b0cdce9427a017a2..69d140fbcccc9054f15716e35a7b854b387fe21d 100644
+index b2bc8869c454eba5c55a45d5671e2e406a0d12a7..9706e08511fcfd72abd5e92d7df54dc199451499 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -916,6 +916,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1468,6 +1468,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 397fcc5f3835418bb31998b0b0cdce9427a017a2..69d140fbcccc9054f15716e35a7b854b
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 86aa09683423b4beae9986250b12359077703f4f..5c9a6fe2f2d67ff4e27c691ebc97e7a50d62fc22 100644
+index 6e3a791c4623ee904c3348ad7be5ede4b1657a12..e3413273076b697d560c927ea0e12f34722a79c1 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 Player {
@@ -55,7 +55,7 @@ index 86aa09683423b4beae9986250b12359077703f4f..5c9a6fe2f2d67ff4e27c691ebc97e7a5
// CraftBukkit end
public boolean isRealPlayer; // Paper
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index c04db4712ac4127cffe250e404eed9198b377429..4be466a21fb1fb936e1eaa6351e30a53c7b5cbb4 100644
+index 4530ba80f7d3983cf4ed9908eb1109c58aa425f2..16d43da0144eb3f77f639568a82e3c9d1bb7e260 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -295,6 +295,12 @@ public abstract class PlayerList {
diff --git a/patches/server/0356-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/patches/server/0356-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch
index 0e3b6dc935..872f63a323 100644
--- a/patches/server/0356-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch
+++ b/patches/server/0356-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch
@@ -10,7 +10,7 @@ Co-authored-by: Wyatt Childers <[email protected]>
Co-authored-by: Jake Potrebic <[email protected]>
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 4be466a21fb1fb936e1eaa6351e30a53c7b5cbb4..5657999a85b9b9dfb48a51170d5fa3d9c37263ad 100644
+index 16d43da0144eb3f77f639568a82e3c9d1bb7e260..54aba3118157f72491cb8c3d5fb5c63750ea6878 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -194,7 +194,7 @@ public abstract class PlayerList {
@@ -87,10 +87,10 @@ index 4be466a21fb1fb936e1eaa6351e30a53c7b5cbb4..5657999a85b9b9dfb48a51170d5fa3d9
}
// Paper end - Entity#getEntitySpawnReason
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 4d0f9ee714ddcd93a5e6c53a81dacbe698507e6e..7332ef95cd4a9465c55de29de04412a9e2e197d4 100644
+index 99f9e96509800e2246e729400a1ac6de522d456a..5bb40d4031ad7539dd98a1f4bf9bc7e3a2c6d978 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2321,27 +2321,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2269,27 +2269,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
// CraftBukkit end
diff --git a/patches/server/0360-Fix-item-duplication-and-teleport-issues.patch b/patches/server/0360-Fix-item-duplication-and-teleport-issues.patch
index 4f29a8c25d..f54692897c 100644
--- a/patches/server/0360-Fix-item-duplication-and-teleport-issues.patch
+++ b/patches/server/0360-Fix-item-duplication-and-teleport-issues.patch
@@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the
same item twice because the source was destroyed.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 7332ef95cd4a9465c55de29de04412a9e2e197d4..b0eba706279b26b68d3bc3fce85ba8781e8ea826 100644
+index 5bb40d4031ad7539dd98a1f4bf9bc7e3a2c6d978..47094050283625e3b494f5ab6955a2f9c736388d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2451,11 +2451,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2399,11 +2399,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} else {
// CraftBukkit start - Capture drops for death event
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {
@@ -34,7 +34,7 @@ index 7332ef95cd4a9465c55de29de04412a9e2e197d4..b0eba706279b26b68d3bc3fce85ba878
entityitem.setDefaultPickUpDelay();
// CraftBukkit start
-@@ -3255,6 +3256,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3203,6 +3204,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@Nullable
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
// CraftBukkit end
@@ -47,7 +47,7 @@ index 7332ef95cd4a9465c55de29de04412a9e2e197d4..b0eba706279b26b68d3bc3fce85ba878
if (this.level() instanceof ServerLevel && !this.isRemoved()) {
this.level().getProfiler().push("changeDimension");
// CraftBukkit start
-@@ -3281,6 +3288,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3229,6 +3236,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// CraftBukkit end
this.level().getProfiler().popPush("reloading");
@@ -59,7 +59,7 @@ index 7332ef95cd4a9465c55de29de04412a9e2e197d4..b0eba706279b26b68d3bc3fce85ba878
Entity entity = this.getType().create(worldserver);
if (entity != null) {
-@@ -3298,10 +3310,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3246,10 +3258,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// CraftBukkit start - Forward the CraftEntity to the new entity
this.getBukkitEntity().setHandle(entity);
entity.bukkitEntity = this.getBukkitEntity();
@@ -70,7 +70,7 @@ index 7332ef95cd4a9465c55de29de04412a9e2e197d4..b0eba706279b26b68d3bc3fce85ba878
// CraftBukkit end
}
-@@ -3420,7 +3428,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3368,7 +3376,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public boolean canChangeDimensions() {
diff --git a/patches/server/0362-Validate-PickItem-Packet-and-kick-for-invalid.patch b/patches/server/0362-Validate-PickItem-Packet-and-kick-for-invalid.patch
index 703e337df1..7d21c287ed 100644
--- a/patches/server/0362-Validate-PickItem-Packet-and-kick-for-invalid.patch
+++ b/patches/server/0362-Validate-PickItem-Packet-and-kick-for-invalid.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index f3abc5552d058c5b96ed56fc49ffd9f420668d01..a1da534dab13f475dca626645c246ef36aea6938 100644
+index d9d983a15aa0e08f1a5e4ac8de485d40d42fac15..ec897c87642bf3cc8d9c0cea4cb76d4594acc95d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -867,7 +867,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -860,7 +860,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handlePickItem(ServerboundPickItemPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
diff --git a/patches/server/0363-Expose-game-version.patch b/patches/server/0363-Expose-game-version.patch
index e0af77195c..31b87107a7 100644
--- a/patches/server/0363-Expose-game-version.patch
+++ b/patches/server/0363-Expose-game-version.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Expose game version
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index edec1e0c931eff59d69890bd48355a0e15b3a001..449f6e07c9693a32b9159657baf038a61391d24f 100644
+index e7cc65bd56b8526ca4f5a935872bc158fae22bb0..46273f6d706ecf9a46c9c41bd93cffda9ff0687a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -577,6 +577,13 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0364-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch b/patches/server/0364-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch
index 1bcb557b10..7501e408f6 100644
--- a/patches/server/0364-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch
+++ b/patches/server/0364-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 5030b865c84d84ed5be9f4987a7f0a829b8ea1e5..b4975e80c1929826feb880526b41b2c871ac8c8f 100644
+index ee9bb75f2850bf421cc8ff02aca5b230538d6503..db6398c1822f6ad499feddd6a915984ef9917777 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -26,6 +26,7 @@ public class Main {
diff --git a/patches/server/0365-misc-debugging-dumps.patch b/patches/server/0365-misc-debugging-dumps.patch
index 70571b0360..fad9dc8e9f 100644
--- a/patches/server/0365-misc-debugging-dumps.patch
+++ b/patches/server/0365-misc-debugging-dumps.patch
@@ -42,10 +42,10 @@ index 40ff3090fb17fb0f01a9b52639fb783ea57ce6b6..d39743d9626eb01c942194387dafb110
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 fe5041d05f93900a22049a2176cb59d226c263bf..ae7bddabc445dc42394235a3f87b2a3a5c27800a 100644
+index fcb8708276a73ab61e004f0113650b0a7415041c..4339a2cd0b2020b673ebdb6902ad0d0a53373a27 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -913,6 +913,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -903,6 +903,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start
private boolean hasStopped = false;
@@ -53,7 +53,7 @@ index fe5041d05f93900a22049a2176cb59d226c263bf..ae7bddabc445dc42394235a3f87b2a3a
private final Object stopLock = new Object();
public final boolean hasStopped() {
synchronized (this.stopLock) {
-@@ -927,6 +928,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -917,6 +918,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.hasStopped) return;
this.hasStopped = true;
}
@@ -61,7 +61,7 @@ index fe5041d05f93900a22049a2176cb59d226c263bf..ae7bddabc445dc42394235a3f87b2a3a
// CraftBukkit end
if (this.metricsRecorder.isRecording()) {
this.cancelRecordingMetrics();
-@@ -1001,6 +1003,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1020,6 +1022,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void safeShutdown(boolean waitForShutdown, boolean isRestarting) {
this.isRestarting = isRestarting;
@@ -87,7 +87,7 @@ index 04a728a16bb629adbae1cd8586764a6dbc22b5dc..d130f843975236018df4fa2ccc3ca6aa
this.connection.disconnect(ServerConfigurationPacketListenerImpl.DISCONNECT_REASON_INVALID_DATA);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 53eb6cbcdaf07658640d68f1e3c46c9171f0c5b6..0d56ed477561d8f876f4c8f52934688404e3161d 100644
+index 46273f6d706ecf9a46c9c41bd93cffda9ff0687a..0035e5c4e4394132a869dcadd15015fd33a2fefb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1006,6 +1006,7 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0366-Prevent-teleporting-dead-entities.patch b/patches/server/0366-Prevent-teleporting-dead-entities.patch
index f308ef1e7d..6b34c6cc71 100644
--- a/patches/server/0366-Prevent-teleporting-dead-entities.patch
+++ b/patches/server/0366-Prevent-teleporting-dead-entities.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Prevent teleporting dead entities
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index a1da534dab13f475dca626645c246ef36aea6938..11f50899ee0144fc56e6829850ad37dd8e6349eb 100644
+index ec897c87642bf3cc8d9c0cea4cb76d4594acc95d..6ec2d3876d2064ed76a475ea93178b77f9cf6696 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1545,6 +1545,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1538,6 +1538,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) { // Paper
diff --git a/patches/server/0367-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0367-Deobfuscate-stacktraces-in-log-messages-crash-report.patch
index 017722d4b0..346aef8e35 100644
--- a/patches/server/0367-Deobfuscate-stacktraces-in-log-messages-crash-report.patch
+++ b/patches/server/0367-Deobfuscate-stacktraces-in-log-messages-crash-report.patch
@@ -545,7 +545,7 @@ index 61f05f34ca33837c643f2915e753ec3935a38314..85b8be8ffac0fb40e9cae0528271ed41
throw new SkipPacketException(var13);
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index 9c7079d0c3c25bef970891b0579daa940fa61e33..249944e48d3e07cc5dd412f58f39a3abdbe446b1 100644
+index 567e642232cc698995def33d7cbe1f679ea7a871..f269441cce34a0b5fb4da4764caeb22ff27cfb00 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -194,6 +194,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -609,10 +609,10 @@ index e697b8f7b165d2394d8155cbee7453e23ac2bee4..6706ac701963fed4798247e6e835b06f
}
}
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 673da3c93291c70ed83b1a06a068e4854fc4d32b..57d7392871634348ff906c03dc0ca601cd3040bd 100644
+index 84036969971a72129f98d5f524eecd237658b81f..73e682bb3ef3b2e450ec8c594b5365c7a340615e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -599,7 +599,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -598,7 +598,7 @@ public class LevelChunk extends ChunkAccess {
+ " (" + getBlockState(blockposition) + ") where there was no entity tile!\n" +
"Chunk coordinates: " + (this.chunkPos.x * 16) + "," + (this.chunkPos.z * 16) +
"\nWorld: " + level.getLevel().dimension().location());
@@ -638,22 +638,28 @@ index 3c1992e212a6d6f1db4d5b807b38d71913619fc0..9c1aff17aabd062640e3f451a2ef8c50
CraftAsyncScheduler() {
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
-index 230d55820778e84c1c8aa2b013ae0e5e35568ea1..a15749bcfb2b36a31801cb1a26b7181ce304e0ee 100644
+index 703787fd9392685c7d8ff9635a29a0b057e2ea5c..9994d8b26ffaff538f39cc72f2137fcabb973d87 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
-@@ -102,7 +102,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+@@ -102,7 +102,7 @@ public class WatchdogThread extends Thread
log.log( Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity" );
log.log( Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated" );
log.log( Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
-- for ( StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace() )
-+ for ( StackTraceElement stack : io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateStacktrace(org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace()) ) // Paper
- {
- log.log( Level.SEVERE, "\t\t" + stack );
+- for (StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace()) {
++ for (StackTraceElement stack : io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateStacktrace(org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace())) { // Paper
+ log.log(Level.SEVERE, "\t\t" + stack);
}
-@@ -174,7 +174,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+ }
+@@ -178,12 +178,12 @@ public class WatchdogThread extends Thread
+ log.log(Level.SEVERE, "During the run of the server, a plugin set an excessive velocity on an entity");
+ log.log(Level.SEVERE, "This may be the cause of the issue, or it may be entirely unrelated");
+ log.log(Level.SEVERE, org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getMessage());
+- for (StackTraceElement stack : org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace()) {
++ for (StackTraceElement stack : io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateStacktrace(org.bukkit.craftbukkit.CraftServer.excessiveVelEx.getStackTrace())) { // Paper
+ log.log( Level.SEVERE, "\t\t" + stack );
+ }
}
- log.log( Level.SEVERE, "\tStack:" );
- //
+ // Paper end
- for ( StackTraceElement stack : thread.getStackTrace() )
+ for ( StackTraceElement stack : io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateStacktrace(thread.getStackTrace()) ) // Paper
{
diff --git a/patches/server/0368-Implement-Mob-Goal-API.patch b/patches/server/0368-Implement-Mob-Goal-API.patch
index 188d045d51..cc9532872f 100644
--- a/patches/server/0368-Implement-Mob-Goal-API.patch
+++ b/patches/server/0368-Implement-Mob-Goal-API.patch
@@ -768,7 +768,7 @@ index 6667ecc4b7eded4e20a415cef1e1b1179e6710b8..16f9a98b8a939e5ca7e2dc04f87134a7
LOOK,
JUMP,
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 0d56ed477561d8f876f4c8f52934688404e3161d..5952c130ed88be6ccd7863f50a7527c6029ff873 100644
+index 0035e5c4e4394132a869dcadd15015fd33a2fefb..0e7cfec27eb76382d4827b62c31e10f118a87dd4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2870,5 +2870,11 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch b/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch
index 13b7c17620..16c9f72f38 100644
--- a/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch
+++ b/patches/server/0374-Wait-for-Async-Tasks-during-shutdown.patch
@@ -10,10 +10,10 @@ 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 ae7bddabc445dc42394235a3f87b2a3a5c27800a..71a47dd29bb950a9209fd5fe2fb23c96b88eb113 100644
+index 4339a2cd0b2020b673ebdb6902ad0d0a53373a27..d983aec418603a470f640ace139572fd239a3393 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -940,6 +940,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -930,6 +930,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start
if (this.server != null) {
this.server.disablePlugins();
@@ -22,7 +22,7 @@ index ae7bddabc445dc42394235a3f87b2a3a5c27800a..71a47dd29bb950a9209fd5fe2fb23c96
// CraftBukkit end
this.getConnection().stop();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 5952c130ed88be6ccd7863f50a7527c6029ff873..373145e04a82de818ff8030b669a97bfa479d7d9 100644
+index 0e7cfec27eb76382d4827b62c31e10f118a87dd4..5b41a2c7e26fde4a5e34f2de567d6e1920e51a36 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1016,6 +1016,31 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0385-Prevent-position-desync-causing-tp-exploit.patch b/patches/server/0385-Prevent-position-desync-causing-tp-exploit.patch
index a22c84b5d5..494a5119bd 100644
--- a/patches/server/0385-Prevent-position-desync-causing-tp-exploit.patch
+++ b/patches/server/0385-Prevent-position-desync-causing-tp-exploit.patch
@@ -13,10 +13,10 @@ behaviour, we need to move all of this dangerous logic outside
of the move call and into an appropriate place in the tick method.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 11f50899ee0144fc56e6829850ad37dd8e6349eb..709eb006717da012ce5f0d3dba9e5bee1e277a90 100644
+index 6ec2d3876d2064ed76a475ea93178b77f9cf6696..b3549abb6ff622974574b35445bd6f562f5c4aca 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1366,6 +1366,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -1359,6 +1359,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
diff --git a/patches/server/0388-Add-PlayerRecipeBookClickEvent.patch b/patches/server/0388-Add-PlayerRecipeBookClickEvent.patch
index e85f3cb085..1291a58a1d 100644
--- a/patches/server/0388-Add-PlayerRecipeBookClickEvent.patch
+++ b/patches/server/0388-Add-PlayerRecipeBookClickEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerRecipeBookClickEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 709eb006717da012ce5f0d3dba9e5bee1e277a90..99bcaf518e22b8d3cd79068defe776bb792abe6c 100644
+index b3549abb6ff622974574b35445bd6f562f5c4aca..7d63a20a87b79608637846fda4a5a2441a05ab03 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2973,16 +2973,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -2966,16 +2966,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (!this.player.containerMenu.stillValid(this.player)) {
ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu);
} else {
diff --git a/patches/server/0390-Add-permission-for-command-blocks.patch b/patches/server/0390-Add-permission-for-command-blocks.patch
index 2e62ea5cb3..c09ef30698 100644
--- a/patches/server/0390-Add-permission-for-command-blocks.patch
+++ b/patches/server/0390-Add-permission-for-command-blocks.patch
@@ -18,10 +18,10 @@ index deef24ad28ecf7895aa03bf8dae085814d307ece..6721b086ec4e8efe29b75a0e08dc1501
return false;
} else if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 99bcaf518e22b8d3cd79068defe776bb792abe6c..2502b8145da151a63dc769c4e717d53d651203c3 100644
+index 7d63a20a87b79608637846fda4a5a2441a05ab03..6dbf7734b640dc9cd553dfd6afb4c9cd4e3d66da 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -778,7 +778,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -771,7 +771,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (!this.server.isCommandBlockEnabled()) {
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
@@ -30,7 +30,7 @@ index 99bcaf518e22b8d3cd79068defe776bb792abe6c..2502b8145da151a63dc769c4e717d53d
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
} else {
BaseCommandBlock commandblocklistenerabstract = null;
-@@ -845,7 +845,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -838,7 +838,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (!this.server.isCommandBlockEnabled()) {
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
diff --git a/patches/server/0391-Ensure-Entity-position-and-AABB-are-never-invalid.patch b/patches/server/0391-Ensure-Entity-position-and-AABB-are-never-invalid.patch
index 1d2fd6c636..c74d2ed12e 100644
--- a/patches/server/0391-Ensure-Entity-position-and-AABB-are-never-invalid.patch
+++ b/patches/server/0391-Ensure-Entity-position-and-AABB-are-never-invalid.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Ensure Entity position and AABB are never invalid
Co-authored-by: Spottedleaf <[email protected]>
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index b0eba706279b26b68d3bc3fce85ba8781e8ea826..11198bc084400d613545f511600810f02e4f3ffb 100644
+index 47094050283625e3b494f5ab6955a2f9c736388d..70380d5807cac6dec19ebe581d685b1e32d8830b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -691,8 +691,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -639,8 +639,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public void setPos(double x, double y, double z) {
@@ -20,7 +20,7 @@ index b0eba706279b26b68d3bc3fce85ba8781e8ea826..11198bc084400d613545f511600810f0
}
protected AABB makeBoundingBox() {
-@@ -4192,7 +4192,29 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -4130,7 +4130,29 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale);
}
@@ -47,10 +47,10 @@ index b0eba706279b26b68d3bc3fce85ba8781e8ea826..11198bc084400d613545f511600810f0
+ return;
+ }
+ // Paper end - Block invalid positions and bounding box
- // Paper start - rewrite chunk system
- if (this.updatingSectionStatus) {
- LOGGER.error("Refusing to update position for entity " + this + " to position " + new Vec3(x, y, z) + " since it is processing a section status update", new Throwable());
-@@ -4216,6 +4238,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+ if (this.position.x != x || this.position.y != y || this.position.z != z) {
+ this.position = new Vec3(x, y, z);
+ int i = Mth.floor(x);
+@@ -4148,6 +4170,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.levelCallback.onMove();
}
diff --git a/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
index 9f9cf2f7e0..c767501ee5 100644
--- a/patches/server/0392-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
+++ b/patches/server/0392-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 71a47dd29bb950a9209fd5fe2fb23c96b88eb113..0e3e68ec5cd568c9fc89555597c167acb6563cee 100644
+index d983aec418603a470f640ace139572fd239a3393..f3afc22e3c4fc792fa4ed5c3ee18d76cd1cd6e85 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -824,7 +824,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -20,7 +20,7 @@ index 71a47dd29bb950a9209fd5fe2fb23c96b88eb113..0e3e68ec5cd568c9fc89555597c167ac
this.forceTicks = false;
// CraftBukkit end
-@@ -1699,11 +1699,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1705,11 +1705,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
@@ -40,7 +40,7 @@ index 71a47dd29bb950a9209fd5fe2fb23c96b88eb113..0e3e68ec5cd568c9fc89555597c167ac
}
}
-@@ -1717,7 +1720,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1723,7 +1726,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
@@ -63,7 +63,7 @@ index 997a96a21440ae72696d68f8031ece4ba487d3ef..3d8584929cee000ae7df10c5bd94f358
return Component.translatable("commands.difficulty.success", difficulty.getDisplayName());
}, true);
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index 249944e48d3e07cc5dd412f58f39a3abdbe446b1..5ecf65315b42cd07dcd69a10c445b1f0576f03c5 100644
+index f269441cce34a0b5fb4da4764caeb22ff27cfb00..317f9048be060778104c8ac3494599c2141b7aac 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -325,7 +325,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -76,10 +76,10 @@ index 249944e48d3e07cc5dd412f58f39a3abdbe446b1..5ecf65315b42cd07dcd69a10c445b1f0
@Override
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 0a3c36e2bdaa6db35f409e728d04c0feb1e5f9b2..3a0335609310a5997b0625e31ed3192f5f4865ec 100644
+index e3413273076b697d560c927ea0e12f34722a79c1..ab92c2c0ff5ebb395670c23fe0e3a8122b215874 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1205,7 +1205,7 @@ public class ServerPlayer extends Player {
+@@ -1161,7 +1161,7 @@ public class ServerPlayer extends Player {
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
this.connection.send(new ClientboundRespawnPacket(this.createCommonSpawnInfo(worldserver), (byte) 3));
@@ -89,10 +89,10 @@ index 0a3c36e2bdaa6db35f409e728d04c0feb1e5f9b2..3a0335609310a5997b0625e31ed3192f
playerlist.sendPlayerPermissionLevel(this);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 2502b8145da151a63dc769c4e717d53d651203c3..2f8715e200b9b8ae4c4b70ddd7cdc3368a109939 100644
+index 6dbf7734b640dc9cd553dfd6afb4c9cd4e3d66da..48fca15cdc6b0bafc3d8ff13cc96b3258104c1fb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -3176,7 +3176,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+@@ -3169,7 +3169,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) {
@@ -102,7 +102,7 @@ index 2502b8145da151a63dc769c4e717d53d651203c3..2f8715e200b9b8ae4c4b70ddd7cdc336
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 373145e04a82de818ff8030b669a97bfa479d7d9..9665f70394e9124be5bcaea6099d458255632472 100644
+index 5b41a2c7e26fde4a5e34f2de567d6e1920e51a36..2b709a4e7b120497c48d0408874a29602ea5bd98 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -955,8 +955,8 @@ public final class CraftServer implements Server {
@@ -117,10 +117,10 @@ index 373145e04a82de818ff8030b669a97bfa479d7d9..9665f70394e9124be5bcaea6099d4582
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 f72409e92cbf00c5665037bf4916ddbd352d66d5..e8b06b5952e5cc63f82d7a0542bf931bd4b45d65 100644
+index 92c19035e4e03530eb27d7dd96847f4546710d28..316ba3726f4bfe2e99edefa87bc0ff372a6389bc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -1111,7 +1111,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1121,7 +1121,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setDifficulty(Difficulty difficulty) {
diff --git a/patches/server/0393-Paper-dumpitem-command.patch b/patches/server/0393-Paper-dumpitem-command.patch
index 5722936af7..2ea07803cc 100644
--- a/patches/server/0393-Paper-dumpitem-command.patch
+++ b/patches/server/0393-Paper-dumpitem-command.patch
@@ -6,13 +6,13 @@ Subject: [PATCH] Paper dumpitem command
Let's you quickly view the item in your hands NBT data
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
-index 5bfa245a621a0bf7ef60cd01f4c04576b770384e..a8b41d6a42e23a7cd839cc3d5e5cae84860f802c 100644
+index ae51993e0de706cb62c96795ca9de7663893a5bf..cfa2c49c554e73a44ed52b5e659c17100e14a6ac 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
-@@ -41,6 +41,7 @@ public final class PaperCommand extends Command {
+@@ -40,6 +40,7 @@ public final class PaperCommand extends Command {
+ commands.put(Set.of("dumpplugins"), new DumpPluginsCommand());
commands.put(Set.of("fixlight"), new FixLightCommand());
commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
- commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
+ commands.put(Set.of("dumpitem"), new DumpItemCommand());
return commands.entrySet().stream()
diff --git a/patches/server/0395-Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/patches/server/0395-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
index fde0556c31..ff602324a9 100644
--- a/patches/server/0395-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
+++ b/patches/server/0395-Add-Plugin-Tickets-to-API-Chunk-Methods.patch
@@ -22,7 +22,7 @@ wants it to collect even faster, they can restore that setting back to 1 instead
Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 8bc0f2a7a4a5af73a4a0b693b91c6bbbf7c6e2d1..8b5fb5e5719ea1453751ef8f7bd97bca1af64ae8 100644
+index 2b709a4e7b120497c48d0408874a29602ea5bd98..3aa481599811af7cd9b0c523f66dac469105ee49 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -377,7 +377,7 @@ public final class CraftServer implements Server {
@@ -44,7 +44,7 @@ index 8bc0f2a7a4a5af73a4a0b693b91c6bbbf7c6e2d1..8b5fb5e5719ea1453751ef8f7bd97bca
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 e8b06b5952e5cc63f82d7a0542bf931bd4b45d65..f248735d48aa5c430752426e9dc02c1ae6644aaf 100644
+index 316ba3726f4bfe2e99edefa87bc0ff372a6389bc..fe0095601b41d85d8813af18e1c74b31f26f150d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -282,7 +282,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -84,7 +84,7 @@ index e8b06b5952e5cc63f82d7a0542bf931bd4b45d65..f248735d48aa5c430752426e9dc02c1a
}
return true;
-@@ -435,7 +447,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -432,7 +444,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
}
if (chunk instanceof net.minecraft.world.level.chunk.LevelChunk) {
@@ -93,7 +93,7 @@ index e8b06b5952e5cc63f82d7a0542bf931bd4b45d65..f248735d48aa5c430752426e9dc02c1a
return true;
}
-@@ -2213,6 +2225,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -2184,6 +2196,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) -> {
net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> {
net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk)c;
diff --git a/patches/server/0396-incremental-chunk-and-player-saving.patch b/patches/server/0396-incremental-chunk-and-player-saving.patch
index 29d9e8dc79..a45acbad50 100644
--- a/patches/server/0396-incremental-chunk-and-player-saving.patch
+++ b/patches/server/0396-incremental-chunk-and-player-saving.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] incremental chunk and player saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 0e3e68ec5cd568c9fc89555597c167acb6563cee..ca005f3c60e58a2ac3e391c9107023e982f33ffe 100644
+index f3afc22e3c4fc792fa4ed5c3ee18d76cd1cd6e85..f03a2995c2eb080ec4db0d6c3aa261a463c08579 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -897,7 +897,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -887,7 +887,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try {
this.isSaving = true;
@@ -17,7 +17,7 @@ index 0e3e68ec5cd568c9fc89555597c167acb6563cee..ca005f3c60e58a2ac3e391c9107023e9
flag3 = this.saveAllChunks(suppressLogs, flush, force);
} finally {
this.isSaving = false;
-@@ -1312,16 +1312,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1318,16 +1318,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
--this.ticksUntilAutosave;
@@ -56,10 +56,10 @@ index 0e3e68ec5cd568c9fc89555597c167acb6563cee..ca005f3c60e58a2ac3e391c9107023e9
// Paper start - move executeAll() into full server tick timing
try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 5bea335653d3cd45354dc67b160a6bf5ce907f41..35f463e5237d12e42f7a8b8c177af3236d2e7986 100644
+index 6bb0b24e8bc5cd031d192dd0b61a3afd248c62e4..1ab9472a4619204ee633e7e91de5f08cf56a1291 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -450,6 +450,15 @@ public class ServerChunkCache extends ChunkSource {
+@@ -600,6 +600,15 @@ public class ServerChunkCache extends ChunkSource {
} // Paper - Timings
}
@@ -76,10 +76,10 @@ index 5bea335653d3cd45354dc67b160a6bf5ce907f41..35f463e5237d12e42f7a8b8c177af323
public void close() throws IOException {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index faf704d805a1af037d0e8d4dd60a942a43e5b054..90fae050445fbebe44ec5ef77fdcac65b48f1f9d 100644
+index ecc716ce94f40ab8f85e5f57fecad68c08d4e85e..baafe984f2e015e20e57841b5009861cb0a02525 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1283,6 +1283,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1046,6 +1046,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos);
}
@@ -115,10 +115,10 @@ index faf704d805a1af037d0e8d4dd60a942a43e5b054..90fae050445fbebe44ec5ef77fdcac65
+ // Paper end - Incremental chunk and player saving
+
public void save(@Nullable ProgressListener progressListener, boolean flush, boolean savingDisabled) {
- // Paper start - rewrite chunk system - add close param
- this.save(progressListener, flush, savingDisabled, false);
+ ServerChunkCache chunkproviderserver = this.getChunkSource();
+
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 3a0335609310a5997b0625e31ed3192f5f4865ec..c449b40c2252829c5f5fa0978b3f9a41336d6318 100644
+index ab92c2c0ff5ebb395670c23fe0e3a8122b215874..c4e0fa6c24f9df0d99508ea7d6a9ed974f14835e 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -190,6 +190,7 @@ import org.bukkit.inventory.MainHand;
@@ -130,7 +130,7 @@ index 3a0335609310a5997b0625e31ed3192f5f4865ec..c449b40c2252829c5f5fa0978b3f9a41
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
private static final int FLY_STAT_RECORDING_SPEED = 25;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 5657999a85b9b9dfb48a51170d5fa3d9c37263ad..172d7c3df8f9aab24d49b2ff12e3cdf5f40727f9 100644
+index 54aba3118157f72491cb8c3d5fb5c63750ea6878..a35dda4010c6db1a8e1efb7951ac8732d9a1e16e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -551,6 +551,7 @@ public abstract class PlayerList {
diff --git a/patches/server/0398-Convert-legacy-attributes-in-Item-Meta.patch b/patches/server/0398-Convert-legacy-attributes-in-Item-Meta.patch
index 396f8e90c1..e639bfc5c6 100644
--- a/patches/server/0398-Convert-legacy-attributes-in-Item-Meta.patch
+++ b/patches/server/0398-Convert-legacy-attributes-in-Item-Meta.patch
@@ -30,7 +30,7 @@ index d4dba8c733c7560e5108b8d239b52e593f8debec..ea48f1119a940056c37d1d203437bfbf
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 1ecea757fffb480af0d27c3326093d79cb93c73b..6a3a8c4cc09a045134a7c3751b33f2763e5a4953 100644
+index ed50a1e492643842a094fc90fb52cbec4e8f5f3d..f9f57f4ab75776dbaa4dc39d30e32b2c778b1955 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -485,7 +485,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
diff --git a/patches/server/0018-Rewrite-chunk-system.patch b/patches/server/0399-Rewrite-chunk-system.patch
index e74f01d432..1e31f16d41 100644
--- a/patches/server/0018-Rewrite-chunk-system.patch
+++ b/patches/server/0399-Rewrite-chunk-system.patch
@@ -8168,7 +8168,7 @@ index 0000000000000000000000000000000000000000..53ddd7e9ac05e6a9eb809f329796e6d4
+}
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java
new file mode 100644
-index 0000000000000000000000000000000000000000..310e61db5d845f904119dcb84d981e7c608bf1a8
+index 0000000000000000000000000000000000000000..f0b03a05387e38ca6933b1ea6fe59b537d5535b9
--- /dev/null
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkLoadTask.java
@@ -0,0 +1,484 @@
@@ -8509,8 +8509,8 @@ index 0000000000000000000000000000000000000000..310e61db5d845f904119dcb84d981e7c
+ chunkPos, this.world
+ );
+ // deserialize
-+ final ChunkSerializer.InProgressChunkHolder chunkHolder = ChunkSerializer.loadChunk(
-+ this.world, chunkMap.getPoiManager(), chunkPos, converted, true
++ final ChunkSerializer.InProgressChunkHolder chunkHolder = ChunkSerializer.readInProgressChunkHolder(
++ this.world, chunkMap.getPoiManager(), chunkPos, converted
+ );
+
+ return new TaskResult<>(chunkHolder.protoChunk, null);
@@ -15282,17 +15282,18 @@ index 0000000000000000000000000000000000000000..f7b0e2564ac4bd2db1d2b2bdc230c9f5
+ }
+}
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
-index de0e1ad2c78e5132651494f198703533847c84bd..0dd48e4098191c8b6e29945d62bc473e9f3a1e77 100644
+index cfa2c49c554e73a44ed52b5e659c17100e14a6ac..b333809320ebfb7a5c4367cb621510f213a69479 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
-@@ -39,6 +39,7 @@ public final class PaperCommand extends Command {
+@@ -39,7 +39,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("version"), new VersionCommand());
commands.put(Set.of("dumpplugins"), new DumpPluginsCommand());
commands.put(Set.of("fixlight"), new FixLightCommand());
-+ commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
+- commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
++ commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); //
+ commands.put(Set.of("dumpitem"), new DumpItemCommand());
return commands.entrySet().stream()
- .flatMap(entry -> entry.getKey().stream().map(s -> Map.entry(s, entry.getValue())))
diff --git a/src/main/java/io/papermc/paper/command/subcommands/ChunkDebugCommand.java b/src/main/java/io/papermc/paper/command/subcommands/ChunkDebugCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..962d3cae6340fc11607b59355e291629618f289c
@@ -15727,10 +15728,10 @@ index cea9c098ade00ee87b8efc8164ab72f5279758f0..197224e31175252d8438a8df585bbb65
+ }
}
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
-index 6d60bb9f77198de3f0692c24b3b0ae085f3a80d0..3a00e24d78acb99d226289ccb9ba419dfc607a45 100644
+index ff8a983e23bcf73ec3f7dd98c48640183647ad4d..200ed770b57e1a9240abf0473968d4b85cbefe3c 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
-@@ -4,17 +4,30 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
+@@ -6,17 +6,30 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
import io.papermc.paper.math.BlockPosition;
import io.papermc.paper.math.FinePosition;
import io.papermc.paper.math.Position;
@@ -15760,8 +15761,8 @@ index 6d60bb9f77198de3f0692c24b3b0ae085f3a80d0..3a00e24d78acb99d226289ccb9ba419d
+import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.phys.Vec3;
import org.apache.commons.lang.exception.ExceptionUtils;
- import org.bukkit.Location;
-@@ -25,8 +38,11 @@ import org.spigotmc.AsyncCatcher;
+ import com.mojang.authlib.GameProfile;
+@@ -28,8 +41,11 @@ import org.spigotmc.AsyncCatcher;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -15773,7 +15774,7 @@ index 6d60bb9f77198de3f0692c24b3b0ae085f3a80d0..3a00e24d78acb99d226289ccb9ba419d
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.LinkedBlockingQueue;
-@@ -527,6 +543,100 @@ public final class MCUtil {
+@@ -534,6 +550,100 @@ public final class MCUtil {
}
}
@@ -16644,7 +16645,7 @@ index a5e438a834826161c52ca9db57d234d9ff80a591..b8bc1b9b8e8a33df90a963f9f9769292
@Override
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
-index ba58580f4c60205d1c7a7b7dfcdc22c4fafc9bc6..9ead836c08ff48430bc6d3ba225864f48d335eee 100644
+index 5374a6b70a9780cfe9f62207b290b9a3ab82c7e9..0c9f6443663bc567a181393b13311a909602f4a4 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -305,6 +305,7 @@ public class Main {
@@ -16656,10 +16657,10 @@ index ba58580f4c60205d1c7a7b7dfcdc22c4fafc9bc6..9ead836c08ff48430bc6d3ba225864f4
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c74217357535a 100644
+index f03a2995c2eb080ec4db0d6c3aa261a463c08579..ca005f3c60e58a2ac3e391c9107023e982f33ffe 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -300,7 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -309,7 +309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
@@ -16668,7 +16669,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
((MinecraftServer) atomicreference.get()).runServer();
}, "Server thread");
-@@ -617,7 +617,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -632,7 +632,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.forceDifficulty();
for (ServerLevel worldserver : this.getAllLevels()) {
this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver);
@@ -16677,7 +16678,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
}
-@@ -813,6 +813,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -845,6 +845,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public abstract boolean shouldRconBroadcast();
public boolean saveAllChunks(boolean suppressLogs, boolean flush, boolean force) {
@@ -16690,7 +16691,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
boolean flag3 = false;
for (Iterator iterator = this.getAllLevels().iterator(); iterator.hasNext(); flag3 = true) {
-@@ -821,8 +827,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -853,8 +859,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (!suppressLogs) {
MinecraftServer.LOGGER.info("Saving chunks for level '{}'/{}", worldserver, worldserver.dimension().location());
}
@@ -16705,7 +16706,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
}
// CraftBukkit start - moved to WorldServer.save
-@@ -841,7 +851,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -873,7 +883,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator1.hasNext()) {
ServerLevel worldserver2 = (ServerLevel) iterator1.next();
@@ -16714,7 +16715,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
}
MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved");
-@@ -918,36 +928,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -954,36 +964,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
@@ -16752,8 +16753,8 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
this.isSaving = false;
this.resources.close();
-@@ -966,7 +947,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
- this.getProfileCache().save();
+@@ -1002,7 +983,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+ this.getProfileCache().save(false); // Paper - Perf: Async GameProfileCache saving
}
// Spigot end
-
@@ -16761,7 +16762,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
}
public String getLocalIp() {
-@@ -1000,6 +981,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1044,6 +1025,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Spigot End
@@ -16770,7 +16771,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
protected void runServer() {
try {
if (!this.initServer()) {
-@@ -1014,6 +997,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1059,6 +1042,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Arrays.fill( this.recentTps, 20 );
long tickSection = Util.getMillis(), tickCount = 1;
while (this.running) {
@@ -16783,7 +16784,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
long i;
if (!this.isPaused() && this.tickRateManager.isSprinting() && this.tickRateManager.checkShouldSprintThisTick()) {
-@@ -1138,6 +1127,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -1183,6 +1172,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
private boolean haveTime() {
@@ -16795,7 +16796,7 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
// CraftBukkit start
if (isOversleep) return canOversleep(); // Paper - because of our changes, this logic is broken
return this.forceTicks || this.runningTask() || Util.getNanos() < (this.mayHaveDelayedTasks ? this.delayedTasksMaxNextTickTimeNanos : this.nextTickTimeNanos);
-@@ -2344,7 +2338,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
+@@ -2429,7 +2423,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start
@Override
public boolean isSameThread() {
@@ -16805,10 +16806,10 @@ index a6a8b5079ceaad90a79a09cab5c38a6fde6d33ee..75b39c8a8471bc37add3a012453c7421
public boolean isDebugging() {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index dfb37ddb89c2f43d9f9a34a6b2d38616575eb39b..0f516d126ce834adadd6a57a762e34c996403ab2 100644
+index 317f9048be060778104c8ac3494599c2141b7aac..5ecf65315b42cd07dcd69a10c445b1f0576f03c5 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-@@ -399,7 +399,34 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+@@ -412,7 +412,34 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
return this.getProperties().allowNether;
}
@@ -16840,7 +16841,7 @@ index dfb37ddb89c2f43d9f9a34a6b2d38616575eb39b..0f516d126ce834adadd6a57a762e34c9
+ return;
+ }
+ // Paper end - rewrite chunk system
- this.consoleInput.add(new ConsoleInput(command, commandSource));
+ this.serverCommandQueue.add(new ConsoleInput(command, commandSource)); // Paper - Perf: use proper queue
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -17522,7 +17523,7 @@ index 807a6bb1026dac2c4cd0a50afe06fd62ce23558b..2b998bdbe49bf8211b755e0eb7c1bf13
// Paper end
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd92249c60ee8b 100644
+index 9706e08511fcfd72abd5e92d7df54dc199451499..69d140fbcccc9054f15716e35a7b854b387fe21d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -119,10 +119,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -18167,9 +18168,9 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
if (!nbt.isEmpty()) {
// CraftBukkit start - these are spawned serialized (DefinedStructure) and we don't call an add event below at the moment due to ordering complexities
world.addWorldGenChunkEntities(EntityType.loadEntitiesRecursive(nbt, world).filter((entity) -> {
-@@ -890,111 +538,27 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- needsRemoval = true;
+@@ -891,53 +539,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
+ checkDupeUUID(world, entity); // Paper - duplicate uuid resolving
return !needsRemoval;
- }));
+ }), position); // Paper - rewrite chunk system
@@ -18222,6 +18223,10 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
+ throw new UnsupportedOperationException(); // Paper - rewrite chunk system
}
+ // Paper start - duplicate uuid resolving
+@@ -980,61 +589,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ }
+ // Paper end - duplicate uuid resolving
public CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> prepareTickingChunk(ChunkHolder holder) {
- CompletableFuture<Either<List<ChunkAccess>, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getChunkRangeFuture(holder, 1, (i) -> {
- return ChunkStatus.FULL;
@@ -18284,7 +18289,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
}
public int getTickingGenerated() {
-@@ -1002,130 +566,52 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1042,130 +606,52 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
private boolean saveChunkIfNeeded(ChunkHolder chunkHolder) {
@@ -18432,7 +18437,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
}
@Nullable
-@@ -1148,30 +634,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1188,30 +674,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
void dumpChunks(Writer writer) throws IOException {
@@ -18464,7 +18469,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
}
private static String printFuture(CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> future) {
-@@ -1190,6 +653,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1230,6 +693,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -18500,7 +18505,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
private CompletableFuture<Optional<CompoundTag>> readChunk(ChunkPos chunkPos) {
return this.read(chunkPos).thenApplyAsync((optional) -> {
return optional.map((nbttagcompound) -> this.upgradeChunkTag(nbttagcompound, chunkPos)); // CraftBukkit
-@@ -1279,8 +771,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1330,8 +822,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.distanceManager.addPlayer(SectionPos.of((EntityAccess) player), player);
}
@@ -18510,7 +18515,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
this.addPlayerToDistanceMaps(player); // Paper - distance maps
} else {
SectionPos sectionposition = player.getLastSectionPos();
-@@ -1291,7 +782,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1342,7 +833,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
this.removePlayerFromDistanceMaps(player); // Paper - distance maps
@@ -18519,7 +18524,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
}
}
-@@ -1339,73 +830,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1390,73 +881,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.playerMap.unIgnorePlayer(player);
}
@@ -18603,7 +18608,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
}
public void addEntity(Entity entity) {
-@@ -1469,13 +917,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1529,13 +977,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected void tick() {
@@ -18618,7 +18623,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
-@@ -1584,16 +1026,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1644,16 +1086,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public void waitForLightBeforeSending(ChunkPos centerPos, int radius) {
@@ -18636,7 +18641,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
}
private class ChunkDistanceManager extends DistanceManager {
-@@ -1604,7 +1037,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1664,7 +1097,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@Override
protected boolean isChunkToRemove(long pos) {
@@ -18646,7 +18651,7 @@ index ed095afdf8be843b9a608130040739c0b21dbe0a..2a52f5fc867f35b9d94b813d5cdd9224
@Nullable
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
-index 0bd05d7a8f2a388c28ddcf3f07db5b0648dddeea..36686a92bd7dc0e29049f72c0e953ff56c2645eb 100644
+index 1a9e6ed379c5fccfd82f4718c7fd2794978f63b4..c80a625f7289e3bb33c6851d2072957e153ca1fb 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
@@ -39,67 +39,29 @@ import org.slf4j.Logger;
@@ -18912,7 +18917,7 @@ index 0bd05d7a8f2a388c28ddcf3f07db5b0648dddeea..36686a92bd7dc0e29049f72c0e953ff5
public void removePlayer(SectionPos pos, ServerPlayer player) {
@@ -289,46 +150,44 @@ public abstract class DistanceManager {
- if (objectset.isEmpty()) {
+ if (objectset == null || objectset.isEmpty()) { // Paper
this.playersPerChunk.remove(i);
this.naturalSpawnChunkCounter.update(i, Integer.MAX_VALUE, false);
- this.playerTicketManager.update(i, Integer.MAX_VALUE, false);
@@ -19107,7 +19112,7 @@ index 0bd05d7a8f2a388c28ddcf3f07db5b0648dddeea..36686a92bd7dc0e29049f72c0e953ff5
+ */ // Paper - rewrite chunk system
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780519004f9 100644
+index 1ab9472a4619204ee633e7e91de5f08cf56a1291..ab1a625bb3eb8f45648d387d324983154b12792c 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -139,108 +139,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -19274,7 +19279,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
return (ChunkAccess) CompletableFuture.supplyAsync(() -> {
return this.getChunk(x, z, leastStatus, create);
}, this.mainThreadProcessor).join();
-@@ -403,23 +275,20 @@ public class ServerChunkCache extends ChunkSource {
+@@ -409,24 +281,19 @@ public class ServerChunkCache extends ChunkSource {
ChunkAccess ichunkaccess;
@@ -19295,16 +19300,15 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
Objects.requireNonNull(completablefuture);
if (!completablefuture.isDone()) { // Paper
-+ // Paper start - async chunk io/loading
+ io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.pushChunkWait(this.level, x1, z1); // Paper - rewrite chunk system
-+ // Paper end
+ com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x, z); // Paper - Add debug for sync chunk loads
this.level.timings.syncChunkLoad.startTiming(); // Paper
chunkproviderserver_b.managedBlock(completablefuture::isDone);
-+ io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - async chunk debug // Paper - rewrite chunk system
++ io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - rewrite chunk system
this.level.timings.syncChunkLoad.stopTiming(); // Paper
} // Paper
ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
-@@ -439,7 +308,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -446,7 +313,7 @@ public class ServerChunkCache extends ChunkSource {
@Nullable
@Override
public LevelChunk getChunkNow(int chunkX, int chunkZ) {
@@ -19312,8 +19316,8 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
+ if (!io.papermc.paper.util.TickThread.isTickThread()) { // Paper - rewrite chunk system
return null;
} else {
- this.level.getProfiler().incrementCounter("getChunkNow");
-@@ -485,7 +354,7 @@ public class ServerChunkCache extends ChunkSource {
+ return this.getChunkAtIfLoadedMainThread(chunkX, chunkZ); // Paper - Perf: Optimise getChunkAt calls for loaded chunks
+@@ -460,7 +327,7 @@ public class ServerChunkCache extends ChunkSource {
}
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getChunkFuture(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
@@ -19322,7 +19326,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
CompletableFuture completablefuture;
if (flag1) {
-@@ -506,47 +375,52 @@ public class ServerChunkCache extends ChunkSource {
+@@ -481,47 +348,52 @@ public class ServerChunkCache extends ChunkSource {
}
private CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getChunkFutureMainThread(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
@@ -19407,7 +19411,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
}
@Nullable
-@@ -558,22 +432,13 @@ public class ServerChunkCache extends ChunkSource {
+@@ -533,22 +405,13 @@ public class ServerChunkCache extends ChunkSource {
if (playerchunk == null) {
return null;
} else {
@@ -19436,7 +19440,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
}
}
-@@ -587,15 +452,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -562,15 +425,7 @@ public class ServerChunkCache extends ChunkSource {
}
boolean runDistanceManagerUpdates() {
@@ -19453,7 +19457,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
}
// Paper start
-@@ -605,17 +462,10 @@ public class ServerChunkCache extends ChunkSource {
+@@ -580,17 +435,10 @@ public class ServerChunkCache extends ChunkSource {
// Paper end
public boolean isPositionTicking(long pos) {
@@ -19475,7 +19479,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
}
public void save(boolean flush) {
-@@ -631,17 +481,13 @@ public class ServerChunkCache extends ChunkSource {
+@@ -615,17 +463,13 @@ public class ServerChunkCache extends ChunkSource {
this.close(true);
}
@@ -19496,7 +19500,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
this.level.getProfiler().push("purge");
this.distanceManager.purgeStaleTickets();
this.runDistanceManagerUpdates();
-@@ -662,6 +508,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -646,6 +490,7 @@ public class ServerChunkCache extends ChunkSource {
this.level.getProfiler().popPush("chunks");
if (tickChunks) {
this.level.timings.chunks.startTiming(); // Paper - timings
@@ -19504,7 +19508,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
this.tickChunks();
this.level.timings.chunks.stopTiming(); // Paper - timings
this.chunkMap.tick();
-@@ -755,7 +602,12 @@ public class ServerChunkCache extends ChunkSource {
+@@ -748,7 +593,12 @@ public class ServerChunkCache extends ChunkSource {
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
if (playerchunk != null) {
@@ -19518,7 +19522,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
}
}
-@@ -921,17 +773,10 @@ public class ServerChunkCache extends ChunkSource {
+@@ -914,17 +764,10 @@ public class ServerChunkCache extends ChunkSource {
@Override
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
public boolean pollTask() {
@@ -19538,7 +19542,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3deeb59da 100644
+index baafe984f2e015e20e57841b5009861cb0a02525..90fae050445fbebe44ec5ef77fdcac65b48f1f9d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -195,7 +195,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -19550,7 +19554,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
private final GameEventDispatcher gameEventDispatcher;
public boolean noSave;
private final SleepStatus sleepStatus;
-@@ -261,50 +261,65 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -262,50 +262,65 @@ public class ServerLevel extends Level implements WorldGenLevel {
return true;
}
@@ -19643,16 +19647,17 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
chunkProvider.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, ticketLevel, chunkPos);
chunkProvider.removeTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, holderIdentifier);
-@@ -316,12 +331,228 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -317,12 +332,228 @@ public class ServerLevel extends Level implements WorldGenLevel {
for (int cx = minChunkX; cx <= maxChunkX; ++cx) {
for (int cz = minChunkZ; cz <= maxChunkZ; ++cz) {
io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(
- this, cx, cz, net.minecraft.world.level.chunk.ChunkStatus.FULL, true, priority, consumer
+ this, cx, cz, chunkStatus, true, priority, consumer
-+ );
-+ }
-+ }
-+ }
+ );
+ }
+ }
+ }
+- // Paper end
+
+ public final void loadChunksForMoveAsync(AABB axisalignedbb, ca.spottedleaf.concurrentutil.executor.standard.PrioritisedExecutor.Priority priority,
+ java.util.function.Consumer<List<net.minecraft.world.level.chunk.ChunkAccess>> onLoad) {
@@ -19742,8 +19747,8 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
+ throw new IllegalArgumentException(
+ "Entity chunk coordinate and serialized data do not have matching coordinates, trying to serialize coordinate " + pos.toString()
+ + " but compound says coordinate is " + nbtPos + " for world: " + this
- );
- }
++ );
++ }
+ super.write(pos, nbt);
+ }
+ }
@@ -19841,9 +19846,8 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
+ if (this.viewDistances.compareAndSet(curr, update.apply(curr))) {
+ return;
+ }
- }
- }
-- // Paper end
++ }
++ }
+
+ public void setTickViewDistance(final int distance) {
+ if ((distance < io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.MIN_VIEW_DISTANCE || distance > io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.MAX_VIEW_DISTANCE)) {
@@ -19872,9 +19876,9 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
+ });
+ }
- // 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) {
-@@ -365,16 +596,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
+ // Paper start - optimise getPlayerByUUID
+ @Nullable
+@@ -375,16 +606,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit end
boolean flag2 = minecraftserver.forceSynchronousWrites();
DataFixer datafixer = minecraftserver.getFixerUpper();
@@ -19896,7 +19900,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
return minecraftserver.overworld().getDataStorage();
});
this.chunkSource.getGeneratorState().ensureStructuresGenerated();
-@@ -403,6 +634,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -413,6 +644,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
return (RandomSequences) this.getDataStorage().computeIfAbsent(RandomSequences.factory(l), "random_sequences");
});
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
@@ -19905,8 +19909,8 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
+ this.entityLookup = new io.papermc.paper.chunk.system.entity.EntityLookup(this, new EntityCallbacks()); // Paper - rewrite chunk system
}
- /** @deprecated */
-@@ -528,7 +762,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+ // Paper start
+@@ -545,7 +779,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.push("checkDespawn");
entity.checkDespawn();
gameprofilerfiller.pop();
@@ -19915,7 +19919,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
Entity entity1 = entity.getVehicle();
if (entity1 != null) {
-@@ -553,13 +787,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -570,13 +804,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
gameprofilerfiller.push("entityManagement");
@@ -19934,8 +19938,8 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
}
protected void tickTime() {
-@@ -1028,6 +1265,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
- }
+@@ -1078,6 +1315,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+ // Paper end - Incremental chunk and player saving
public void save(@Nullable ProgressListener progressListener, boolean flush, boolean savingDisabled) {
+ // Paper start - rewrite chunk system - add close param
@@ -19946,7 +19950,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
ServerChunkCache chunkproviderserver = this.getChunkSource();
if (!savingDisabled) {
-@@ -1043,16 +1285,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1093,16 +1335,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
timings.worldSaveChunks.startTiming(); // Paper
@@ -19967,7 +19971,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
// CraftBukkit start - moved from MinecraftServer.saveChunks
ServerLevel worldserver1 = this;
-@@ -1188,7 +1427,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1238,7 +1477,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED);
}
@@ -19976,7 +19980,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
}
// CraftBukkit start
-@@ -1204,7 +1443,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1261,7 +1500,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
// CraftBukkit end
@@ -19985,7 +19989,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
}
}
-@@ -1216,10 +1455,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1273,10 +1512,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
public boolean tryAddFreshEntityWithPassengers(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
// CraftBukkit end
Stream<UUID> stream = entity.getSelfAndPassengers().map(Entity::getUUID); // CraftBukkit - decompile error
@@ -19999,7 +20003,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
return false;
} else {
this.addFreshEntityWithPassengers(entity, reason); // CraftBukkit
-@@ -1745,7 +1984,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1880,7 +2119,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
@@ -20008,7 +20012,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
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()));
-@@ -1794,7 +2033,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1929,7 +2168,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
BufferedWriter bufferedwriter2 = Files.newBufferedWriter(path1);
try {
@@ -20017,7 +20021,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
} catch (Throwable throwable4) {
if (bufferedwriter2 != null) {
try {
-@@ -1815,7 +2054,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1950,7 +2189,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
BufferedWriter bufferedwriter3 = Files.newBufferedWriter(path2);
try {
@@ -20026,7 +20030,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
} catch (Throwable throwable6) {
if (bufferedwriter3 != null) {
try {
-@@ -1957,7 +2196,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2092,7 +2331,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@VisibleForTesting
public String getWatchdogStats() {
@@ -20035,7 +20039,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
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());
}
-@@ -2017,15 +2256,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2152,15 +2391,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public LevelEntityGetter<Entity> getEntities() {
org.spigotmc.AsyncCatcher.catchOp("Chunk getEntities call"); // Spigot
@@ -20056,7 +20060,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
}
public void startTickingChunk(LevelChunk chunk) {
-@@ -2041,34 +2280,49 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2176,34 +2415,49 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public void close() throws IOException {
super.close();
@@ -20113,7 +20117,7 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
}
@Override
-@@ -2089,7 +2343,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2224,7 +2478,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
CrashReportCategory crashreportsystemdetails = super.fillReportDetails(report);
crashreportsystemdetails.setDetail("Loaded entity count", () -> {
@@ -20123,12 +20127,12 @@ index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3
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 61d4afb6b76fdffdda9f01af5005f005e21f4807..682388297375ea43515388bbdf9f7d2b949a7a62 100644
+index c4e0fa6c24f9df0d99508ea7d6a9ed974f14835e..c449b40c2252829c5f5fa0978b3f9a41336d6318 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -265,6 +265,50 @@ public class ServerPlayer extends Player {
- public boolean isRealPlayer; // Paper
+@@ -275,6 +275,50 @@ public class ServerPlayer extends Player {
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
+ public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
+ // Paper start - replace player chunk loader
+ private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
@@ -20494,11 +20498,11 @@ index c509a1318bcef38fd4927e38b6ee9846853e2d15..5de5209e04d631bd6a50e28e8d3abebf
this.desiredChunksPerTick = Double.isNaN((double)desiredBatchSize) ? 0.01F : Mth.clamp(desiredBatchSize, 0.01F, 64.0F);
if (this.unacknowledgedBatches == 0) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index ce7caf08865df9ff032ba6c42308ea3ce4de6226..e8e5773776060b7b6861c80ec736bc5740a262c8 100644
+index 48fca15cdc6b0bafc3d8ff13cc96b3258104c1fb..2f8715e200b9b8ae4c4b70ddd7cdc3368a109939 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -696,6 +696,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
- this.disconnect(Component.translatable("disconnect.spam"));
+@@ -714,6 +714,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam"))); // Paper - AsyncTabCompleteEvent
return;
}
+ // Paper start
@@ -20509,13 +20513,13 @@ index ce7caf08865df9ff032ba6c42308ea3ce4de6226..e8e5773776060b7b6861c80ec736bc57
+ }
+ // Paper end
// CraftBukkit end
- StringReader stringreader = new StringReader(packet.getCommand());
-
+ // Paper start - AsyncTabCompleteEvent
+ TAB_COMPLETE_EXECUTOR.execute(() -> {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index f5a4191977e8675952fc689744c8a39e86f62a07..fdf3bf3decb14378f5e59e41bab26e965bc7be14 100644
+index a35dda4010c6db1a8e1efb7951ac8732d9a1e16e..172d7c3df8f9aab24d49b2ff12e3cdf5f40727f9 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -250,7 +250,7 @@ public abstract class PlayerList {
+@@ -292,7 +292,7 @@ public abstract class PlayerList {
boolean flag2 = gamerules.getBoolean(GameRules.RULE_LIMITED_CRAFTING);
// Spigot - view distance
@@ -20524,7 +20528,7 @@ index f5a4191977e8675952fc689744c8a39e86f62a07..fdf3bf3decb14378f5e59e41bab26e96
player.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
playerconnection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
playerconnection.send(new ClientboundPlayerAbilitiesPacket(player.getAbilities()));
-@@ -798,8 +798,8 @@ public abstract class PlayerList {
+@@ -881,8 +881,8 @@ public abstract class PlayerList {
LevelData worlddata = worldserver2.getLevelData();
entityplayer1.connection.send(new ClientboundRespawnPacket(entityplayer1.createCommonSpawnInfo(worldserver2), (byte) i));
@@ -20535,7 +20539,7 @@ index f5a4191977e8675952fc689744c8a39e86f62a07..fdf3bf3decb14378f5e59e41bab26e96
entityplayer1.connection.teleport(CraftLocation.toBukkit(entityplayer1.position(), worldserver2.getWorld(), entityplayer1.getYRot(), entityplayer1.getXRot())); // CraftBukkit
entityplayer1.connection.send(new ClientboundSetDefaultSpawnPositionPacket(worldserver1.getSharedSpawnPos(), worldserver1.getSharedSpawnAngle()));
entityplayer1.connection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
-@@ -1292,7 +1292,7 @@ public abstract class PlayerList {
+@@ -1433,7 +1433,7 @@ public abstract class PlayerList {
public void setViewDistance(int viewDistance) {
this.viewDistance = viewDistance;
@@ -20544,7 +20548,7 @@ index f5a4191977e8675952fc689744c8a39e86f62a07..fdf3bf3decb14378f5e59e41bab26e96
Iterator iterator = this.server.getAllLevels().iterator();
while (iterator.hasNext()) {
-@@ -1307,7 +1307,7 @@ public abstract class PlayerList {
+@@ -1448,7 +1448,7 @@ public abstract class PlayerList {
public void setSimulationDistance(int simulationDistance) {
this.simulationDistance = simulationDistance;
@@ -20663,10 +20667,10 @@ index 640db9f71608310a64e09f1e3e677c01e6ccd98a..f2a7cb6ebed7a4b4019a09af2a025f62
if (flag1) {
++this.converted;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 8811646495f37587e7976edd8b9558cda412edb1..80affc349b03d3eba394b6d882d29efb4bbbf4a2 100644
+index 70380d5807cac6dec19ebe581d685b1e32d8830b..b5a39909c21888cef3f967435ff89a20fed00d02 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -334,6 +334,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -433,6 +433,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
// Paper end
@@ -20725,7 +20729,7 @@ index 8811646495f37587e7976edd8b9558cda412edb1..80affc349b03d3eba394b6d882d29efb
public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
this.passengers = ImmutableList.of();
-@@ -2295,11 +2347,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -2442,11 +2494,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return InteractionResult.PASS;
}
@@ -20739,7 +20743,7 @@ index 8811646495f37587e7976edd8b9558cda412edb1..80affc349b03d3eba394b6d882d29efb
return false;
}
-@@ -3632,6 +3684,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -3802,6 +3854,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}).count();
}
@@ -20756,20 +20760,20 @@ index 8811646495f37587e7976edd8b9558cda412edb1..80affc349b03d3eba394b6d882d29efb
public boolean hasExactlyOnePlayerPassenger() {
return this.countPlayerPassengers() == 1;
}
-@@ -3961,6 +4023,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
- }
-
- public final void setPosRaw(double x, double y, double z) {
+@@ -4153,6 +4215,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+ return;
+ }
+ // Paper end - Block invalid positions and bounding box
+ // Paper start - rewrite chunk system
+ if (this.updatingSectionStatus) {
-+ LOGGER.error("Refusing to update position for entity " + this + " to position " + new Vec3(x, y, z) + " since it is processing a section status update", new Throwable());
++ LOGGER.error("Refusing to update position for entity {} to position {} since it is processing a section status update", this, new Vec3(x, y, z), new Throwable());
+ return;
+ }
+ // Paper end - rewrite chunk system
if (this.position.x != x || this.position.y != y || this.position.z != z) {
this.position = new Vec3(x, y, z);
int i = Mth.floor(x);
-@@ -4068,6 +4136,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -4266,6 +4334,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@Override
public final void setRemoved(Entity.RemovalReason reason) {
@@ -20783,7 +20787,7 @@ index 8811646495f37587e7976edd8b9558cda412edb1..80affc349b03d3eba394b6d882d29efb
if (this.removalReason == null) {
this.removalReason = reason;
}
-@@ -4076,7 +4151,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -4274,7 +4349,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.stopRiding();
}
@@ -20792,7 +20796,7 @@ index 8811646495f37587e7976edd8b9558cda412edb1..80affc349b03d3eba394b6d882d29efb
this.levelCallback.onRemove(reason);
}
-@@ -4091,7 +4166,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
+@@ -4289,7 +4364,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@Override
public boolean shouldBeSaved() {
@@ -21053,7 +21057,7 @@ index 795a02941d7cecb58ec45b5e79c8d510ff21163a..3fc17817906876e83f040f908b8b1ba6
this.setDirty = updateListener;
this.isValid = valid;
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
-index b6a3c75b84d9f768afee33aa0f226207b307c1c0..2ec2b1d9d987c7f31c685aec3d3c87f42758c94b 100644
+index e7b6f97d8519a5797903664e5ba2a793e37a4bfc..dbdf124638c35510aa0040100c4d80d63ab14ada 100644
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
@@ -18,6 +18,18 @@ import net.minecraft.world.phys.shapes.Shapes;
@@ -21076,10 +21080,10 @@ index b6a3c75b84d9f768afee33aa0f226207b307c1c0..2ec2b1d9d987c7f31c685aec3d3c87f4
<T extends Entity> List<T> getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index aa22d4024cdd0ecb1c0442ecdeae00822597362e..d3a7de8d3fd92d36d3df257cae5686fc7f61d3c3 100644
+index 3f1c0f3b879bf562db2b999dd39a3ce37759775d..d6ba5b4f91ba4297f8cdae03b50ba5188702d77f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -463,6 +463,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -533,6 +533,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || (chunk.getFullStatus() != null && chunk.getFullStatus().isOrAfter(FullChunkStatus.BLOCK_TICKING)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement
this.sendBlockUpdated(blockposition, iblockdata1, iblockdata, i);
@@ -21091,16 +21095,16 @@ index aa22d4024cdd0ecb1c0442ecdeae00822597362e..d3a7de8d3fd92d36d3df257cae5686fc
}
if ((i & 1) != 0) {
-@@ -823,7 +828,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
- return this.capturedTileEntities.get(blockposition);
+@@ -922,7 +927,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
+ // 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
}
public void setBlockEntity(BlockEntity blockEntity) {
-@@ -914,26 +919,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -1013,26 +1018,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
this.getProfiler().incrementCounter("getEntities");
List<Entity> list = Lists.newArrayList();
@@ -21128,7 +21132,7 @@ index aa22d4024cdd0ecb1c0442ecdeae00822597362e..d3a7de8d3fd92d36d3df257cae5686fc
return list;
}
-@@ -951,34 +937,23 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -1050,34 +1036,23 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public <T extends Entity> void getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate, List<? super T> result, int limit) {
this.getProfiler().incrementCounter("getEntities");
@@ -21179,10 +21183,10 @@ index aa22d4024cdd0ecb1c0442ecdeae00822597362e..d3a7de8d3fd92d36d3df257cae5686fc
}
@Nullable
-@@ -1250,4 +1225,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
-
- private ExplosionInteraction() {}
+@@ -1359,4 +1334,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+ return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
}
+ // Paper end - respect global sound events gamerule
+ // Paper start
+ //protected final io.papermc.paper.world.EntitySliceManager entitySliceManager; // Paper - rewrite chunk system
+
@@ -21246,7 +21250,7 @@ index cc0d20e9f851268fe8403ac516f426ec1d008150..12eaafdbd324fa36b3f46c3b644bc811
@Nullable default ChunkAccess getChunkIfLoadedImmediately(BlockPos pos) { return this.getChunkIfLoadedImmediately(pos.getX() >> 4, pos.getZ() >> 4);}
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
-index b2f9429e0d437cf70bf56410e163e957b80ebdf1..e124ae2711bcd4681fe0b41bd266de67bef8344f 100644
+index 3e57142dd9cb23d43857d5a4cb30962e4b696b74..1eacb6998f99833441dd1dcb8301f25759675f53 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -114,7 +114,7 @@ public abstract class ChunkGenerator {
@@ -21258,7 +21262,7 @@ index b2f9429e0d437cf70bf56410e163e957b80ebdf1..e124ae2711bcd4681fe0b41bd266de67
}
public abstract void applyCarvers(WorldGenRegion chunkRegion, long seed, RandomState noiseConfig, BiomeManager biomeAccess, StructureManager structureAccessor, ChunkAccess chunk, GenerationStep.Carving carverStep);
-@@ -287,7 +287,7 @@ public abstract class ChunkGenerator {
+@@ -288,7 +288,7 @@ public abstract class ChunkGenerator {
return Pair.of(placement.getLocatePos(pos), holder);
}
@@ -21333,10 +21337,10 @@ index 846ae3fd184a1d63b743aa25e045604576697c96..a907b79fd8291a0e92db138f37239d17
public int getIndex() {
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 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c2c0b3fc8 100644
+index 73e682bb3ef3b2e450ec8c594b5365c7a340615e..6a5756bd333d9b221e7770842e5114d295cb7f1d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -83,6 +83,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -84,6 +84,7 @@ public class LevelChunk extends ChunkAccess {
private final Int2ObjectMap<GameEventListenerRegistry> gameEventListenerRegistrySections;
private final LevelChunkTicks<Block> blockTicks;
private final LevelChunkTicks<Fluid> fluidTicks;
@@ -21344,7 +21348,7 @@ index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c
public LevelChunk(Level world, ChunkPos pos) {
this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null);
-@@ -673,9 +674,26 @@ public class LevelChunk extends ChunkAccess {
+@@ -690,9 +691,26 @@ public class LevelChunk extends ChunkAccess {
}
@@ -21374,7 +21378,7 @@ index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c
int chunkX = this.chunkPos.x;
int chunkZ = this.chunkPos.z;
net.minecraft.server.level.ServerChunkCache chunkProvider = this.level.getChunkSource();
-@@ -690,10 +708,55 @@ public class LevelChunk extends ChunkAccess {
+@@ -707,10 +725,55 @@ public class LevelChunk extends ChunkAccess {
}
}
this.setNeighbourLoaded(0, 0, this);
@@ -21432,7 +21436,7 @@ index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c
if (server != null) {
/*
* If it's a new world, the first few chunks are generated inside
-@@ -702,6 +765,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -719,6 +782,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));
@@ -21440,7 +21444,7 @@ index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c
if (this.needsDecoration) {
try (co.aikar.timings.Timing ignored = this.level.timings.chunkLoadPopulate.startTiming()) { // Paper
-@@ -730,9 +794,11 @@ public class LevelChunk extends ChunkAccess {
+@@ -747,9 +811,11 @@ public class LevelChunk extends ChunkAccess {
}
public void unloadCallback() {
@@ -21453,7 +21457,7 @@ index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c
server.getPluginManager().callEvent(unloadEvent);
// note: saving can be prevented, but not forced if no saving is actually required
this.mustNotSave = !unloadEvent.isSaveChunk();
-@@ -754,9 +820,26 @@ public class LevelChunk extends ChunkAccess {
+@@ -771,9 +837,26 @@ public class LevelChunk extends ChunkAccess {
// Paper end
}
@@ -21481,7 +21485,7 @@ index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c
}
// CraftBukkit end
-@@ -825,7 +908,9 @@ public class LevelChunk extends ChunkAccess {
+@@ -842,7 +925,9 @@ public class LevelChunk extends ChunkAccess {
return this.blockEntities;
}
@@ -21491,7 +21495,7 @@ index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c
ChunkPos chunkcoordintpair = this.getPos();
for (int i = 0; i < this.postProcessing.length; ++i) {
-@@ -846,6 +931,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -863,6 +948,7 @@ public class LevelChunk extends ChunkAccess {
BlockState iblockdata1 = Block.updateFromNeighbourShapes(iblockdata, this.level, blockposition);
this.level.setBlock(blockposition, iblockdata1, 20);
@@ -21499,7 +21503,7 @@ index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c
}
}
-@@ -863,6 +949,10 @@ public class LevelChunk extends ChunkAccess {
+@@ -880,6 +966,10 @@ public class LevelChunk extends ChunkAccess {
this.pendingBlockEntities.clear();
this.upgradeData.upgrade(this);
@@ -21510,7 +21514,7 @@ index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c
}
@Nullable
-@@ -912,7 +1002,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -929,7 +1019,7 @@ public class LevelChunk extends ChunkAccess {
}
public FullChunkStatus getFullStatus() {
@@ -21520,14 +21524,14 @@ index 3e51fb9fe05d5b974ae41ccc0acbb516a07c114b..a664126bbcd29026e9d6770e362aa04c
public void setFullStatus(Supplier<FullChunkStatus> levelTypeProvider) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
-index 24892ae367e19038625e243bcdf1bb694632ede5..97cdd8cd7749185230471f34f7d1ce3abcd0fd11 100644
+index b4ea37dfa90f0c19914ecd32ddedde586d9d5f78..c1ca83446bb4ccc7c1cb0f5e071850ce15657a69 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
-@@ -94,7 +94,27 @@ public class ChunkSerializer {
-
- public ChunkSerializer() {}
-
-+ // Paper start
+@@ -106,7 +106,24 @@ public class ChunkSerializer {
+ }
+ }
+ // Paper end - guard against serializing mismatching coordinates
++ // Paper start - rewrite chunk system
+ public static final class InProgressChunkHolder {
+
+ public final ProtoChunk protoChunk;
@@ -21538,20 +21542,17 @@ index 24892ae367e19038625e243bcdf1bb694632ede5..97cdd8cd7749185230471f34f7d1ce3a
+ this.protoChunk = protoChunk;
+ }
+ }
-+ // Paper end
-+
public static ProtoChunk read(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) {
-+ // Paper start - add variant for async calls
-+ InProgressChunkHolder holder = loadChunk(world, poiStorage, chunkPos, nbt, true);
++ InProgressChunkHolder holder = readInProgressChunkHolder(world, poiStorage, chunkPos, nbt);
+ return holder.protoChunk;
+ }
+
-+ public static InProgressChunkHolder loadChunk(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt, boolean distinguish) {
-+ // Paper end
- ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos"));
++ public static InProgressChunkHolder readInProgressChunkHolder(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) {
++ // Paper end - rewrite chunk system
+ ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos")); // Paper - guard against serializing mismatching coordinates; diff on change, see ChunkSerializer#getChunkCoordinate
if (!Objects.equals(chunkPos, chunkcoordintpair1)) {
-@@ -160,7 +180,7 @@ public class ChunkSerializer {
+@@ -172,7 +189,7 @@ public class ChunkSerializer {
achunksection[k] = chunksection;
SectionPos sectionposition = SectionPos.of(chunkPos, b0);
@@ -21560,7 +21561,7 @@ index 24892ae367e19038625e243bcdf1bb694632ede5..97cdd8cd7749185230471f34f7d1ce3a
}
boolean flag3 = nbttagcompound1.contains("BlockLight", 7);
-@@ -306,7 +326,7 @@ public class ChunkSerializer {
+@@ -318,7 +335,7 @@ public class ChunkSerializer {
}
if (chunkstatus_type == ChunkStatus.ChunkType.LEVELCHUNK) {
@@ -21569,7 +21570,7 @@ index 24892ae367e19038625e243bcdf1bb694632ede5..97cdd8cd7749185230471f34f7d1ce3a
} else {
ProtoChunk protochunk1 = (ProtoChunk) object1;
-@@ -334,9 +354,41 @@ public class ChunkSerializer {
+@@ -346,9 +363,41 @@ public class ChunkSerializer {
protochunk1.setCarvingMask(worldgenstage_features, new CarvingMask(nbttagcompound5.getLongArray(s1), ((ChunkAccess) object1).getMinBuildHeight()));
}
@@ -21612,7 +21613,7 @@ index 24892ae367e19038625e243bcdf1bb694632ede5..97cdd8cd7749185230471f34f7d1ce3a
private static void logErrors(ChunkPos chunkPos, int y, String message) {
ChunkSerializer.LOGGER.error("Recoverable errors when loading section [" + chunkPos.x + ", " + y + ", " + chunkPos.z + "]: " + message);
-@@ -353,6 +405,11 @@ public class ChunkSerializer {
+@@ -365,6 +414,11 @@ public class ChunkSerializer {
// CraftBukkit end
public static CompoundTag write(ServerLevel world, ChunkAccess chunk) {
@@ -21624,7 +21625,7 @@ index 24892ae367e19038625e243bcdf1bb694632ede5..97cdd8cd7749185230471f34f7d1ce3a
// Paper start - rewrite light impl
final int minSection = io.papermc.paper.util.WorldUtil.getMinLightSection(world);
final int maxSection = io.papermc.paper.util.WorldUtil.getMaxLightSection(world);
-@@ -365,7 +422,7 @@ public class ChunkSerializer {
+@@ -377,7 +431,7 @@ public class ChunkSerializer {
nbttagcompound.putInt("xPos", chunkcoordintpair.x);
nbttagcompound.putInt("yPos", chunk.getMinSection());
nbttagcompound.putInt("zPos", chunkcoordintpair.z);
@@ -21633,7 +21634,7 @@ index 24892ae367e19038625e243bcdf1bb694632ede5..97cdd8cd7749185230471f34f7d1ce3a
nbttagcompound.putLong("InhabitedTime", chunk.getInhabitedTime());
nbttagcompound.putString("Status", BuiltInRegistries.CHUNK_STATUS.getKey(chunk.getStatus()).toString());
BlendingData blendingdata = chunk.getBlendingData();
-@@ -465,8 +522,17 @@ public class ChunkSerializer {
+@@ -477,8 +531,17 @@ public class ChunkSerializer {
nbttagcompound.putBoolean("isLightOn", false); // Paper - set to false but still store, this allows us to detect --eraseCache (as eraseCache _removes_)
}
@@ -21653,7 +21654,7 @@ index 24892ae367e19038625e243bcdf1bb694632ede5..97cdd8cd7749185230471f34f7d1ce3a
CompoundTag nbttagcompound2;
-@@ -502,7 +568,14 @@ public class ChunkSerializer {
+@@ -514,7 +577,14 @@ public class ChunkSerializer {
nbttagcompound.put("CarvingMasks", nbttagcompound2);
}
@@ -21668,7 +21669,7 @@ index 24892ae367e19038625e243bcdf1bb694632ede5..97cdd8cd7749185230471f34f7d1ce3a
nbttagcompound.put("PostProcessing", ChunkSerializer.packOffsets(chunk.getPostProcessing()));
CompoundTag nbttagcompound3 = new CompoundTag();
Iterator iterator1 = chunk.getHeightmaps().iterator();
-@@ -558,7 +631,7 @@ public class ChunkSerializer {
+@@ -570,7 +640,7 @@ public class ChunkSerializer {
return nbttaglist == null && nbttaglist1 == null ? null : (chunk) -> {
if (nbttaglist != null) {
@@ -21678,7 +21679,7 @@ index 24892ae367e19038625e243bcdf1bb694632ede5..97cdd8cd7749185230471f34f7d1ce3a
if (nbttaglist1 != null) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
-index 6c0f87535ffa95cf82ab4b03bb7bf8f2132d275f..b4e7c9b317d532d4915932f8f79dfebf2b63ff16 100644
+index ab6b4491d4278b3839b7363d9890bd12a757e4cc..4892edc56ea89c57dbeb4d6f2b67b8cec3aa7deb 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
@@ -28,26 +28,33 @@ import net.minecraft.world.level.storage.DimensionDataStorage;
@@ -21749,7 +21750,7 @@ index 6c0f87535ffa95cf82ab4b03bb7bf8f2132d275f..b4e7c9b317d532d4915932f8f79dfebf
persistentstructurelegacy = this.legacyStructureHandler;
if (persistentstructurelegacy == null) {
this.legacyStructureHandler = persistentstructurelegacy = LegacyStructureDataHandler.getLegacyStructureHandler(worldKey, (DimensionDataStorage) stateManagerGetter.get());
-@@ -153,26 +163,49 @@ public class ChunkStorage implements AutoCloseable {
+@@ -153,10 +163,20 @@ public class ChunkStorage implements AutoCloseable {
}
public CompletableFuture<Optional<CompoundTag>> read(ChunkPos chunkPos) {
@@ -21768,15 +21769,20 @@ index 6c0f87535ffa95cf82ab4b03bb7bf8f2132d275f..b4e7c9b317d532d4915932f8f79dfebf
+ // Paper end - async chunk io
- public void write(ChunkPos chunkPos, CompoundTag nbt) {
++ public void write(ChunkPos chunkPos, CompoundTag nbt) throws IOException { // Paper - rewrite chunk system; async chunk io
+ // Paper start - guard against serializing mismatching coordinates
+ if (nbt != null && !chunkPos.equals(ChunkSerializer.getChunkCoordinate(nbt))) {
+ final String world = (this instanceof net.minecraft.server.level.ChunkMap) ? ((net.minecraft.server.level.ChunkMap) this).level.getWorld().getName() : null;
+@@ -164,22 +184,33 @@ public class ChunkStorage implements AutoCloseable {
+ + " but compound says coordinate is " + ChunkSerializer.getChunkCoordinate(nbt) + (world == null ? " for an unknown world" : (" for world: " + world)));
+ }
+ // Paper end - guard against serializing mismatching coordinates
- this.worker.store(chunkPos, nbt);
-+ // Paper start - async chunk io
-+ public void write(ChunkPos chunkPos, CompoundTag nbt) throws IOException {
-+ this.regionFileCache.write(chunkPos, nbt);
-+ // Paper end - Async chunk loading
++ this.regionFileCache.write(chunkPos, nbt); // Paper - rewrite chunk system; async chunk io
if (this.legacyStructureHandler != null) {
-+ synchronized (this.persistentDataLock) { // Paper - Async chunk loading
++ synchronized (this.persistentDataLock) { // Paper - rewrite chunk system; async chunk io
this.legacyStructureHandler.removeIndex(chunkPos.toLong());
-+ } // Paper - Async chunk loading
++ } // Paper - rewrite chunk system; async chunk io
}
}
@@ -21963,7 +21969,7 @@ index 98b3909b536f11eda9c481ffd74066ad0cdb0ebc..0ec0be22f7292d57c40da6f1f4575bde
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
-index d9daf07132c46548964a75588b69d7a74680e917..5103081e8469dd5a393595eae00c6f6c9d0a5028 100644
+index 140d6e455c1729f6e31e95facba5520b75ad838c..f3d169436ce05f1c56599cfe15a56671b7d13516 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -44,6 +44,7 @@ public class RegionFile implements AutoCloseable {
@@ -21983,7 +21989,7 @@ index d9daf07132c46548964a75588b69d7a74680e917..5103081e8469dd5a393595eae00c6f6c
int i = this.getOffset(pos);
if (i == 0) {
-@@ -393,6 +394,11 @@ public class RegionFile implements AutoCloseable {
+@@ -395,6 +396,11 @@ public class RegionFile implements AutoCloseable {
}
public void close() throws IOException {
@@ -21995,7 +22001,7 @@ index d9daf07132c46548964a75588b69d7a74680e917..5103081e8469dd5a393595eae00c6f6c
try {
this.padToFullSector();
} finally {
-@@ -402,6 +408,10 @@ public class RegionFile implements AutoCloseable {
+@@ -404,6 +410,10 @@ public class RegionFile implements AutoCloseable {
this.file.close();
}
}
@@ -22007,7 +22013,7 @@ index d9daf07132c46548964a75588b69d7a74680e917..5103081e8469dd5a393595eae00c6f6c
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-index 1988063a0cac0350ae3b3388b8f2a0c95b8b259f..2b6ba2e30c9a4682d6deb2ab750d6923ad8469e4 100644
+index 50f8e12c964a7a0f388568e4df512ddffdda4a64..f54663cdd00064cc3130a27f93e1ea815dc617de 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -25,30 +25,98 @@ public class RegionFileStorage implements AutoCloseable {
@@ -22084,7 +22090,7 @@ index 1988063a0cac0350ae3b3388b8f2a0c95b8b259f..2b6ba2e30c9a4682d6deb2ab750d6923
+ return null;
+ }
+ // Paper end - cache regionfile does not exist state
- if (this.regionCache.size() >= 256) {
+ if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - Sanitise RegionFileCache and make configurable
((RegionFile) this.regionCache.removeLast()).close();
}
@@ -22143,22 +22149,28 @@ index 1988063a0cac0350ae3b3388b8f2a0c95b8b259f..2b6ba2e30c9a4682d6deb2ab750d6923
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
- RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit
-+ RegionFile regionfile = this.getRegionFile(pos, nbt == null, true); // CraftBukkit // Paper // Paper start - rewrite chunk system
++ // Paper start - rewrite chunk system
++ RegionFile regionfile = this.getRegionFile(pos, nbt == null, true); // CraftBukkit
+ if (nbt == null && regionfile == null) {
+ return;
+ }
+ // Paper end - rewrite chunk system
-+ try { // Paper
-
- if (nbt == null) {
- regionfile.clear(pos);
-@@ -157,9 +234,12 @@ public class RegionFileStorage implements AutoCloseable {
+ // Paper start - Chunk save reattempt
+ int attempts = 0;
+ Exception lastException = null;
+@@ -166,6 +243,10 @@ public class RegionFileStorage implements AutoCloseable {
+ return;
+ } catch (Exception ex) {
+ lastException = ex;
++ // Paper start - rewrite chunk system
++ } finally {
++ regionfile.fileLock.unlock();
++ // Paper end - rewrite chunk system
}
}
-+ } finally { // Paper start
-+ regionfile.fileLock.unlock();
-+ } // Paper end
+@@ -176,7 +257,7 @@ public class RegionFileStorage implements AutoCloseable {
+ // Paper end - Chunk save reattempt
}
- public void close() throws IOException {
@@ -22166,7 +22178,7 @@ index 1988063a0cac0350ae3b3388b8f2a0c95b8b259f..2b6ba2e30c9a4682d6deb2ab750d6923
ExceptionCollector<IOException> exceptionsuppressor = new ExceptionCollector<>();
ObjectIterator objectiterator = this.regionCache.values().iterator();
-@@ -176,7 +256,7 @@ public class RegionFileStorage implements AutoCloseable {
+@@ -193,7 +274,7 @@ public class RegionFileStorage implements AutoCloseable {
exceptionsuppressor.throwIfPresent();
}
@@ -22606,7 +22618,7 @@ index 9f6c2e5b5d9e8d714a47c770e255d06c0ef7c190..ac807277a6b26d140ea9873d17c7aa4f
for(SavedTick<T> savedTick : this.pendingTicks) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
-index b1aeb021e53a233bfb0439d38f1a889ed6fc301d..7687a81bfa420e8377308fea3d6738141bc945d3 100644
+index e38643853220cabeac6c30912a9ae4bc1c018d5f..545b14f02ac72dda30891d681eba585d19fd5e1d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -113,7 +113,7 @@ public class CraftChunk implements Chunk {
@@ -22672,10 +22684,10 @@ index b1aeb021e53a233bfb0439d38f1a889ed6fc301d..7687a81bfa420e8377308fea3d673814
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index f7ff043c99268d5d8d139e2a4d8cd0817b7bb96b..b41a5263cef159f90a60c62561753482c3f5eeb7 100644
+index 3aa481599811af7cd9b0c523f66dac469105ee49..c94bc27ef76ee94d5541e5ff2dcdaa176d91cb5e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -1195,7 +1195,7 @@ public final class CraftServer implements Server {
+@@ -1280,7 +1280,7 @@ public final class CraftServer implements Server {
this.console.addLevel(internal);
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
@@ -22684,7 +22696,7 @@ index f7ff043c99268d5d8d139e2a4d8cd0817b7bb96b..b41a5263cef159f90a60c62561753482
this.pluginManager.callEvent(new WorldLoadEvent(internal.getWorld()));
return internal.getWorld();
-@@ -1239,7 +1239,7 @@ public final class CraftServer implements Server {
+@@ -1324,7 +1324,7 @@ public final class CraftServer implements Server {
}
handle.getChunkSource().close(save);
@@ -22693,7 +22705,7 @@ index f7ff043c99268d5d8d139e2a4d8cd0817b7bb96b..b41a5263cef159f90a60c62561753482
handle.convertable.close();
} catch (Exception ex) {
this.getLogger().log(Level.SEVERE, null, ex);
-@@ -2130,7 +2130,7 @@ public final class CraftServer implements Server {
+@@ -2239,7 +2239,7 @@ public final class CraftServer implements Server {
@Override
public boolean isPrimaryThread() {
@@ -22703,10 +22715,10 @@ index f7ff043c99268d5d8d139e2a4d8cd0817b7bb96b..b41a5263cef159f90a60c62561753482
// Paper start - Adventure
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 68a7db9c840f101950435b386058f4cf409bfc05..3c7fdf150f39a75794a6927bd545c3eb9c480d6f 100644
+index fe0095601b41d85d8813af18e1c74b31f26f150d..f248735d48aa5c430752426e9dc02c1ae6644aaf 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -325,10 +325,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -410,10 +410,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
if (playerChunk == null) return false;
@@ -22724,7 +22736,7 @@ index 68a7db9c840f101950435b386058f4cf409bfc05..3c7fdf150f39a75794a6927bd545c3eb
ClientboundLevelChunkWithLightPacket refreshPacket = new ClientboundLevelChunkWithLightPacket(chunk, this.world.getLightEngine(), null, null);
for (ServerPlayer player : playersInRange) {
-@@ -336,8 +340,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -421,8 +425,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
player.connection.send(refreshPacket);
}
@@ -22734,7 +22746,7 @@ index 68a7db9c840f101950435b386058f4cf409bfc05..3c7fdf150f39a75794a6927bd545c3eb
return true;
}
-@@ -414,20 +417,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -499,20 +502,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public Collection<Plugin> getPluginChunkTickets(int x, int z) {
DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager;
@@ -22756,7 +22768,7 @@ index 68a7db9c840f101950435b386058f4cf409bfc05..3c7fdf150f39a75794a6927bd545c3eb
}
@Override
-@@ -435,7 +425,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -520,7 +510,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
Map<Plugin, ImmutableList.Builder<Chunk>> ret = new HashMap<>();
DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager;
@@ -22765,7 +22777,7 @@ index 68a7db9c840f101950435b386058f4cf409bfc05..3c7fdf150f39a75794a6927bd545c3eb
long chunkKey = chunkTickets.getLongKey();
SortedArraySet<Ticket<?>> tickets = chunkTickets.getValue();
-@@ -1036,13 +1026,52 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1143,13 +1133,52 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public int getViewDistance() {
@@ -22821,10 +22833,10 @@ index 68a7db9c840f101950435b386058f4cf409bfc05..3c7fdf150f39a75794a6927bd545c3eb
public BlockMetadataStore getBlockMetadata() {
return this.blockMetadata;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index cf8a5b3ba642d4829725bc488c074b1b3b142867..29cefb53474080d5e524ae54e9295dd11aa6546d 100644
+index 549c14e2d861c0b4692ee56e1de5df13ef72f6f8..4de49a81238ca3d550f85fdcdf921c17f992f65a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -195,6 +195,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -199,6 +199,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.firstPlayed = System.currentTimeMillis();
}
@@ -22959,10 +22971,10 @@ index 440660dfa70d57e94ae4eef1dce783aee5034f7e..187eda2dd40785eb09528c86718d6b4f
+ // Paper end
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
-index a5da6c1cae0afbde684be250e2fc3c0c32a1265b..a5ab3e1d52ff68730a4b9069e6d25a3d31c25da5 100644
+index 90df7e83d9166c22a56a31db22d843768229b9ab..f60eb4bf10c32d2d92fa24992ed20525f0f0f781 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
-@@ -135,7 +135,13 @@ public class ActivationRange
+@@ -136,7 +136,13 @@ public class ActivationRange
ActivationType.ANIMAL.boundingBox = player.getBoundingBox().inflate( animalActivationRange, 256, animalActivationRange );
ActivationType.MONSTER.boundingBox = player.getBoundingBox().inflate( monsterActivationRange, 256, monsterActivationRange );
@@ -22991,7 +23003,7 @@ index 78669fa035b7537ff7e533cf32aaf2995625424f..05e94702e42b8f5c35d2a112c486d579
throw new IllegalStateException( "Asynchronous " + reason + "!" );
}
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
-index c4bf7053d83d207caca0e13e19f5c1afa7062de3..7621bf889ef765ed57af221edf95b07346f4ae43 100644
+index 9994d8b26ffaff538f39cc72f2137fcabb973d87..de0ad206e8603a7d5b5d5ec3e87d5cab47714eb8 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;
@@ -23003,11 +23015,11 @@ index c4bf7053d83d207caca0e13e19f5c1afa7062de3..7621bf889ef765ed57af221edf95b073
{
private static WatchdogThread instance;
-@@ -83,6 +83,7 @@ public class WatchdogThread extends Thread
- //
+@@ -115,6 +115,7 @@ public class WatchdogThread extends Thread
+ // Paper end - Different message for short timeout
log.log( Level.SEVERE, "------------------------------" );
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Spigot!):" );
-+ io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
++ io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
log.log( Level.SEVERE, "------------------------------" );
//
diff --git a/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch
index ba7f1213ae..941e280dfb 100644
--- a/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch
+++ b/patches/server/0419-Do-not-let-the-server-load-chunks-from-newer-version.patch
@@ -9,11 +9,11 @@ the game, immediately stop the server to prevent data corruption.
You can override this functionality at your own peril.
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 7862caa0f787634cec14af81fe1f39803a43f115..1650541abeedce04ddeddfed15411b64a01be452 100644
+index c1ca83446bb4ccc7c1cb0f5e071850ce15657a69..00e60bba33fe3e100070bb3ded55e5253a8db138 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
-@@ -124,8 +124,20 @@ public class ChunkSerializer {
- InProgressChunkHolder holder = loadChunk(world, poiStorage, chunkPos, nbt, true);
+@@ -121,9 +121,22 @@ public class ChunkSerializer {
+ InProgressChunkHolder holder = readInProgressChunkHolder(world, poiStorage, chunkPos, nbt);
return holder.protoChunk;
}
+ // Paper start - Do not let the server load chunks from newer versions
@@ -21,15 +21,17 @@ index 7862caa0f787634cec14af81fe1f39803a43f115..1650541abeedce04ddeddfed15411b64
+ private static final boolean JUST_CORRUPT_IT = Boolean.getBoolean("Paper.ignoreWorldDataVersion");
+ // Paper end - Do not let the server load chunks from newer versions
- public static InProgressChunkHolder loadChunk(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt, boolean distinguish) {
+ public static InProgressChunkHolder readInProgressChunkHolder(ServerLevel world, PoiManager poiStorage, ChunkPos chunkPos, CompoundTag nbt) {
+ // Paper end - rewrite chunk system
+ // Paper start - Do not let the server load chunks from newer versions
+ if (nbt.contains("DataVersion", net.minecraft.nbt.Tag.TAG_ANY_NUMERIC)) {
-+ int dataVersion = nbt.getInt("DataVersion");
++ final int dataVersion = nbt.getInt("DataVersion");
+ if (!JUST_CORRUPT_IT && dataVersion > CURRENT_DATA_VERSION) {
+ new RuntimeException("Server attempted to load chunk saved with newer version of minecraft! " + dataVersion + " > " + CURRENT_DATA_VERSION).printStackTrace();
+ System.exit(1);
+ }
+ }
- // Paper end
++ // Paper end - Do not let the server load chunks from newer versions
ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos")); // Paper - guard against serializing mismatching coordinates; diff on change, see ChunkSerializer#getChunkCoordinate
+ if (!Objects.equals(chunkPos, chunkcoordintpair1)) {
diff --git a/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch
index a006f92fb2..93c65f7241 100644
--- a/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch
+++ b/patches/server/0634-Add-paper-mobcaps-and-paper-playermobcaps.patch
@@ -10,12 +10,12 @@ Also has a hover text on each mob category listing what entity types are
in said category
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
-index a8b41d6a42e23a7cd839cc3d5e5cae84860f802c..b7fc337ab2bbe3c6d80ed70834e294ab3a7f9dc2 100644
+index b333809320ebfb7a5c4367cb621510f213a69479..d105489b583aee849748cd13f8e95083ab27843e 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
-@@ -42,6 +42,7 @@ public final class PaperCommand extends Command {
- commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
- commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
+@@ -41,6 +41,7 @@ public final class PaperCommand extends Command {
+ commands.put(Set.of("fixlight"), new FixLightCommand());
+ commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); //
commands.put(Set.of("dumpitem"), new DumpItemCommand());
+ commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand());
@@ -278,7 +278,7 @@ index 4ad3a4403f497f4b437209a9e63445f0d29b09f1..28ec1cc4dec6d12627761a58d635fd51
BlockPos blockposition = NaturalSpawner.getRandomPosWithin(world, chunk);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index e437dac193b6aa301b35b847647ca6004334a092..9ad1645c143d91ae9e08dfe3d875c9b0aa4d0844 100644
+index f779364a29ff91e47c44a99533acb9d387a72b48..8d7cf6e0e24d114570967b70a1685a253bbc0f9d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2279,6 +2279,11 @@ public final class CraftServer implements Server {
diff --git a/patches/server/0677-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch b/patches/server/0677-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch
index 6de737ae8f..e6c158e17d 100644
--- a/patches/server/0677-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch
+++ b/patches/server/0677-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch
@@ -44,10 +44,10 @@ index f3d169436ce05f1c56599cfe15a56671b7d13516..4d5ab1771129114ef1e4745c43a4fd18
public void close() throws IOException {
ByteBuffer bytebuffer = ByteBuffer.wrap(this.buf, 0, this.count);
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-index eeccc924dbba6f860245611eb943c9219471f670..c3bf911a76373dcd1c345a3091adefb0e550fd18 100644
+index 480dc0dc8892004edf00b51f57fc639e839453fa..0b17369dda00b415ed15c7215f222b891a1dc2ee 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-@@ -241,10 +241,17 @@ public class RegionFileStorage implements AutoCloseable {
+@@ -246,10 +246,17 @@ public class RegionFileStorage implements AutoCloseable {
try {
NbtIo.write(nbt, (DataOutput) dataoutputstream);
@@ -66,7 +66,7 @@ index eeccc924dbba6f860245611eb943c9219471f670..c3bf911a76373dcd1c345a3091adefb0
} catch (Throwable throwable1) {
throwable.addSuppressed(throwable1);
}
-@@ -252,10 +259,7 @@ public class RegionFileStorage implements AutoCloseable {
+@@ -257,10 +264,7 @@ public class RegionFileStorage implements AutoCloseable {
throw throwable;
}
@@ -77,8 +77,8 @@ index eeccc924dbba6f860245611eb943c9219471f670..c3bf911a76373dcd1c345a3091adefb0
+ // Paper - don't write garbage data to disk if writing serialization fails; move into try block to only write if successfully serialized
}
// Paper start - Chunk save reattempt
- return;
-@@ -301,4 +305,13 @@ public class RegionFileStorage implements AutoCloseable {
+ return;
+@@ -307,4 +311,13 @@ public class RegionFileStorage implements AutoCloseable {
}
}
diff --git a/patches/server/0818-Add-paper-dumplisteners-command.patch b/patches/server/0818-Add-paper-dumplisteners-command.patch
index 9669276c0a..ade83b3559 100644
--- a/patches/server/0818-Add-paper-dumplisteners-command.patch
+++ b/patches/server/0818-Add-paper-dumplisteners-command.patch
@@ -6,11 +6,11 @@ Subject: [PATCH] Add /paper dumplisteners command
Co-authored-by: TwoLeggedCat <[email protected]>
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
-index b7fc337ab2bbe3c6d80ed70834e294ab3a7f9dc2..05b29305f5e3018a662884c2ef1af5ae4f6867ee 100644
+index d105489b583aee849748cd13f8e95083ab27843e..e166c319812bf6bc3abd350394b2966228d6283e 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
-@@ -43,6 +43,7 @@ public final class PaperCommand extends Command {
- commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
+@@ -42,6 +42,7 @@ public final class PaperCommand extends Command {
+ commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand()); //
commands.put(Set.of("dumpitem"), new DumpItemCommand());
commands.put(Set.of("mobcaps", "playermobcaps"), new MobcapsCommand());
+ commands.put(Set.of("dumplisteners"), new DumpListenersCommand());
diff --git a/patches/server/0908-Only-capture-actual-tree-growth.patch b/patches/server/0908-Only-capture-actual-tree-growth.patch
index 56ff55e087..e513b361e9 100644
--- a/patches/server/0908-Only-capture-actual-tree-growth.patch
+++ b/patches/server/0908-Only-capture-actual-tree-growth.patch
@@ -29,10 +29,10 @@ index e14d928e8bf484c61f2687621623942a27f30db1..0fd5decb0790423aba80a7c1e55ce39a
}
entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index f4db64595f4434c9225923390c4fe7d7e0af6d26..a63beddef78967d13add0e62a97f03ec82f3fcc0 100644
+index 6bd2c70b1bfe27b22cbe5ac2ed1bba3dc4e6cd7d..7c57ffa9eb3a80977ed1cbc109bbaeeceb89fb94 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -1403,4 +1403,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -1361,6 +1361,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
}
// Paper end - respect global sound events gamerule
@@ -46,7 +46,9 @@ index f4db64595f4434c9225923390c4fe7d7e0af6d26..a63beddef78967d13add0e62a97f03ec
+ }
+ }
+ // Paper end - notify observers even if grow failed
- }
+ // Paper start
+ //protected final io.papermc.paper.world.EntitySliceManager entitySliceManager; // Paper - rewrite chunk system
+
diff --git a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java b/src/main/java/net/minecraft/world/level/block/SaplingBlock.java
index 7e6ee9c1ccef3eaa6b2edc39e414bd186426aee5..836c86104ed4f0d375330c9123af5d502efefa4d 100644
--- a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java
diff --git a/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch b/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch
index c518d54ea7..6ef49c0dae 100644
--- a/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch
+++ b/patches/server/0946-Do-not-read-tile-entities-in-chunks-that-are-positio.patch
@@ -10,10 +10,10 @@ which would cause a crash on Folia but would appear to function
fine on Paper.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
-index 1650541abeedce04ddeddfed15411b64a01be452..e45141ea0cc26c6c903edb5ff714bafa38d3189c 100644
+index 00e60bba33fe3e100070bb3ded55e5253a8db138..b7aa80f94ae2bbbc94ad335fd1d3078ee78ff2e4 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
-@@ -365,6 +365,13 @@ public class ChunkSerializer {
+@@ -363,6 +363,13 @@ public class ChunkSerializer {
for (int k1 = 0; k1 < nbttaglist3.size(); ++k1) {
CompoundTag nbttagcompound4 = nbttaglist3.getCompound(k1);
@@ -27,7 +27,7 @@ index 1650541abeedce04ddeddfed15411b64a01be452..e45141ea0cc26c6c903edb5ff714bafa
((ChunkAccess) object1).setBlockEntityNbt(nbttagcompound4);
}
-@@ -663,10 +670,19 @@ public class ChunkSerializer {
+@@ -661,10 +668,19 @@ public class ChunkSerializer {
CompoundTag nbttagcompound1 = nbttaglist1.getCompound(i);
boolean flag = nbttagcompound1.getBoolean("keepPacked");
diff --git a/patches/server/0999-Allow-Saving-of-Oversized-Chunks.patch b/patches/server/0999-Allow-Saving-of-Oversized-Chunks.patch
index 6a131f4dd4..1cba9cff01 100644
--- a/patches/server/0999-Allow-Saving-of-Oversized-Chunks.patch
+++ b/patches/server/0999-Allow-Saving-of-Oversized-Chunks.patch
@@ -141,7 +141,7 @@ index bc8038da65f834249c61a262fc1a5abb7cc91a63..6c89b92cac521808873e9e1eccc36369
private final ChunkPos pos;
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-index c3bf911a76373dcd1c345a3091adefb0e550fd18..6900e52d3e24ba64cebcd409b5fb3a8f5e15ef1d 100644
+index 0b17369dda00b415ed15c7215f222b891a1dc2ee..aa2ff1e4a07fc3d01414b8a1dbaccb4959e74670 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -144,6 +144,43 @@ public class RegionFileStorage implements AutoCloseable {
@@ -201,7 +201,7 @@ index c3bf911a76373dcd1c345a3091adefb0e550fd18..6900e52d3e24ba64cebcd409b5fb3a8f
CompoundTag nbttagcompound;
label43:
{
-@@ -241,6 +284,7 @@ public class RegionFileStorage implements AutoCloseable {
+@@ -246,6 +289,7 @@ public class RegionFileStorage implements AutoCloseable {
try {
NbtIo.write(nbt, (DataOutput) dataoutputstream);
diff --git a/patches/server/1000-Fix-World-isChunkGenerated-calls.patch b/patches/server/1000-Fix-World-isChunkGenerated-calls.patch
index 4221e0a841..105088ea4f 100644
--- a/patches/server/1000-Fix-World-isChunkGenerated-calls.patch
+++ b/patches/server/1000-Fix-World-isChunkGenerated-calls.patch
@@ -141,10 +141,10 @@ index 6c89b92cac521808873e9e1eccc363695275cd7a..92ba75254f6ffca40abd5485dbb4789d
this.padToFullSector();
} finally {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-index 6900e52d3e24ba64cebcd409b5fb3a8f5e15ef1d..eeb596a357ca9a18199596af665bc308ff706b70 100644
+index aa2ff1e4a07fc3d01414b8a1dbaccb4959e74670..0d4ca8629707ba5cee10ee94b330404291cd2c30 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-@@ -284,6 +284,7 @@ public class RegionFileStorage implements AutoCloseable {
+@@ -289,6 +289,7 @@ public class RegionFileStorage implements AutoCloseable {
try {
NbtIo.write(nbt, (DataOutput) dataoutputstream);
diff --git a/patches/server/1003-Optional-per-player-mob-spawns.patch b/patches/server/1003-Optional-per-player-mob-spawns.patch
index f17a8b939a..eb409a4359 100644
--- a/patches/server/1003-Optional-per-player-mob-spawns.patch
+++ b/patches/server/1003-Optional-per-player-mob-spawns.patch
@@ -39,10 +39,10 @@ index 3c24a700cb417f98bf94631d4c87e66cbdbbba57..b4611b21beb31b109cb5ecfa5aa03ac1
private static double euclideanDistanceSquared(ChunkPos pos, Entity entity) {
double d0 = (double) SectionPos.sectionToBlockCoord(pos.x, 8);
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 35f463e5237d12e42f7a8b8c177af3236d2e7986..25009accd401fc3860c57cac1ef628b233e746e7 100644
+index ab1a625bb3eb8f45648d387d324983154b12792c..e448f7088cc7691bd2125869feb7422a6b749429 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -533,7 +533,19 @@ public class ServerChunkCache extends ChunkSource {
+@@ -531,7 +531,19 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.popPush("naturalSpawnCount");
this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
int k = this.distanceManager.getNaturalSpawnChunkCount();
diff --git a/patches/server/1004-Anti-Xray.patch b/patches/server/1004-Anti-Xray.patch
index e732304ca4..d90bfc603c 100644
--- a/patches/server/1004-Anti-Xray.patch
+++ b/patches/server/1004-Anti-Xray.patch
@@ -1168,7 +1168,7 @@ index 34bd7e81f9480c97afd69c11eca216b03e6a5a1f..eae6121a2f3fb33146b0a625cc82c8bc
}
// 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 84761bacda56c7288f22e122560f24f4e25f3bf3..5dfec4d38444e48e3a4c9faf52d364a9fe421104 100644
+index 6d67582fe7108eefb88fd8ebce610c54ced12e7f..3805556aaef0a92fc043e9542876af897b1e3c3c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -177,6 +177,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1504,7 +1504,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 e45141ea0cc26c6c903edb5ff714bafa38d3189c..bb5da9ddcd3030c8d6148902f3c649227430baab 100644
+index b7aa80f94ae2bbbc94ad335fd1d3078ee78ff2e4..d25b24eb03d9b2d92c159ac4d0f8039784af1748 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
@@ -71,7 +71,7 @@ import org.slf4j.Logger;
@@ -1516,7 +1516,7 @@ index e45141ea0cc26c6c903edb5ff714bafa38d3189c..bb5da9ddcd3030c8d6148902f3c64922
private static final Logger LOGGER = LogUtils.getLogger();
private static final String TAG_UPGRADE_DATA = "UpgradeData";
private static final String BLOCK_TICKS_TAG = "block_ticks";
-@@ -174,16 +174,20 @@ public class ChunkSerializer {
+@@ -172,16 +172,20 @@ public class ChunkSerializer {
if (k >= 0 && k < achunksection.length) {
Logger logger;
PalettedContainer datapaletteblock;
@@ -1539,7 +1539,7 @@ index e45141ea0cc26c6c903edb5ff714bafa38d3189c..bb5da9ddcd3030c8d6148902f3c64922
}
PalettedContainer object; // CraftBukkit - read/write
-@@ -196,7 +200,7 @@ public class ChunkSerializer {
+@@ -194,7 +198,7 @@ public class ChunkSerializer {
Objects.requireNonNull(logger);
object = ((DataResult<PalettedContainer<Holder<Biome>>>) dataresult).getOrThrow(false, logger::error); // CraftBukkit - decompile error
} else {
@@ -1548,7 +1548,7 @@ index e45141ea0cc26c6c903edb5ff714bafa38d3189c..bb5da9ddcd3030c8d6148902f3c64922
}
LevelChunkSection chunksection = new LevelChunkSection(datapaletteblock, (PalettedContainer) object); // CraftBukkit - read/write
-@@ -431,7 +435,7 @@ public class ChunkSerializer {
+@@ -429,7 +433,7 @@ public class ChunkSerializer {
// CraftBukkit start - read/write
private static Codec<PalettedContainer<Holder<Biome>>> makeBiomeCodecRW(Registry<Biome> iregistry) {
diff --git a/patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch
index 1f7922b7bd..1cb3a01b46 100644
--- a/patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch
+++ b/patches/server/1005-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch
@@ -37,10 +37,10 @@ index b4611b21beb31b109cb5ecfa5aa03ac15e16335a..e69e68ae3be2760c079338793f33c27f
// Paper end - Optional per player mob spawns
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 25009accd401fc3860c57cac1ef628b233e746e7..15139198a02e366c0bbfcd5495a21c48e05b3a23 100644
+index e448f7088cc7691bd2125869feb7422a6b749429..0fad2a160878d4883c88b889bd6ba00b144a2dcd 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -539,7 +539,17 @@ public class ServerChunkCache extends ChunkSource {
+@@ -537,7 +537,17 @@ public class ServerChunkCache extends ChunkSource {
if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled
// re-set mob counts
for (ServerPlayer player : this.level.players) {
diff --git a/patches/server/1006-Write-SavedData-IO-async.patch b/patches/server/1006-Write-SavedData-IO-async.patch
index 33814644c8..ff0b27ee04 100644
--- a/patches/server/1006-Write-SavedData-IO-async.patch
+++ b/patches/server/1006-Write-SavedData-IO-async.patch
@@ -26,10 +26,10 @@ index 513833c2ea23df5b079d157bc5cb89d5c9754c0b..9017907c0ec67a37a506f09b7e4499ce
this.threadPool.shutdown();
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 15139198a02e366c0bbfcd5495a21c48e05b3a23..3b0fd733e8fd9639362f251876bea814a2515618 100644
+index 0fad2a160878d4883c88b889bd6ba00b144a2dcd..5b5fe47650be05063c258209275819427f73a45c 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -467,6 +467,13 @@ public class ServerChunkCache extends ChunkSource {
+@@ -465,6 +465,13 @@ public class ServerChunkCache extends ChunkSource {
public void close(boolean save) { // Paper - rewrite chunk system
this.level.chunkTaskScheduler.chunkHolderManager.close(save, true); // Paper - rewrite chunk system
diff --git a/patches/server/1009-Improved-Watchdog-Support.patch b/patches/server/1009-Improved-Watchdog-Support.patch
index 589f10f399..ba9bb9759f 100644
--- a/patches/server/1009-Improved-Watchdog-Support.patch
+++ b/patches/server/1009-Improved-Watchdog-Support.patch
@@ -291,7 +291,7 @@ index f5829ae484d93b547a5437b85a9621346384a11b..83701fbfaa56a232593ee8f11a3afb89
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 5dfec4d38444e48e3a4c9faf52d364a9fe421104..31c01e222e6223d84f9a3b6e9fc0b3bb42e3fe0b 100644
+index 3805556aaef0a92fc043e9542876af897b1e3c3c..a7e9faed6873def24986d1d010b797b9c4999024 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -940,6 +940,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -468,7 +468,7 @@ index e3b262add194a126e731c68e68f3139a00cacacb..da7d5efd76c9ef92e9ce22860fec7918
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 a15749bcfb2b36a31801cb1a26b7181ce304e0ee..dca163ff5436f1007383c8261cac1ac7c0613f23 100644
+index de0ad206e8603a7d5b5d5ec3e87d5cab47714eb8..5c62604bdc1483c793677e803aecd7a62e7055f3 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;
@@ -504,7 +504,7 @@ index a15749bcfb2b36a31801cb1a26b7181ce304e0ee..dca163ff5436f1007383c8261cac1ac7
lastEarlyWarning = currentTime;
if (isLongTimeout) {
// Paper end
-@@ -137,9 +140,24 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+@@ -136,9 +139,24 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
if ( isLongTimeout )
{
diff --git a/patches/server/1021-Execute-chunk-tasks-mid-tick.patch b/patches/server/1021-Execute-chunk-tasks-mid-tick.patch
index 5eb7d636c5..cb33fb5e11 100644
--- a/patches/server/1021-Execute-chunk-tasks-mid-tick.patch
+++ b/patches/server/1021-Execute-chunk-tasks-mid-tick.patch
@@ -103,10 +103,10 @@ index 153c8994b2f3325c7772b763737ad694ba2b6ce6..2f89c5efa0decf792fd2cd079c1d2692
} else {
boolean ret = false; // Paper - force execution of all worlds, do not just bias the first
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 3b0fd733e8fd9639362f251876bea814a2515618..c2973fcfde402b5432db37468e4a40a1a119cca1 100644
+index 5b5fe47650be05063c258209275819427f73a45c..585e3639ae54c9bb5a2e77181091ab634d53c558 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -583,6 +583,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -581,6 +581,7 @@ public class ServerChunkCache extends ChunkSource {
boolean flag1 = this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && this.level.getLevelData().getGameTime() % this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
Iterator iterator1 = list.iterator();
@@ -114,7 +114,7 @@ index 3b0fd733e8fd9639362f251876bea814a2515618..c2973fcfde402b5432db37468e4a40a1
while (iterator1.hasNext()) {
ServerChunkCache.ChunkAndHolder chunkproviderserver_a = (ServerChunkCache.ChunkAndHolder) iterator1.next();
LevelChunk chunk1 = chunkproviderserver_a.chunk;
-@@ -596,6 +597,7 @@ public class ServerChunkCache extends ChunkSource {
+@@ -594,6 +595,7 @@ public class ServerChunkCache extends ChunkSource {
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
this.level.tickChunk(chunk1, l);
@@ -151,7 +151,7 @@ index f24734f2a38eb5f2dc39f418a1f506a600127a79..3535f86b92c4e61fd84defbbf37e0746
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 84ed9046d337175352b1f40f3c8b78e0dbb434ce..7070457a13974f0b578dba014d90540896e0c227 100644
+index c07cfd8fdf056bb613ab5b64a58975d0ed9446ee..e221fe55d6ec5e77a82d33570a2ac1a77c221112 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -929,6 +929,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch
index db86c8271a..fbc2c7f3e0 100644
--- a/patches/server/1023-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch
+++ b/patches/server/1023-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 bb5da9ddcd3030c8d6148902f3c649227430baab..362516b6703dfa037954c55b8628074965240dff 100644
+index d25b24eb03d9b2d92c159ac4d0f8039784af1748..2a179e83f847e76a6a57f55aedcc324f987bd398 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
@@ -70,6 +70,18 @@ import net.minecraft.world.ticks.ProtoChunkTicks;
@@ -32,7 +32,7 @@ index bb5da9ddcd3030c8d6148902f3c649227430baab..362516b6703dfa037954c55b86280749
public static final Codec<PalettedContainer<BlockState>> BLOCK_STATE_CODEC = PalettedContainer.codecRW(Block.BLOCK_STATE_REGISTRY, BlockState.CODEC, PalettedContainer.Strategy.SECTION_STATES, Blocks.AIR.defaultBlockState(), null); // Paper - Anti-Xray - Add preset block states
private static final Logger LOGGER = LogUtils.getLogger();
-@@ -457,7 +469,7 @@ public class ChunkSerializer {
+@@ -455,7 +467,7 @@ public class ChunkSerializer {
nbttagcompound.putInt("xPos", chunkcoordintpair.x);
nbttagcompound.putInt("yPos", chunk.getMinSection());
nbttagcompound.putInt("zPos", chunkcoordintpair.z);
@@ -42,7 +42,7 @@ index bb5da9ddcd3030c8d6148902f3c649227430baab..362516b6703dfa037954c55b86280749
nbttagcompound.putString("Status", BuiltInRegistries.CHUNK_STATUS.getKey(chunk.getStatus()).toString());
BlendingData blendingdata = chunk.getBlendingData();
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
-index cccc3741227402b24c76d31a339d01323610b9f0..2f7c9e0e62599688c0ed2e05444bce5040035a99 100644
+index 0334924169de23f8b4f4e3b9b773d5e501e76a32..9be8dc63fc01ae6d43d9f22fbfce25c4e2af247b 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
@@ -41,7 +41,7 @@ public class ChunkStorage implements AutoCloseable {
@@ -685,7 +685,7 @@ index 92ba75254f6ffca40abd5485dbb4789de59edebd..6cf83502a954cce9c562ec036bfeddb4
return bytebuffer;
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
-index eeb596a357ca9a18199596af665bc308ff706b70..30d4efc896fe8b2ec0e8b091045c7d07f952b00b 100644
+index 0d4ca8629707ba5cee10ee94b330404291cd2c30..1e97e2696c953e87a7bbde4a0016bdf55ded5241 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -24,6 +24,7 @@ public class RegionFileStorage implements AutoCloseable {
diff --git a/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch b/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch
index df963d6ee9..9ee90956c9 100644
--- a/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch
+++ b/patches/server/1025-Detail-more-information-in-watchdog-dumps.patch
@@ -204,7 +204,7 @@ index b4b8baa0bc303c5bdb7175fcdf00a70c446cd452..7e51a93ac779a6119a09b5b5f0428751
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 dca163ff5436f1007383c8261cac1ac7c0613f23..40dcdf6885e99b26283a9ea2bd4d4bf6ec358e71 100644
+index 5c62604bdc1483c793677e803aecd7a62e7055f3..69c0918c4baa193d49b55bc890d03a89c78a74c5 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -22,6 +22,78 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
@@ -286,10 +286,10 @@ index dca163ff5436f1007383c8261cac1ac7c0613f23..40dcdf6885e99b26283a9ea2bd4d4bf6
private WatchdogThread(long timeoutTime, boolean restart)
{
super( "Paper Watchdog Thread" );
-@@ -120,6 +192,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
+@@ -119,6 +191,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
log.log( Level.SEVERE, "------------------------------" );
log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
- io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
+ io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
+ this.dumpTickingInfo(); // Paper - log detailed tick information
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
log.log( Level.SEVERE, "------------------------------" );
diff --git a/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch b/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch
index 60448b2f46..0c4cd1212b 100644
--- a/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch
+++ b/patches/server/1030-Add-Alternate-Current-redstone-implementation.patch
@@ -2034,13 +2034,13 @@ index 5eaf8585df1f885f4a08fdd06ff4bb730961e400..ab2e84f85da7931e133ad5f0d2686cd1
EntityCallbacks() {}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index da4e2c9572d602bb622cbe0dc46b842fd62d0a0b..504b22fe308611c60520d4f1fda18c5656b544d6 100644
+index 5e6caf9ca811a2fbca4ac93f6c61d3d8606e02db..b33bb001a48788e727e2f01788a6163024121bf3 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -1897,4 +1897,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
- }
+@@ -1896,4 +1896,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+ return ret;
}
- // Paper end - notify observers even if grow failed
+ // Paper end
+ // Paper start - optimize redstone (Alternate Current)
+ public alternate.current.wire.WireHandler getWireHandler() {
+ // This method is overridden in ServerLevel.
diff --git a/patches/server/1036-Optimise-chunk-tick-iteration.patch b/patches/server/1036-Optimise-chunk-tick-iteration.patch
index 6120a7359b..31e9d1bc60 100644
--- a/patches/server/1036-Optimise-chunk-tick-iteration.patch
+++ b/patches/server/1036-Optimise-chunk-tick-iteration.patch
@@ -187,10 +187,10 @@ index c80a625f7289e3bb33c6851d2072957e153ca1fb..7c425ac50c83757b66a2178bc19d4c92
public String getDebugStatus() {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index c2973fcfde402b5432db37468e4a40a1a119cca1..77a2458b8acb21c64676934cd8d6b05ef6351c10 100644
+index 585e3639ae54c9bb5a2e77181091ab634d53c558..ce1cee91351d2665437573b0d756420769637fa0 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -523,18 +523,10 @@ public class ServerChunkCache extends ChunkSource {
+@@ -521,18 +521,10 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.push("pollingChunks");
gameprofilerfiller.push("filteringLoadedChunks");
@@ -211,7 +211,7 @@ index c2973fcfde402b5432db37468e4a40a1a119cca1..77a2458b8acb21c64676934cd8d6b05e
if (this.level.getServer().tickRateManager().runsNormally()) {
gameprofilerfiller.popPush("naturalSpawnCount");
-@@ -569,38 +561,109 @@ public class ServerChunkCache extends ChunkSource {
+@@ -567,38 +559,109 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.popPush("spawnAndTick");
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
@@ -337,7 +337,7 @@ index c2973fcfde402b5432db37468e4a40a1a119cca1..77a2458b8acb21c64676934cd8d6b05e
this.level.timings.chunkTicks.stopTiming(); // Paper
gameprofilerfiller.popPush("customSpawners");
-@@ -612,11 +675,23 @@ public class ServerChunkCache extends ChunkSource {
+@@ -610,11 +673,23 @@ public class ServerChunkCache extends ChunkSource {
}
gameprofilerfiller.popPush("broadcast");
diff --git a/scripts/moveback.py b/scripts/moveback.py
index 6dec9e0759..6135e33d8b 100644
--- a/scripts/moveback.py
+++ b/scripts/moveback.py
@@ -2,8 +2,8 @@ import os
import sys
# Use inside of server patch dir
-# py ../../scripts/moveback.py ''
-patch_target = 100 # TODO: Update this
+# py ../../scripts/moveback.py 'Rewrite chunk system'
+patch_target = 400 # TODO: Update this
def increment_number(filename):