aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2021-12-10 15:24:07 +0100
committerGitHub <[email protected]>2021-12-10 15:24:07 +0100
commit1c779c2d2eca9cf83bb08deb68e2209666d64d9c (patch)
tree2f24a42de86d25f70fdd55fe114a0271d8913717
parentdce79f333c1f3f60335163d8fe1050d424722a92 (diff)
downloadPaper-1c779c2d2eca9cf83bb08deb68e2209666d64d9c.tar.gz
Paper-1c779c2d2eca9cf83bb08deb68e2209666d64d9c.zip
Update to 1.18.1 (#7076)
-rw-r--r--build.gradle.kts2
-rw-r--r--gradle.properties4
-rw-r--r--patches/api/0001-Convert-project-to-Gradle.patch4
-rw-r--r--patches/server/0001-Setup-Gradle-project.patch4
-rw-r--r--patches/server/0003-Build-system-changes.patch4
-rw-r--r--patches/server/0004-Paper-config-files.patch6
-rw-r--r--patches/server/0005-MC-Dev-fixes.patch4
-rw-r--r--patches/server/0006-MC-Utils.patch50
-rw-r--r--patches/server/0010-Timings-v2.patch54
-rw-r--r--patches/server/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch4
-rw-r--r--patches/server/0012-Adventure.patch22
-rw-r--r--patches/server/0020-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch4
-rw-r--r--patches/server/0027-Entity-Origin-API.patch4
-rw-r--r--patches/server/0036-Disable-thunder.patch4
-rw-r--r--patches/server/0037-Disable-ice-and-snow.patch4
-rw-r--r--patches/server/0047-Ensure-commands-are-not-ran-async.patch4
-rw-r--r--patches/server/0056-Add-exception-reporting-event.patch8
-rw-r--r--patches/server/0061-Complete-resource-pack-API.patch4
-rw-r--r--patches/server/0065-Handle-Item-Meta-Inconsistencies.patch12
-rw-r--r--patches/server/0067-Add-World-Util-Methods.patch4
-rw-r--r--patches/server/0071-Configurable-spawn-chances-for-skeleton-horses.patch4
-rw-r--r--patches/server/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch6
-rw-r--r--patches/server/0074-Entity-AddTo-RemoveFrom-World-Events.patch6
-rw-r--r--patches/server/0076-EntityPathfindEvent.patch10
-rw-r--r--patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch4
-rw-r--r--patches/server/0091-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch6
-rw-r--r--patches/server/0098-Add-server-name-parameter.patch4
-rw-r--r--patches/server/0105-Configurable-packet-in-spam-threshold.patch4
-rw-r--r--patches/server/0106-Configurable-flying-kick-messages.patch6
-rw-r--r--patches/server/0116-Prevent-Pathfinding-out-of-World-Border.patch4
-rw-r--r--patches/server/0120-Optimize-ItemStack.isEmpty.patch4
-rw-r--r--patches/server/0123-Properly-fix-item-duplication-bug.patch4
-rw-r--r--patches/server/0133-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch6
-rw-r--r--patches/server/0135-Add-option-to-make-parrots-stay-on-shoulders-despite.patch4
-rw-r--r--patches/server/0137-Use-TerminalConsoleAppender-for-console-improvements.patch8
-rw-r--r--patches/server/0152-Fix-this-stupid-bullshit.patch4
-rw-r--r--patches/server/0159-Add-PlayerJumpEvent.patch4
-rw-r--r--patches/server/0160-handle-PacketPlayInKeepAlive-async.patch4
-rw-r--r--patches/server/0162-revert-serverside-behavior-of-keepalives.patch4
-rw-r--r--patches/server/0169-AsyncTabCompleteEvent.patch6
-rw-r--r--patches/server/0172-PlayerNaturallySpawnCreaturesEvent.patch6
-rw-r--r--patches/server/0193-Fix-exploit-that-allowed-colored-signs-to-be-created.patch4
-rw-r--r--patches/server/0197-Expand-World.spawnParticle-API-and-add-Builder.patch4
-rw-r--r--patches/server/0219-InventoryCloseEvent-Reason-API.patch10
-rw-r--r--patches/server/0221-Refresh-player-inventory-when-cancelling-PlayerInter.patch4
-rw-r--r--patches/server/0239-Break-up-and-make-tab-spam-limits-configurable.patch6
-rw-r--r--patches/server/0242-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch16
-rw-r--r--patches/server/0258-Asynchronous-chunk-IO-and-loading.patch40
-rw-r--r--patches/server/0262-Allow-chests-to-be-placed-with-NBT-data.patch4
-rw-r--r--patches/server/0283-Add-option-to-prevent-players-from-moving-into-unloa.patch10
-rw-r--r--patches/server/0286-Improve-Server-Thread-Pool-and-Thread-Priorities.patch8
-rw-r--r--patches/server/0291-Don-t-allow-digging-into-unloaded-chunks.patch4
-rw-r--r--patches/server/0297-Book-Size-Limits.patch4
-rw-r--r--patches/server/0306-Implement-Brigadier-Mojang-API.patch8
-rw-r--r--patches/server/0308-Limit-Client-Sign-length-more.patch4
-rw-r--r--patches/server/0315-Entity-getEntitySpawnReason.patch6
-rw-r--r--patches/server/0316-Update-entity-Metadata-for-all-tracked-players.patch4
-rw-r--r--patches/server/0325-Fix-CB-call-to-changed-postToMainThread-method.patch4
-rw-r--r--patches/server/0330-Configurable-Keep-Spawn-Loaded-range-per-world.patch6
-rw-r--r--patches/server/0335-Fix-World-isChunkGenerated-calls.patch4
-rw-r--r--patches/server/0342-Dont-send-unnecessary-sign-update.patch4
-rw-r--r--patches/server/0344-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch4
-rw-r--r--patches/server/0348-Duplicate-UUID-Resolve-Option.patch8
-rw-r--r--patches/server/0349-Optimize-Hoppers.patch4
-rw-r--r--patches/server/0354-Optimise-IEntityAccess-getPlayerByUUID.patch4
-rw-r--r--patches/server/0360-Entity-Activation-Range-2.0.patch24
-rw-r--r--patches/server/0363-Anti-Xray.patch16
-rw-r--r--patches/server/0365-Tracking-Range-Improvements.patch4
-rw-r--r--patches/server/0371-Add-debug-for-sync-chunk-loads.patch6
-rw-r--r--patches/server/0372-Allow-overriding-the-java-version-check.patch4
-rw-r--r--patches/server/0378-Prevent-teleporting-dead-entities.patch4
-rw-r--r--patches/server/0390-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch14
-rw-r--r--patches/server/0396-Improved-Watchdog-Support.patch10
-rw-r--r--patches/server/0397-Optimize-Pathfinding.patch4
-rw-r--r--patches/server/0406-Fix-Chunk-Post-Processing-deadlock-risk.patch6
-rw-r--r--patches/server/0407-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch6
-rw-r--r--patches/server/0408-Load-Chunks-for-Login-Asynchronously.patch8
-rw-r--r--patches/server/0415-Validate-PickItem-Packet-and-kick-for-invalid.patch4
-rw-r--r--patches/server/0418-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch4
-rw-r--r--patches/server/0432-Reduce-allocation-of-Vec3D-by-entity-tracker.patch4
-rw-r--r--patches/server/0435-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch6
-rw-r--r--patches/server/0436-Use-distance-map-to-optimise-entity-tracker.patch14
-rw-r--r--patches/server/0437-Optimize-ServerLevels-chunk-level-checking-methods.patch4
-rw-r--r--patches/server/0446-Prevent-position-desync-in-playerconnection-causing-.patch4
-rw-r--r--patches/server/0449-Add-and-implement-PlayerRecipeBookClickEvent.patch4
-rw-r--r--patches/server/0451-Add-permission-for-command-blocks.patch8
-rw-r--r--patches/server/0453-Fix-Per-World-Difficulty-Remembering-Difficulty.patch4
-rw-r--r--patches/server/0459-incremental-chunk-and-player-saving.patch26
-rw-r--r--patches/server/0469-Update-itemstack-legacy-name-and-lore.patch10
-rw-r--r--patches/server/0473-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch18
-rw-r--r--patches/server/0478-Move-range-check-for-block-placing-up.patch6
-rw-r--r--patches/server/0487-Brand-support.patch8
-rw-r--r--patches/server/0491-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch4
-rw-r--r--patches/server/0493-Improve-Chunk-Status-Transition-Speed.patch6
-rw-r--r--patches/server/0500-PortalCreateEvent-needs-to-know-its-entity.patch4
-rw-r--r--patches/server/0506-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch6
-rw-r--r--patches/server/0509-Extend-block-drop-capture-to-capture-all-items-added.patch6
-rw-r--r--patches/server/0517-Fix-for-large-move-vectors-crashing-server.patch10
-rw-r--r--patches/server/0534-Add-API-for-quit-reason.patch8
-rw-r--r--patches/server/0547-Limit-recipe-packets.patch6
-rw-r--r--patches/server/0564-Fix-interact-event-not-being-called-in-adventure.patch6
-rw-r--r--patches/server/0578-Remove-stale-POIs.patch4
-rw-r--r--patches/server/0589-Added-firing-of-PlayerChangeBeaconEffectEvent.patch5
-rw-r--r--patches/server/0596-EntityMoveEvent.patch4
-rw-r--r--patches/server/0597-added-option-to-disable-pathfinding-updates-on-block.patch12
-rw-r--r--patches/server/0616-Allow-using-signs-inside-spawn-protection.patch6
-rw-r--r--patches/server/0624-Don-t-ignore-result-of-PlayerEditBookEvent.patch4
-rw-r--r--patches/server/0628-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch6
-rw-r--r--patches/server/0639-fix-PlayerItemHeldEvent-firing-twice.patch4
-rw-r--r--patches/server/0646-add-RespawnFlags-to-PlayerRespawnEvent.patch6
-rw-r--r--patches/server/0650-Add-EntityBlockStorage-clearEntities.patch4
-rw-r--r--patches/server/0659-additions-to-PlayerGameModeChangeEvent.patch8
-rw-r--r--patches/server/0667-Add-cause-to-Weather-ThunderChangeEvents.patch8
-rw-r--r--patches/server/0670-Add-PlayerKickEvent-causes.patch52
-rw-r--r--patches/server/0687-Ensure-disconnect-for-book-edit-is-called-on-main.patch4
-rw-r--r--patches/server/0689-Use-getChunkIfLoadedImmediately-in-places.patch10
-rw-r--r--patches/server/0691-Adds-PlayerArmSwingEvent.patch4
-rw-r--r--patches/server/0692-Fixes-kick-event-leave-message-not-being-sent.patch10
-rw-r--r--patches/server/0704-Improve-boat-collision-performance.patch4
-rw-r--r--patches/server/0705-Prevent-AFK-kick-while-watching-end-credits.patch4
-rw-r--r--patches/server/0711-Added-EntityDamageItemEvent.patch12
-rw-r--r--patches/server/0725-Add-methods-to-find-targets-for-lightning-strikes.patch6
-rw-r--r--patches/server/0739-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch4
-rw-r--r--patches/server/0742-Fix-chunks-refusing-to-unload-at-low-TPS.patch4
-rw-r--r--patches/server/0743-Do-not-allow-ticket-level-changes-while-unloading-pl.patch8
-rw-r--r--patches/server/0745-Do-not-submit-profile-lookups-to-worldgen-threads.patch4
-rw-r--r--patches/server/0753-Rewrite-entity-bounding-box-lookup-calls.patch4
-rw-r--r--patches/server/0755-Execute-chunk-tasks-mid-tick.patch4
-rw-r--r--patches/server/0756-Do-not-copy-visible-chunks.patch24
-rw-r--r--patches/server/0759-Detail-more-information-in-watchdog-dumps.patch6
-rw-r--r--patches/server/0773-Oprimise-map-impl-for-tracked-players.patch4
-rw-r--r--patches/server/0776-Optimise-random-block-ticking.patch8
-rw-r--r--patches/server/0778-Optimise-nearby-player-lookups.patch8
-rw-r--r--patches/server/0779-Optimise-WorldServer-notify.patch48
-rw-r--r--patches/server/0783-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch4
-rw-r--r--patches/server/0787-Fix-merchant-inventory-not-closing-on-entity-removal.patch4
-rw-r--r--patches/server/0789-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch4
-rw-r--r--patches/server/0797-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch6
-rw-r--r--patches/server/0813-Remove-client-side-code-using-deprecated-for-removal.patch6
-rw-r--r--patches/server/0826-Optimise-collision-checking-in-player-move-packet-ha.patch18
-rw-r--r--patches/server/0827-Actually-unload-POI-data.patch12
-rw-r--r--patches/server/0829-Don-t-disable-log4j-lookups.patch19
-rw-r--r--patches/server/0829-Update-Log4j.patch (renamed from patches/server/0830-Update-Log4j.patch)0
m---------work/Bukkit0
m---------work/CraftBukkit0
m---------work/Spigot0
146 files changed, 565 insertions, 585 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 796cd83277..4d72246c80 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -46,7 +46,7 @@ repositories {
}
dependencies {
- paramMappings("net.fabricmc:yarn:1.18+build.1:mergedv2")
+ paramMappings("net.fabricmc:yarn:1.18.1+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.7.0:fat")
decompiler("net.minecraftforge:forgeflower:1.5.498.22")
paperclip("io.papermc:paperclip:3.0.2")
diff --git a/gradle.properties b/gradle.properties
index 7d23481854..a0297b8e1f 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,7 +1,7 @@
group=io.papermc.paper
-version=1.18-R0.1-SNAPSHOT
+version=1.18.1-R0.1-SNAPSHOT
-mcVersion=1.18
+mcVersion=1.18.1
org.gradle.caching=true
org.gradle.parallel=true
diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch
index 54e916367b..a623f130c6 100644
--- a/patches/api/0001-Convert-project-to-Gradle.patch
+++ b/patches/api/0001-Convert-project-to-Gradle.patch
@@ -99,7 +99,7 @@ index 0000000000000000000000000000000000000000..1b16a242187079f80720fc1990ee09bb
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
-index 236c9e76bbbb6db5eafd03b1468ecf9fac3416fc..0000000000000000000000000000000000000000
+index 0e69806e4b6fa44d1d2f8ebf1cf0dc4ef386e69e..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,262 +0,0 @@
@@ -110,7 +110,7 @@ index 236c9e76bbbb6db5eafd03b1468ecf9fac3416fc..00000000000000000000000000000000
-
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId>
-- <version>1.18-R0.1-SNAPSHOT</version>
+- <version>1.18.1-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>Spigot-API</name>
diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch
index 3461bd14d8..d03b406f5b 100644
--- a/patches/server/0001-Setup-Gradle-project.patch
+++ b/patches/server/0001-Setup-Gradle-project.patch
@@ -175,7 +175,7 @@ index 0000000000000000000000000000000000000000..9c4382ef7373110b6e72163779316ff4
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
-index 1ab6e8bd68a3fff2ec8795da099e4f8cce8b62ca..0000000000000000000000000000000000000000
+index 56938962e9ba6b188c2f4bc1694b911f05994436..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,540 +0,0 @@
@@ -185,7 +185,7 @@ index 1ab6e8bd68a3fff2ec8795da099e4f8cce8b62ca..00000000000000000000000000000000
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot</artifactId>
- <packaging>jar</packaging>
-- <version>1.18-R0.1-SNAPSHOT</version>
+- <version>1.18.1-R0.1-SNAPSHOT</version>
- <name>Spigot</name>
- <url>https://www.spigotmc.org/</url>
-
diff --git a/patches/server/0003-Build-system-changes.patch b/patches/server/0003-Build-system-changes.patch
index 3dab42d346..151fe3a360 100644
--- a/patches/server/0003-Build-system-changes.patch
+++ b/patches/server/0003-Build-system-changes.patch
@@ -39,10 +39,10 @@ index 9c4382ef7373110b6e72163779316ff40234a992..bba267ecca0121df22fdfa6096101786
for (tld in setOf("net", "com", "org")) {
attributes("$tld/bukkit", "Sealed" to true)
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index dd755cbbf65614c010cc178d8945cf918b7be326..56f102a7b749a6294056d0f2db175f13970248a9 100644
+index 21713baa2db85a49dae0fa7675776b029f8bf4c9..ec50a122331b2ceb19822273f89f32b66a9f7db0 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
-@@ -192,7 +192,7 @@ public class Main {
+@@ -190,7 +190,7 @@ public class Main {
}
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
diff --git a/patches/server/0004-Paper-config-files.patch b/patches/server/0004-Paper-config-files.patch
index 9ecbf0d379..d3790dfa4e 100644
--- a/patches/server/0004-Paper-config-files.patch
+++ b/patches/server/0004-Paper-config-files.patch
@@ -591,7 +591,7 @@ index 0000000000000000000000000000000000000000..4adf44026fc6269934dfa4513f06a7f8
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
-index dc2cb18ec926e2eed1caa8e2106e70bcb04f6c0f..a497b281d03c097587b21e9f141a6a66f36e4dad 100644
+index 82d04f803201e39b48cd514cd8d9e2b90b28c1d4..156fa293626119caf0cf414505fdf0e96eaa08b7 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -106,6 +106,12 @@ public class Main {
@@ -777,10 +777,10 @@ index ae0e8dc6fd3f8323c34df83450a16fc3c44a9e5e..980e5abe159ebfdf5334332b8d8201c0
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 56f102a7b749a6294056d0f2db175f13970248a9..45b0da909136989d60c47bbff2ad9962f5c7f170 100644
+index ec50a122331b2ceb19822273f89f32b66a9f7db0..2bd2f436d5514b5e9bbc8bbd27ead4d4cb529b4f 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
-@@ -131,6 +131,14 @@ public class Main {
+@@ -129,6 +129,14 @@ public class Main {
.defaultsTo(new File("spigot.yml"))
.describedAs("Yml file");
// Spigot End
diff --git a/patches/server/0005-MC-Dev-fixes.patch b/patches/server/0005-MC-Dev-fixes.patch
index ef93a30268..62c73e1c0f 100644
--- a/patches/server/0005-MC-Dev-fixes.patch
+++ b/patches/server/0005-MC-Dev-fixes.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index 486d01f5cb69c58878ad7d2fa06ee1154486e55d..58dbe9077fc12964477d6a6fb57d67c41865412c 100644
+index 820ba0832fb2a7afe37f461a126e90613d775ff4..1851b36f978330651627f902f1c123337cdf9075 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
-@@ -345,7 +345,7 @@ public class Util {
+@@ -354,7 +354,7 @@ public class Util {
}
public static <K> Strategy<K> identityStrategy() {
diff --git a/patches/server/0006-MC-Utils.patch b/patches/server/0006-MC-Utils.patch
index 3c88d8e77d..d701fb42b4 100644
--- a/patches/server/0006-MC-Utils.patch
+++ b/patches/server/0006-MC-Utils.patch
@@ -4414,10 +4414,10 @@ index 0000000000000000000000000000000000000000..4d3dc8fba51bf5c0dceb06744781d1df
+ }
+}
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index 58dbe9077fc12964477d6a6fb57d67c41865412c..3ed0bf0485266c0a2b459f5cc1940f85f74e3624 100644
+index 1851b36f978330651627f902f1c123337cdf9075..5c57a6607f1a95ac4d8770d0429d6848351f5452 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
-@@ -98,7 +98,7 @@ public class Util {
+@@ -107,7 +107,7 @@ public class Util {
}
public static long getNanos() {
@@ -5285,7 +5285,7 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
+ // 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 fa2ff0d8e7f6015200dded40335fe6245d9c6bcf..e4d2771e86a0de4ea8bd08ca5811ce7a2e38c7d1 100644
+index 6628fd9cff01a3ddb736ec829566afcd08a7f95e..f3a2a5dcd18d8abe370779f75106eacab498c3b6 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -59,6 +59,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket;
@@ -5364,7 +5364,7 @@ index fa2ff0d8e7f6015200dded40335fe6245d9c6bcf..e4d2771e86a0de4ea8bd08ca5811ce7a
}
protected ChunkGenerator generator() {
-@@ -320,6 +375,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -282,6 +337,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -5379,7 +5379,7 @@ index fa2ff0d8e7f6015200dded40335fe6245d9c6bcf..e4d2771e86a0de4ea8bd08ca5811ce7a
private CompletableFuture<Either<List<ChunkAccess>, ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkPos centerChunk, int margin, IntFunction<ChunkStatus> distanceToStatus) {
List<CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>>> list = new ArrayList();
List<ChunkHolder> list1 = new ArrayList();
-@@ -420,6 +483,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -382,6 +445,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
holder.setTicketLevel(level);
} else {
holder = new ChunkHolder(new ChunkPos(pos), level, this.level, this.lightEngine, this.queueSorter, this);
@@ -5391,7 +5391,7 @@ index fa2ff0d8e7f6015200dded40335fe6245d9c6bcf..e4d2771e86a0de4ea8bd08ca5811ce7a
}
this.updatingChunkMap.put(pos, holder);
-@@ -545,7 +613,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -507,7 +575,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (completablefuture1 != completablefuture) {
this.scheduleUnload(pos, holder);
} else {
@@ -5406,7 +5406,7 @@ index fa2ff0d8e7f6015200dded40335fe6245d9c6bcf..e4d2771e86a0de4ea8bd08ca5811ce7a
if (ichunkaccess instanceof LevelChunk) {
((LevelChunk) ichunkaccess).setLoaded(false);
}
-@@ -560,7 +634,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -522,7 +596,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lightEngine.updateChunkStatus(ichunkaccess.getPos());
this.lightEngine.tryScheduleUpdate();
this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null);
@@ -5419,7 +5419,7 @@ index fa2ff0d8e7f6015200dded40335fe6245d9c6bcf..e4d2771e86a0de4ea8bd08ca5811ce7a
}
};
-@@ -1094,6 +1172,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1057,6 +1135,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!flag1) {
this.distanceManager.addPlayer(SectionPos.of((Entity) player), player);
}
@@ -5427,15 +5427,15 @@ index fa2ff0d8e7f6015200dded40335fe6245d9c6bcf..e4d2771e86a0de4ea8bd08ca5811ce7a
} else {
SectionPos sectionposition = player.getLastSectionPos();
-@@ -1101,6 +1180,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1064,6 +1143,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!flag2) {
this.distanceManager.removePlayer(sectionposition, player);
}
+ this.removePlayerFromDistanceMaps(player); // Paper - distance maps
}
- for (int k = i - this.viewDistance; k <= i + this.viewDistance; ++k) {
-@@ -1217,6 +1297,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ for (int k = i - this.viewDistance - 1; k <= i + this.viewDistance + 1; ++k) {
+@@ -1176,6 +1256,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -5444,7 +5444,7 @@ index fa2ff0d8e7f6015200dded40335fe6245d9c6bcf..e4d2771e86a0de4ea8bd08ca5811ce7a
}
@Override
-@@ -1419,7 +1501,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1379,7 +1461,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public class ChunkDistanceManager extends DistanceManager {
protected ChunkDistanceManager(Executor workerExecutor, Executor mainThreadExecutor) {
@@ -5875,18 +5875,10 @@ index d672c467267ef4d96184e104c35d0379116880db..be11caf7c0dcdb11e24cfb053cda45ac
@Override
public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 9812116e2f28d01423373990ecce0e5ab6229ce2..e66b4837498a8bfefabc4dd95e91ccfba67843e4 100644
+index 5ee375a81164bbf18b8fc8e4fec5869187438078..ce9ff034a281cd9cc76c26713b6d1eab3f6c9fe2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -9,6 +9,7 @@ import it.unimi.dsi.fastutil.longs.LongSet;
- import it.unimi.dsi.fastutil.longs.LongSets;
- import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry;
- import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
-+import it.unimi.dsi.fastutil.objects.Object2IntMap;
- import it.unimi.dsi.fastutil.objects.ObjectIterator;
- import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
- import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
-@@ -157,6 +158,7 @@ import org.bukkit.event.server.MapInitializeEvent;
+@@ -159,6 +159,7 @@ import org.bukkit.event.server.MapInitializeEvent;
import org.bukkit.event.weather.LightningStrikeEvent;
import org.bukkit.event.world.TimeSkipEvent;
// CraftBukkit end
@@ -5894,7 +5886,7 @@ index 9812116e2f28d01423373990ecce0e5ab6229ce2..e66b4837498a8bfefabc4dd95e91ccfb
public class ServerLevel extends Level implements WorldGenLevel {
-@@ -212,6 +214,96 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -215,6 +216,96 @@ public class ServerLevel extends Level implements WorldGenLevel {
return convertable.dimensionType;
}
@@ -6057,7 +6049,7 @@ index d679be6c3ce0d57fa2063a45baec1b108a0a2707..de5e18a331178da8f7e82aa2419a0ee6
public BlockState getBlockState(BlockPos pos) {
return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 46cc3dc2d9f51dac1b84941d7549080e24c057bc..5996549250d666405ab113403faeb422b6e38c8c 100644
+index baabc63258872c274ea790356a373f8baf326357..92acae1b00f06d47eb2d9326ba09d73c344a81b8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -217,9 +217,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -6120,7 +6112,7 @@ index e772ed45ba7cf366c6da0dc8b1bd3497d561473a..e9e97cf0b202c84252fb3bada9789019
@Override
public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index 0651d4d661aa52171f617f1dd844a89cb2d05e20..f286fcc2958a02c1e480b8fcf5d049bf0de27131 100644
+index 1dbfdf060294e8f322e45625cf981087b9fcdac7..f6c93812c30bd1637219c22c1a903e2ec93a9d72 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -238,6 +238,7 @@ public abstract class Mob extends LivingEntity {
@@ -6157,10 +6149,10 @@ index 6c3044b6194dfd3037389d717bbe6783f58b951d..457880c9e894a83d88505cf0b7235df9
super(type, world);
this.xpReward = 5;
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index 962c942c05fc02befef6c306df51c0b438dd1dab..566f1b8a0acd679b2f776db2e80458b1c532f97e 100644
+index 770520ace95a1fbc5bdaf5d9d62c09f0f7396602..8335880dbbb31a3f5d10c259b567baa0d5f381a1 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -728,6 +728,25 @@ public final class ItemStack {
+@@ -727,6 +727,25 @@ public final class ItemStack {
return this.tag != null ? this.tag.getList("Enchantments", 10) : new ListTag();
}
@@ -6186,7 +6178,7 @@ index 962c942c05fc02befef6c306df51c0b438dd1dab..566f1b8a0acd679b2f776db2e80458b1
public void setTag(@Nullable CompoundTag nbt) {
this.tag = nbt;
if (this.getItem().canBeDepleted()) {
-@@ -1128,6 +1147,7 @@ public final class ItemStack {
+@@ -1127,6 +1146,7 @@ public final class ItemStack {
// CraftBukkit start
@Deprecated
public void setItem(Item item) {
@@ -6965,7 +6957,7 @@ index 0000000000000000000000000000000000000000..909b2c98e7a9117d2f737245e4661792
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
-index 9d57eda5d5c16004776c2e23837425cfe9184476..b39819d579c548318f1539702fb2df97b052b63a 100644
+index 1befbe94f6e47caf60fbfd7719e4008805cca198..bcd17766cb0a2be11669ded7d339de1c565ab112 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -88,8 +88,17 @@ public final class CraftMagicNumbers implements UnsafeValues {
diff --git a/patches/server/0010-Timings-v2.patch b/patches/server/0010-Timings-v2.patch
index ecb4ddf8dc..96da31f793 100644
--- a/patches/server/0010-Timings-v2.patch
+++ b/patches/server/0010-Timings-v2.patch
@@ -1041,7 +1041,7 @@ index 4dd57007af218ba1c0e666117a49939c5884f2c6..a6cb949b6f048455acc50c897fdd93d3
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index e4d2771e86a0de4ea8bd08ca5811ce7a2e38c7d1..c8ba2eec9b1c07c9aba3d69d4f4501f1010de4e2 100644
+index f3a2a5dcd18d8abe370779f75106eacab498c3b6..67113f1bb622acde89c05d1ee0af88644f67e776 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,8 +1,10 @@
@@ -1055,7 +1055,7 @@ index e4d2771e86a0de4ea8bd08ca5811ce7a2e38c7d1..c8ba2eec9b1c07c9aba3d69d4f4501f1
import com.google.common.collect.Lists;
import com.google.common.collect.Queues;
import com.google.common.collect.Sets;
-@@ -690,11 +692,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -652,11 +654,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
private CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> scheduleChunkLoad(ChunkPos pos) {
return CompletableFuture.supplyAsync(() -> {
@@ -1073,7 +1073,7 @@ index e4d2771e86a0de4ea8bd08ca5811ce7a2e38c7d1..c8ba2eec9b1c07c9aba3d69d4f4501f1
boolean flag = nbttagcompound.contains("Status", 8);
if (flag) {
-@@ -705,7 +710,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -667,7 +672,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
ChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", pos);
@@ -1082,7 +1082,7 @@ index e4d2771e86a0de4ea8bd08ca5811ce7a2e38c7d1..c8ba2eec9b1c07c9aba3d69d4f4501f1
} catch (ReportedException reportedexception) {
Throwable throwable = reportedexception.getCause();
-@@ -822,6 +827,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -784,6 +789,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkStatus chunkstatus = ChunkHolder.getStatus(chunkHolder.getTicketLevel());
return !chunkstatus.isOrAfter(ChunkStatus.FULL) ? ChunkHolder.UNLOADED_CHUNK : either.mapLeft((ichunkaccess) -> {
@@ -1090,7 +1090,7 @@ index e4d2771e86a0de4ea8bd08ca5811ce7a2e38c7d1..c8ba2eec9b1c07c9aba3d69d4f4501f1
ChunkPos chunkcoordintpair = chunkHolder.getPos();
ProtoChunk protochunk = (ProtoChunk) ichunkaccess;
LevelChunk chunk;
-@@ -846,6 +852,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -808,6 +814,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
return chunk;
@@ -1098,7 +1098,7 @@ index e4d2771e86a0de4ea8bd08ca5811ce7a2e38c7d1..c8ba2eec9b1c07c9aba3d69d4f4501f1
});
}, (runnable) -> {
ProcessorHandle mailbox = this.mainThreadMailbox;
-@@ -1382,6 +1389,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1342,6 +1349,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
@@ -1106,7 +1106,7 @@ index e4d2771e86a0de4ea8bd08ca5811ce7a2e38c7d1..c8ba2eec9b1c07c9aba3d69d4f4501f1
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
-@@ -1406,14 +1414,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1366,14 +1374,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker.serverEntity.sendChanges();
}
}
@@ -1125,7 +1125,7 @@ index e4d2771e86a0de4ea8bd08ca5811ce7a2e38c7d1..c8ba2eec9b1c07c9aba3d69d4f4501f1
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 566c32a71054479257b7fba981507fa2559aa9e6..109d6638d8fe035498bd717c180c9143ff00e0ad 100644
+index be11caf7c0dcdb11e24cfb053cda45ac1867da63..8f5e9f1bdfd2e02512e1341f91b147b16e959e5b 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -528,13 +528,15 @@ public class ServerChunkCache extends ChunkSource {
@@ -1217,7 +1217,7 @@ index 566c32a71054479257b7fba981507fa2559aa9e6..109d6638d8fe035498bd717c180c9143
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b864447d98a 100644
+index ce9ff034a281cd9cc76c26713b6d1eab3f6c9fe2..ae090f58bec25270e55f8da37355351783e69a7f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1,6 +1,8 @@
@@ -1229,7 +1229,7 @@ index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b86
import com.google.common.collect.Lists;
import com.mojang.datafixers.DataFixer;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-@@ -150,7 +152,6 @@ import org.apache.logging.log4j.LogManager;
+@@ -151,7 +153,6 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Bukkit;
import org.bukkit.WeatherType;
@@ -1237,7 +1237,7 @@ index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b86
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.util.WorldUUID;
import org.bukkit.event.entity.CreatureSpawnEvent;
-@@ -422,7 +423,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -424,7 +425,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.updateSkyBrightness();
this.tickTime();
gameprofilerfiller.popPush("tickPending");
@@ -1246,7 +1246,7 @@ index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b86
if (!this.isDebug()) {
j = this.getGameTime();
gameprofilerfiller.push("blockTicks");
-@@ -431,12 +432,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -433,12 +434,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.fluidTicks.tick(j, 65536, this::tickFluid);
gameprofilerfiller.pop();
}
@@ -1264,7 +1264,7 @@ index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b86
gameprofilerfiller.popPush("blockEvents");
timings.doSounds.startTiming(); // Spigot
this.runBlockEvents();
-@@ -601,6 +606,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -603,6 +608,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
gameprofilerfiller.popPush("tickBlocks");
@@ -1272,7 +1272,7 @@ index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b86
if (randomTickSpeed > 0) {
LevelChunkSection[] achunksection = chunk.getSections();
int l = achunksection.length;
-@@ -633,6 +639,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -635,6 +641,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
@@ -1280,7 +1280,7 @@ index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b86
gameprofilerfiller.pop();
}
-@@ -867,14 +874,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -869,14 +876,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void tickNonPassenger(Entity entity) {
@@ -1304,7 +1304,7 @@ index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b86
entity.setOldPosAndRot();
ProfilerFiller gameprofilerfiller = this.getProfiler();
-@@ -893,7 +908,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -895,7 +910,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1);
}
@@ -1313,7 +1313,7 @@ index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b86
}
-@@ -935,6 +950,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -937,6 +952,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!savingDisabled) {
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit
@@ -1321,7 +1321,7 @@ index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b86
if (progressListener != null) {
progressListener.progressStartNoAbort(new TranslatableComponent("menu.savingLevel"));
}
-@@ -944,7 +960,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -946,7 +962,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
progressListener.progressStage(new TranslatableComponent("menu.savingChunks"));
}
@@ -1333,7 +1333,7 @@ index e66b4837498a8bfefabc4dd95e91ccfba67843e4..d78aeeff0d729284e60ffb72f7485b86
this.entityManager.saveAll();
} else {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 5996549250d666405ab113403faeb422b6e38c8c..d2d7d4f506b2eacc5672c5eace1c9b9cdf6c8167 100644
+index 92acae1b00f06d47eb2d9326ba09d73c344a81b8..01abf5d48f63d7456a0ca5043289f6a0de9d4a9d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -207,6 +207,7 @@ import org.bukkit.inventory.EquipmentSlot;
@@ -1344,7 +1344,7 @@ index 5996549250d666405ab113403faeb422b6e38c8c..d2d7d4f506b2eacc5672c5eace1c9b9c
// CraftBukkit end
public class ServerGamePacketListenerImpl implements ServerPlayerConnection, ServerGamePacketListener {
-@@ -286,7 +287,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -287,7 +288,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end
public void tick() {
@@ -1352,7 +1352,7 @@ index 5996549250d666405ab113403faeb422b6e38c8c..d2d7d4f506b2eacc5672c5eace1c9b9c
this.resetPosition();
this.player.xo = this.player.getX();
this.player.yo = this.player.getY();
-@@ -362,7 +362,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -363,7 +363,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
this.disconnect(new TranslatableComponent("multiplayer.disconnect.idling"));
}
@@ -1360,7 +1360,7 @@ index 5996549250d666405ab113403faeb422b6e38c8c..d2d7d4f506b2eacc5672c5eace1c9b9c
}
-@@ -1915,7 +1914,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1916,7 +1915,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end
private void handleCommand(String input) {
@@ -1369,7 +1369,7 @@ index 5996549250d666405ab113403faeb422b6e38c8c..d2d7d4f506b2eacc5672c5eace1c9b9c
// CraftBukkit start - whole method
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + input);
-@@ -1926,7 +1925,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1927,7 +1926,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.cserver.getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -1378,7 +1378,7 @@ index 5996549250d666405ab113403faeb422b6e38c8c..d2d7d4f506b2eacc5672c5eace1c9b9c
return;
}
-@@ -1939,7 +1938,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1940,7 +1939,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
return;
} finally {
@@ -1582,7 +1582,7 @@ index e9e97cf0b202c84252fb3bada97890198fcc6bb9..2a65e7ae49f2fc1d56cdace60f72b729
if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
this.hurt(DamageSource.DROWN, 1.0F);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 9e6a02a05ea20c21aed26ed4bc92488627febd4c..f4561232aa390d1c40216f2d5599ecf8720e60c2 100644
+index 84b462d5f3c9727f8da6d254e67a7a752c4508d3..a75171ecfd23df3f626ca651febb75da28079c2d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -83,7 +83,6 @@ import org.bukkit.Bukkit;
@@ -1667,7 +1667,7 @@ index d33c2d2ec285179614d21a255cea394682e4cc2c..65aedffad9bef4ab80eb835e9c05b6d4
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
public CraftPersistentDataContainer persistentDataContainer;
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 3f09451a04404231f1eaac0954c0ecf01b7507ea..127727c3b4b21c42c64b8616c9fccf7783a89a9c 100644
+index f263022e1d15e78b51cfd148cf024b9a8c761898..52eda58a085d0a7b6329dd4791e05edf2f644df3 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -661,6 +661,7 @@ public class LevelChunk extends ChunkAccess {
@@ -2114,7 +2114,7 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae
this.value = value;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
-index b39819d579c548318f1539702fb2df97b052b63a..a73185be22c73ffd746fe2abcfbf07796328960c 100644
+index bcd17766cb0a2be11669ded7d339de1c565ab112..afdf4bc63dfaa469a16701541332e5380a027c22 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -173,6 +173,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
diff --git a/patches/server/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch
index 1749863883..4ccda846c8 100644
--- a/patches/server/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch
+++ b/patches/server/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch
@@ -66,10 +66,10 @@ index 59e619f745f62dec5a5fe304bbea75690a0b1663..23cba4bd17742733659aef498aa39d12
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 45b0da909136989d60c47bbff2ad9962f5c7f170..c5a9e3be2ad799752649b0d4ffeef8a3644f6d7b 100644
+index 2bd2f436d5514b5e9bbc8bbd27ead4d4cb529b4f..dd115bd005604614e64a236ccf86a24882beb096 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
-@@ -138,6 +138,12 @@ public class Main {
+@@ -136,6 +136,12 @@ public class Main {
.ofType(File.class)
.defaultsTo(new File("paper.yml"))
.describedAs("Yml file");
diff --git a/patches/server/0012-Adventure.patch b/patches/server/0012-Adventure.patch
index 5975253de3..d1a2069c3f 100644
--- a/patches/server/0012-Adventure.patch
+++ b/patches/server/0012-Adventure.patch
@@ -1312,7 +1312,7 @@ index 925ffbddd5475be7fe00570d861b615f707434b4..a3436596d05547a60c9906c92f709bb5
// CraftBukkit end
this.chatVisibility = packet.chatVisibility();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index d2d7d4f506b2eacc5672c5eace1c9b9cdf6c8167..b38431701e9dd36e8e6eddac434b3cb88e0f23c8 100644
+index 01abf5d48f63d7456a0ca5043289f6a0de9d4a9d..8dfc214b57f77c86f3e3f52ef8b6058295bf7be9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -160,6 +160,8 @@ import org.apache.logging.log4j.LogManager;
@@ -1324,7 +1324,7 @@ index d2d7d4f506b2eacc5672c5eace1c9b9cdf6c8167..b38431701e9dd36e8e6eddac434b3cb8
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicInteger;
import net.minecraft.world.inventory.AbstractContainerMenu;
-@@ -383,21 +385,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -384,21 +386,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return this.server.isSingleplayerOwner(this.player.getGameProfile());
}
@@ -1357,7 +1357,7 @@ index d2d7d4f506b2eacc5672c5eace1c9b9cdf6c8167..b38431701e9dd36e8e6eddac434b3cb8
if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event);
-@@ -408,8 +413,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -409,8 +414,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return;
}
// Send the possibly modified leave message
@@ -1367,7 +1367,7 @@ index d2d7d4f506b2eacc5672c5eace1c9b9cdf6c8167..b38431701e9dd36e8e6eddac434b3cb8
// CraftBukkit end
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> {
-@@ -1665,9 +1669,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1666,9 +1670,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
*/
this.player.disconnect();
@@ -1382,7 +1382,7 @@ index d2d7d4f506b2eacc5672c5eace1c9b9cdf6c8167..b38431701e9dd36e8e6eddac434b3cb8
}
// CraftBukkit end
this.player.getTextFilter().leave();
-@@ -1849,7 +1855,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1850,7 +1856,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.handleCommand(s);
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin
@@ -1396,7 +1396,7 @@ index d2d7d4f506b2eacc5672c5eace1c9b9cdf6c8167..b38431701e9dd36e8e6eddac434b3cb8
Player player = this.getCraftPlayer();
AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server));
this.cserver.getPluginManager().callEvent(event);
-@@ -2639,30 +2650,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2640,30 +2651,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return;
}
@@ -1891,13 +1891,13 @@ index b66b88475178f5a20a689f1af9a06f7f8e50ff9b..8df699de4ddde3089324f347a82d913f
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index c5a9e3be2ad799752649b0d4ffeef8a3644f6d7b..3a7a3709eb5e68663e7f6734d39179c3f69e17c6 100644
+index dd115bd005604614e64a236ccf86a24882beb096..0c26dc0b060700323aca0a062b34d35e16a3ec9f 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
-@@ -21,6 +21,12 @@ public class Main {
- public static void main(String[] args) {
- System.setProperty("log4j2.formatMsgNoLookups", "true");
+@@ -19,6 +19,12 @@ public class Main {
+ public static boolean useConsole = true;
+ public static void main(String[] args) {
+ // Paper start
+ final String warnWhenLegacyFormattingDetected = String.join(".", "net", "kyori", "adventure", "text", "warnWhenLegacyFormattingDetected");
+ if (false && System.getProperty(warnWhenLegacyFormattingDetected) == null) {
@@ -3505,7 +3505,7 @@ index f9b7b8f7ccc95b73967a51420fd6ce88d80d75fe..0de5a46423ae0403dcbfca630dfd7c5a
boolean hadFormat = false;
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
-index a73185be22c73ffd746fe2abcfbf07796328960c..ec507e6ce6784441561d142dbdd145be80c66fcd 100644
+index afdf4bc63dfaa469a16701541332e5380a027c22..4a25660971042322b1f9322b906e2775e81a6f01 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -57,6 +57,33 @@ public final class CraftMagicNumbers implements UnsafeValues {
diff --git a/patches/server/0020-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0020-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
index b1433b7efd..e01dcd586c 100644
--- a/patches/server/0020-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
+++ b/patches/server/0020-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
@@ -45,10 +45,10 @@ index cf79b158c7fbbb3ccddd4472eceb27d6f238f489..cfdc78fe0820d47d8af055e844b08ea0
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 3a7a3709eb5e68663e7f6734d39179c3f69e17c6..6300161cafb6efed7a262fa6b0b17d2f471fb2bb 100644
+index 0c26dc0b060700323aca0a062b34d35e16a3ec9f..e6362865d1e7beac23e520ebd2deb8a356428045 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
-@@ -218,12 +218,25 @@ public class Main {
+@@ -216,12 +216,25 @@ public class Main {
deadline.add(Calendar.DAY_OF_YEAR, -14);
if (buildDate.before(deadline.getTime())) {
System.err.println("*** Error, this build is outdated ***");
diff --git a/patches/server/0027-Entity-Origin-API.patch b/patches/server/0027-Entity-Origin-API.patch
index b347996aa4..9fb06ca68c 100644
--- a/patches/server/0027-Entity-Origin-API.patch
+++ b/patches/server/0027-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 9584f09f44445d91ee259f2a50b1fecf718e18dc..f158ddd486fbd6081fef1592e916986462d01991 100644
+index ae090f58bec25270e55f8da37355351783e69a7f..50513abfb5009c22cfd6d8fcf20243f66bf2f53e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1983,6 +1983,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2016,6 +2016,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
entity.valid = true; // CraftBukkit
diff --git a/patches/server/0036-Disable-thunder.patch b/patches/server/0036-Disable-thunder.patch
index d39cbc6585..d9b3ca1d6a 100644
--- a/patches/server/0036-Disable-thunder.patch
+++ b/patches/server/0036-Disable-thunder.patch
@@ -19,10 +19,10 @@ index 5cae4a5caf9aba8c0e99f1cb6badc5e8374862c8..1a9b4b08ea906adbfa25c3963a463487
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 057285ca421dc7e9a0c6449238409eaf42235ef5..0fd9ad873ed681dab1b297bf5cdf700e43be2200 100644
+index 50513abfb5009c22cfd6d8fcf20243f66bf2f53e..afa067e314892fcb7a2b04c4f54c964f62ee2df5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -556,7 +556,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -558,7 +558,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.push("thunder");
BlockPos blockposition;
diff --git a/patches/server/0037-Disable-ice-and-snow.patch b/patches/server/0037-Disable-ice-and-snow.patch
index 22e656a978..85463155b2 100644
--- a/patches/server/0037-Disable-ice-and-snow.patch
+++ b/patches/server/0037-Disable-ice-and-snow.patch
@@ -19,10 +19,10 @@ index 1a9b4b08ea906adbfa25c3963a4634871d7ca2f6..ceb1602afb90fc0a23d6cc8d22fc85fa
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 0fd9ad873ed681dab1b297bf5cdf700e43be2200..032e1e08413f2d0f601cdc32fe12145e2c1fec5f 100644
+index afa067e314892fcb7a2b04c4f54c964f62ee2df5..c8ba29065b2e195bdb2570806763e299108725af 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -580,7 +580,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -582,7 +582,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
gameprofilerfiller.popPush("iceandsnow");
diff --git a/patches/server/0047-Ensure-commands-are-not-ran-async.patch b/patches/server/0047-Ensure-commands-are-not-ran-async.patch
index 67a69a8c77..2dff934b14 100644
--- a/patches/server/0047-Ensure-commands-are-not-ran-async.patch
+++ b/patches/server/0047-Ensure-commands-are-not-ran-async.patch
@@ -14,10 +14,10 @@ big slowdown in execution but throwing an exception at same time to raise awaren
that it is happening so that plugin authors can fix their code to stop executing commands async.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index b38431701e9dd36e8e6eddac434b3cb88e0f23c8..63ba639701b703392ce2be973e2a53ba76e4fd46 100644
+index 8dfc214b57f77c86f3e3f52ef8b6058295bf7be9..25117f4b7f6139688c1845a1dc257f7d5c268fde 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1852,6 +1852,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1853,6 +1853,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
if (!async && s.startsWith("/")) {
diff --git a/patches/server/0056-Add-exception-reporting-event.patch b/patches/server/0056-Add-exception-reporting-event.patch
index 384479522d..ee84d6b387 100644
--- a/patches/server/0056-Add-exception-reporting-event.patch
+++ b/patches/server/0056-Add-exception-reporting-event.patch
@@ -49,10 +49,10 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index c8ba2eec9b1c07c9aba3d69d4f4501f1010de4e2..13038723347cdbada65611d9de542d35d94084a0 100644
+index 67113f1bb622acde89c05d1ee0af88644f67e776..c72d19a903a5cbb48d38f493e00e8c54a8e23b9c 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -957,6 +957,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -919,6 +919,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return true;
} catch (Exception exception) {
ChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception);
@@ -108,7 +108,7 @@ index 4cde8d630a0951f297622af4ef781f5b3fabf9af..7044d8c71e85551e11bf2d96b767e088
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 50a2fdc1f51fe6ca5a62d17e36ed88ecf7d20473..c68ababd68a8c49be6dbef275b94f3f90320e10a 100644
+index ad4b29c96113d15b284aed78e5768588802e468c..731e1cefd2a9c829bfe82ec87038d9333ef21fb3 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 @@
@@ -151,7 +151,7 @@ index 81b61b6cc1e99328d4d339ca32895d1268c88ca7..28a7c53d98450cc79bee953411a18f50
}
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 9638e28077b5720745f6125805fbda702a804f74..d207e54019360f7f94bfa5301462fe3c8ac6758e 100644
+index 949d8cc16c91390ea573dd566bec566dc95efc18..3ba9f8d7dc12709670dcd94df5d82b8d44f983fa 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 @@
diff --git a/patches/server/0061-Complete-resource-pack-API.patch b/patches/server/0061-Complete-resource-pack-API.patch
index 4f57ff55ce..4441d7ac93 100644
--- a/patches/server/0061-Complete-resource-pack-API.patch
+++ b/patches/server/0061-Complete-resource-pack-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 63ba639701b703392ce2be973e2a53ba76e4fd46..59bf84ff2aac4f39c1027db9c32e3cf4accedcb1 100644
+index 25117f4b7f6139688c1845a1dc257f7d5c268fde..103d0afd73de68e3b07a9a4ef6d2f5af0a0e40c5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1634,8 +1634,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1635,8 +1635,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
this.disconnect(new TranslatableComponent("multiplayer.requiredTexturePrompt.disconnect"));
}
diff --git a/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch
index 1d936562f4..df1e94275b 100644
--- a/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch
+++ b/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch
@@ -18,10 +18,10 @@ For consistency, the old API methods now forward to use the
ItemMeta API equivalents, and should deprecate the old API's.
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index 566f1b8a0acd679b2f776db2e80458b1c532f97e..d342ae7b4fc1f682a885f0dca7b7fc222905490d 100644
+index 8335880dbbb31a3f5d10c259b567baa0d5f381a1..74e4990888d88f18cb3d800724d9156e9d1ae21d 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -13,6 +13,8 @@ import java.text.DecimalFormatSymbols;
+@@ -12,6 +12,8 @@ import java.text.DecimalFormatSymbols;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@@ -30,7 +30,7 @@ index 566f1b8a0acd679b2f776db2e80458b1c532f97e..d342ae7b4fc1f682a885f0dca7b7fc22
import java.util.Locale;
import java.util.Map.Entry;
import java.util.Optional;
-@@ -152,6 +154,23 @@ public final class ItemStack {
+@@ -151,6 +153,23 @@ public final class ItemStack {
return this.getItem().getTooltipImage(this);
}
@@ -54,7 +54,7 @@ index 566f1b8a0acd679b2f776db2e80458b1c532f97e..d342ae7b4fc1f682a885f0dca7b7fc22
public ItemStack(ItemLike item) {
this(item, 1);
}
-@@ -195,6 +214,7 @@ public final class ItemStack {
+@@ -194,6 +213,7 @@ public final class ItemStack {
// CraftBukkit start - make defensive copy as this data may be coming from the save thread
this.tag = nbttagcompound.getCompound("tag").copy();
// CraftBukkit end
@@ -62,7 +62,7 @@ index 566f1b8a0acd679b2f776db2e80458b1c532f97e..d342ae7b4fc1f682a885f0dca7b7fc22
this.getItem().verifyTagAfterLoad(this.tag);
}
-@@ -749,6 +769,7 @@ public final class ItemStack {
+@@ -748,6 +768,7 @@ public final class ItemStack {
public void setTag(@Nullable CompoundTag nbt) {
this.tag = nbt;
@@ -70,7 +70,7 @@ index 566f1b8a0acd679b2f776db2e80458b1c532f97e..d342ae7b4fc1f682a885f0dca7b7fc22
if (this.getItem().canBeDepleted()) {
this.setDamageValue(this.getDamageValue());
}
-@@ -1056,6 +1077,7 @@ public final class ItemStack {
+@@ -1055,6 +1076,7 @@ public final class ItemStack {
ListTag nbttaglist = this.tag.getList("Enchantments", 10);
nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (byte) level));
diff --git a/patches/server/0067-Add-World-Util-Methods.patch b/patches/server/0067-Add-World-Util-Methods.patch
index 4a33a42cd4..56dc64ce68 100644
--- a/patches/server/0067-Add-World-Util-Methods.patch
+++ b/patches/server/0067-Add-World-Util-Methods.patch
@@ -6,10 +6,10 @@ 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/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 7bc41c8546bc665b085cad6c384d0a5fab9f0b8b..51046d9fb37eabdbf76dee23cea81b6ee3406140 100644
+index c8ba29065b2e195bdb2570806763e299108725af..b106dfc16820d89b9c9792ad85d09fd66b7204b6 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -206,7 +206,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -208,7 +208,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
diff --git a/patches/server/0071-Configurable-spawn-chances-for-skeleton-horses.patch b/patches/server/0071-Configurable-spawn-chances-for-skeleton-horses.patch
index d2cc3e5420..6e19d6467b 100644
--- a/patches/server/0071-Configurable-spawn-chances-for-skeleton-horses.patch
+++ b/patches/server/0071-Configurable-spawn-chances-for-skeleton-horses.patch
@@ -22,10 +22,10 @@ index 71c672eafdce3547eaeb8e31fddcb142ad213094..aa8cd5965632626e4cbd4952acf9b349
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 19c97a14cbf23130db2de80e3f7f6e0c4ff27662..9f7bbd602c19f317d05cd8b72453c2e37d8acff5 100644
+index b106dfc16820d89b9c9792ad85d09fd66b7204b6..4e896cdc395cfb2b976e13ee3f0228d9f475069f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -560,7 +560,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -562,7 +562,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
diff --git a/patches/server/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
index 5ad51fdc46..11039950c0 100644
--- a/patches/server/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
+++ b/patches/server/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
@@ -18,10 +18,10 @@ index 9d6daeba112e68c64c2b5d7d0c7717766913fd56..b8938c4118b61758874624229b698695
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 180e04c6e5d52ed5e0f5da06c1de1b925511e51c..2f406dc2264bcaa584c56780e3f015f476102845 100644
+index 4e896cdc395cfb2b976e13ee3f0228d9f475069f..419f539109ca0b8103475e52d0fdda40a7b99cc7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -205,6 +205,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -207,6 +207,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
private int tickPosition;
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
@@ -30,7 +30,7 @@ index 180e04c6e5d52ed5e0f5da06c1de1b925511e51c..2f406dc2264bcaa584c56780e3f015f4
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
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 7ee958e6a4f16780aa746ce0eb8cb8ee27df08e1..609dd263ca6ee3287492a39a74d49ec01339956c 100644
+index 987962d1142c0ec0e28a9f2c7a62c8440bb10bd7..a0529181ab587c6675a6b6252efa12354c29316e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -475,7 +475,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0074-Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/0074-Entity-AddTo-RemoveFrom-World-Events.patch
index fdcc86e4a8..34cf38f5b8 100644
--- a/patches/server/0074-Entity-AddTo-RemoveFrom-World-Events.patch
+++ b/patches/server/0074-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 4611c44a460f87df864dd88f9ae961f9c0bc0d29..6869a07e4a3cfc19b5e814c7e3162d5315ec8908 100644
+index 419f539109ca0b8103475e52d0fdda40a7b99cc7..ce13b2b9bcf0984732b3309ec3f14731cc6aef5f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1993,6 +1993,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2026,6 +2026,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.setOrigin(entity.getOriginVector().toLocation(getWorld()));
}
// Paper end
@@ -16,7 +16,7 @@ index 4611c44a460f87df864dd88f9ae961f9c0bc0d29..6869a07e4a3cfc19b5e814c7e3162d53
}
public void onTrackingEnd(Entity entity) {
-@@ -2064,6 +2065,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2106,6 +2107,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
// CraftBukkit end
diff --git a/patches/server/0076-EntityPathfindEvent.patch b/patches/server/0076-EntityPathfindEvent.patch
index 49f7b83e8d..0657e6b613 100644
--- a/patches/server/0076-EntityPathfindEvent.patch
+++ b/patches/server/0076-EntityPathfindEvent.patch
@@ -32,7 +32,7 @@ index a9fd90d5282bd013e031b9d7481e3f777d6892c6..a6f8ca71ba5d107cfbd24b8e8a225195
private int getSurfaceY() {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
-index 80c172b57857a19d5f78c6f06335dc7c957ccbb6..e10d377eb7540ed54ddcb6632afc2395c021b8ab 100644
+index 6b47e7abe63c196ab17c5816fdb4f79a89225178..4335bd9d6413d56326be573f7c07c8cd0503d352 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -10,6 +10,7 @@ import net.minecraft.core.BlockPos;
@@ -43,7 +43,7 @@ index 80c172b57857a19d5f78c6f06335dc7c957ccbb6..e10d377eb7540ed54ddcb6632afc2395
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.Mob;
-@@ -110,7 +111,13 @@ public abstract class PathNavigation {
+@@ -106,7 +107,13 @@ public abstract class PathNavigation {
@Nullable
public Path createPath(BlockPos target, int distance) {
@@ -58,7 +58,7 @@ index 80c172b57857a19d5f78c6f06335dc7c957ccbb6..e10d377eb7540ed54ddcb6632afc2395
}
@Nullable
-@@ -120,7 +127,7 @@ public abstract class PathNavigation {
+@@ -116,7 +123,7 @@ public abstract class PathNavigation {
@Nullable
public Path createPath(Entity entity, int distance) {
@@ -67,7 +67,7 @@ index 80c172b57857a19d5f78c6f06335dc7c957ccbb6..e10d377eb7540ed54ddcb6632afc2395
}
@Nullable
-@@ -130,6 +137,16 @@ public abstract class PathNavigation {
+@@ -126,6 +133,16 @@ public abstract class PathNavigation {
@Nullable
protected Path createPath(Set<BlockPos> positions, int range, boolean useHeadPos, int distance, float followRange) {
@@ -84,7 +84,7 @@ index 80c172b57857a19d5f78c6f06335dc7c957ccbb6..e10d377eb7540ed54ddcb6632afc2395
if (positions.isEmpty()) {
return null;
} else if (this.mob.getY() < (double)this.level.getMinBuildHeight()) {
-@@ -139,6 +156,23 @@ public abstract class PathNavigation {
+@@ -135,6 +152,23 @@ public abstract class PathNavigation {
} else if (this.path != null && !this.path.isDone() && positions.contains(this.targetPos)) {
return this.path;
} else {
diff --git a/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch
index d310031d24..dfee9b2f25 100644
--- a/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch
+++ b/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch
@@ -20,10 +20,10 @@ index 8834ed411a7db86b4d2b88183a1315317107d719..c45b5ab6776f3ac79f856c3a6467c510
static final ServerboundInteractPacket.Action ATTACK_ACTION = new ServerboundInteractPacket.Action() {
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 76e34fb4bb6b3d194e155bec30d36887350f3ee3..7d6fc7b64a4cdec0f432374c5258ec99ea52889c 100644
+index 103d0afd73de68e3b07a9a4ef6d2f5af0a0e40c5..71b424b65d55302c8d5b243f6f3bc9fae1b7b98f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2200,8 +2200,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2201,8 +2201,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
});
}
}
diff --git a/patches/server/0091-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/0091-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch
index ed6a4bcb7d..1bbe5ec5c6 100644
--- a/patches/server/0091-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch
+++ b/patches/server/0091-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch
@@ -13,10 +13,10 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 8c5133defa9d3166cf987a6f1d02f02f0515746d..41b4cc7577b937e22512df00e3d4a3445fa7d004 100644
+index ce13b2b9bcf0984732b3309ec3f14731cc6aef5f..92fc07fb1a9dab0d44ac439287d10ae05a4e7043 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2013,6 +2013,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2046,6 +2046,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
{
if ( iter.next().player == entity )
{
@@ -25,7 +25,7 @@ index 8c5133defa9d3166cf987a6f1d02f02f0515746d..41b4cc7577b937e22512df00e3d4a344
}
}
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
-index 5d37c82bd5cd20aa2d452f0214f3303768e36a3d..6cf50fbfdeee38f8835ad8dd6ec6d16416174067 100644
+index 4d9b7fbb35d0c8f4fbb43b77a2e11a919614ab56..2862e75108b3304ab186ed89eb36801500e58b85 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -87,6 +87,7 @@ import net.minecraft.world.item.ElytraItem;
diff --git a/patches/server/0098-Add-server-name-parameter.patch b/patches/server/0098-Add-server-name-parameter.patch
index 3d4b1ca6b7..041f0bc305 100644
--- a/patches/server/0098-Add-server-name-parameter.patch
+++ b/patches/server/0098-Add-server-name-parameter.patch
@@ -5,10 +5,10 @@ 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 6300161cafb6efed7a262fa6b0b17d2f471fb2bb..ed842f74fbd2de066cfbf8522c638ff2942e8197 100644
+index e6362865d1e7beac23e520ebd2deb8a356428045..60ccdf33a014f3488353045e30526bc3f16e93c5 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
-@@ -151,6 +151,14 @@ public class Main {
+@@ -149,6 +149,14 @@ public class Main {
.defaultsTo(new File[] {})
.describedAs("Jar file");
// Paper end
diff --git a/patches/server/0105-Configurable-packet-in-spam-threshold.patch b/patches/server/0105-Configurable-packet-in-spam-threshold.patch
index d7ae98b04f..386952e4e5 100644
--- a/patches/server/0105-Configurable-packet-in-spam-threshold.patch
+++ b/patches/server/0105-Configurable-packet-in-spam-threshold.patch
@@ -23,10 +23,10 @@ index 728835cddd413d778e9628360989724f65335b46..6c13fe725ca2b2a6f0f375b80f6c2cb6
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 7d6fc7b64a4cdec0f432374c5258ec99ea52889c..9b24ddf170e00e60391a240686e6767e19b04fd3 100644
+index 71b424b65d55302c8d5b243f6f3bc9fae1b7b98f..d5ada382c2239d459338f377c9835cdcc573bd0e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1489,13 +1489,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1490,13 +1490,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// Spigot start - limit place/interactions
private int limitedPackets;
private long lastLimitedPacket = -1;
diff --git a/patches/server/0106-Configurable-flying-kick-messages.patch b/patches/server/0106-Configurable-flying-kick-messages.patch
index 86b2a21a19..c4b6d10c0f 100644
--- a/patches/server/0106-Configurable-flying-kick-messages.patch
+++ b/patches/server/0106-Configurable-flying-kick-messages.patch
@@ -21,10 +21,10 @@ index 6c13fe725ca2b2a6f0f375b80f6c2cb643b9913d..5e23ff0c5e44427a996281ae42fc12c2
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 9b24ddf170e00e60391a240686e6767e19b04fd3..73293dff5dac52c0737bbda65caea3a1e0cc4acd 100644
+index d5ada382c2239d459338f377c9835cdcc573bd0e..0d947ddd19841ab4de3a2d46c6a5a8b5fd42385b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -300,7 +300,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -301,7 +301,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (this.clientIsFloating && !this.player.isSleeping()) {
if (++this.aboveGroundTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
@@ -33,7 +33,7 @@ index 9b24ddf170e00e60391a240686e6767e19b04fd3..73293dff5dac52c0737bbda65caea3a1
return;
}
} else {
-@@ -319,7 +319,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -320,7 +320,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) {
if (++this.aboveGroundVehicleTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
diff --git a/patches/server/0116-Prevent-Pathfinding-out-of-World-Border.patch b/patches/server/0116-Prevent-Pathfinding-out-of-World-Border.patch
index 951f0f0043..a1262e3eaa 100644
--- a/patches/server/0116-Prevent-Pathfinding-out-of-World-Border.patch
+++ b/patches/server/0116-Prevent-Pathfinding-out-of-World-Border.patch
@@ -13,10 +13,10 @@ by adding code to all overrides in:
to return BLOCKED if it is outside the world border.
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
-index e10d377eb7540ed54ddcb6632afc2395c021b8ab..e675eca77a0a1718cdaceefa20b026dffdcc5508 100644
+index 4335bd9d6413d56326be573f7c07c8cd0503d352..9fba89aa8b1c257cdc3a63a5bd137320d66a37ec 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
-@@ -159,7 +159,7 @@ public abstract class PathNavigation {
+@@ -155,7 +155,7 @@ public abstract class PathNavigation {
// Paper start - Pathfind event
boolean copiedSet = false;
for (BlockPos possibleTarget : positions) {
diff --git a/patches/server/0120-Optimize-ItemStack.isEmpty.patch b/patches/server/0120-Optimize-ItemStack.isEmpty.patch
index 34a70b6909..b3f1e45f9e 100644
--- a/patches/server/0120-Optimize-ItemStack.isEmpty.patch
+++ b/patches/server/0120-Optimize-ItemStack.isEmpty.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Optimize ItemStack.isEmpty()
Remove hashMap lookup every check, simplify code to remove ternary
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index d342ae7b4fc1f682a885f0dca7b7fc222905490d..de3a7542403e0b42679ac7fab623611605f280b7 100644
+index 74e4990888d88f18cb3d800724d9156e9d1ae21d..ce082016d841e3e7ba46b722b85edae9acc3f290 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -240,7 +240,7 @@ public final class ItemStack {
+@@ -239,7 +239,7 @@ public final class ItemStack {
}
public boolean isEmpty() {
diff --git a/patches/server/0123-Properly-fix-item-duplication-bug.patch b/patches/server/0123-Properly-fix-item-duplication-bug.patch
index fd1c978fb6..d3c15f5fe0 100644
--- a/patches/server/0123-Properly-fix-item-duplication-bug.patch
+++ b/patches/server/0123-Properly-fix-item-duplication-bug.patch
@@ -19,10 +19,10 @@ index 3a97690a1e65db9a1c184fa4df5899cfda3d44bc..ab73818893b00551f8137704a727e330
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 73293dff5dac52c0737bbda65caea3a1e0cc4acd..f9d5af3842696c1a0286098f2d255f44932d4a4a 100644
+index 0d947ddd19841ab4de3a2d46c6a5a8b5fd42385b..0d473a405345d809742cb312068db8bf33ef17e7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2817,7 +2817,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2818,7 +2818,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
public final boolean isDisconnected() {
diff --git a/patches/server/0133-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/patches/server/0133-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch
index 2b1b4708c4..dcbdf3eafc 100644
--- a/patches/server/0133-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch
+++ b/patches/server/0133-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 13038723347cdbada65611d9de542d35d94084a0..e954365c9fe7a5f442c4ab31ab8c8db9684409e8 100644
+index c72d19a903a5cbb48d38f493e00e8c54a8e23b9c..065ee0486ec275f9b61dc18afa86023183f0c73b 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -221,7 +221,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -17,7 +17,7 @@ index 13038723347cdbada65611d9de542d35d94084a0..e954365c9fe7a5f442c4ab31ab8c8db9
this.structureManager = structureManager;
Path path = session.getDimensionPath(world.dimension());
-@@ -567,7 +567,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -529,7 +529,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Spigot start
org.spigotmc.SlackActivityAccountant activityAccountant = this.level.getServer().slackActivityAccountant;
activityAccountant.startActivity(0.5);
@@ -26,7 +26,7 @@ index 13038723347cdbada65611d9de542d35d94084a0..e954365c9fe7a5f442c4ab31ab8c8db9
// Spigot end
while (longiterator.hasNext()) { // Spigot
long j = longiterator.nextLong();
-@@ -587,7 +587,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -549,7 +549,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
activityAccountant.endActivity(); // Spigot
diff --git a/patches/server/0135-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/patches/server/0135-Add-option-to-make-parrots-stay-on-shoulders-despite.patch
index a29f8bc9a1..f97ed1bf54 100644
--- a/patches/server/0135-Add-option-to-make-parrots-stay-on-shoulders-despite.patch
+++ b/patches/server/0135-Add-option-to-make-parrots-stay-on-shoulders-despite.patch
@@ -26,10 +26,10 @@ index 47b717e8741bb2b8f3aa776dcdc73a3e7dbb5960..9dad1efab44b8a23f274aa89c85944d9
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index f9d5af3842696c1a0286098f2d255f44932d4a4a..1eac0962c59fffe47a33903238f7f43e5f77450e 100644
+index 0d473a405345d809742cb312068db8bf33ef17e7..57f1d97c77350757e1686023a422d343af6d6e92 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2050,6 +2050,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2051,6 +2051,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
switch (packet.getAction()) {
case PRESS_SHIFT_KEY:
this.player.setShiftKeyDown(true);
diff --git a/patches/server/0137-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0137-Use-TerminalConsoleAppender-for-console-improvements.patch
index 197157616c..9dd1d44a9e 100644
--- a/patches/server/0137-Use-TerminalConsoleAppender-for-console-improvements.patch
+++ b/patches/server/0137-Use-TerminalConsoleAppender-for-console-improvements.patch
@@ -278,7 +278,7 @@ index 93e3d587f7d1d621e8aedb8e53f38a8df21b5587..8bad6fa590cfe47e1216a160531f4cd1
@Override
public PluginCommand getPluginCommand(String name) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index ed842f74fbd2de066cfbf8522c638ff2942e8197..8ab84e5591bbf2895f75b428f024760faa74d06d 100644
+index 60ccdf33a014f3488353045e30526bc3f16e93c5..a19d5abb8188e2fd2382b9b42d65fa7a8c3d1799 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -12,7 +12,7 @@ import java.util.logging.Level;
@@ -290,7 +290,7 @@ index ed842f74fbd2de066cfbf8522c638ff2942e8197..8ab84e5591bbf2895f75b428f024760f
public class Main {
public static boolean useJline = true;
-@@ -197,6 +197,8 @@ public class Main {
+@@ -195,6 +195,8 @@ public class Main {
}
try {
@@ -299,7 +299,7 @@ index ed842f74fbd2de066cfbf8522c638ff2942e8197..8ab84e5591bbf2895f75b428f024760f
// This trick bypasses Maven Shade's clever rewriting of our getProperty call when using String literals
String jline_UnsupportedTerminal = new String(new char[]{'j', 'l', 'i', 'n', 'e', '.', 'U', 'n', 's', 'u', 'p', 'p', 'o', 'r', 't', 'e', 'd', 'T', 'e', 'r', 'm', 'i', 'n', 'a', 'l'});
String jline_terminal = new String(new char[]{'j', 'l', 'i', 'n', 'e', '.', 't', 'e', 'r', 'm', 'i', 'n', 'a', 'l'});
-@@ -214,9 +216,18 @@ public class Main {
+@@ -212,9 +214,18 @@ public class Main {
// This ensures the terminal literal will always match the jline implementation
System.setProperty(jline.TerminalFactory.JLINE_TERMINAL, jline.UnsupportedTerminal.class.getName());
}
@@ -318,7 +318,7 @@ index ed842f74fbd2de066cfbf8522c638ff2942e8197..8ab84e5591bbf2895f75b428f024760f
}
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
-@@ -244,7 +255,7 @@ public class Main {
+@@ -242,7 +253,7 @@ public class Main {
System.out.println("Unable to read system info");
}
// Paper end
diff --git a/patches/server/0152-Fix-this-stupid-bullshit.patch b/patches/server/0152-Fix-this-stupid-bullshit.patch
index 688dd39acf..60a3feffac 100644
--- a/patches/server/0152-Fix-this-stupid-bullshit.patch
+++ b/patches/server/0152-Fix-this-stupid-bullshit.patch
@@ -31,10 +31,10 @@ index bf42e5687935022fe5bcb1ed40bab09bfe189e88..b111200a8f5d3255de29c9836f70fc7f
Bootstrap.isBootstrapped = true;
if (Registry.REGISTRY.keySet().isEmpty()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 8ab84e5591bbf2895f75b428f024760faa74d06d..8dc72669abcaed848bb872e6eea81cae064e11b9 100644
+index a19d5abb8188e2fd2382b9b42d65fa7a8c3d1799..a87a6583a1bd31a276a79c2cfb3c3ca4e749c3dc 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
-@@ -236,10 +236,12 @@ public class Main {
+@@ -234,10 +234,12 @@ public class Main {
Calendar deadline = Calendar.getInstance();
deadline.add(Calendar.DAY_OF_YEAR, -14);
if (buildDate.before(deadline.getTime())) {
diff --git a/patches/server/0159-Add-PlayerJumpEvent.patch b/patches/server/0159-Add-PlayerJumpEvent.patch
index 66b2f5053c..936203cc45 100644
--- a/patches/server/0159-Add-PlayerJumpEvent.patch
+++ b/patches/server/0159-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 1eac0962c59fffe47a33903238f7f43e5f77450e..397a6e095c5aa5674d1ef5c3bb820e864cc88d1a 100644
+index 57f1d97c77350757e1686023a422d343af6d6e92..3a744fce441052427cb16dd99fbcefdb20761651 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1173,7 +1173,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1174,7 +1174,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
boolean flag = d8 > 0.0D;
if (this.player.isOnGround() && !packet.isOnGround() && flag) {
diff --git a/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch b/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch
index b640c1236d..e14533f60e 100644
--- a/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch
+++ b/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch
@@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 397a6e095c5aa5674d1ef5c3bb820e864cc88d1a..a0cd15635635074b88841a1b43c3a08b9f32e74f 100644
+index 3a744fce441052427cb16dd99fbcefdb20761651..77378ca56f1ec0f26fc29c2a80e27b7eddb94b93 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2776,14 +2776,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2777,14 +2777,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
diff --git a/patches/server/0162-revert-serverside-behavior-of-keepalives.patch b/patches/server/0162-revert-serverside-behavior-of-keepalives.patch
index 33f96da52e..4a7f76a37f 100644
--- a/patches/server/0162-revert-serverside-behavior-of-keepalives.patch
+++ b/patches/server/0162-revert-serverside-behavior-of-keepalives.patch
@@ -17,7 +17,7 @@ from networking or during connections flood of chunk packets on slower clients,
at the cost of dead connections being kept open for longer.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index a0cd15635635074b88841a1b43c3a08b9f32e74f..7e80a929bc0ddcf94f27f4febedf10ad07a531ff 100644
+index 77378ca56f1ec0f26fc29c2a80e27b7eddb94b93..c63bb524cbcceb926fa7f0b72bfffb670e560c5a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -220,9 +220,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -41,7 +41,7 @@ index a0cd15635635074b88841a1b43c3a08b9f32e74f..7e80a929bc0ddcf94f27f4febedf10ad
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.server = server;
-@@ -333,18 +334,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -334,18 +335,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
this.server.getProfiler().push("keepAlive");
diff --git a/patches/server/0169-AsyncTabCompleteEvent.patch b/patches/server/0169-AsyncTabCompleteEvent.patch
index 3ae4fcaac3..480a2aea45 100644
--- a/patches/server/0169-AsyncTabCompleteEvent.patch
+++ b/patches/server/0169-AsyncTabCompleteEvent.patch
@@ -14,10 +14,10 @@ completion, such as offline players.
Also adds isCommand and getLocation to the sync TabCompleteEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 898846546819ff71586cc1e038140047d2797e33..c795469d3221505faeabb5d06f35549c161f4f48 100644
+index c63bb524cbcceb926fa7f0b72bfffb670e560c5a..fd7242648da5acbb6b7c5f4c182c1e0442dff77d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -701,10 +701,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -702,10 +702,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
@@ -30,7 +30,7 @@ index 898846546819ff71586cc1e038140047d2797e33..c795469d3221505faeabb5d06f35549c
return;
}
// CraftBukkit end
-@@ -714,12 +714,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -715,12 +715,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
stringreader.skip();
}
diff --git a/patches/server/0172-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0172-PlayerNaturallySpawnCreaturesEvent.patch
index d05077e4a2..6a31762c8d 100644
--- a/patches/server/0172-PlayerNaturallySpawnCreaturesEvent.patch
+++ b/patches/server/0172-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 e954365c9fe7a5f442c4ab31ab8c8db9684409e8..fb9a82b4fabdb73e9a44bcbc20b848d8116df3e9 100644
+index 065ee0486ec275f9b61dc18afa86023183f0c73b..871c5839ec7ea39282380a42e1a45ea18897a507 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1110,7 +1110,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1073,7 +1073,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
chunkRange = (chunkRange > 8) ? 8 : chunkRange;
@@ -23,7 +23,7 @@ index e954365c9fe7a5f442c4ab31ab8c8db9684409e8..fb9a82b4fabdb73e9a44bcbc20b848d8
// Spigot end
long i = chunkcoordintpair.toLong();
-@@ -1127,6 +1129,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1090,6 +1092,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
entityplayer = (ServerPlayer) iterator.next();
diff --git a/patches/server/0193-Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/patches/server/0193-Fix-exploit-that-allowed-colored-signs-to-be-created.patch
index bac92c3dc3..ad15443ad9 100644
--- a/patches/server/0193-Fix-exploit-that-allowed-colored-signs-to-be-created.patch
+++ b/patches/server/0193-Fix-exploit-that-allowed-colored-signs-to-be-created.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index f97125ad82bc1ec850af9bdd92973942fc470bc1..77323b363573e770bbb4ae98911d5a922ad315c2 100644
+index fd7242648da5acbb6b7c5f4c182c1e0442dff77d..222487a756ae17ffaf8b42c3b2d81873ccd103eb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2782,9 +2782,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2783,9 +2783,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
TextFilter.FilteredText currentLine = signText.get(i);
if (this.player.isTextFilteringEnabled()) {
diff --git a/patches/server/0197-Expand-World.spawnParticle-API-and-add-Builder.patch b/patches/server/0197-Expand-World.spawnParticle-API-and-add-Builder.patch
index 56ab4e397a..88b8683d5b 100644
--- a/patches/server/0197-Expand-World.spawnParticle-API-and-add-Builder.patch
+++ b/patches/server/0197-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 9dbb71220a966ca8d5b907d21d43f7fad138c8db..e7db1e848c1631d80e0f03d0202b20b4715d3aac 100644
+index 92fc07fb1a9dab0d44ac439287d10ae05a4e7043..377c8a43e063522478037c1368cefd71fec701cb 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1361,12 +1361,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1383,12 +1383,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) {
diff --git a/patches/server/0219-InventoryCloseEvent-Reason-API.patch b/patches/server/0219-InventoryCloseEvent-Reason-API.patch
index dbaae2529e..827a533b5a 100644
--- a/patches/server/0219-InventoryCloseEvent-Reason-API.patch
+++ b/patches/server/0219-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 858f2f8a55d32d232f14c0d723dd906dca38c70d..af8b594e3e5ab5d7dc9e7d86f308903120c7fd72 100644
+index 377c8a43e063522478037c1368cefd71fec701cb..17eb43f6bb0a9bbc4e0abb991255b322a56f6160 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1128,7 +1128,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1130,7 +1130,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 858f2f8a55d32d232f14c0d723dd906dca38c70d..af8b594e3e5ab5d7dc9e7d86f3089031
}
}
}
-@@ -2030,7 +2030,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2063,7 +2063,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder) {
for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) {
@@ -75,7 +75,7 @@ index 90bff0dd400a67bcb84f8576bd8326793420919a..fd1937f49312204d38510996a5be43b7
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 024c89a62749fc33f36f1394c732d4151cfb85ae..f0eb8a5b0a0f54037a7d973a0b628fb987d6492c 100644
+index 222487a756ae17ffaf8b42c3b2d81873ccd103eb..00db9e4f46f810a4c51a0aa3d8b1a5673e2e1d67 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -186,6 +186,7 @@ import org.bukkit.event.inventory.ClickType;
@@ -86,7 +86,7 @@ index 024c89a62749fc33f36f1394c732d4151cfb85ae..f0eb8a5b0a0f54037a7d973a0b628fb9
import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.inventory.SmithItemEvent;
-@@ -2330,10 +2331,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2331,10 +2332,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handleContainerClose(ServerboundContainerClosePacket packet) {
diff --git a/patches/server/0221-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/patches/server/0221-Refresh-player-inventory-when-cancelling-PlayerInter.patch
index 8b74258342..5c7ef9b376 100644
--- a/patches/server/0221-Refresh-player-inventory-when-cancelling-PlayerInter.patch
+++ b/patches/server/0221-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 930f71861b1ee2fe210bd0e987a6b304b25f19dc..843e0c6bf53ccbb92efe14a3d32fed3013a6a53e 100644
+index 00db9e4f46f810a4c51a0aa3d8b1a5673e2e1d67..1c81dff5ddd54ce9ae8e8d1ba9e986647e52ca29 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2215,6 +2215,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2216,6 +2216,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
if (event.isCancelled()) {
diff --git a/patches/server/0239-Break-up-and-make-tab-spam-limits-configurable.patch b/patches/server/0239-Break-up-and-make-tab-spam-limits-configurable.patch
index 9272ed1d11..1510b0f520 100644
--- a/patches/server/0239-Break-up-and-make-tab-spam-limits-configurable.patch
+++ b/patches/server/0239-Break-up-and-make-tab-spam-limits-configurable.patch
@@ -45,7 +45,7 @@ index 8ecd1e851cc2168c538947623e1c328e463b52d9..1508afe593a1b62e3a33455707e25524
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 843e0c6bf53ccbb92efe14a3d32fed3013a6a53e..c8a5cd52689b2cd81a2206f0f71623d784c379ce 100644
+index 1c81dff5ddd54ce9ae8e8d1ba9e986647e52ca29..3b757e6748fa2af3730ae18d1bad1d7c86a11b90 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -226,6 +226,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -56,7 +56,7 @@ index 843e0c6bf53ccbb92efe14a3d32fed3013a6a53e..c8a5cd52689b2cd81a2206f0f71623d7
// CraftBukkit end
private int dropSpamTickCount;
private double firstGoodX;
-@@ -358,6 +359,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -359,6 +360,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.server.getProfiler().pop();
// CraftBukkit start
for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
@@ -64,7 +64,7 @@ index 843e0c6bf53ccbb92efe14a3d32fed3013a6a53e..c8a5cd52689b2cd81a2206f0f71623d7
/* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount;
-@@ -704,7 +706,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -705,7 +707,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
// PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async
// CraftBukkit start
diff --git a/patches/server/0242-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/0242-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
index df874bb2bf..ebf835f2a9 100644
--- a/patches/server/0242-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
+++ b/patches/server/0242-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
@@ -8,10 +8,10 @@ Add -Ddebug.entities=true to your JVM flags to gain more information
1.17: Needs to be reworked for new entity storage system
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index fb9a82b4fabdb73e9a44bcbc20b848d8116df3e9..488682910779bcfbd16f7658b1fb3be5f7984627 100644
+index 871c5839ec7ea39282380a42e1a45ea18897a507..a8c47535ec8c0cf992c40ec74a7a3a1f78da4865 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1352,6 +1352,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1312,6 +1312,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else {
ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas());
@@ -19,7 +19,7 @@ index fb9a82b4fabdb73e9a44bcbc20b848d8116df3e9..488682910779bcfbd16f7658b1fb3be5
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
playerchunkmap_entitytracker.updatePlayers(this.level.players());
if (entity instanceof ServerPlayer) {
-@@ -1394,7 +1395,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1354,7 +1355,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.broadcastRemoved();
}
@@ -29,10 +29,10 @@ index fb9a82b4fabdb73e9a44bcbc20b848d8116df3e9..488682910779bcfbd16f7658b1fb3be5
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 9a51aa9f40ceaaa3500595bf08b2b5515704b91a..9a9ae2cac9f44e38f58bd58c279fc648ec728032 100644
+index 17eb43f6bb0a9bbc4e0abb991255b322a56f6160..2d0e04cd2ab6403b3f5324cad130ec768a39d608 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -206,6 +206,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -208,6 +208,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper
@@ -42,7 +42,7 @@ index 9a51aa9f40ceaaa3500595bf08b2b5515704b91a..9a9ae2cac9f44e38f58bd58c279fc648
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkSource.getChunk(x, z, false);
-@@ -1091,7 +1094,28 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1093,7 +1096,28 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit start
private boolean addEntity(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
@@ -72,7 +72,7 @@ index 9a51aa9f40ceaaa3500595bf08b2b5515704b91a..9a9ae2cac9f44e38f58bd58c279fc648
return false;
} else {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 5df955eea09b5abd32c12abf5d13030bf9a3a9ae..d442725c1c9ae274b11f3a11ea4cf15f51d62def 100644
+index 2a11514554b6aea819046282cfcaeeb43d1ed920..2981a29b011cb1a08a776abc5ec6a94228061f98 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -170,6 +170,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
@@ -85,7 +85,7 @@ index 5df955eea09b5abd32c12abf5d13030bf9a3a9ae..d442725c1c9ae274b11f3a11ea4cf15f
if (this.bukkitEntity == null) {
this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index aa8bbf6435c19013e3ccaa963118d71200b6efea..2cdf117a5041830f201d5f1e98f7cc8f9cb6dd6f 100644
+index c239a71a9d864107c3a8e9537e4160c50b3a76c9..ee5415574dea0712f08e2467ecf93aa1ce39a2e5 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -142,6 +142,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0258-Asynchronous-chunk-IO-and-loading.patch b/patches/server/0258-Asynchronous-chunk-IO-and-loading.patch
index ec3861f998..3a9b520b9c 100644
--- a/patches/server/0258-Asynchronous-chunk-IO-and-loading.patch
+++ b/patches/server/0258-Asynchronous-chunk-IO-and-loading.patch
@@ -2279,7 +2279,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 4ab820c43ddc79f5a280e2d4b322a667b9ba725f..e0c1e4e38ff49429a587c59afb86e95c452d52a0 100644
+index e98492adfb83c24e1baa6cab24cca55f3ec151bf..afc7606e0df5dc87767444b42bb4e4b1b2f96b2d 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -227,6 +227,7 @@ public class Main {
@@ -2317,10 +2317,10 @@ index 45de5e508540b4ba622985d530f1aadaa7eb4535..5b8b9dabc6673b6f0a335a42d2ec71a5
ChunkHolder.FullChunkStatus playerchunk_state1 = ChunkHolder.getFullChunkStatus(this.ticketLevel);
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d75909467ba94 100644
+index a8c47535ec8c0cf992c40ec74a7a3a1f78da4865..87f055f8338d4ce2f9ff76bdc6c0b7ffc266ce78 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -504,6 +504,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -466,6 +466,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void close() throws IOException {
try {
this.queueSorter.close();
@@ -2328,7 +2328,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
this.poiManager.close();
} finally {
super.close();
-@@ -540,7 +541,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -502,7 +503,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.processUnloads(() -> {
return true;
});
@@ -2338,7 +2338,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
} else {
this.visibleChunkMap.values().forEach(this::saveChunkIfNeeded);
}
-@@ -550,17 +552,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -512,17 +514,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
protected void tick(BooleanSupplier shouldKeepTicking) {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
@@ -2361,7 +2361,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
private void processUnloads(BooleanSupplier shouldKeepTicking) {
LongIterator longiterator = this.toDrop.iterator();
-@@ -577,12 +583,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -539,12 +545,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (playerchunk != null) {
this.pendingUnloads.put(j, playerchunk);
this.modified = true;
@@ -2376,7 +2376,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
}
}
activityAccountant.endActivity(); // Spigot
-@@ -626,7 +633,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -588,7 +595,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
((LevelChunk) ichunkaccess).setLoaded(false);
}
@@ -2394,7 +2394,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
if (this.entitiesInLevel.remove(pos) && ichunkaccess instanceof LevelChunk) {
LevelChunk chunk = (LevelChunk) ichunkaccess;
-@@ -691,20 +707,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -653,20 +669,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
private CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> scheduleChunkLoad(ChunkPos pos) {
@@ -2427,7 +2427,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
this.markPosition(pos, protochunk.getStatus().getChunkType());
return Either.left(protochunk);
}
-@@ -726,7 +743,32 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -688,7 +705,32 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.markPositionReplaceable(pos);
return Either.left(new ProtoChunk(pos, UpgradeData.EMPTY, this.level, this.level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), (BlendingData) null));
@@ -2461,7 +2461,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
}
private void markPositionReplaceable(ChunkPos pos) {
-@@ -928,7 +970,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -890,7 +932,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -2510,7 +2510,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
this.poiManager.flush(chunk.getPos());
if (!chunk.isUnsaved()) {
return false;
-@@ -940,7 +1023,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -902,7 +985,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkStatus chunkstatus = chunk.getStatus();
if (chunkstatus.getChunkType() != ChunkStatus.ChunkType.LEVELCHUNK) {
@@ -2519,7 +2519,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
return false;
}
-@@ -950,9 +1033,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -912,9 +995,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
this.level.getProfiler().incrementCounter("chunkSave");
@@ -2537,7 +2537,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
this.markPosition(chunkcoordintpair, chunkstatus.getChunkType());
return true;
} catch (Exception exception) {
-@@ -961,6 +1050,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -923,6 +1012,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return false;
}
}
@@ -2545,7 +2545,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
}
private boolean isExistingChunkFull(ChunkPos pos) {
-@@ -1093,6 +1183,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1056,6 +1146,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -2582,7 +2582,7 @@ index 488682910779bcfbd16f7658b1fb3be5f7984627..aea216ee07fc733e90bd1170e46d7590
public CompoundTag readChunk(ChunkPos pos) throws IOException {
CompoundTag nbttagcompound = this.read(pos);
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 9090bc174c0ccb542616e756be66967f55f0a626..1dc1005142f822c05eb9065b4a5da456ec936ff2 100644
+index 87c9a7ffc69206554cf37c7d2c9939eb3cbea3a9..7b391d6ab84eeaed7bdd27ea70d5e3f9690a0abf 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -502,10 +502,111 @@ public class ServerChunkCache extends ChunkSource {
@@ -2744,10 +2744,10 @@ index 9090bc174c0ccb542616e756be66967f55f0a626..1dc1005142f822c05eb9065b4a5da456
} finally {
chunkMap.callbackExecutor.run();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 9a9ae2cac9f44e38f58bd58c279fc648ec728032..e1f8d771775acef29b8e4808a69d8e3a37070a28 100644
+index 2d0e04cd2ab6403b3f5324cad130ec768a39d608..5abcae55b2dc37eea514d194803bc9a851f18c25 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -307,6 +307,78 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -309,6 +309,78 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
}
@@ -2826,7 +2826,7 @@ index 9a9ae2cac9f44e38f58bd58c279fc648ec728032..e1f8d771775acef29b8e4808a69d8e3a
// Paper end
// Add env and gen to constructor, WorldData -> WorldDataServer
-@@ -374,6 +446,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -376,6 +448,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.sleepStatus = new SleepStatus();
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
@@ -2848,10 +2848,10 @@ index 0d536d72ac918fbd403397ff369d10143ee9c204..be677d437d17b74c6188ce1bd5fc6fdc
private final String name;
private final Comparator<T> comparator;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 5706d52d89bcec1d5da44ebf24f1b94cad59d359..136b5972f4faa4f43bc49b9c282a6578d31aed55 100644
+index 3b757e6748fa2af3730ae18d1bad1d7c86a11b90..a2783f87c560f4104216dce0c662e464f247356c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -710,6 +710,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -711,6 +711,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
server.scheduleOnMain(() -> this.disconnect(new TranslatableComponent("disconnect.spam", new Object[0]))); // Paper
return;
}
diff --git a/patches/server/0262-Allow-chests-to-be-placed-with-NBT-data.patch b/patches/server/0262-Allow-chests-to-be-placed-with-NBT-data.patch
index 76d445062c..1bcd55b62f 100644
--- a/patches/server/0262-Allow-chests-to-be-placed-with-NBT-data.patch
+++ b/patches/server/0262-Allow-chests-to-be-placed-with-NBT-data.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Allow chests to be placed with NBT data
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index de3a7542403e0b42679ac7fab623611605f280b7..e546f212d0228171920a0b28f918020617dfd7ca 100644
+index ce082016d841e3e7ba46b722b85edae9acc3f290..589a9bd9d3bf3cbf88a6efad5f58970a0a4a56c0 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -339,6 +339,7 @@ public final class ItemStack {
+@@ -338,6 +338,7 @@ public final class ItemStack {
enuminteractionresult = InteractionResult.FAIL; // cancel placement
// PAIL: Remove this when MC-99075 fixed
placeEvent.getPlayer().updateInventory();
diff --git a/patches/server/0283-Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/0283-Add-option-to-prevent-players-from-moving-into-unloa.patch
index a6a06aba90..8c9c0d72f9 100644
--- a/patches/server/0283-Add-option-to-prevent-players-from-moving-into-unloa.patch
+++ b/patches/server/0283-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/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-index 9c558fc727eb597612139820650a4226a7923cbb..92a5e0357328b5d472afd181a77a7ec7b593b88c 100644
+index e57ab8a3e6efd78e12385042b7d91dcd27fef11d..eb44aef0aecf65f5c1b19f42bf85a3a263965a7c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -431,4 +431,9 @@ public class PaperWorldConfig {
@@ -20,10 +20,10 @@ index 9c558fc727eb597612139820650a4226a7923cbb..92a5e0357328b5d472afd181a77a7ec7
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 7ed73ea4a5f7383c953ee3e28ce8f234d8ff941e..26ca0db447a76c3028dacf96bf9afd3b735bda74 100644
+index a2783f87c560f4104216dce0c662e464f247356c..886c150861c77bf26111b2ef26713e7d260f10ac 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -530,6 +530,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -531,6 +531,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
@@ -37,7 +37,7 @@ index 7ed73ea4a5f7383c953ee3e28ce8f234d8ff941e..26ca0db447a76c3028dacf96bf9afd3b
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! {},{},{}", entity.getName().getString(), this.player.getName().getString(), d6, d7, d8);
-@@ -1154,9 +1161,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1155,9 +1162,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
float prevYaw = this.player.getYRot();
float prevPitch = this.player.getXRot();
// CraftBukkit end
@@ -49,7 +49,7 @@ index 7ed73ea4a5f7383c953ee3e28ce8f234d8ff941e..26ca0db447a76c3028dacf96bf9afd3b
double d6 = this.player.getY();
double d7 = d0 - this.firstGoodX;
double d8 = d1 - this.firstGoodY;
-@@ -1194,6 +1201,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1195,6 +1202,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
} else {
speed = this.player.getAbilities().walkingSpeed * 10f;
}
diff --git a/patches/server/0286-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/0286-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
index a5a3f8742a..8c8f9eb9ff 100644
--- a/patches/server/0286-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
+++ b/patches/server/0286-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
@@ -12,10 +12,10 @@ server threads
Allow usage of a single thread executor by not using ForkJoin so single core CPU's.
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index 3ed0bf0485266c0a2b459f5cc1940f85f74e3624..b9775bc4e601fe1be8e514222e56ae782a897395 100644
+index 5c57a6607f1a95ac4d8770d0429d6848351f5452..cc565d1f766d5a6e0fe674ee9e453dbcb890116e 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
-@@ -68,8 +68,8 @@ public class Util {
+@@ -74,8 +74,8 @@ public class Util {
private static final int DEFAULT_MAX_THREADS = 255;
private static final String MAX_THREADS_SYSTEM_PROPERTY = "max.bg.threads";
private static final AtomicInteger WORKER_COUNT = new AtomicInteger(1);
@@ -26,7 +26,7 @@ index 3ed0bf0485266c0a2b459f5cc1940f85f74e3624..b9775bc4e601fe1be8e514222e56ae78
private static final ExecutorService IO_POOL = makeIoExecutor();
public static LongSupplier timeSource = System::nanoTime;
public static final UUID NIL_UUID = new UUID(0L, 0L);
-@@ -105,14 +105,18 @@ public class Util {
+@@ -114,14 +114,18 @@ public class Util {
return Instant.now().toEpochMilli();
}
@@ -49,7 +49,7 @@ index 3ed0bf0485266c0a2b459f5cc1940f85f74e3624..b9775bc4e601fe1be8e514222e56ae78
@Override
protected void onTermination(Throwable throwable) {
if (throwable != null) {
-@@ -128,6 +132,7 @@ public class Util {
+@@ -137,6 +141,7 @@ public class Util {
return forkJoinWorkerThread;
}, Util::onThreadException, true);
}
diff --git a/patches/server/0291-Don-t-allow-digging-into-unloaded-chunks.patch b/patches/server/0291-Don-t-allow-digging-into-unloaded-chunks.patch
index 16cc08c664..3eead4a690 100644
--- a/patches/server/0291-Don-t-allow-digging-into-unloaded-chunks.patch
+++ b/patches/server/0291-Don-t-allow-digging-into-unloaded-chunks.patch
@@ -59,10 +59,10 @@ index 1d1f355a49e2324902feee10c1717fd772e359c6..d0b54ebc05cac6535a023709c76efd80
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 ab5a6bba572bc27dbf9473cf7042c4cdef6843dc..7960a57c25dc80c6ca762e65c3ef82065cce2b7a 100644
+index 886c150861c77bf26111b2ef26713e7d260f10ac..96987ac75a2cb33e3761857f2c5074066f8c8b03 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1550,7 +1550,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1551,7 +1551,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
case START_DESTROY_BLOCK:
case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK:
diff --git a/patches/server/0297-Book-Size-Limits.patch b/patches/server/0297-Book-Size-Limits.patch
index 5d055cbd63..978f973db9 100644
--- a/patches/server/0297-Book-Size-Limits.patch
+++ b/patches/server/0297-Book-Size-Limits.patch
@@ -24,10 +24,10 @@ index 769353df1fcdaacecd80085165a1d72f99b577ee..4875e323e8ba52cf91259262b8418310
private static void asyncChunks() {
ConfigurationSection section;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 25ec1613f4c9ecc59ec5e27717ff7de9ad9e4398..2d2b1a293a1359ffa6d33635856406a909c452ce 100644
+index 96987ac75a2cb33e3761857f2c5074066f8c8b03..e1004d267fc62ecce8a1f98cbec40dddaa6e1485 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1000,6 +1000,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1001,6 +1001,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handleEditBook(ServerboundEditBookPacket packet) {
diff --git a/patches/server/0306-Implement-Brigadier-Mojang-API.patch b/patches/server/0306-Implement-Brigadier-Mojang-API.patch
index ae93d82a96..18f9505aa1 100644
--- a/patches/server/0306-Implement-Brigadier-Mojang-API.patch
+++ b/patches/server/0306-Implement-Brigadier-Mojang-API.patch
@@ -10,7 +10,7 @@ Adds CommandRegisteredEvent
- Allows manipulating the CommandNode to add more children/metadata for the client
diff --git a/build.gradle.kts b/build.gradle.kts
-index 1d62be2d0b8b35eaa7c0f7169df71ca27f8477d3..fc59f56860d02ef8c11082feae042a39e3924f45 100644
+index f02dc8b25f406a34535e9ae4666faf6b05ad0831..6e47e915134bccb7efa9555d7f33fbe82a25c003 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -12,6 +12,7 @@ repositories {
@@ -81,10 +81,10 @@ index ee31455158afbed8f3bbac57d2f41a59d01a0670..4049576478efed97092b7e1b3d40afda
event.getPlayer().getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index d4760d3cd2037ae47258d6016c6303e0a295dcbc..d0ed45db0226ebd8f60e9d84b7f41a3ca5cb3c9b 100644
+index e1004d267fc62ecce8a1f98cbec40dddaa6e1485..3dc23e2eaa5bf9c2bdbba366767be39a8de81b5f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -747,8 +747,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -748,8 +748,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
@@ -99,7 +99,7 @@ index d4760d3cd2037ae47258d6016c6303e0a295dcbc..d0ed45db0226ebd8f60e9d84b7f41a3c
});
});
}
-@@ -757,7 +761,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -758,7 +762,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
builder = builder.createOffset(builder.getInput().lastIndexOf(' ') + 1);
completions.forEach(builder::suggest);
diff --git a/patches/server/0308-Limit-Client-Sign-length-more.patch b/patches/server/0308-Limit-Client-Sign-length-more.patch
index 46f72c515b..9ad77d45f3 100644
--- a/patches/server/0308-Limit-Client-Sign-length-more.patch
+++ b/patches/server/0308-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 be5f7b5e8537aa3bf4088fa8c2e9d6cce17c64ac..5d0836c8bc38e3d29f47359b273c58330805b396 100644
+index 3dc23e2eaa5bf9c2bdbba366767be39a8de81b5f..8585cc9441674950dc8646f12698fb356cfc9e96 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -253,6 +253,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -33,7 +33,7 @@ index be5f7b5e8537aa3bf4088fa8c2e9d6cce17c64ac..5d0836c8bc38e3d29f47359b273c5833
private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
-@@ -2861,6 +2862,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2862,6 +2863,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
for (int i = 0; i < signText.size(); ++i) {
TextFilter.FilteredText currentLine = signText.get(i);
diff --git a/patches/server/0315-Entity-getEntitySpawnReason.patch b/patches/server/0315-Entity-getEntitySpawnReason.patch
index e3033c5c5c..e91f4ef5cc 100644
--- a/patches/server/0315-Entity-getEntitySpawnReason.patch
+++ b/patches/server/0315-Entity-getEntitySpawnReason.patch
@@ -10,10 +10,10 @@ persistenting Living Entity, SPAWNER for spawners,
or DEFAULT since data was not stored.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index e1f8d771775acef29b8e4808a69d8e3a37070a28..4025baacbd278b0a30bb808895eae14bfbf706e1 100644
+index 5abcae55b2dc37eea514d194803bc9a851f18c25..2950ad995f322570cd647d3217f340327cc3e7c8 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1183,6 +1183,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1185,6 +1185,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
return true;
}
// Paper end
@@ -22,7 +22,7 @@ index e1f8d771775acef29b8e4808a69d8e3a37070a28..4025baacbd278b0a30bb808895eae14b
// Paper start
if (DEBUG_ENTITIES) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 7ac89aa6d0af25cac96ede3b085e68a803fb7229..dc5d5a498460d09de6626b8da8a7bfcbebc028e1 100644
+index 25da9e3252154415303db662286e89e3aa7cfcd8..eea7a625fb00af13944b21e1af4bf1804c5ce6d9 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -342,7 +342,7 @@ public abstract class PlayerList {
diff --git a/patches/server/0316-Update-entity-Metadata-for-all-tracked-players.patch b/patches/server/0316-Update-entity-Metadata-for-all-tracked-players.patch
index 4b2584d8d6..ab0862ea30 100644
--- a/patches/server/0316-Update-entity-Metadata-for-all-tracked-players.patch
+++ b/patches/server/0316-Update-entity-Metadata-for-all-tracked-players.patch
@@ -22,10 +22,10 @@ index 3d27cbf5e9105def2f38525a85da5acf8ebf8fe9..ceba19ea3bb9664899b83f82f28af064
this.broadcast.accept(packet);
if (this.entity instanceof ServerPlayer) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 5d0836c8bc38e3d29f47359b273c58330805b396..d27bc3d8433c0692019c0eb968c857d95a9558f0 100644
+index 8585cc9441674950dc8646f12698fb356cfc9e96..e3d0180fc1219cfb33cfc3b55a127f86fa23618a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2286,7 +2286,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2287,7 +2287,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem) {
// Refresh the current entity metadata
diff --git a/patches/server/0325-Fix-CB-call-to-changed-postToMainThread-method.patch b/patches/server/0325-Fix-CB-call-to-changed-postToMainThread-method.patch
index 128b0ba5d3..e82dc3ca33 100644
--- a/patches/server/0325-Fix-CB-call-to-changed-postToMainThread-method.patch
+++ b/patches/server/0325-Fix-CB-call-to-changed-postToMainThread-method.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix CB call to changed postToMainThread method
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index d27bc3d8433c0692019c0eb968c857d95a9558f0..f4444fb23a75d0617438f6b25df7bd401ab65a26 100644
+index e3d0180fc1219cfb33cfc3b55a127f86fa23618a..240c97682863d78d7c3621131ee1407932ec4599 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -438,7 +438,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -439,7 +439,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
Objects.requireNonNull(this.connection);
// CraftBukkit - Don't wait
diff --git a/patches/server/0330-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/0330-Configurable-Keep-Spawn-Loaded-range-per-world.patch
index e7144f69bd..f0e25d5b10 100644
--- a/patches/server/0330-Configurable-Keep-Spawn-Loaded-range-per-world.patch
+++ b/patches/server/0330-Configurable-Keep-Spawn-Loaded-range-per-world.patch
@@ -85,10 +85,10 @@ index bd8e654c1580a0ac7dd411b9f1dcad4a20d1d3e5..7576047ea9695434ca06ca8fefde0dce
// CraftBukkit start
// this.updateMobSpawningFlags();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 4025baacbd278b0a30bb808895eae14bfbf706e1..68c0f332c176030cd9adfb18a56108ce0931c332 100644
+index 2950ad995f322570cd647d3217f340327cc3e7c8..fef3846a978dcba95c5dbe5c528ac20cb4f56178 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -59,6 +59,7 @@ import net.minecraft.network.protocol.game.ClientboundSoundEntityPacket;
+@@ -60,6 +60,7 @@ import net.minecraft.network.protocol.game.ClientboundSoundEntityPacket;
import net.minecraft.network.protocol.game.ClientboundSoundPacket;
import net.minecraft.network.protocol.game.DebugPackets;
import net.minecraft.resources.ResourceKey;
@@ -96,7 +96,7 @@ index 4025baacbd278b0a30bb808895eae14bfbf706e1..68c0f332c176030cd9adfb18a56108ce
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.ServerScoreboard;
import net.minecraft.server.level.progress.ChunkProgressListener;
-@@ -1584,12 +1585,84 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1606,12 +1607,84 @@ public class ServerLevel extends Level implements WorldGenLevel {
return ((MapIndex) this.getServer().overworld().getDataStorage().computeIfAbsent(MapIndex::load, MapIndex::new, "idcounts")).getFreeAuxValueForMap();
}
diff --git a/patches/server/0335-Fix-World-isChunkGenerated-calls.patch b/patches/server/0335-Fix-World-isChunkGenerated-calls.patch
index 55ad7b501b..41006d2ad6 100644
--- a/patches/server/0335-Fix-World-isChunkGenerated-calls.patch
+++ b/patches/server/0335-Fix-World-isChunkGenerated-calls.patch
@@ -8,7 +8,7 @@ This patch also adds a chunk status cache on region files (note that
its only purpose is to cache the status on DISK)
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index aea216ee07fc733e90bd1170e46d75909467ba94..9f2c9a1e32e1bfbeeda8e8f733f04d7f5347bbe9 100644
+index 87f055f8338d4ce2f9ff76bdc6c0b7ffc266ce78..9dd2f5d7ea6a1d6744916c403bdd852bb66e45b8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -87,6 +87,7 @@ import net.minecraft.world.level.chunk.ProtoChunk;
@@ -19,7 +19,7 @@ index aea216ee07fc733e90bd1170e46d75909467ba94..9f2c9a1e32e1bfbeeda8e8f733f04d7f
import net.minecraft.world.level.entity.ChunkStatusUpdateListener;
import net.minecraft.world.level.levelgen.blending.BlendingData;
import net.minecraft.world.level.levelgen.structure.StructureStart;
-@@ -1215,10 +1216,59 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1178,10 +1179,59 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@Nullable
public CompoundTag readChunk(ChunkPos pos) throws IOException {
CompoundTag nbttagcompound = this.read(pos);
diff --git a/patches/server/0342-Dont-send-unnecessary-sign-update.patch b/patches/server/0342-Dont-send-unnecessary-sign-update.patch
index 54f604061a..b482be0ba7 100644
--- a/patches/server/0342-Dont-send-unnecessary-sign-update.patch
+++ b/patches/server/0342-Dont-send-unnecessary-sign-update.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Dont send unnecessary sign update
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index f4444fb23a75d0617438f6b25df7bd401ab65a26..26a15d0b49180651361f336da29a7acccca92483 100644
+index 240c97682863d78d7c3621131ee1407932ec4599..5efac3203b98870a3f3549baddd5f773de961ee8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2856,6 +2856,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2857,6 +2857,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (!tileentitysign.isEditable() || !this.player.getUUID().equals(tileentitysign.getPlayerWhoMayEdit())) {
ServerGamePacketListenerImpl.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getName().getString());
diff --git a/patches/server/0344-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch b/patches/server/0344-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch
index ff9014b00c..fe606e0430 100644
--- a/patches/server/0344-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch
+++ b/patches/server/0344-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch
@@ -7,10 +7,10 @@ Fixes an AssertionError when setting the player's item in hand to null or a new
Fixes GH-2718
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 26a15d0b49180651361f336da29a7acccca92483..23f06b3a4c7471bd3081c5e9ee78707c26280bfd 100644
+index 5efac3203b98870a3f3549baddd5f773de961ee8..a0aa9be6ee16109c68c2c75b2a150982f2ab3d62 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1734,6 +1734,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1735,6 +1735,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player.getBukkitEntity().updateInventory(); // SPIGOT-2524
return;
}
diff --git a/patches/server/0348-Duplicate-UUID-Resolve-Option.patch b/patches/server/0348-Duplicate-UUID-Resolve-Option.patch
index 96217e6982..9f29e293a1 100644
--- a/patches/server/0348-Duplicate-UUID-Resolve-Option.patch
+++ b/patches/server/0348-Duplicate-UUID-Resolve-Option.patch
@@ -33,7 +33,7 @@ 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/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-index e55647f5fb58aeca93bbb70fa8d06c1e356fe633..0b99f20ec760692a350acd4f78dd060e30d88b50 100644
+index e4820ece5279a0324f1e7ebf0027dcb054b7ecc3..3e3a48a636c225ec113c1c64f6ffc8a37ad9169e 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -443,6 +443,45 @@ public class PaperWorldConfig {
@@ -83,7 +83,7 @@ index e55647f5fb58aeca93bbb70fa8d06c1e356fe633..0b99f20ec760692a350acd4f78dd060e
private void countAllMobsForSpawning() {
countAllMobsForSpawning = getBoolean("count-all-mobs-for-spawning", false);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 9f2c9a1e32e1bfbeeda8e8f733f04d7f5347bbe9..f0c4e98a6d5c448850a72ba90fb68c512fff8310 100644
+index 9dd2f5d7ea6a1d6744916c403bdd852bb66e45b8..848952c9bd3d91488d964c72bdc77925f904c3fa 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,6 +1,7 @@
@@ -112,7 +112,7 @@ index 9f2c9a1e32e1bfbeeda8e8f733f04d7f5347bbe9..f0c4e98a6d5c448850a72ba90fb68c51
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.CompletionStage;
-@@ -856,6 +861,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -818,6 +823,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.discard();
needsRemoval = true;
}
@@ -120,7 +120,7 @@ index 9f2c9a1e32e1bfbeeda8e8f733f04d7f5347bbe9..f0c4e98a6d5c448850a72ba90fb68c51
return !needsRemoval;
}));
// CraftBukkit end
-@@ -906,6 +912,43 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -868,6 +874,43 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
});
}
diff --git a/patches/server/0349-Optimize-Hoppers.patch b/patches/server/0349-Optimize-Hoppers.patch
index ebdf16e0e2..951a144d91 100644
--- a/patches/server/0349-Optimize-Hoppers.patch
+++ b/patches/server/0349-Optimize-Hoppers.patch
@@ -47,10 +47,10 @@ index 7576047ea9695434ca06ca8fefde0dce68980be8..f71a1401d229b32557f0444ce45cfa47
this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location();
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index e546f212d0228171920a0b28f918020617dfd7ca..d612d6e737d60e10b5a1504f363db214d3589594 100644
+index 589a9bd9d3bf3cbf88a6efad5f58970a0a4a56c0..83d872044c3db54352847e08bb333ff7e0aee0b0 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -604,11 +604,12 @@ public final class ItemStack {
+@@ -603,11 +603,12 @@ public final class ItemStack {
return this.getItem().interactLivingEntity(this, user, entity, hand);
}
diff --git a/patches/server/0354-Optimise-IEntityAccess-getPlayerByUUID.patch b/patches/server/0354-Optimise-IEntityAccess-getPlayerByUUID.patch
index 310c2e3737..b877d9624b 100644
--- a/patches/server/0354-Optimise-IEntityAccess-getPlayerByUUID.patch
+++ b/patches/server/0354-Optimise-IEntityAccess-getPlayerByUUID.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Optimise IEntityAccess#getPlayerByUUID
Use the world entity 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 68c0f332c176030cd9adfb18a56108ce0931c332..e6408251ed836715f324b1c1e49ff2473f0963ae 100644
+index fef3846a978dcba95c5dbe5c528ac20cb4f56178..c04402666b9219d508bfd32b4f2e3faea0c9b648 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -382,6 +382,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -384,6 +384,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager;
// Paper end
diff --git a/patches/server/0360-Entity-Activation-Range-2.0.patch b/patches/server/0360-Entity-Activation-Range-2.0.patch
index 4908b5cf54..cceab0fe78 100644
--- a/patches/server/0360-Entity-Activation-Range-2.0.patch
+++ b/patches/server/0360-Entity-Activation-Range-2.0.patch
@@ -14,7 +14,7 @@ Adds flying monsters to control ghast and phantoms
Adds villagers as separate config
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index e6408251ed836715f324b1c1e49ff2473f0963ae..db123ef36fc4cb0206349ac696572714b806454c 100644
+index c04402666b9219d508bfd32b4f2e3faea0c9b648..daeb483b7aa0356447381aec8d92f5dfa500d5b1 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2,7 +2,6 @@ package net.minecraft.server.level;
@@ -25,15 +25,7 @@ index e6408251ed836715f324b1c1e49ff2473f0963ae..db123ef36fc4cb0206349ac696572714
import com.google.common.collect.Lists;
import com.mojang.datafixers.DataFixer;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-@@ -11,7 +10,6 @@ import it.unimi.dsi.fastutil.longs.LongSet;
- import it.unimi.dsi.fastutil.longs.LongSets;
- import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry;
- import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
--import it.unimi.dsi.fastutil.objects.Object2IntMap;
- import it.unimi.dsi.fastutil.objects.ObjectIterator;
- import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
- import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
-@@ -964,17 +962,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -966,17 +965,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
++TimingHistory.entityTicks; // Paper - timings
// Spigot start
co.aikar.timings.Timing timer; // Paper
@@ -55,7 +47,7 @@ index e6408251ed836715f324b1c1e49ff2473f0963ae..db123ef36fc4cb0206349ac696572714
try {
// Paper end - timings
entity.setOldPosAndRot();
-@@ -985,9 +983,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -987,9 +986,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
return Registry.ENTITY_TYPE.getKey(entity.getType()).toString();
});
gameprofilerfiller.incrementCounter("tickNonPassenger");
@@ -69,7 +61,7 @@ index e6408251ed836715f324b1c1e49ff2473f0963ae..db123ef36fc4cb0206349ac696572714
Iterator iterator = entity.getPassengers().iterator();
while (iterator.hasNext()) {
-@@ -995,13 +997,18 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -997,13 +1000,18 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1);
}
@@ -89,7 +81,7 @@ index e6408251ed836715f324b1c1e49ff2473f0963ae..db123ef36fc4cb0206349ac696572714
passenger.setOldPosAndRot();
++passenger.tickCount;
ProfilerFiller gameprofilerfiller = this.getProfiler();
-@@ -1010,8 +1017,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1012,8 +1020,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
return Registry.ENTITY_TYPE.getKey(passenger.getType()).toString();
});
gameprofilerfiller.incrementCounter("tickPassenger");
@@ -107,7 +99,7 @@ index e6408251ed836715f324b1c1e49ff2473f0963ae..db123ef36fc4cb0206349ac696572714
gameprofilerfiller.pop();
Iterator iterator = passenger.getPassengers().iterator();
-@@ -1021,6 +1037,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1023,6 +1040,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(passenger, entity2);
}
@@ -152,7 +144,7 @@ index 9723109a678f9532cd7ca0034d30bc4b450fcab5..09c70c911bfa7be9883b6b83c1e8600f
movement = this.maybeBackOffFromEdge(movement, movementType);
Vec3 vec3d1 = this.collide(movement);
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index ad2ef9460d85b2182f6af35733daadcedbd15e4c..63b0044a86e6830ccf9d6da8e29989de1402dff4 100644
+index 7db99b4ad89fd5b38a4767d166caedda86a6188a..341614d0f0df4008a443d9cda400d0c0103af90a 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -206,6 +206,19 @@ public abstract class Mob extends LivingEntity {
@@ -311,7 +303,7 @@ index fc47ef685539addfcfc6b5defea8936fbca9f69d..55b44d0391e9b946536f070ea5bbdd19
super.customServerAiStep();
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 62f5d137e27b51eaf54d2f84b10bb22f3df216af..77e58257dc3fb517aeca8f8436a4279aa133b570 100644
+index dac62bad9def39aba8fe7bebf1631eccde9cbf00..615204f7e3095fcd65099a1b752635fa08d44d25 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -157,6 +157,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0363-Anti-Xray.patch b/patches/server/0363-Anti-Xray.patch
index 1309986ae3..4ed91f867a 100644
--- a/patches/server/0363-Anti-Xray.patch
+++ b/patches/server/0363-Anti-Xray.patch
@@ -1126,10 +1126,10 @@ index 7825d6f0fdcfda6212cff8033ec55fb7db236154..2072aa8710f6e285f7c8f76c63b7bcf8
public ClientboundLevelChunkWithLightPacket(FriendlyByteBuf buf) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index fee7c426876ecfc1e6a55afcd4f7c7a503d02902..a3806b29907468f690e386d9147ae18f71f688ef 100644
+index cb050e658c5c99feb4586c1fba9a57ee3c0d6052..1112ffdaa13c6f0ca41b32127c3fed69f828d6fe 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -976,7 +976,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -938,7 +938,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
completablefuture1.thenAcceptAsync((either) -> {
either.ifLeft((chunk) -> {
this.tickingGenerated.getAndIncrement();
@@ -1138,7 +1138,7 @@ index fee7c426876ecfc1e6a55afcd4f7c7a503d02902..a3806b29907468f690e386d9147ae18f
this.getPlayers(chunkcoordintpair, false).forEach((entityplayer) -> {
this.playerLoadedChunk(entityplayer, mutableobject, chunk);
-@@ -1143,7 +1143,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1105,7 +1105,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
while (objectiterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) objectiterator.next();
ChunkPos chunkcoordintpair = playerchunk.getPos();
@@ -1146,8 +1146,8 @@ index fee7c426876ecfc1e6a55afcd4f7c7a503d02902..a3806b29907468f690e386d9147ae18f
+ MutableObject<java.util.Map<Object, ClientboundLevelChunkWithLightPacket>> mutableobject = new MutableObject<>(); // Paper - Anti-Xray - Bypass
this.getPlayers(chunkcoordintpair, false).forEach((entityplayer) -> {
- boolean flag = ChunkMap.isChunkInEuclideanRange(chunkcoordintpair, entityplayer, true, k);
-@@ -1156,7 +1156,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ SectionPos sectionposition = entityplayer.getLastSectionPos();
+@@ -1119,7 +1119,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
@@ -1156,7 +1156,7 @@ index fee7c426876ecfc1e6a55afcd4f7c7a503d02902..a3806b29907468f690e386d9147ae18f
if (player.level == this.level) {
if (newWithinViewDistance && !oldWithinViewDistance) {
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos.toLong());
-@@ -1679,12 +1679,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1639,12 +1639,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
@@ -1179,10 +1179,10 @@ index fee7c426876ecfc1e6a55afcd4f7c7a503d02902..a3806b29907468f690e386d9147ae18f
List<Entity> list = Lists.newArrayList();
List<Entity> list1 = Lists.newArrayList();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 66552855fa1d2eacc6e722428993bd5b9c07d960..f2c2f128fdb4d66616078dbae0aa85144f0825c3 100644
+index daeb483b7aa0356447381aec8d92f5dfa500d5b1..6a0eb9313ae62549f2e9220ca00a7ef27d3b2fca 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -391,7 +391,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -394,7 +394,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Add env and gen to constructor, WorldData -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, ServerLevelData iworlddataserver, ResourceKey<Level> resourcekey, DimensionType dimensionmanager, ChunkProgressListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
diff --git a/patches/server/0365-Tracking-Range-Improvements.patch b/patches/server/0365-Tracking-Range-Improvements.patch
index ff01a96da0..1f22b79e87 100644
--- a/patches/server/0365-Tracking-Range-Improvements.patch
+++ b/patches/server/0365-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 a3806b29907468f690e386d9147ae18f71f688ef..8de14a3078017c59b7e3a37894c6c250fa8558b0 100644
+index 1112ffdaa13c6f0ca41b32127c3fed69f828d6fe..0c82b270c7095c7e4666a8078ecc7142503795c4 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1867,6 +1867,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1827,6 +1827,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/0371-Add-debug-for-sync-chunk-loads.patch b/patches/server/0371-Add-debug-for-sync-chunk-loads.patch
index 1d43ed1c38..5e497afc6b 100644
--- a/patches/server/0371-Add-debug-for-sync-chunk-loads.patch
+++ b/patches/server/0371-Add-debug-for-sync-chunk-loads.patch
@@ -305,7 +305,7 @@ index 0000000000000000000000000000000000000000..0bb4aaa546939b67a5d22865190f3047
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index fa95322c02f9eee7d2cca06c48c19383d414032f..1eab367b375bb7bf6fadb602f378f6817e519371 100644
+index 8a6d23475983560644e391607137953803824b4b..5d7ea3dc5b294c1a4f22042796ca9b6d626e866d 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -644,6 +644,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -317,10 +317,10 @@ index fa95322c02f9eee7d2cca06c48c19383d414032f..1eab367b375bb7bf6fadb602f378f681
chunkproviderserver_b.managedBlock(completablefuture::isDone);
com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index d26e42449a1f75898d06aba384178c0ef30d9aa7..a21300a866dc6c9f7097a894e0506515210090f5 100644
+index 6a0eb9313ae62549f2e9220ca00a7ef27d3b2fca..c5109445e392cc9d91b2f6c4bab4bb5aea708be2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -379,6 +379,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -382,6 +382,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
};
public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager;
// Paper end
diff --git a/patches/server/0372-Allow-overriding-the-java-version-check.patch b/patches/server/0372-Allow-overriding-the-java-version-check.patch
index 0e2925ab23..bf02cce178 100644
--- a/patches/server/0372-Allow-overriding-the-java-version-check.patch
+++ b/patches/server/0372-Allow-overriding-the-java-version-check.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Allow overriding the java version check
-DPaper.IgnoreJavaVersion=true
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 8dc72669abcaed848bb872e6eea81cae064e11b9..d302ba1af03bd5921f4da02eaced3659990fc00a 100644
+index a87a6583a1bd31a276a79c2cfb3c3ca4e749c3dc..e3b2b61e5f030080e481dc00d1086f723b8b97ee 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
-@@ -193,7 +193,7 @@ public class Main {
+@@ -191,7 +191,7 @@ public class Main {
}
if (javaVersion > 61.0) {
System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 17 is supported.");
diff --git a/patches/server/0378-Prevent-teleporting-dead-entities.patch b/patches/server/0378-Prevent-teleporting-dead-entities.patch
index ea7c12d145..f55c8fa69e 100644
--- a/patches/server/0378-Prevent-teleporting-dead-entities.patch
+++ b/patches/server/0378-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 23f06b3a4c7471bd3081c5e9ee78707c26280bfd..97c67fe091b2042a3aa98cc53d5e1ea1163a0966 100644
+index a0aa9be6ee16109c68c2c75b2a150982f2ab3d62..52448f75d093a4880ce619036af00c8a1772ad80 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1494,6 +1494,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1495,6 +1495,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<ClientboundPlayerPositionPacket.RelativeArgument> set, boolean flag) {
diff --git a/patches/server/0390-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/patches/server/0390-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
index 4801094d00..47185d77fc 100644
--- a/patches/server/0390-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch
+++ b/patches/server/0390-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 262a2182d4d98787d0ae396c5ed0fe79177a177e..4c09411a2537705df10aa314a28fad824b3fbd47 100644
+index 0583d7ee24f694fbf5138dfae9f7b8c8e4225ab3..27c304d66ecf0bb8d7b5b4343ca207880e14711b 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1579,6 +1579,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1539,6 +1539,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void addEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
@@ -26,19 +26,19 @@ index 262a2182d4d98787d0ae396c5ed0fe79177a177e..4c09411a2537705df10aa314a28fad82
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 a21300a866dc6c9f7097a894e0506515210090f5..3d4961418f3ee7e2d421738d8a8104aac09361d6 100644
+index c5109445e392cc9d91b2f6c4bab4bb5aea708be2..fda854c603629e3b9facc8ea3577cd8b23d973d9 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2170,7 +2170,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2193,7 +2193,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void onTrackingStart(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot
- ServerLevel.this.getChunkSource().addEntity(entity);
+ // ServerLevel.this.getChunkSource().addEntity(entity); // Paper - moved down below valid=true
if (entity instanceof ServerPlayer) {
- ServerLevel.this.players.add((ServerPlayer) entity);
- ServerLevel.this.updateSleepingPlayerList();
-@@ -2192,6 +2192,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+ ServerPlayer entityplayer = (ServerPlayer) entity;
+
+@@ -2226,6 +2226,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
entity.valid = true; // CraftBukkit
diff --git a/patches/server/0396-Improved-Watchdog-Support.patch b/patches/server/0396-Improved-Watchdog-Support.patch
index 918d707c8b..844f752b60 100644
--- a/patches/server/0396-Improved-Watchdog-Support.patch
+++ b/patches/server/0396-Improved-Watchdog-Support.patch
@@ -262,10 +262,10 @@ index 049eb5693dc98e1d0ec3bd88c73a41fdb2f59bff..0716aaf29f9d76240a0de4ca02daba44
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 4c09411a2537705df10aa314a28fad824b3fbd47..62880f8f3ec11fa26e8bdc4cf0a5bd0cf5d01b78 100644
+index 27c304d66ecf0bb8d7b5b4343ca207880e14711b..6f851c24a67d1b3a349790b0d60f45b23ff93bc6 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -552,6 +552,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -514,6 +514,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
MutableBoolean mutableboolean = new MutableBoolean();
do {
@@ -336,7 +336,7 @@ index 8a0e1e7ac1c447d6e9b8807054aaa86820171e7b..264d1202d2efc6aeb89be17f74c0f142
// Paper start
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index d302ba1af03bd5921f4da02eaced3659990fc00a..8a89fdc537a97fa5f1c30a1ae298e0fef95b4543 100644
+index e3b2b61e5f030080e481dc00d1086f723b8b97ee..a5f8554e2cd43774b1978dce659062d9c7e7dbda 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -12,6 +12,8 @@ import java.util.logging.Level;
@@ -348,7 +348,7 @@ index d302ba1af03bd5921f4da02eaced3659990fc00a..8a89fdc537a97fa5f1c30a1ae298e0fe
import net.minecrell.terminalconsole.TerminalConsoleAppender; // Paper
public class Main {
-@@ -164,6 +166,36 @@ public class Main {
+@@ -162,6 +164,36 @@ public class Main {
OptionSet options = null;
@@ -385,7 +385,7 @@ index d302ba1af03bd5921f4da02eaced3659990fc00a..8a89fdc537a97fa5f1c30a1ae298e0fe
try {
options = parser.parse(args);
} catch (joptsimple.OptionException ex) {
-@@ -263,8 +295,64 @@ public class Main {
+@@ -261,8 +293,64 @@ public class Main {
} catch (Throwable t) {
t.printStackTrace();
}
diff --git a/patches/server/0397-Optimize-Pathfinding.patch b/patches/server/0397-Optimize-Pathfinding.patch
index cb063274e6..590eb8051d 100644
--- a/patches/server/0397-Optimize-Pathfinding.patch
+++ b/patches/server/0397-Optimize-Pathfinding.patch
@@ -7,10 +7,10 @@ Prevents pathfinding from spamming failures for things such as
arrow attacks.
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
-index e675eca77a0a1718cdaceefa20b026dffdcc5508..5884fb42f0880585dee843b98a6ea470a1508e46 100644
+index 9fba89aa8b1c257cdc3a63a5bd137320d66a37ec..b06789336098233b642b769b0fd60e740459874c 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
-@@ -193,9 +193,29 @@ public abstract class PathNavigation {
+@@ -189,9 +189,29 @@ public abstract class PathNavigation {
return this.moveTo(this.createPath(x, y, z, 1), speed);
}
diff --git a/patches/server/0406-Fix-Chunk-Post-Processing-deadlock-risk.patch b/patches/server/0406-Fix-Chunk-Post-Processing-deadlock-risk.patch
index f03855bee7..3c97b33094 100644
--- a/patches/server/0406-Fix-Chunk-Post-Processing-deadlock-risk.patch
+++ b/patches/server/0406-Fix-Chunk-Post-Processing-deadlock-risk.patch
@@ -25,7 +25,7 @@ This successfully fixed a reoccurring and highly reproduceable crash
for heightmaps.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 62880f8f3ec11fa26e8bdc4cf0a5bd0cf5d01b78..394c64e55b3346ccd1721894bfa5899344b38367 100644
+index 6f851c24a67d1b3a349790b0d60f45b23ff93bc6..4566af37c76cb3a2fe6441451a444a5a3c9914f9 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -174,6 +174,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -36,7 +36,7 @@ index 62880f8f3ec11fa26e8bdc4cf0a5bd0cf5d01b78..394c64e55b3346ccd1721894bfa58993
// Paper start - distance maps
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
-@@ -992,7 +993,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -954,7 +955,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return Either.left(chunk);
});
}, (runnable) -> {
@@ -46,7 +46,7 @@ index 62880f8f3ec11fa26e8bdc4cf0a5bd0cf5d01b78..394c64e55b3346ccd1721894bfa58993
completablefuture1.thenAcceptAsync((either) -> {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 1eab367b375bb7bf6fadb602f378f6817e519371..3c36dfa4f4c6025b02ec455d997f13226de75a64 100644
+index 5d7ea3dc5b294c1a4f22042796ca9b6d626e866d..41d2027cd4cf8f5de7bd59283361f7f1075356cb 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -1144,6 +1144,7 @@ public class ServerChunkCache extends ChunkSource {
diff --git a/patches/server/0407-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/patches/server/0407-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch
index e582ea09fe..76c107076b 100644
--- a/patches/server/0407-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch
+++ b/patches/server/0407-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch
@@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick
delays anymore.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 394c64e55b3346ccd1721894bfa5899344b38367..fa097f426792f69bfa8376d62ce9285c6a6a7c7f 100644
+index 4566af37c76cb3a2fe6441451a444a5a3c9914f9..49e612fc0fc4ec991d821d0aa4b41f488dd9f832 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1588,6 +1588,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1548,6 +1548,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
.printStackTrace();
return;
}
@@ -52,7 +52,7 @@ index cdb0eb8e21299ca70ed7ed5c1195d07f44e47838..6d59a813aa752b4233dbe1894cfc8273
// CraftBukkit end
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 734f74e4ef178ae4b887bccdd571d9b269b29abe..0a097f5bd7ce5aab3f4fba111d6dfb3d16c229c9 100644
+index f32fad01c9f1b0642615be896bbf79f73f4656db..f096fbe48d8cc70e3749f48bc9972def42b0068d 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -276,6 +276,12 @@ public abstract class PlayerList {
diff --git a/patches/server/0408-Load-Chunks-for-Login-Asynchronously.patch b/patches/server/0408-Load-Chunks-for-Login-Asynchronously.patch
index 01f626cf50..de38679eb8 100644
--- a/patches/server/0408-Load-Chunks-for-Login-Asynchronously.patch
+++ b/patches/server/0408-Load-Chunks-for-Login-Asynchronously.patch
@@ -37,7 +37,7 @@ index be677d437d17b74c6188ce1bd5fc6fdc228fd92f..78fbb4c3e52e900956ae0811aaf934c8
public static final TicketType<ChunkPos> UNKNOWN = TicketType.create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1);
public static final TicketType<Unit> PLUGIN = TicketType.create("plugin", (a, b) -> 0); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 97c67fe091b2042a3aa98cc53d5e1ea1163a0966..f2960cc42295833a788a22becfa28cca76e15930 100644
+index 52448f75d093a4880ce619036af00c8a1772ad80..bce9986235833b6ee3b470f8d77f2d38ee017620 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 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -48,7 +48,7 @@ index 97c67fe091b2042a3aa98cc53d5e1ea1163a0966..f2960cc42295833a788a22becfa28cca
public ServerPlayer player;
private int tickCount;
private long keepAliveTime = Util.getMillis();
-@@ -293,6 +294,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -294,6 +295,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end
public void tick() {
@@ -64,7 +64,7 @@ index 97c67fe091b2042a3aa98cc53d5e1ea1163a0966..f2960cc42295833a788a22becfa28cca
this.resetPosition();
this.player.xo = this.player.getX();
this.player.yo = this.player.getY();
-@@ -334,7 +344,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -335,7 +345,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.lastVehicle = null;
this.clientVehicleIsFloating = false;
this.aboveGroundVehicleTickCount = 0;
@@ -96,7 +96,7 @@ index bb767f5b626225e70a8af273384bb74dbd21430d..301042e7a0d372a914f27ec0988dd938
try {
ServerPlayer entityplayer1 = this.server.getPlayerList().getPlayerForLogin(this.gameProfile, s); // CraftBukkit - add player reference
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 0a097f5bd7ce5aab3f4fba111d6dfb3d16c229c9..9b7fcd8be912cd211b6226386bd3340076953442 100644
+index f096fbe48d8cc70e3749f48bc9972def42b0068d..f3926ee149e5e42d48e33759202d8297e3afd1d4 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -39,6 +39,7 @@ import net.minecraft.network.protocol.Packet;
diff --git a/patches/server/0415-Validate-PickItem-Packet-and-kick-for-invalid.patch b/patches/server/0415-Validate-PickItem-Packet-and-kick-for-invalid.patch
index be3a22b04c..b46c78bdb2 100644
--- a/patches/server/0415-Validate-PickItem-Packet-and-kick-for-invalid.patch
+++ b/patches/server/0415-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 f2960cc42295833a788a22becfa28cca76e15930..bb1244d895c6e5fd668b5a01f507624fdac847f0 100644
+index bce9986235833b6ee3b470f8d77f2d38ee017620..ed5beda4b159001de4bc8b624d0cb103e257aed3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -875,7 +875,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -876,7 +876,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handlePickItem(ServerboundPickItemPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
diff --git a/patches/server/0418-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch b/patches/server/0418-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch
index b1f8febceb..9f6a56cec1 100644
--- a/patches/server/0418-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch
+++ b/patches/server/0418-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch
@@ -17,10 +17,10 @@ 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 8a89fdc537a97fa5f1c30a1ae298e0fef95b4543..461c086d82514d2558d3f472b675305248619d8c 100644
+index a5f8554e2cd43774b1978dce659062d9c7e7dbda..55bae3efbc630be6d40d415509de4c3e744a5004 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
-@@ -30,6 +30,7 @@ public class Main {
+@@ -28,6 +28,7 @@ public class Main {
}
// Paper end
// Todo: Installation script
diff --git a/patches/server/0432-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0432-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
index fd0544bc97..510e73aae3 100644
--- a/patches/server/0432-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
+++ b/patches/server/0432-Reduce-allocation-of-Vec3D-by-entity-tracker.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Reduce allocation of Vec3D by entity tracker
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index fa097f426792f69bfa8376d62ce9285c6a6a7c7f..ce2e8058cebc594def1d257b93d6818c004ad200 100644
+index 49e612fc0fc4ec991d821d0aa4b41f488dd9f832..62a8482b73796f2c6b76c0e039cb21e799bc9416 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1866,9 +1866,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1826,9 +1826,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void updatePlayer(ServerPlayer player) {
org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
if (player != this.entity) {
diff --git a/patches/server/0435-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch b/patches/server/0435-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch
index 2d9c5091d3..b1ccb5f6ec 100644
--- a/patches/server/0435-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch
+++ b/patches/server/0435-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch
@@ -37,7 +37,7 @@ index 74d674b2684b0db4aa6c183edc6091d53e9ee882..626bcbc6dd013260c3f8b38a1d14e7ba
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index ce2e8058cebc594def1d257b93d6818c004ad200..f99ad457b9ac0676861d4dbda2ee277cd3631548 100644
+index 62a8482b73796f2c6b76c0e039cb21e799bc9416..44dc880042dc16a4146c6d3bb35a8eb7b28fd3a4 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -177,21 +177,40 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -121,7 +121,7 @@ index ce2e8058cebc594def1d257b93d6818c004ad200..f99ad457b9ac0676861d4dbda2ee277c
}
protected ChunkGenerator generator() {
-@@ -504,6 +555,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -466,6 +517,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else {
if (holder != null) {
holder.setTicketLevel(level);
@@ -129,7 +129,7 @@ index ce2e8058cebc594def1d257b93d6818c004ad200..f99ad457b9ac0676861d4dbda2ee277c
}
if (holder != null) {
-@@ -1347,43 +1399,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1310,43 +1362,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return this.anyPlayerCloseEnoughForSpawning(pos, false);
}
diff --git a/patches/server/0436-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/0436-Use-distance-map-to-optimise-entity-tracker.patch
index 28331c2900..c27f897cc3 100644
--- a/patches/server/0436-Use-distance-map-to-optimise-entity-tracker.patch
+++ b/patches/server/0436-Use-distance-map-to-optimise-entity-tracker.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Use distance map to optimise entity tracker
Use the distance map to find candidate players for tracking.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index f99ad457b9ac0676861d4dbda2ee277cd3631548..b1ae9e1aa68aaa0435ecdd50d78f82d4e36441bf 100644
+index 44dc880042dc16a4146c6d3bb35a8eb7b28fd3a4..847c4705f88b999976c9a99519939eb2e71e7f1d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -67,6 +67,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket;
@@ -126,7 +126,7 @@ index f99ad457b9ac0676861d4dbda2ee277cd3631548..b1ae9e1aa68aaa0435ecdd50d78f82d4
// Paper start - optimise ChunkMap#anyPlayerCloseEnoughForSpawning
this.playerChunkTickRangeMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets,
(ServerPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ,
-@@ -1522,17 +1600,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1485,17 +1563,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public void move(ServerPlayer player) {
@@ -145,7 +145,7 @@ index f99ad457b9ac0676861d4dbda2ee277cd3631548..b1ae9e1aa68aaa0435ecdd50d78f82d4
int i = SectionPos.blockToSectionCoord(player.getBlockX());
int j = SectionPos.blockToSectionCoord(player.getBlockZ());
-@@ -1662,7 +1730,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1622,7 +1690,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
@@ -154,7 +154,7 @@ index f99ad457b9ac0676861d4dbda2ee277cd3631548..b1ae9e1aa68aaa0435ecdd50d78f82d4
if (entity instanceof ServerPlayer) {
ServerPlayer entityplayer = (ServerPlayer) entity;
-@@ -1706,7 +1774,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1666,7 +1734,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.tracker = null; // Paper - We're no longer tracked
}
@@ -192,7 +192,7 @@ index f99ad457b9ac0676861d4dbda2ee277cd3631548..b1ae9e1aa68aaa0435ecdd50d78f82d4
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
-@@ -1782,23 +1880,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1742,23 +1840,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
DebugPackets.sendPoiPacketsForChunk(this.level, chunk.getPos());
List<Entity> list = Lists.newArrayList();
List<Entity> list1 = Lists.newArrayList();
@@ -236,7 +236,7 @@ index f99ad457b9ac0676861d4dbda2ee277cd3631548..b1ae9e1aa68aaa0435ecdd50d78f82d4
Iterator iterator;
Entity entity1;
-@@ -1874,6 +1980,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1834,6 +1940,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lastSectionPos = SectionPos.of(entity);
}
@@ -280,7 +280,7 @@ index f99ad457b9ac0676861d4dbda2ee277cd3631548..b1ae9e1aa68aaa0435ecdd50d78f82d4
return object instanceof ChunkMap.TrackedEntity ? ((ChunkMap.TrackedEntity) object).entity.getId() == this.entity.getId() : false;
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 95fcf31b0ea68312f6c3475c1b4a01ca2b269536..9d4dc7d8d8b6633a3e88a8fc43d3d798683ef1d9 100644
+index f2be5a99ea4074a72858ddf8f728f5aa81aec59b..b047726aa8672d2298a0bbbcff43ada76969c809 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -51,6 +51,7 @@ import net.minecraft.network.syncher.EntityDataSerializers;
diff --git a/patches/server/0437-Optimize-ServerLevels-chunk-level-checking-methods.patch b/patches/server/0437-Optimize-ServerLevels-chunk-level-checking-methods.patch
index 256818f978..21abb956a9 100644
--- a/patches/server/0437-Optimize-ServerLevels-chunk-level-checking-methods.patch
+++ b/patches/server/0437-Optimize-ServerLevels-chunk-level-checking-methods.patch
@@ -8,10 +8,10 @@ so inline where possible, and avoid the abstraction of the
Either class.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 3fea7315ed3caf7363dd9349f8e977282dfa4c07..00d5060e2a81a7c5fe32f8b9ed8334ff844a70f5 100644
+index fda854c603629e3b9facc8ea3577cd8b23d973d9..083772c2f71851b5521f0ec5c1ecb872e357e8f7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2139,15 +2139,18 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2162,15 +2162,18 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
private boolean isPositionTickingWithEntitiesLoaded(long chunkPos) {
diff --git a/patches/server/0446-Prevent-position-desync-in-playerconnection-causing-.patch b/patches/server/0446-Prevent-position-desync-in-playerconnection-causing-.patch
index a79dfde026..a0c9934cf6 100644
--- a/patches/server/0446-Prevent-position-desync-in-playerconnection-causing-.patch
+++ b/patches/server/0446-Prevent-position-desync-in-playerconnection-causing-.patch
@@ -14,10 +14,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 2dcbee2e13141aff6b22e5ba1746c73592d9803c..3cd080bdf22a2fa4e9a1904a0e10325098621d7a 100644
+index ed5beda4b159001de4bc8b624d0cb103e257aed3..ba2fef9d01d54ad590535532a4f44ab5918d7135 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1324,6 +1324,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1325,6 +1325,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9));
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
diff --git a/patches/server/0449-Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/server/0449-Add-and-implement-PlayerRecipeBookClickEvent.patch
index bc05c6333c..5059337530 100644
--- a/patches/server/0449-Add-and-implement-PlayerRecipeBookClickEvent.patch
+++ b/patches/server/0449-Add-and-implement-PlayerRecipeBookClickEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index fec9551ef74c17be417a326847cc20b0ad54076b..31d99592c06da5c7eb0738210128509870d44d75 100644
+index ba2fef9d01d54ad590535532a4f44ab5918d7135..3e7d09445ed0679b962a226364b7aedba0fb2d74 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2773,9 +2773,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2774,9 +2774,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
this.player.resetLastActionTime();
if (!this.player.isSpectator() && this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu instanceof RecipeBookMenu) {
diff --git a/patches/server/0451-Add-permission-for-command-blocks.patch b/patches/server/0451-Add-permission-for-command-blocks.patch
index 07a74e38d2..47344e7f6f 100644
--- a/patches/server/0451-Add-permission-for-command-blocks.patch
+++ b/patches/server/0451-Add-permission-for-command-blocks.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add permission for command blocks
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
-index a85b89a0d525e623e154c8b1bea55470d2072dcb..4f1430c71aff4959b1db76200fe750a6c44cef68 100644
+index d87ee258db769bc072cbdae4298ebc08588b2160..29809127da2961858142bfb5b54c6db1ad4d4f0f 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -391,7 +391,7 @@ public class ServerPlayerGameMode {
@@ -18,10 +18,10 @@ index a85b89a0d525e623e154c8b1bea55470d2072dcb..4f1430c71aff4959b1db76200fe750a6
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 31d99592c06da5c7eb0738210128509870d44d75..dd29bad410ff74ce3f1f94bc60560cf10b12375f 100644
+index 3e7d09445ed0679b962a226364b7aedba0fb2d74..62deb7cc804b97528a74600b1918fc88d71e2966 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -786,7 +786,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -787,7 +787,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (!this.server.isCommandBlockEnabled()) {
this.player.sendMessage(new TranslatableComponent("advMode.notEnabled"), Util.NIL_UUID);
@@ -30,7 +30,7 @@ index 31d99592c06da5c7eb0738210128509870d44d75..dd29bad410ff74ce3f1f94bc60560cf1
this.player.sendMessage(new TranslatableComponent("advMode.notAllowed"), Util.NIL_UUID);
} else {
BaseCommandBlock commandblocklistenerabstract = null;
-@@ -853,7 +853,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -854,7 +854,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (!this.server.isCommandBlockEnabled()) {
this.player.sendMessage(new TranslatableComponent("advMode.notEnabled"), Util.NIL_UUID);
diff --git a/patches/server/0453-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0453-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
index f5d589f9cb..4ceaacadbc 100644
--- a/patches/server/0453-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
+++ b/patches/server/0453-Fix-Per-World-Difficulty-Remembering-Difficulty.patch
@@ -94,10 +94,10 @@ index 2f13055a39c26fe12d2c1094103186635e536166..6b0cb662d9163c360035e19c5faad59f
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 22a10327a690263a8756ffa3098b816c4be20e54..4e73fae8276be9874c61a456a2648828d39dd1cb 100644
+index 62deb7cc804b97528a74600b1918fc88d71e2966..acffb2c8a4f864da16c65b83a320d8b181bdc2d7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -3028,7 +3028,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3029,7 +3029,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) {
diff --git a/patches/server/0459-incremental-chunk-and-player-saving.patch b/patches/server/0459-incremental-chunk-and-player-saving.patch
index 4c58cdfe3d..f5e658a985 100644
--- a/patches/server/0459-incremental-chunk-and-player-saving.patch
+++ b/patches/server/0459-incremental-chunk-and-player-saving.patch
@@ -165,7 +165,7 @@ index 626bcbc6dd013260c3f8b38a1d14e7ba35dc1e01..9e96b0465717bfa761289c255fd8d2f1
for (int i = 0; i < this.futures.length(); ++i) {
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = (CompletableFuture) this.futures.get(i);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index b1ae9e1aa68aaa0435ecdd50d78f82d4e36441bf..9a247feffce5ba08064afaa96053feb22dd52716 100644
+index 847c4705f88b999976c9a99519939eb2e71e7f1d..1ff5ca11e3550dc730dd9d44acd666119f42898f 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -101,6 +101,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
@@ -176,7 +176,7 @@ index b1ae9e1aa68aaa0435ecdd50d78f82d4e36441bf..9a247feffce5ba08064afaa96053feb2
import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.commons.lang3.mutable.MutableObject;
import org.apache.logging.log4j.LogManager;
-@@ -677,6 +678,64 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -639,6 +640,64 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
@@ -241,7 +241,7 @@ index b1ae9e1aa68aaa0435ecdd50d78f82d4e36441bf..9a247feffce5ba08064afaa96053feb2
protected void saveAllChunks(boolean flush) {
if (flush) {
List<ChunkHolder> list = (List) this.visibleChunkMap.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList());
-@@ -772,7 +831,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -734,7 +793,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
int l = 0;
ObjectIterator objectiterator = this.visibleChunkMap.values().iterator();
@@ -250,7 +250,7 @@ index b1ae9e1aa68aaa0435ecdd50d78f82d4e36441bf..9a247feffce5ba08064afaa96053feb2
if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) {
++l;
}
-@@ -814,6 +873,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -776,6 +835,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.level.unload(chunk);
}
@@ -258,7 +258,7 @@ index b1ae9e1aa68aaa0435ecdd50d78f82d4e36441bf..9a247feffce5ba08064afaa96053feb2
this.lightEngine.updateChunkStatus(ichunkaccess.getPos());
this.lightEngine.tryScheduleUpdate();
-@@ -1211,6 +1271,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1173,6 +1233,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
asyncSaveData, chunk);
chunk.setUnsaved(false);
@@ -266,7 +266,7 @@ index b1ae9e1aa68aaa0435ecdd50d78f82d4e36441bf..9a247feffce5ba08064afaa96053feb2
}
// Paper end
-@@ -1220,6 +1281,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1182,6 +1243,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!chunk.isUnsaved()) {
return false;
} else {
@@ -275,7 +275,7 @@ index b1ae9e1aa68aaa0435ecdd50d78f82d4e36441bf..9a247feffce5ba08064afaa96053feb2
ChunkPos chunkcoordintpair = chunk.getPos();
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 76b56ea346d843aba482c52c4bfe877fdf0e9225..eb0c5ceb05f37bc653ea0cc91cc778866861688a 100644
+index 24d0b02264e4cced08a60f36b5c41bb350a1dc60..013c4c428b3cf3c9ad7b9b2ed8b00b410e1804a9 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -825,6 +825,15 @@ public class ServerChunkCache extends ChunkSource {
@@ -295,10 +295,10 @@ index 76b56ea346d843aba482c52c4bfe877fdf0e9225..eb0c5ceb05f37bc653ea0cc91cc77886
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 fe572c99263a44a23e2dc5141295d98973684a88..d21a910f2cca26adedab0732d04c8613e5afcd4f 100644
+index 083772c2f71851b5521f0ec5c1ecb872e357e8f7..be26327d31a3117cb7a5bf752c49c204738bc91e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1055,6 +1055,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1058,6 +1058,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos);
}
@@ -337,7 +337,7 @@ index fe572c99263a44a23e2dc5141295d98973684a88..d21a910f2cca26adedab0732d04c8613
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 2f13055a39c26fe12d2c1094103186635e536166..4b83617a81db1749faaf49fc3ee77e44846dce1a 100644
+index 6b0cb662d9163c360035e19c5faad59fc72af3c1..d2280b9e9f107dca890bc76f0c58e7070ce4b38c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -171,6 +171,7 @@ public class ServerPlayer extends Player {
@@ -349,7 +349,7 @@ index 2f13055a39c26fe12d2c1094103186635e536166..4b83617a81db1749faaf49fc3ee77e44
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
public ServerGamePacketListenerImpl connection;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 9b7fcd8be912cd211b6226386bd3340076953442..a8048e3af5bccb4cabe1ed1bc774aac6b8486bec 100644
+index f3926ee149e5e42d48e33759202d8297e3afd1d4..8c0faa9ee28943c7750dc33947e3f096b45a2026 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -556,6 +556,7 @@ public abstract class PlayerList {
@@ -385,7 +385,7 @@ index 9b7fcd8be912cd211b6226386bd3340076953442..a8048e3af5bccb4cabe1ed1bc774aac6
MinecraftTimings.savePlayers.stopTiming(); // Paper
return null; }); // Paper - ensure main
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
-index 0a2f9e93666a5b2123f84e5cf409e4355d3cad86..e3a92021b32aa74a37287504e0e539af5ec8216f 100644
+index a657b41263739b454617db5d7cb9e5cdd94f44ec..6d5f867989eb786683e81e2d270ed0b085c1f072 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
@@ -457,6 +457,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
@@ -397,7 +397,7 @@ index 0a2f9e93666a5b2123f84e5cf409e4355d3cad86..e3a92021b32aa74a37287504e0e539af
// CraftBukkit start - decompile error
public static record TicksToSave(SerializableTickContainer<Block> blocks, SerializableTickContainer<Fluid> fluids) {
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 f7388d37b467d1c153fcf8002eedd20417f93d52..ed22486dafcecae454a932c1354cf26c31e95636 100644
+index d70bdf21dd7bdf01b34d0fd38e79f9b386ec1fcc..6eaba33b7730d66bf631b6d5c6a7080f9f019f8b 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -87,6 +87,12 @@ public class LevelChunk extends ChunkAccess {
diff --git a/patches/server/0469-Update-itemstack-legacy-name-and-lore.patch b/patches/server/0469-Update-itemstack-legacy-name-and-lore.patch
index b98004d198..d59dc7e541 100644
--- a/patches/server/0469-Update-itemstack-legacy-name-and-lore.patch
+++ b/patches/server/0469-Update-itemstack-legacy-name-and-lore.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Update itemstack legacy name and lore
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index 57a9106005413e6767f0fe291c463742ba9afb21..31439467f1730d96712e53a8e27892dfce017c70 100644
+index 83d872044c3db54352847e08bb333ff7e0aee0b0..6dd68c17d5365fecfbd15cfaac837e0869cdce2e 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -169,6 +169,44 @@ public final class ItemStack {
+@@ -168,6 +168,44 @@ public final class ItemStack {
list.sort((Comparator<? super net.minecraft.nbt.Tag>) enchantSorter); // Paper
} catch (Exception ignored) {}
}
@@ -21,7 +21,7 @@ index 57a9106005413e6767f0fe291c463742ba9afb21..31439467f1730d96712e53a8e27892df
+ if (json != null && json.contains("\u00A7")) {
+ try {
+ display.put("Name", convert(json));
-+ } catch (JsonParseException jsonparseexception) {
++ } catch (com.google.gson.JsonParseException jsonparseexception) {
+ display.remove("Name");
+ }
+ }
@@ -33,7 +33,7 @@ index 57a9106005413e6767f0fe291c463742ba9afb21..31439467f1730d96712e53a8e27892df
+ if (json != null && json.contains("\u00A7")) { // Only try if it has legacy in the unparsed json
+ try {
+ list.set(index, convert(json));
-+ } catch (JsonParseException e) {
++ } catch (com.google.gson.JsonParseException e) {
+ list.set(index, net.minecraft.nbt.StringTag.valueOf(org.bukkit.craftbukkit.util.CraftChatMessage.toJSON(new TextComponent(""))));
+ }
+ }
@@ -53,7 +53,7 @@ index 57a9106005413e6767f0fe291c463742ba9afb21..31439467f1730d96712e53a8e27892df
// Paper end
public ItemStack(ItemLike item) {
-@@ -215,6 +253,7 @@ public final class ItemStack {
+@@ -214,6 +252,7 @@ public final class ItemStack {
this.tag = nbttagcompound.getCompound("tag").copy();
// CraftBukkit end
this.processEnchantOrder(this.tag); // Paper
diff --git a/patches/server/0473-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/patches/server/0473-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
index 9c4ab60311..7f224b44fe 100644
--- a/patches/server/0473-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
+++ b/patches/server/0473-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
@@ -360,7 +360,7 @@ index 9e96b0465717bfa761289c255fd8d2f1df1be3d8..87271552aa85626f22f7f8569c8fb48f
return this.isEntityTickingReady;
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 9a247feffce5ba08064afaa96053feb22dd52716..807914712faf6dc98ff138ffa31b08376afcff8e 100644
+index 1ff5ca11e3550dc730dd9d44acd666119f42898f..0b8b813d329aa1de912057ddeb52c0442f262f13 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -128,6 +128,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -425,7 +425,7 @@ index 9a247feffce5ba08064afaa96053feb22dd52716..807914712faf6dc98ff138ffa31b0837
// Paper start
public void updatePlayerMobTypeMap(Entity entity) {
if (!this.level.paperConfig.perPlayerMobSpawns) {
-@@ -555,6 +596,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -517,6 +558,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
List<ChunkHolder> list1 = new ArrayList();
int j = centerChunk.x;
int k = centerChunk.z;
@@ -433,7 +433,7 @@ index 9a247feffce5ba08064afaa96053feb22dd52716..807914712faf6dc98ff138ffa31b0837
for (int l = -margin; l <= margin; ++l) {
for (int i1 = -margin; i1 <= margin; ++i1) {
-@@ -573,6 +615,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -535,6 +577,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkStatus chunkstatus = (ChunkStatus) distanceToStatus.apply(j1);
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = playerchunk.getOrScheduleFuture(chunkstatus, this);
@@ -448,7 +448,7 @@ index 9a247feffce5ba08064afaa96053feb22dd52716..807914712faf6dc98ff138ffa31b0837
list1.add(playerchunk);
list.add(completablefuture);
-@@ -913,11 +963,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -875,11 +925,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (requiredStatus == ChunkStatus.EMPTY) {
return this.scheduleChunkLoad(chunkcoordintpair);
} else {
@@ -469,7 +469,7 @@ index 9a247feffce5ba08064afaa96053feb22dd52716..807914712faf6dc98ff138ffa31b0837
if (optional.isPresent() && ((ChunkAccess) optional.get()).getStatus().isOrAfter(requiredStatus)) {
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = requiredStatus.load(this.level, this.structureManager, this.lightEngine, (ichunkaccess) -> {
-@@ -929,6 +987,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -891,6 +949,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else {
return this.scheduleChunkGeneration(holder, requiredStatus);
}
@@ -477,7 +477,7 @@ index 9a247feffce5ba08064afaa96053feb22dd52716..807914712faf6dc98ff138ffa31b0837
}
}
-@@ -985,14 +1044,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -947,14 +1006,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
};
CompletableFuture<CompoundTag> chunkSaveFuture = this.level.asyncChunkTaskManager.getChunkSaveFuture(pos.x, pos.z);
@@ -507,7 +507,7 @@ index 9a247feffce5ba08064afaa96053feb22dd52716..807914712faf6dc98ff138ffa31b0837
return ret;
// Paper end
}
-@@ -1044,7 +1113,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1006,7 +1075,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.releaseLightTicket(chunkcoordintpair);
return CompletableFuture.completedFuture(Either.right(playerchunk_failure));
});
@@ -519,7 +519,7 @@ index 9a247feffce5ba08064afaa96053feb22dd52716..807914712faf6dc98ff138ffa31b0837
}
protected void releaseLightTicket(ChunkPos pos) {
-@@ -1128,7 +1200,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1090,7 +1162,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
long i = chunkHolder.getPos().toLong();
Objects.requireNonNull(chunkHolder);
@@ -1164,7 +1164,7 @@ index 96de46b0b1b4bd69b1afa689083ec57ffb07120e..40e8c0b36ec521a8850782f349eb29b4
public float yRotO;
public float xRotO;
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 9cb5e608ace42acd1a5335b70d049a88f3918de5..b69ce653592575252a58cdd47052ab13fcb80f1c 100644
+index 6eaba33b7730d66bf631b6d5c6a7080f9f019f8b..8e03e63a00dd242791ba0d5a8a17922227b16165 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -141,7 +141,7 @@ public class LevelChunk extends ChunkAccess {
diff --git a/patches/server/0478-Move-range-check-for-block-placing-up.patch b/patches/server/0478-Move-range-check-for-block-placing-up.patch
index f7c7d2dd76..5f4bf62156 100644
--- a/patches/server/0478-Move-range-check-for-block-placing-up.patch
+++ b/patches/server/0478-Move-range-check-for-block-placing-up.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Move range check for block placing up
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 0bcafeb8008bd2556bcdc556b17d00ff936d7aa9..26bd27d3dd6e99488fd0a77257866b1eb1b191b8 100644
+index acffb2c8a4f864da16c65b83a320d8b181bdc2d7..938e6ee89bdb398dc4e2ce1682727c0e63f28c26 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1666,6 +1666,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1667,6 +1667,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
// Spigot end
@@ -23,7 +23,7 @@ index 0bcafeb8008bd2556bcdc556b17d00ff936d7aa9..26bd27d3dd6e99488fd0a77257866b1e
@Override
public void handleUseItemOn(ServerboundUseItemOnPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
-@@ -1678,17 +1686,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1679,17 +1687,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
BlockPos blockposition = movingobjectpositionblock.getBlockPos();
Direction enumdirection = movingobjectpositionblock.getDirection();
diff --git a/patches/server/0487-Brand-support.patch b/patches/server/0487-Brand-support.patch
index f26931b7bd..7e22187c8b 100644
--- a/patches/server/0487-Brand-support.patch
+++ b/patches/server/0487-Brand-support.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Brand support
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 2ab8a56276997499457d8c6559b3a448e9072674..86c30ab5e690a7e12a0691fc4b5dcee8b7971cb8 100644
+index 938e6ee89bdb398dc4e2ce1682727c0e63f28c26..4065a1cb1b4b68aa3ff9f1c3e86c270e1509f93f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
@@ -33,7 +33,7 @@ index 2ab8a56276997499457d8c6559b3a448e9072674..86c30ab5e690a7e12a0691fc4b5dcee8
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.server = server;
this.connection = connection;
-@@ -2996,6 +3000,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2997,6 +3001,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register");
private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister");
@@ -42,7 +42,7 @@ index 2ab8a56276997499457d8c6559b3a448e9072674..86c30ab5e690a7e12a0691fc4b5dcee8
@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
-@@ -3023,6 +3029,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3024,6 +3030,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
try {
byte[] data = new byte[packet.data.readableBytes()];
packet.data.readBytes(data);
@@ -58,7 +58,7 @@ index 2ab8a56276997499457d8c6559b3a448e9072674..86c30ab5e690a7e12a0691fc4b5dcee8
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data);
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
-@@ -3032,6 +3047,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3033,6 +3048,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
diff --git a/patches/server/0491-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0491-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
index a6c1cc787b..24c50ccb97 100644
--- a/patches/server/0491-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
+++ b/patches/server/0491-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index d21a910f2cca26adedab0732d04c8613e5afcd4f..ad4904aff037fd916ef5481dc5516781ad078330 100644
+index be26327d31a3117cb7a5bf752c49c204738bc91e..230ee6dd71e55921960a81d7b3aedbc804f785e5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1720,6 +1720,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1743,6 +1743,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
//ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c()));
this.levelData.setSpawn(pos, angle);
diff --git a/patches/server/0493-Improve-Chunk-Status-Transition-Speed.patch b/patches/server/0493-Improve-Chunk-Status-Transition-Speed.patch
index f95cb1a58c..e3f37a7db6 100644
--- a/patches/server/0493-Improve-Chunk-Status-Transition-Speed.patch
+++ b/patches/server/0493-Improve-Chunk-Status-Transition-Speed.patch
@@ -54,10 +54,10 @@ index 87271552aa85626f22f7f8569c8fb48fe4b30bf3..80aae4303e011dad13ce818136f0383e
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 807914712faf6dc98ff138ffa31b08376afcff8e..a1b667084f710230d3f94ee0e5f5750de1d71e29 100644
+index 0b8b813d329aa1de912057ddeb52c0442f262f13..a97bf06a0e8ba1cd612f7e8be2585bfdfbdfa969 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -674,7 +674,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -636,7 +636,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return either.mapLeft((list) -> {
return (LevelChunk) list.get(list.size() / 2);
});
@@ -66,7 +66,7 @@ index 807914712faf6dc98ff138ffa31b08376afcff8e..a1b667084f710230d3f94ee0e5f5750d
}
@Nullable
-@@ -1084,6 +1084,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1046,6 +1046,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return "chunkGenerate " + requiredStatus.getName();
});
Executor executor = (runnable) -> {
diff --git a/patches/server/0500-PortalCreateEvent-needs-to-know-its-entity.patch b/patches/server/0500-PortalCreateEvent-needs-to-know-its-entity.patch
index 0d7bc590fa..19b2867cf5 100644
--- a/patches/server/0500-PortalCreateEvent-needs-to-know-its-entity.patch
+++ b/patches/server/0500-PortalCreateEvent-needs-to-know-its-entity.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] PortalCreateEvent needs to know its entity
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index 2fdd19ec71bdf92e317196eab5426760d9c57278..a0d1877e9b5229bc04dba72fb629e26d25e85bfb 100644
+index 6dd68c17d5365fecfbd15cfaac837e0869cdce2e..9afecaa4cfa0466abb691977e55bcddb64b7feda 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -410,7 +410,7 @@ public final class ItemStack {
+@@ -409,7 +409,7 @@ public final class ItemStack {
net.minecraft.world.level.block.state.BlockState block = world.getBlockState(newblockposition);
if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically
diff --git a/patches/server/0506-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/0506-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch
index cebce82fed..22f0e6e4ec 100644
--- a/patches/server/0506-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch
+++ b/patches/server/0506-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch
@@ -9,10 +9,10 @@ as this is how Vanilla teleports entities.
Cancel any pending motion when teleported.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 86c30ab5e690a7e12a0691fc4b5dcee8b7971cb8..aacfc474223bbbaca2182eeb9bcffd5a941e7b06 100644
+index 4065a1cb1b4b68aa3ff9f1c3e86c270e1509f93f..70c1f6d91d1792ef713e46b93897a94fc50e08eb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -680,7 +680,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -681,7 +681,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
public void handleAcceptTeleportPacket(ServerboundAcceptTeleportationPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (packet.getId() == this.awaitingTeleport && this.awaitingPositionFromClient != null) { // CraftBukkit
@@ -21,7 +21,7 @@ index 86c30ab5e690a7e12a0691fc4b5dcee8b7971cb8..aacfc474223bbbaca2182eeb9bcffd5a
this.lastGoodX = this.awaitingPositionFromClient.x;
this.lastGoodY = this.awaitingPositionFromClient.y;
this.lastGoodZ = this.awaitingPositionFromClient.z;
-@@ -1554,7 +1554,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1555,7 +1555,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end
this.awaitingTeleportTime = this.tickCount;
diff --git a/patches/server/0509-Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/0509-Extend-block-drop-capture-to-capture-all-items-added.patch
index 7ee1833921..eb1b351172 100644
--- a/patches/server/0509-Extend-block-drop-capture-to-capture-all-items-added.patch
+++ b/patches/server/0509-Extend-block-drop-capture-to-capture-all-items-added.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index ad4904aff037fd916ef5481dc5516781ad078330..00a64168592ad2c8cecb2fc844d81e47610601ad 100644
+index 230ee6dd71e55921960a81d7b3aedbc804f785e5..1a79c9767dd6e207653d59532b00742a1d85f314 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1257,6 +1257,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1260,6 +1260,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false;
} else {
@@ -24,7 +24,7 @@ index ad4904aff037fd916ef5481dc5516781ad078330..00a64168592ad2c8cecb2fc844d81e47
return false;
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
-index 4f1430c71aff4959b1db76200fe750a6c44cef68..01b19225193ef3a3f69291f0357c096fc9e71618 100644
+index 29809127da2961858142bfb5b54c6db1ad4d4f0f..aa065f732637b6220fd7328b4d5bc6005ee31832 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -423,10 +423,12 @@ public class ServerPlayerGameMode {
diff --git a/patches/server/0517-Fix-for-large-move-vectors-crashing-server.patch b/patches/server/0517-Fix-for-large-move-vectors-crashing-server.patch
index b66e68dbc7..7d8b99b371 100644
--- a/patches/server/0517-Fix-for-large-move-vectors-crashing-server.patch
+++ b/patches/server/0517-Fix-for-large-move-vectors-crashing-server.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix for large move vectors crashing server
Check movement distance also based on current position.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 2074760beee6fdc2e94bb0f5dcfbae7b5813e8c9..2dd47eab63cf9322a5844e748709e220272a8cfe 100644
+index 70c1f6d91d1792ef713e46b93897a94fc50e08eb..5313b035870fc39af214b18383a496b2fccdc1f4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -505,20 +505,31 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -506,20 +506,31 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (entity != this.player && entity.getControllingPassenger() == this.player && entity == this.lastVehicle) {
ServerLevel worldserver = this.player.getLevel();
@@ -49,7 +49,7 @@ index 2074760beee6fdc2e94bb0f5dcfbae7b5813e8c9..2dd47eab63cf9322a5844e748709e220
// CraftBukkit start - handle custom speeds and skipped ticks
this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick;
-@@ -561,9 +572,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -562,9 +573,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
boolean flag = worldserver.noCollision(entity, entity.getBoundingBox().deflate(0.0625D));
@@ -62,7 +62,7 @@ index 2074760beee6fdc2e94bb0f5dcfbae7b5813e8c9..2dd47eab63cf9322a5844e748709e220
entity.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
double d11 = d7;
-@@ -1231,14 +1242,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1232,14 +1243,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
float prevPitch = this.player.getXRot();
// CraftBukkit end
double d3 = this.player.getX(); final double toX = d3; // Paper - OBFHELPER
@@ -90,7 +90,7 @@ index 2074760beee6fdc2e94bb0f5dcfbae7b5813e8c9..2dd47eab63cf9322a5844e748709e220
if (this.player.isSleeping()) {
if (d11 > 1.0D) {
-@@ -1290,9 +1312,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1291,9 +1313,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
AABB axisalignedbb = this.player.getBoundingBox();
diff --git a/patches/server/0534-Add-API-for-quit-reason.patch b/patches/server/0534-Add-API-for-quit-reason.patch
index 6ea3012532..89a652575c 100644
--- a/patches/server/0534-Add-API-for-quit-reason.patch
+++ b/patches/server/0534-Add-API-for-quit-reason.patch
@@ -25,7 +25,7 @@ index d30bc3f1da336b421d9a42070184e07169dd14e4..a6eadf71957b37e2acc5d09f0ce4ee96
Connection.LOGGER.debug("Failed to sent packet", throwable);
ConnectionProtocol enumprotocol = this.getCurrentProtocol();
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 968b8180f92066a43f06bff8dd1d49b03bd08f5b..257942084d988cac5f87ff998ea637fa263a3fe9 100644
+index c68b95ef0d4c3e0d942e61bfccf23a00d0d8afd9..57ca53876941faf6a1cbefd6e0382ee0ce2e678f 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -257,6 +257,7 @@ public class ServerPlayer extends Player {
@@ -37,10 +37,10 @@ index 968b8180f92066a43f06bff8dd1d49b03bd08f5b..257942084d988cac5f87ff998ea637fa
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 2dd47eab63cf9322a5844e748709e220272a8cfe..c0a685cfe62aeda3583763ecc1e4fa127f8fb0d4 100644
+index 5313b035870fc39af214b18383a496b2fccdc1f4..f62f2c0bf9a9d280ed68de8c1afc382b561f31ec 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -442,6 +442,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -443,6 +443,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure
// CraftBukkit end
@@ -49,7 +49,7 @@ index 2dd47eab63cf9322a5844e748709e220272a8cfe..c0a685cfe62aeda3583763ecc1e4fa12
this.connection.disconnect(ichatbasecomponent);
});
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index a1077445ab7d416dc61db85742e447193642b919..38f0f98c2191bfe36c3547501e49680faef50403 100644
+index ba46e9eafab188455d49f1a555e38b0ebe66fcf9..3428f3014d9b8e9422a9f586268f5e82dcf1e33f 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -596,7 +596,7 @@ public abstract class PlayerList {
diff --git a/patches/server/0547-Limit-recipe-packets.patch b/patches/server/0547-Limit-recipe-packets.patch
index b845097946..228cb4bc55 100644
--- a/patches/server/0547-Limit-recipe-packets.patch
+++ b/patches/server/0547-Limit-recipe-packets.patch
@@ -23,7 +23,7 @@ index bd7926fa89621e8cdd0b5fdd8ed3b8c6dbfbc3ec..f20497eb1202e3e4c256f6cf04f8644a
public static boolean velocityOnlineMode;
public static byte[] velocitySecretKey;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index c0a685cfe62aeda3583763ecc1e4fa127f8fb0d4..ff36ca2dbdf4a9abb953097f1b6246a177370b02 100644
+index f62f2c0bf9a9d280ed68de8c1afc382b561f31ec..fa4ce1c0f2d1f0204aa6db7503e8c5bd4c605d16 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -230,6 +230,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -34,7 +34,7 @@ index c0a685cfe62aeda3583763ecc1e4fa127f8fb0d4..ff36ca2dbdf4a9abb953097f1b6246a1
// CraftBukkit end
private int dropSpamTickCount;
private double firstGoodX;
-@@ -375,6 +376,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -376,6 +377,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit start
for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable
@@ -42,7 +42,7 @@ index c0a685cfe62aeda3583763ecc1e4fa127f8fb0d4..ff36ca2dbdf4a9abb953097f1b6246a1
/* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount;
-@@ -2810,6 +2812,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2811,6 +2813,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
diff --git a/patches/server/0564-Fix-interact-event-not-being-called-in-adventure.patch b/patches/server/0564-Fix-interact-event-not-being-called-in-adventure.patch
index 857bbcaeb2..c577168e70 100644
--- a/patches/server/0564-Fix-interact-event-not-being-called-in-adventure.patch
+++ b/patches/server/0564-Fix-interact-event-not-being-called-in-adventure.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix interact event not being called in adventure
Call PlayerInteractEvent when left-clicking on a block in adventure mode
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index ff36ca2dbdf4a9abb953097f1b6246a177370b02..f9490e629b8aa94158724850812414ede2df7e92 100644
+index fa4ce1c0f2d1f0204aa6db7503e8c5bd4c605d16..5a334dd83f3585c61fafd85fd581dbf79051910d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1739,7 +1739,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1740,7 +1740,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
MutableComponent ichatmutablecomponent = (new TranslatableComponent("build.tooHigh", new Object[]{i - 1})).withStyle(ChatFormatting.RED);
this.player.sendMessage(ichatmutablecomponent, ChatType.GAME_INFO, Util.NIL_UUID);
@@ -18,7 +18,7 @@ index ff36ca2dbdf4a9abb953097f1b6246a177370b02..f9490e629b8aa94158724850812414ed
this.player.swing(enumhand, true);
}
}
-@@ -2211,7 +2211,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2212,7 +2212,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
Vec3 vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
HitResult movingobjectposition = this.player.level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, this.player));
diff --git a/patches/server/0578-Remove-stale-POIs.patch b/patches/server/0578-Remove-stale-POIs.patch
index c7050f8002..0dfcb57c09 100644
--- a/patches/server/0578-Remove-stale-POIs.patch
+++ b/patches/server/0578-Remove-stale-POIs.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Remove stale POIs
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 00a64168592ad2c8cecb2fc844d81e47610601ad..6d635a02a12d3af0639d7afda19d5f71cf81ee44 100644
+index 1a79c9767dd6e207653d59532b00742a1d85f314..7f2f47c16b15be32347f0e1689ac69fc6d6d0c2d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1800,6 +1800,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1823,6 +1823,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
});
optional1.ifPresent((villageplacetype) -> {
this.getServer().execute(() -> {
diff --git a/patches/server/0589-Added-firing-of-PlayerChangeBeaconEffectEvent.patch b/patches/server/0589-Added-firing-of-PlayerChangeBeaconEffectEvent.patch
index b6c0947f13..3ec45e2a4d 100644
--- a/patches/server/0589-Added-firing-of-PlayerChangeBeaconEffectEvent.patch
+++ b/patches/server/0589-Added-firing-of-PlayerChangeBeaconEffectEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Added firing of PlayerChangeBeaconEffectEvent
diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
-index 61276c2a7d607f57b3e5e4c61bc89d5016d5dd1f..fb4c987512f82e702b20c0eff493a2777624f3b3 100644
+index a974b8b9fe6c2071d978afcc2d00bb65861fb82e..4a16f7d06431ae9cbc477d94ca930d814603cae0 100644
--- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
-@@ -160,9 +160,15 @@ public class BeaconMenu extends AbstractContainerMenu {
+@@ -161,10 +161,16 @@ public class BeaconMenu extends AbstractContainerMenu {
public void updateEffects(int primaryEffectId, int secondaryEffectId) {
if (this.paymentSlot.hasItem()) {
@@ -21,6 +21,7 @@ index 61276c2a7d607f57b3e5e4c61bc89d5016d5dd1f..fb4c987512f82e702b20c0eff493a277
+ this.beaconData.set(2, event.getSecondary() == null ? 0 : event.getSecondary().getId());
+ if (!event.willConsumeItem()) return;
this.paymentSlot.remove(1);
+ this.access.execute(Level::blockEntityChanged);
+ }
+ // Paper end
}
diff --git a/patches/server/0596-EntityMoveEvent.patch b/patches/server/0596-EntityMoveEvent.patch
index 5d31007a2f..c4e9383131 100644
--- a/patches/server/0596-EntityMoveEvent.patch
+++ b/patches/server/0596-EntityMoveEvent.patch
@@ -17,10 +17,10 @@ index b5b7bb3c0147f95ac4036e7d2aa8f26ac755f4df..18830fa8e43c70c9da417eb771d55335
this.profiler.push(() -> {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index f352c7d30a9d493f6d86830414623c2b2b1e2554..7e79aad7950298060e7b71321a0d60c1b29655ce 100644
+index 7f2f47c16b15be32347f0e1689ac69fc6d6d0c2d..2b6444711c39f042c21d374fc0dc507f1577fa1a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -205,6 +205,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -208,6 +208,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper
diff --git a/patches/server/0597-added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/0597-added-option-to-disable-pathfinding-updates-on-block.patch
index 691f1b3f28..62989c5691 100644
--- a/patches/server/0597-added-option-to-disable-pathfinding-updates-on-block.patch
+++ b/patches/server/0597-added-option-to-disable-pathfinding-updates-on-block.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-index 24f33bf34bacd1748aa7394fbe8951a818e85060..a94cb1ffe034a00f9d3cf2dc190862b906abd8dc 100644
+index a17dc48e0bddea3272120f4a129278b755834d40..83d5bbf0a819d6a75d148de5a7f3679e3faad9ec 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -755,6 +755,11 @@ public class PaperWorldConfig {
@@ -21,18 +21,18 @@ index 24f33bf34bacd1748aa7394fbe8951a818e85060..a94cb1ffe034a00f9d3cf2dc190862b9
public boolean phantomOnlyAttackInsomniacs = true;
private void phantomSettings() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 3a66376145f29e2330daed723ffccf98415b0540..5b17b4c06d8da92d25048a4df72a328c90af76b6 100644
+index 2b6444711c39f042c21d374fc0dc507f1577fa1a..277f9c00c305a1e8b832bb48d9764a9d014612a6 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1391,6 +1391,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
- @Override
- public void sendBlockUpdated(BlockPos pos, BlockState oldState, BlockState newState, int flags) {
+@@ -1400,6 +1400,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+ }
+
this.getChunkSource().blockChanged(pos);
+ if(this.paperConfig.updatePathfindingOnBlockUpdate) { // Paper - option to disable pathfinding updates
VoxelShape voxelshape = oldState.getCollisionShape(this, pos);
VoxelShape voxelshape1 = newState.getCollisionShape(this, pos);
-@@ -1418,6 +1419,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1441,6 +1442,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
diff --git a/patches/server/0616-Allow-using-signs-inside-spawn-protection.patch b/patches/server/0616-Allow-using-signs-inside-spawn-protection.patch
index 4b9fc3b054..c799932a1a 100644
--- a/patches/server/0616-Allow-using-signs-inside-spawn-protection.patch
+++ b/patches/server/0616-Allow-using-signs-inside-spawn-protection.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Allow using signs inside spawn protection
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-index a94cb1ffe034a00f9d3cf2dc190862b906abd8dc..716747f86cb7b4ee811c5e128c00b5319959cb64 100644
+index 83d5bbf0a819d6a75d148de5a7f3679e3faad9ec..f372caad76d5f59f37d073bb245fca3a037c2bef 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -789,4 +789,9 @@ public class PaperWorldConfig {
@@ -19,10 +19,10 @@ index a94cb1ffe034a00f9d3cf2dc190862b906abd8dc..716747f86cb7b4ee811c5e128c00b531
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index f9490e629b8aa94158724850812414ede2df7e92..91ed360b7e326ddac93abd61dfbaf6b8e83bb6e6 100644
+index 5a334dd83f3585c61fafd85fd581dbf79051910d..cd1a06338cebfc6cc65a2545a882c59949635061 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1728,7 +1728,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1729,7 +1729,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
int i = this.player.level.getMaxBuildHeight();
if (blockposition.getY() < i) {
diff --git a/patches/server/0624-Don-t-ignore-result-of-PlayerEditBookEvent.patch b/patches/server/0624-Don-t-ignore-result-of-PlayerEditBookEvent.patch
index bdb7bd8746..899ceb3a90 100644
--- a/patches/server/0624-Don-t-ignore-result-of-PlayerEditBookEvent.patch
+++ b/patches/server/0624-Don-t-ignore-result-of-PlayerEditBookEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't ignore result of PlayerEditBookEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 91ed360b7e326ddac93abd61dfbaf6b8e83bb6e6..7d5b999178ef7faed6a901fdc7456a9a2a28d89a 100644
+index cd1a06338cebfc6cc65a2545a882c59949635061..127472fc929ed121f63a4ee53ff6cfd80db36b7f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1176,7 +1176,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1177,7 +1177,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
itemstack.addTagElement("pages", nbttaglist);
diff --git a/patches/server/0628-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch b/patches/server/0628-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch
index 42fbf5a03d..885ffa6011 100644
--- a/patches/server/0628-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch
+++ b/patches/server/0628-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Allow for Component suggestion tooltips in
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 7d5b999178ef7faed6a901fdc7456a9a2a28d89a..48420071e5d1ee2b4c04822095a1789b6606bef4 100644
+index 127472fc929ed121f63a4ee53ff6cfd80db36b7f..9178614b456cf528e910e9fe991300ce24e92158 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -762,12 +762,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -763,12 +763,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// Paper start - async tab completion
com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event;
@@ -24,7 +24,7 @@ index 7d5b999178ef7faed6a901fdc7456a9a2a28d89a..48420071e5d1ee2b4c04822095a1789b
// If the event isn't handled, we can assume that we have no completions, and so we'll ask the server
if (!event.isHandled()) {
if (!event.isCancelled()) {
-@@ -786,10 +785,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -787,10 +786,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
});
}
} else if (!completions.isEmpty()) {
diff --git a/patches/server/0639-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0639-fix-PlayerItemHeldEvent-firing-twice.patch
index 13b4e6d251..0354ab8a80 100644
--- a/patches/server/0639-fix-PlayerItemHeldEvent-firing-twice.patch
+++ b/patches/server/0639-fix-PlayerItemHeldEvent-firing-twice.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 48420071e5d1ee2b4c04822095a1789b6606bef4..eb811f9fcaf84edce3b59fc5f53cd72ffaf1506c 100644
+index 9178614b456cf528e910e9fe991300ce24e92158..7851595980ea4d26325cfb1e98a347c4985baa93 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1932,6 +1932,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1933,6 +1933,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (this.player.isImmobile()) return; // CraftBukkit
if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) {
diff --git a/patches/server/0646-add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/0646-add-RespawnFlags-to-PlayerRespawnEvent.patch
index 1363695456..01902436d8 100644
--- a/patches/server/0646-add-RespawnFlags-to-PlayerRespawnEvent.patch
+++ b/patches/server/0646-add-RespawnFlags-to-PlayerRespawnEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] add RespawnFlags to PlayerRespawnEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index eb811f9fcaf84edce3b59fc5f53cd72ffaf1506c..9daad376b7c837ac5dcda5f54d520e2adfda0481 100644
+index 7851595980ea4d26325cfb1e98a347c4985baa93..d16de053be28cb7d31f431e56cd7f6c01311e2fd 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2470,7 +2470,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2471,7 +2471,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
case PERFORM_RESPAWN:
if (this.player.wonGame) {
this.player.wonGame = false;
@@ -18,7 +18,7 @@ index eb811f9fcaf84edce3b59fc5f53cd72ffaf1506c..9daad376b7c837ac5dcda5f54d520e2a
} else {
if (this.player.getHealth() > 0.0F) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 2edb28eddc740a13f1bcad1271f7f0163538846b..bc623b2e326f0241d8c86a37f231dd113a331583 100644
+index d7e6baab6fd48e4126e1c333d997a8673b4c0139..ad7e4ec5ca3f2f874c916d7ee80f5b2b2ae03bf8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -806,6 +806,12 @@ public abstract class PlayerList {
diff --git a/patches/server/0650-Add-EntityBlockStorage-clearEntities.patch b/patches/server/0650-Add-EntityBlockStorage-clearEntities.patch
index f432865c13..71da98f3c3 100644
--- a/patches/server/0650-Add-EntityBlockStorage-clearEntities.patch
+++ b/patches/server/0650-Add-EntityBlockStorage-clearEntities.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityBlockStorage#clearEntities()
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
-index cdf7778f4bfd576e87fe41096414ca8dcdbdf35b..9fcd835d219aafbe113ebb1b796052e07bf2b046 100644
+index 93f17997ac3f36d0a72e5d4e85c7e748d615801f..5c784e1155c16dbbe1b75bb5bcb3d73793d146a3 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
-@@ -135,6 +135,11 @@ public class BeehiveBlockEntity extends BlockEntity {
+@@ -139,6 +139,11 @@ public class BeehiveBlockEntity extends BlockEntity {
return this.stored.size();
}
diff --git a/patches/server/0659-additions-to-PlayerGameModeChangeEvent.patch b/patches/server/0659-additions-to-PlayerGameModeChangeEvent.patch
index 91286c0a32..436d2bd876 100644
--- a/patches/server/0659-additions-to-PlayerGameModeChangeEvent.patch
+++ b/patches/server/0659-additions-to-PlayerGameModeChangeEvent.patch
@@ -45,7 +45,7 @@ index d75f78d2e3fb1376e8f6a8668c98a04a693c99e1..79f6089b934124c3309c6bee2e48b36b
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 670048f5114ec1dcb0d6e0bb6173ba9d657e6eb1..b6230ce81d50da84b2db9446232c83bde3632a91 100644
+index fd6eb3b3953ca0413af6a71c52503c9674917a9e..77ba7fe43ceffcb816d209da45ab0c5de2112ee3 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1805,8 +1805,15 @@ public class ServerPlayer extends Player {
@@ -93,7 +93,7 @@ index 670048f5114ec1dcb0d6e0bb6173ba9d657e6eb1..b6230ce81d50da84b2db9446232c83bd
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
-index 3a8e87f19aa03786b3bf60b793958b59284d31ac..92f5cb240e0cf52caa8e95302606baa79a0da0f9 100644
+index e39e16f0b3a0d168b3049c37f5a2a9dc8f15a652..1ca6dc1e9334bf7e03eab4c2a75f4c86c7d36a9f 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -72,18 +72,24 @@ public class ServerPlayerGameMode {
@@ -126,10 +126,10 @@ index 3a8e87f19aa03786b3bf60b793958b59284d31ac..92f5cb240e0cf52caa8e95302606baa7
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 612da79bcad7216cb58e45bd0d29b05da8cdc321..ed2154c6987f6b94e1bcf6e1f91985a82d34fea0 100644
+index d16de053be28cb7d31f431e56cd7f6c01311e2fd..16ab98df5f5f538fa48feb9de32d06c8396b8013 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2479,7 +2479,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2480,7 +2480,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player = this.server.getPlayerList().respawn(this.player, false);
if (this.server.isHardcore()) {
diff --git a/patches/server/0667-Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/server/0667-Add-cause-to-Weather-ThunderChangeEvents.patch
index 7af83473e6..9de063e065 100644
--- a/patches/server/0667-Add-cause-to-Weather-ThunderChangeEvents.patch
+++ b/patches/server/0667-Add-cause-to-Weather-ThunderChangeEvents.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 5b17b4c06d8da92d25048a4df72a328c90af76b6..51e290adb44c9f7987ad79f22f158e5f93bedbbe 100644
+index 277f9c00c305a1e8b832bb48d9764a9d014612a6..2c8acd5610e873d64470b0e4b0373566357d885d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -468,8 +468,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -471,8 +471,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setClearWeatherTime(clearDuration);
this.serverLevelData.setRainTime(rainDuration);
this.serverLevelData.setThunderTime(rainDuration);
@@ -19,7 +19,7 @@ index 5b17b4c06d8da92d25048a4df72a328c90af76b6..51e290adb44c9f7987ad79f22f158e5f
}
@Override
-@@ -859,8 +859,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -862,8 +862,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setThunderTime(j);
this.serverLevelData.setRainTime(k);
this.serverLevelData.setClearWeatherTime(i);
@@ -30,7 +30,7 @@ index 5b17b4c06d8da92d25048a4df72a328c90af76b6..51e290adb44c9f7987ad79f22f158e5f
}
this.oThunderLevel = this.thunderLevel;
-@@ -926,14 +926,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -929,14 +929,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
private void resetWeatherCycle() {
// CraftBukkit start
diff --git a/patches/server/0670-Add-PlayerKickEvent-causes.patch b/patches/server/0670-Add-PlayerKickEvent-causes.patch
index 906b7a6273..cb2c7d5483 100644
--- a/patches/server/0670-Add-PlayerKickEvent-causes.patch
+++ b/patches/server/0670-Add-PlayerKickEvent-causes.patch
@@ -57,10 +57,10 @@ index 708ac03d5a849bf09c49547306e4a8c5a5ef8d91..5a8df368a4a25839cd4ac9be6972da2e
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650daa292fba 100644
+index 16ab98df5f5f538fa48feb9de32d06c8396b8013..1c303677bac4df134ee7eeda71bd0b5118358cb3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -319,7 +319,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -320,7 +320,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (this.clientIsFloating && !this.player.isSleeping()) {
if (++this.aboveGroundTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
@@ -69,7 +69,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return;
}
} else {
-@@ -338,7 +338,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -339,7 +339,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) {
if (++this.aboveGroundVehicleTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
@@ -78,7 +78,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return;
}
} else {
-@@ -360,7 +360,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -361,7 +361,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (this.keepAlivePending) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info
@@ -87,7 +87,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
}
} else {
if (elapsedTime >= 15000L) { // 15 seconds
-@@ -390,7 +390,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -391,7 +391,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) (this.server.getPlayerIdleTimeout() * 1000 * 60)) {
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
@@ -96,7 +96,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
}
}
-@@ -415,14 +415,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -416,14 +416,22 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
public void disconnect(String s) {
// Paper start
@@ -122,7 +122,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
// Paper end
// CraftBukkit start - fire PlayerKickEvent
if (this.processedDisconnect) {
-@@ -430,7 +438,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -431,7 +439,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, this.player.getBukkitEntity().displayName()); // Paper - Adventure
@@ -131,7 +131,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event);
-@@ -502,7 +510,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -503,7 +511,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(), packet.getY(), packet.getZ(), packet.getYRot(), packet.getXRot())) {
@@ -140,7 +140,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
} else {
Entity entity = this.player.getRootVehicle();
-@@ -743,13 +751,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -744,13 +752,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async
// CraftBukkit start
if (this.chatSpamTickCount.addAndGet(com.destroystokyo.paper.PaperConfig.tabSpamIncrement) > com.destroystokyo.paper.PaperConfig.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable
@@ -156,7 +156,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return;
}
// Paper end
-@@ -901,7 +909,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -902,7 +910,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// Paper start - validate pick item position
if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
@@ -165,7 +165,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return;
}
this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed
-@@ -1060,7 +1068,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1061,7 +1069,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
if (byteLength > 256 * 4) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!");
@@ -174,7 +174,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return;
}
byteTotal += byteLength;
-@@ -1083,14 +1091,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1084,14 +1092,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (byteTotal > byteAllowed) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
@@ -191,7 +191,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return;
}
this.lastBookTick = MinecraftServer.currentTick;
-@@ -1214,7 +1222,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1215,7 +1223,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) {
@@ -200,7 +200,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
} else {
ServerLevel worldserver = this.player.getLevel();
-@@ -1637,7 +1645,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1638,7 +1646,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.dropCount++;
if (this.dropCount >= 20) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!");
@@ -209,7 +209,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return;
}
}
-@@ -1844,7 +1852,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1845,7 +1853,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) {
ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
@@ -218,7 +218,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
}
// Paper start
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()];
-@@ -1949,7 +1957,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1950,7 +1958,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player.resetLastActionTime();
} else {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
@@ -227,7 +227,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
}
}
-@@ -1965,7 +1973,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1966,7 +1974,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@@ -236,7 +236,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return;
}
}
-@@ -2038,7 +2046,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2039,7 +2047,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
Waitable waitable = new Waitable() {
@Override
protected Object evaluate() {
@@ -245,7 +245,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return null;
}
};
-@@ -2053,7 +2061,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2054,7 +2062,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
throw new RuntimeException(e);
}
} else {
@@ -254,7 +254,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
}
// CraftBukkit end
}
-@@ -2326,7 +2334,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2327,7 +2335,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// Spigot Start
if ( entity == this.player && !this.player.isSpectator() )
{
@@ -263,7 +263,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return;
}
// Spigot End
-@@ -2421,7 +2429,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2422,7 +2430,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
// CraftBukkit end
} else {
@@ -272,7 +272,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
}
}
-@@ -2821,7 +2829,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2822,7 +2830,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// Paper start
if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (recipeSpamPackets.addAndGet(com.destroystokyo.paper.PaperConfig.autoRecipeIncrement) > com.destroystokyo.paper.PaperConfig.autoRecipeLimit) {
@@ -281,7 +281,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
return;
}
}
-@@ -3006,7 +3014,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3007,7 +3015,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
} else if (!this.isSingleplayerOwner()) {
// Paper start - This needs to be handled on the main thread for plugins
server.submit(() -> {
@@ -290,7 +290,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
});
// Paper end
}
-@@ -3052,7 +3060,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3053,7 +3061,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
@@ -299,7 +299,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
}
} else if (packet.identifier.equals(CUSTOM_UNREGISTER)) {
try {
-@@ -3062,7 +3070,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3063,7 +3071,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
@@ -308,7 +308,7 @@ index ed2154c6987f6b94e1bcf6e1f91985a82d34fea0..6c52ee394ecfbc6f36032ebc9632650d
}
} else {
try {
-@@ -3080,7 +3088,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3081,7 +3089,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data);
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
diff --git a/patches/server/0687-Ensure-disconnect-for-book-edit-is-called-on-main.patch b/patches/server/0687-Ensure-disconnect-for-book-edit-is-called-on-main.patch
index 5a91c997eb..6c7f6fb6e6 100644
--- a/patches/server/0687-Ensure-disconnect-for-book-edit-is-called-on-main.patch
+++ b/patches/server/0687-Ensure-disconnect-for-book-edit-is-called-on-main.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 85e24920e774e84f9fa63a4fb088c07caf2833da..b0c319175b40b0f1ac87152eb64b6b60ddc36464 100644
+index 1c303677bac4df134ee7eeda71bd0b5118358cb3..61a0c9ffd7a5f156c4274a2425451c4a8ebdc5b8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1098,7 +1098,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1099,7 +1099,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// Paper end
// CraftBukkit start
if (this.lastBookTick + 20 > MinecraftServer.currentTick) {
diff --git a/patches/server/0689-Use-getChunkIfLoadedImmediately-in-places.patch b/patches/server/0689-Use-getChunkIfLoadedImmediately-in-places.patch
index d0296bb8d3..7b1716dae9 100644
--- a/patches/server/0689-Use-getChunkIfLoadedImmediately-in-places.patch
+++ b/patches/server/0689-Use-getChunkIfLoadedImmediately-in-places.patch
@@ -8,10 +8,10 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case).
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 51e290adb44c9f7987ad79f22f158e5f93bedbbe..081c031f08c9817de6c4e1e6bf18b11efc3c668b 100644
+index 2c8acd5610e873d64470b0e4b0373566357d885d..4f3719e77e008cbd3d2bd9262a03a526000bc837 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -211,7 +211,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -214,7 +214,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
@@ -21,10 +21,10 @@ index 51e290adb44c9f7987ad79f22f158e5f93bedbbe..081c031f08c9817de6c4e1e6bf18b11e
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index b0c319175b40b0f1ac87152eb64b6b60ddc36464..8705df3ca3df6b4aa77b38e1a0b6ad5fc3bc3f28 100644
+index 61a0c9ffd7a5f156c4274a2425451c4a8ebdc5b8..818d3b0d149354381be896b294d2be1901c8af10 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1309,7 +1309,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1310,7 +1310,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
speed = this.player.getAbilities().walkingSpeed * 10f;
}
// Paper start - Prevent moving into unloaded chunks
@@ -34,7 +34,7 @@ index b0c319175b40b0f1ac87152eb64b6b60ddc36464..8705df3ca3df6b4aa77b38e1a0b6ad5f
return;
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index aaebbf265ba6ad98fc14d02d24b3db1a6fa904ba..7ac5755df29a82d053fdd3f9e83b0789cbdb0525 100644
+index b7f9d6682c1dc5f03ae363b782ae9346f5bbe841..d63f4108012b4d3ed566298c7cda27bbbf018c6a 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -194,6 +194,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/patches/server/0691-Adds-PlayerArmSwingEvent.patch b/patches/server/0691-Adds-PlayerArmSwingEvent.patch
index 10e2f0ccb8..74eee7020e 100644
--- a/patches/server/0691-Adds-PlayerArmSwingEvent.patch
+++ b/patches/server/0691-Adds-PlayerArmSwingEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Adds PlayerArmSwingEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 8705df3ca3df6b4aa77b38e1a0b6ad5fc3bc3f28..d66c9c09ae3874dd53ef298f94a0e5c6177f2b35 100644
+index 818d3b0d149354381be896b294d2be1901c8af10..b3d877ca2eec03dfc0d507993eb41857ad1a6f78 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2230,7 +2230,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2231,7 +2231,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
// Arm swing animation
diff --git a/patches/server/0692-Fixes-kick-event-leave-message-not-being-sent.patch b/patches/server/0692-Fixes-kick-event-leave-message-not-being-sent.patch
index c5876012bc..ab1a07ff97 100644
--- a/patches/server/0692-Fixes-kick-event-leave-message-not-being-sent.patch
+++ b/patches/server/0692-Fixes-kick-event-leave-message-not-being-sent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fixes kick event leave message not being sent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index d66c9c09ae3874dd53ef298f94a0e5c6177f2b35..43cd0b67f31d0340893672c9bf5a00467d9cdb54 100644
+index b3d877ca2eec03dfc0d507993eb41857ad1a6f78..5646f3ca3f2e0493a4d9d4feaacf1449f4a6a0c5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -456,7 +456,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -457,7 +457,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> {
this.connection.disconnect(ichatbasecomponent);
});
@@ -17,7 +17,7 @@ index d66c9c09ae3874dd53ef298f94a0e5c6177f2b35..43cd0b67f31d0340893672c9bf5a0046
this.connection.setReadOnly();
MinecraftServer minecraftserver = this.server;
Connection networkmanager = this.connection;
-@@ -1877,6 +1877,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1878,6 +1878,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void onDisconnect(Component reason) {
@@ -29,7 +29,7 @@ index d66c9c09ae3874dd53ef298f94a0e5c6177f2b35..43cd0b67f31d0340893672c9bf5a0046
// CraftBukkit start - Rarely it would send a disconnect line twice
if (this.processedDisconnect) {
return;
-@@ -1893,7 +1898,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1894,7 +1899,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player.disconnect();
// Paper start - Adventure
@@ -39,7 +39,7 @@ index d66c9c09ae3874dd53ef298f94a0e5c6177f2b35..43cd0b67f31d0340893672c9bf5a0046
this.server.getPlayerList().broadcastMessage(PaperAdventure.asVanilla(quitMessage), ChatType.SYSTEM, Util.NIL_UUID);
// Paper end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 75ca1abe19c789fec020aa4b135d6df05abaec5c..2c3249359bf8f7e5e625ef4769c7e884cddd473c 100644
+index 9b55968cb1db5f77a8e858e2a7aa66d518ddd00a..656c0235dfb8e7335fb7be4afc727eefb2a4188e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -587,6 +587,11 @@ public abstract class PlayerList {
diff --git a/patches/server/0704-Improve-boat-collision-performance.patch b/patches/server/0704-Improve-boat-collision-performance.patch
index 59d8dd2afe..9e8bbe1be1 100644
--- a/patches/server/0704-Improve-boat-collision-performance.patch
+++ b/patches/server/0704-Improve-boat-collision-performance.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Improve boat collision performance
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index b9775bc4e601fe1be8e514222e56ae782a897395..6288ffdaad147a10f25cce00c13820903b4cc7d7 100644
+index cc565d1f766d5a6e0fe674ee9e453dbcb890116e..5bdd1958dff2fc9321bf858e6aa4cc5ad0a5a9ca 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
-@@ -78,6 +78,7 @@ public class Util {
+@@ -84,6 +84,7 @@ public class Util {
}).findFirst().orElseThrow(() -> {
return new IllegalStateException("No jar file system provider found");
});
diff --git a/patches/server/0705-Prevent-AFK-kick-while-watching-end-credits.patch b/patches/server/0705-Prevent-AFK-kick-while-watching-end-credits.patch
index 90a93b893c..0a0996db8c 100644
--- a/patches/server/0705-Prevent-AFK-kick-while-watching-end-credits.patch
+++ b/patches/server/0705-Prevent-AFK-kick-while-watching-end-credits.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Prevent AFK kick while watching end credits.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 43cd0b67f31d0340893672c9bf5a00467d9cdb54..7b6cf326dfab9bd0b13dfc330d143d2efeea9aa1 100644
+index 5646f3ca3f2e0493a4d9d4feaacf1449f4a6a0c5..4281356d240be5bc0232645b6ac87dfdb8a7d49f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -388,7 +388,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -389,7 +389,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
--this.dropSpamTickCount;
}
diff --git a/patches/server/0711-Added-EntityDamageItemEvent.patch b/patches/server/0711-Added-EntityDamageItemEvent.patch
index 2a1dad2ab6..bab8258ae6 100644
--- a/patches/server/0711-Added-EntityDamageItemEvent.patch
+++ b/patches/server/0711-Added-EntityDamageItemEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Added EntityDamageItemEvent
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index a0d1877e9b5229bc04dba72fb629e26d25e85bfb..f9b7292c2eb2588c9769fcd8f56cc8da5259e7ce 100644
+index 9afecaa4cfa0466abb691977e55bcddb64b7feda..66f808cabcf6a9a6584849b285f1c60133adc7b4 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -526,7 +526,7 @@ public final class ItemStack {
+@@ -525,7 +525,7 @@ public final class ItemStack {
return this.getItem().getMaxDamage();
}
@@ -17,7 +17,7 @@ index a0d1877e9b5229bc04dba72fb629e26d25e85bfb..f9b7292c2eb2588c9769fcd8f56cc8da
if (!this.isDamageableItem()) {
return false;
} else {
-@@ -544,8 +544,8 @@ public final class ItemStack {
+@@ -543,8 +543,8 @@ public final class ItemStack {
amount -= k;
// CraftBukkit start
@@ -28,7 +28,7 @@ index a0d1877e9b5229bc04dba72fb629e26d25e85bfb..f9b7292c2eb2588c9769fcd8f56cc8da
event.getPlayer().getServer().getPluginManager().callEvent(event);
if (amount != event.getDamage() || event.isCancelled()) {
-@@ -556,6 +556,14 @@ public final class ItemStack {
+@@ -555,6 +555,14 @@ public final class ItemStack {
}
amount = event.getDamage();
@@ -43,7 +43,7 @@ index a0d1877e9b5229bc04dba72fb629e26d25e85bfb..f9b7292c2eb2588c9769fcd8f56cc8da
}
// CraftBukkit end
if (amount <= 0) {
-@@ -563,8 +571,8 @@ public final class ItemStack {
+@@ -562,8 +570,8 @@ public final class ItemStack {
}
}
@@ -54,7 +54,7 @@ index a0d1877e9b5229bc04dba72fb629e26d25e85bfb..f9b7292c2eb2588c9769fcd8f56cc8da
}
j = this.getDamageValue() + amount;
-@@ -576,7 +584,7 @@ public final class ItemStack {
+@@ -575,7 +583,7 @@ public final class ItemStack {
public <T extends LivingEntity> void hurtAndBreak(int amount, T entity, Consumer<T> breakCallback) {
if (!entity.level.isClientSide && (!(entity instanceof net.minecraft.world.entity.player.Player) || !((net.minecraft.world.entity.player.Player) entity).getAbilities().instabuild)) {
if (this.isDamageableItem()) {
diff --git a/patches/server/0725-Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/server/0725-Add-methods-to-find-targets-for-lightning-strikes.patch
index f2c4db516e..166bb4006d 100644
--- a/patches/server/0725-Add-methods-to-find-targets-for-lightning-strikes.patch
+++ b/patches/server/0725-Add-methods-to-find-targets-for-lightning-strikes.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add methods to find targets for lightning strikes
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 1d372935aeab82d7d6540b8fd7590466a0dc5763..ae0f2bd13adf1d8a56e4a2a26aa5d8cc75e7aaae 100644
+index 4f3719e77e008cbd3d2bd9262a03a526000bc837..cd262cbe8f5f9588dd1d9fcd308eeb0418f54922 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -748,6 +748,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -751,6 +751,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
protected BlockPos findLightningTargetAround(BlockPos pos) {
@@ -20,7 +20,7 @@ index 1d372935aeab82d7d6540b8fd7590466a0dc5763..ae0f2bd13adf1d8a56e4a2a26aa5d8cc
BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos);
Optional<BlockPos> optional = this.findLightningRod(blockposition1);
-@@ -762,6 +767,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -765,6 +770,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!list.isEmpty()) {
return ((LivingEntity) list.get(this.random.nextInt(list.size()))).blockPosition();
} else {
diff --git a/patches/server/0739-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/0739-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch
index ad0f95ae14..04bbf92438 100644
--- a/patches/server/0739-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch
+++ b/patches/server/0739-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch
@@ -9,10 +9,10 @@ chunk through it. This should also be OK from a leak prevention/
state desync POV because the TE is getting unloaded anyways.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index ae0f2bd13adf1d8a56e4a2a26aa5d8cc75e7aaae..37ca0efe6ad83b0e8c7578514d3d2d3fb58b91ec 100644
+index cd262cbe8f5f9588dd1d9fcd308eeb0418f54922..bc6f48892290ac3e6909fb401a559b1148b405b4 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1303,9 +1303,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1306,9 +1306,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) {
if (tileentity instanceof net.minecraft.world.Container) {
diff --git a/patches/server/0742-Fix-chunks-refusing-to-unload-at-low-TPS.patch b/patches/server/0742-Fix-chunks-refusing-to-unload-at-low-TPS.patch
index 5d95d12b7c..b0b95db3bf 100644
--- a/patches/server/0742-Fix-chunks-refusing-to-unload-at-low-TPS.patch
+++ b/patches/server/0742-Fix-chunks-refusing-to-unload-at-low-TPS.patch
@@ -10,10 +10,10 @@ chunk future to complete. We can simply schedule to the immediate
executor to get this effect, rather than the main mailbox.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index b8066eec2a1481059ee0c25756e14449e3007b6b..c9563c0a5f230753dda469530cabde67fdb13f83 100644
+index 2af478902b528f335797c691730afb2657d4e6c4..71ca2c2edc6a89e9365b4686c233f60cea12a472 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1297,9 +1297,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1259,9 +1259,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return chunk;
});
diff --git a/patches/server/0743-Do-not-allow-ticket-level-changes-while-unloading-pl.patch b/patches/server/0743-Do-not-allow-ticket-level-changes-while-unloading-pl.patch
index 42b3fa9938..af693f3838 100644
--- a/patches/server/0743-Do-not-allow-ticket-level-changes-while-unloading-pl.patch
+++ b/patches/server/0743-Do-not-allow-ticket-level-changes-while-unloading-pl.patch
@@ -8,7 +8,7 @@ Sync loading the chunk at this stage would cause it to load
older data, as well as screwing our region state.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index c9563c0a5f230753dda469530cabde67fdb13f83..5157eac0190c6e1458dedfb1cb2eddee5639407e 100644
+index 71ca2c2edc6a89e9365b4686c233f60cea12a472..09bb6e14864af68e9833e171a33aa981f51c8569 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -296,6 +296,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -19,7 +19,7 @@ index c9563c0a5f230753dda469530cabde67fdb13f83..5157eac0190c6e1458dedfb1cb2eddee
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync);
this.visibleChunkMap = this.updatingChunkMap.clone();
-@@ -690,6 +691,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -652,6 +653,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@Nullable
ChunkHolder updateChunkScheduling(long pos, int level, @Nullable ChunkHolder holder, int k) {
@@ -27,7 +27,7 @@ index c9563c0a5f230753dda469530cabde67fdb13f83..5157eac0190c6e1458dedfb1cb2eddee
if (k > ChunkMap.MAX_CHUNK_DISTANCE && level > ChunkMap.MAX_CHUNK_DISTANCE) {
return holder;
} else {
-@@ -908,6 +910,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -870,6 +872,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (completablefuture1 != completablefuture) {
this.scheduleUnload(pos, holder);
} else {
@@ -40,7 +40,7 @@ index c9563c0a5f230753dda469530cabde67fdb13f83..5157eac0190c6e1458dedfb1cb2eddee
// Paper start
boolean removed;
if ((removed = this.pendingUnloads.remove(pos, holder)) && ichunkaccess != null) {
-@@ -944,6 +952,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -906,6 +914,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z);
}
} // Paper end
diff --git a/patches/server/0745-Do-not-submit-profile-lookups-to-worldgen-threads.patch b/patches/server/0745-Do-not-submit-profile-lookups-to-worldgen-threads.patch
index 6fd3fefa43..534570379c 100644
--- a/patches/server/0745-Do-not-submit-profile-lookups-to-worldgen-threads.patch
+++ b/patches/server/0745-Do-not-submit-profile-lookups-to-worldgen-threads.patch
@@ -10,10 +10,10 @@ out due to a sync load, as the worldgen threads will be
stalling on profile lookups.
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index 6288ffdaad147a10f25cce00c13820903b4cc7d7..f4b8dca0a3cbccb55b23b2408e9a17185fd2896f 100644
+index 5bdd1958dff2fc9321bf858e6aa4cc5ad0a5a9ca..354e8096d404bfca8055aafcd80b2de29a7bc929 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
-@@ -70,6 +70,22 @@ public class Util {
+@@ -76,6 +76,22 @@ public class Util {
private static final AtomicInteger WORKER_COUNT = new AtomicInteger(1);
private static final ExecutorService BOOTSTRAP_EXECUTOR = makeExecutor("Bootstrap", -2); // Paper - add -2 priority
private static final ExecutorService BACKGROUND_EXECUTOR = makeExecutor("Main", -1); // Paper - add -1 priority
diff --git a/patches/server/0753-Rewrite-entity-bounding-box-lookup-calls.patch b/patches/server/0753-Rewrite-entity-bounding-box-lookup-calls.patch
index a509a9c638..790186480d 100644
--- a/patches/server/0753-Rewrite-entity-bounding-box-lookup-calls.patch
+++ b/patches/server/0753-Rewrite-entity-bounding-box-lookup-calls.patch
@@ -914,10 +914,10 @@ index 0000000000000000000000000000000000000000..3ba094e640d7fe7803e2bbdab8ff3beb
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 37ca0efe6ad83b0e8c7578514d3d2d3fb58b91ec..875ba4b21f122a0d748c7bd5b3d48f4b8ead5693 100644
+index bc6f48892290ac3e6909fb401a559b1148b405b4..5e65df1a9a8282c4ffa06801379b79ab0ed1b45c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -425,7 +425,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -428,7 +428,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
DataFixer datafixer = minecraftserver.getFixerUpper();
EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(this, convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, minecraftserver);
diff --git a/patches/server/0755-Execute-chunk-tasks-mid-tick.patch b/patches/server/0755-Execute-chunk-tasks-mid-tick.patch
index d1841cb15c..9f14b511e7 100644
--- a/patches/server/0755-Execute-chunk-tasks-mid-tick.patch
+++ b/patches/server/0755-Execute-chunk-tasks-mid-tick.patch
@@ -128,10 +128,10 @@ index ad352b4b67632f9984c4d10994a9acfe434a4996..df415f79dfd2ae9a709747b112022b38
}
// Paper start - optimise chunk tick iteration
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 875ba4b21f122a0d748c7bd5b3d48f4b8ead5693..8eb4320b281ef83fa9387d14f10d140f099e83e4 100644
+index 5e65df1a9a8282c4ffa06801379b79ab0ed1b45c..7e837b2896cac64a982d9025c4e190dfa7ebc451 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -198,7 +198,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -201,7 +201,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
private final StructureFeatureManager structureFeatureManager;
private final StructureCheck structureCheck;
private final boolean tickTime;
diff --git a/patches/server/0756-Do-not-copy-visible-chunks.patch b/patches/server/0756-Do-not-copy-visible-chunks.patch
index e649466db3..ba44aac258 100644
--- a/patches/server/0756-Do-not-copy-visible-chunks.patch
+++ b/patches/server/0756-Do-not-copy-visible-chunks.patch
@@ -35,7 +35,7 @@ index 35949e9c15eb998aa89842d34d0999cd973590e0..15f0c85ba9f4f9666e94e67dde43eb2e
List<ChunkHolder> allChunks = new ArrayList<>(visibleChunks.values());
List<ServerPlayer> players = world.players;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14ffc8ec338 100644
+index 09bb6e14864af68e9833e171a33aa981f51c8569..53399b80e60872224ba6b77f41626b2beef236d2 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -120,9 +120,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -61,7 +61,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f
this.pendingUnloads = new Long2ObjectLinkedOpenHashMap();
this.entitiesInLevel = new LongOpenHashSet();
this.toDrop = new LongOpenHashSet();
-@@ -554,12 +556,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -516,12 +518,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@Nullable
public ChunkHolder getUpdatingChunkIfPresent(long pos) {
@@ -81,7 +81,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f
}
protected IntSupplier getChunkQueueLevel(long pos) {
-@@ -721,7 +728,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -683,7 +690,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end
}
@@ -90,7 +90,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f
this.modified = true;
}
-@@ -801,7 +808,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -763,7 +770,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
protected void saveAllChunks(boolean flush) {
if (flush) {
@@ -99,7 +99,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f
MutableBoolean mutableboolean = new MutableBoolean();
do {
-@@ -832,7 +839,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -794,7 +801,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
//this.flushWorker(); // Paper - nuke IOWorker
this.level.asyncChunkTaskManager.flush(); // Paper - flush to preserve behavior compat with pre-async behaviour
} else {
@@ -108,7 +108,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f
}
}
-@@ -866,7 +873,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -828,7 +835,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
while (longiterator.hasNext()) { // Spigot
long j = longiterator.nextLong();
longiterator.remove(); // Spigot
@@ -117,7 +117,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f
if (playerchunk != null) {
this.pendingUnloads.put(j, playerchunk);
-@@ -892,7 +899,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -854,7 +861,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
int l = 0;
@@ -126,7 +126,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f
while (false && l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) { // Paper - incremental chunk and player saving
if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) {
-@@ -971,7 +978,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -933,7 +940,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!this.modified) {
return false;
} else {
@@ -140,16 +140,16 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f
this.modified = false;
return true;
}
-@@ -1449,7 +1461,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1411,7 +1423,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.viewDistance = j;
- this.distanceManager.updatePlayerTickets(this.viewDistance);
+ this.distanceManager.updatePlayerTickets(this.viewDistance + 1);
- ObjectIterator objectiterator = this.updatingChunkMap.values().iterator();
+ Iterator objectiterator = this.updatingChunks.getVisibleValuesCopy().iterator(); // Paper
while (objectiterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) objectiterator.next();
-@@ -1491,7 +1503,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1454,7 +1466,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
public int size() {
@@ -158,7 +158,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f
}
public DistanceManager getDistanceManager() {
-@@ -1499,13 +1511,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1462,13 +1474,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected Iterable<ChunkHolder> getChunks() {
diff --git a/patches/server/0759-Detail-more-information-in-watchdog-dumps.patch b/patches/server/0759-Detail-more-information-in-watchdog-dumps.patch
index 7a4abf8346..3ee35843b6 100644
--- a/patches/server/0759-Detail-more-information-in-watchdog-dumps.patch
+++ b/patches/server/0759-Detail-more-information-in-watchdog-dumps.patch
@@ -77,10 +77,10 @@ index bcf53ec07b8eeec7a88fb67e6fb908362e6f51b0..acc12307f61e1e055896b68fe16654c9
});
throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 8eb4320b281ef83fa9387d14f10d140f099e83e4..dd37f4ac7b1b2bca52ed1a0055eb5d6b53a11bd4 100644
+index 7e837b2896cac64a982d9025c4e190dfa7ebc451..c353e41fa733b42350285861a5ddbdf304ec0e02 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -973,7 +973,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -976,7 +976,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
@@ -107,7 +107,7 @@ index 8eb4320b281ef83fa9387d14f10d140f099e83e4..dd37f4ac7b1b2bca52ed1a0055eb5d6b
++TimingHistory.entityTicks; // Paper - timings
// Spigot start
co.aikar.timings.Timing timer; // Paper
-@@ -1013,7 +1032,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1016,7 +1035,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1);
}
// } finally { timer.stopTiming(); } // Paper - timings - move up
diff --git a/patches/server/0773-Oprimise-map-impl-for-tracked-players.patch b/patches/server/0773-Oprimise-map-impl-for-tracked-players.patch
index 9a9b55816c..977c8a0a81 100644
--- a/patches/server/0773-Oprimise-map-impl-for-tracked-players.patch
+++ b/patches/server/0773-Oprimise-map-impl-for-tracked-players.patch
@@ -7,7 +7,7 @@ Reference2BooleanOpenHashMap is going to have
better lookups than HashMap.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 800191e9ed63773333b5650d8ffcb14ffc8ec338..9ab37d95b0dbd13dfe31b34b2a91c2a7bc7f6e64 100644
+index 53399b80e60872224ba6b77f41626b2beef236d2..087eec200cec325edb11f7fbae1a81a216b019d6 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -108,6 +108,7 @@ import org.apache.logging.log4j.LogManager;
@@ -18,7 +18,7 @@ index 800191e9ed63773333b5650d8ffcb14ffc8ec338..9ab37d95b0dbd13dfe31b34b2a91c2a7
public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
-@@ -2141,7 +2142,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -2101,7 +2102,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity;
private final int range;
SectionPos lastSectionPos;
diff --git a/patches/server/0776-Optimise-random-block-ticking.patch b/patches/server/0776-Optimise-random-block-ticking.patch
index 19ca976a3d..74ef7737b2 100644
--- a/patches/server/0776-Optimise-random-block-ticking.patch
+++ b/patches/server/0776-Optimise-random-block-ticking.patch
@@ -71,10 +71,10 @@ index 0000000000000000000000000000000000000000..e8b4053babe46999980b926431254050
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index dd37f4ac7b1b2bca52ed1a0055eb5d6b53a11bd4..e6a8e21aa0ef8846b9998fe40605bf98c3966888 100644
+index c353e41fa733b42350285861a5ddbdf304ec0e02..83517c4eaf419770178f0520210218e0a70c4642 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -639,6 +639,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -642,6 +642,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
entityplayer.stopSleepInBed(false, false);
});
}
@@ -85,7 +85,7 @@ index dd37f4ac7b1b2bca52ed1a0055eb5d6b53a11bd4..e6a8e21aa0ef8846b9998fe40605bf98
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
ChunkPos chunkcoordintpair = chunk.getPos();
-@@ -648,10 +652,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -651,10 +655,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
ProfilerFiller gameprofilerfiller = this.getProfiler();
gameprofilerfiller.push("thunder");
@@ -98,7 +98,7 @@ index dd37f4ac7b1b2bca52ed1a0055eb5d6b53a11bd4..e6a8e21aa0ef8846b9998fe40605bf98
if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * paperConfig.skeleHorseSpawnChance && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper
-@@ -674,65 +678,78 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -677,65 +681,78 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
gameprofilerfiller.popPush("iceandsnow");
diff --git a/patches/server/0778-Optimise-nearby-player-lookups.patch b/patches/server/0778-Optimise-nearby-player-lookups.patch
index b56bd770af..7eacd2f196 100644
--- a/patches/server/0778-Optimise-nearby-player-lookups.patch
+++ b/patches/server/0778-Optimise-nearby-player-lookups.patch
@@ -26,7 +26,7 @@ index 1f602d50f3212078490c0092ceefd3b17e0b1532..825fdb0336b0388dbbc54c8da9978190
// Paper end - optimise anyPlayerCloseEnoughForSpawning
long lastAutoSaveTime; // Paper - incremental autosave
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 9ab37d95b0dbd13dfe31b34b2a91c2a7bc7f6e64..27e9bd7dabb5f827b8baf126565d1efb9eb2c2ef 100644
+index 087eec200cec325edb11f7fbae1a81a216b019d6..86d751738ae82257b527f01b805c30d055ac85c9 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -159,6 +159,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -92,10 +92,10 @@ index 9ab37d95b0dbd13dfe31b34b2a91c2a7bc7f6e64..27e9bd7dabb5f827b8baf126565d1efb
protected ChunkGenerator generator() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index e6a8e21aa0ef8846b9998fe40605bf98c3966888..f166a4cf5e71f3b3eb961ab729ce59991a06ce7c 100644
+index 83517c4eaf419770178f0520210218e0a70c4642..0918bb28fd058e6b79f45993a46738a50b05b60a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -396,6 +396,83 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -399,6 +399,83 @@ public class ServerLevel extends Level implements WorldGenLevel {
return this.getServer().getPlayerList().getPlayer(uuid);
}
// Paper end
@@ -179,7 +179,7 @@ index e6a8e21aa0ef8846b9998fe40605bf98c3966888..f166a4cf5e71f3b3eb961ab729ce5999
// Add env and gen to constructor, WorldData -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, ServerLevelData iworlddataserver, ResourceKey<Level> resourcekey, DimensionType dimensionmanager, ChunkProgressListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
-@@ -484,6 +561,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -487,6 +564,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void tick(BooleanSupplier shouldKeepTicking) {
diff --git a/patches/server/0779-Optimise-WorldServer-notify.patch b/patches/server/0779-Optimise-WorldServer-notify.patch
index cad31cc75e..c1218ac6bd 100644
--- a/patches/server/0779-Optimise-WorldServer-notify.patch
+++ b/patches/server/0779-Optimise-WorldServer-notify.patch
@@ -8,7 +8,7 @@ Instead, only iterate over navigators in the current region that are
eligible for repathing.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 27e9bd7dabb5f827b8baf126565d1efb9eb2c2ef..a14effa7f8f56a27bccd4479baad82fcb67e55c5 100644
+index 86d751738ae82257b527f01b805c30d055ac85c9..7cd99b894914404be9be3a58b1ec83dc08538929 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -283,15 +283,81 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -110,10 +110,10 @@ index 27e9bd7dabb5f827b8baf126565d1efb9eb2c2ef..a14effa7f8f56a27bccd4479baad82fc
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index f166a4cf5e71f3b3eb961ab729ce59991a06ce7c..10563d4d02d825f5334b0c2c3e0fe032ccdacb73 100644
+index 0918bb28fd058e6b79f45993a46738a50b05b60a..f17c0f501c89c07651a40673ad5ecfe6c7168fce 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1090,6 +1090,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1093,6 +1093,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void tickNonPassenger(Entity entity) {
// Paper start - log detailed entity tick information
io.papermc.paper.util.TickThread.ensureTickThread("Cannot tick an entity off-main");
@@ -121,10 +121,10 @@ index f166a4cf5e71f3b3eb961ab729ce59991a06ce7c..10563d4d02d825f5334b0c2c3e0fe032
try {
if (currentlyTickingEntity.get() == null) {
currentlyTickingEntity.lazySet(entity);
-@@ -1535,9 +1536,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
- VoxelShape voxelshape1 = newState.getCollisionShape(this, pos);
+@@ -1545,9 +1546,18 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (Shapes.joinIsNotEmpty(voxelshape, voxelshape1, BooleanOp.NOT_SAME)) {
+ List<PathNavigation> list = new ObjectArrayList();
- Iterator iterator = this.navigatingMobs.iterator();
+ // Paper start - optimise notify()
+ io.papermc.paper.chunk.SingleThreadChunkRegionManager.Region region = this.getChunkSource().chunkMap.dataRegionManager.getRegion(pos.getX() >> 4, pos.getZ() >> 4);
@@ -138,14 +138,28 @@ index f166a4cf5e71f3b3eb961ab729ce59991a06ce7c..10563d4d02d825f5334b0c2c3e0fe032
+ io.papermc.paper.util.maplist.IteratorSafeOrderedReferenceSet.Iterator<Mob> iterator = navigatorsFromRegion.iterator();
- while (iterator.hasNext()) {
-+
+ try { while (iterator.hasNext()) { // Paper end - optimise notify()
// CraftBukkit start - fix SPIGOT-6362
Mob entityinsentient;
try {
-@@ -1556,6 +1567,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
- navigationabstract.recomputePath(pos);
+@@ -1569,16 +1579,23 @@ public class ServerLevel extends Level implements WorldGenLevel {
+
+ try {
+ this.isUpdatingNavigations = true;
+- iterator = list.iterator();
++ // Paper start - optimise notify()
++ Iterator<PathNavigation> navigationIterator = list.iterator();
+
+- while (iterator.hasNext()) {
+- PathNavigation navigationabstract1 = (PathNavigation) iterator.next();
++ while (navigationIterator.hasNext()) {
++ PathNavigation navigationabstract1 = navigationIterator.next();
++ // Paper end - optimise notify()
+
+ navigationabstract1.recomputePath();
}
+ } finally {
+ this.isUpdatingNavigations = false;
}
+ // Paper start - optimise notify()
+ } finally {
@@ -155,7 +169,7 @@ index f166a4cf5e71f3b3eb961ab729ce59991a06ce7c..10563d4d02d825f5334b0c2c3e0fe032
}
} // Paper
-@@ -2351,10 +2367,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2374,10 +2391,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void onTickingStart(Entity entity) {
ServerLevel.this.entityTickList.add(entity);
@@ -169,7 +183,7 @@ index f166a4cf5e71f3b3eb961ab729ce59991a06ce7c..10563d4d02d825f5334b0c2c3e0fe032
public void onTrackingStart(Entity entity) {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
-index 5884fb42f0880585dee843b98a6ea470a1508e46..4651c2e78089ed28220e767654261c735d2c5eb1 100644
+index b06789336098233b642b769b0fd60e740459874c..792366024a0d2a39e1d63509bbf0da51c973bdcf 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -27,7 +27,7 @@ import net.minecraft.world.phys.Vec3;
@@ -204,15 +218,15 @@ index 5884fb42f0880585dee843b98a6ea470a1508e46..4651c2e78089ed28220e767654261c73
public PathNavigation(Mob mob, Level world) {
this.mob = mob;
this.level = world;
-@@ -415,7 +422,7 @@ public abstract class PathNavigation {
- }
-
- public void recomputePath(BlockPos pos) {
-- if (this.path != null && !this.path.isDone() && this.path.getNodeCount() != 0) {
-+ if (this.path != null && !this.path.isDone() && this.path.getNodeCount() != 0) { // Paper - diff on change - needed for isViableForPathRecalculationChecking()
+@@ -413,7 +420,7 @@ public abstract class PathNavigation {
+ public boolean shouldRecomputePath(BlockPos pos) {
+ if (this.hasDelayedRecomputation) {
+ return false;
+- } else if (this.path != null && !this.path.isDone() && this.path.getNodeCount() != 0) {
++ } else if (this.path != null && !this.path.isDone() && this.path.getNodeCount() != 0) { // Paper - diff on change - needed for isViableForPathRecalculationChecking()
Node node = this.path.getEndNode();
Vec3 vec3 = new Vec3(((double)node.x + this.mob.getX()) / 2.0D, ((double)node.y + this.mob.getY()) / 2.0D, ((double)node.z + this.mob.getZ()) / 2.0D);
- if (pos.closerThan(vec3, (double)(this.path.getNodeCount() - this.path.getNextNodeIndex()))) {
+ return pos.closerThan(vec3, (double)(this.path.getNodeCount() - this.path.getNextNodeIndex()));
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
index a0c66689c954823e7c20664594557dc26afbd246..21f3c8a2fe91ff47486b4c63f2b3f1d54f83fdb6 100644
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
diff --git a/patches/server/0783-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch b/patches/server/0783-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch
index d95c023f1e..07f72d1a93 100644
--- a/patches/server/0783-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch
+++ b/patches/server/0783-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Reduce worldgen thread worker count for low core count CPUs
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index f4b8dca0a3cbccb55b23b2408e9a17185fd2896f..faffd25b11836915764add5c6afd63cfe424979a 100644
+index 354e8096d404bfca8055aafcd80b2de29a7bc929..652c84fe3a4c3004fd9ef8123380836344608359 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
-@@ -124,7 +124,19 @@ public class Util {
+@@ -133,7 +133,19 @@ public class Util {
private static ExecutorService makeExecutor(String s, int priorityModifier) { // Paper - add priority
// Paper start - use simpler thread pool that allows 1 thread
diff --git a/patches/server/0787-Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/0787-Fix-merchant-inventory-not-closing-on-entity-removal.patch
index ed32ea573d..5f9cbf9735 100644
--- a/patches/server/0787-Fix-merchant-inventory-not-closing-on-entity-removal.patch
+++ b/patches/server/0787-Fix-merchant-inventory-not-closing-on-entity-removal.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 10563d4d02d825f5334b0c2c3e0fe032ccdacb73..a770b5abc7fc66b6de9f17dde192447686e70f4a 100644
+index f17c0f501c89c07651a40673ad5ecfe6c7168fce..28f605c3daa969c1a54745e552d55ecb874120a9 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2440,6 +2440,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2475,6 +2475,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot end
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder) {
diff --git a/patches/server/0789-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch b/patches/server/0789-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch
index 2dbc76dea7..1b40cf1c18 100644
--- a/patches/server/0789-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch
+++ b/patches/server/0789-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index d572a0f423844606a8e96eba1f7570d9d356077c..f4f075c678f30d375d15041860fcc5543eedc7fe 100644
+index 4281356d240be5bc0232645b6ac87dfdb8a7d49f..1816c3aa0573928c0845b0a23d4dfc078317184e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -762,6 +762,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -763,6 +763,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
// Paper end
// CraftBukkit end
diff --git a/patches/server/0797-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch b/patches/server/0797-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch
index e68034a318..7cda38b29f 100644
--- a/patches/server/0797-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch
+++ b/patches/server/0797-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch
@@ -12,10 +12,10 @@ time to save, as flush saving performs a full flush at
the end anyways.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index a14effa7f8f56a27bccd4479baad82fcb67e55c5..30f3d7571c021ed9c0d7d96b53752dd453704b20 100644
+index 7cd99b894914404be9be3a58b1ec83dc08538929..b5ea631f93b9390f82475560cf3e33585d034cd6 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -910,6 +910,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -872,6 +872,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end
protected void saveAllChunks(boolean flush) {
@@ -32,7 +32,7 @@ index a14effa7f8f56a27bccd4479baad82fcb67e55c5..30f3d7571c021ed9c0d7d96b53752dd4
if (flush) {
List<ChunkHolder> list = (List) this.updatingChunks.getVisibleValuesCopy().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList()); // Paper
MutableBoolean mutableboolean = new MutableBoolean();
-@@ -932,6 +942,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -894,6 +904,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}).filter((ichunkaccess) -> {
return ichunkaccess instanceof ImposterProtoChunk || ichunkaccess instanceof LevelChunk;
}).filter(this::save).forEach((ichunkaccess) -> {
diff --git a/patches/server/0813-Remove-client-side-code-using-deprecated-for-removal.patch b/patches/server/0813-Remove-client-side-code-using-deprecated-for-removal.patch
index 368687d252..654a699a88 100644
--- a/patches/server/0813-Remove-client-side-code-using-deprecated-for-removal.patch
+++ b/patches/server/0813-Remove-client-side-code-using-deprecated-for-removal.patch
@@ -7,10 +7,10 @@ Subject: [PATCH] Remove client-side code using deprecated for removal
Fixes warnings on build
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index faffd25b11836915764add5c6afd63cfe424979a..fbbf531c187ddd315a34cc97793daa33cbe60feb 100644
+index 652c84fe3a4c3004fd9ef8123380836344608359..f6561599391583ba7d669af42b5716cda0df2d68 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
-@@ -21,7 +21,6 @@ import java.net.URL;
+@@ -23,7 +23,6 @@ import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.spi.FileSystemProvider;
@@ -18,7 +18,7 @@ index faffd25b11836915764add5c6afd63cfe424979a..fbbf531c187ddd315a34cc97793daa33
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.time.Duration;
-@@ -746,21 +745,7 @@ public class Util {
+@@ -780,21 +779,7 @@ public class Util {
}
public void openUrl(URL url) {
diff --git a/patches/server/0826-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/0826-Optimise-collision-checking-in-player-move-packet-ha.patch
index fdd4f47039..c5199df153 100644
--- a/patches/server/0826-Optimise-collision-checking-in-player-move-packet-ha.patch
+++ b/patches/server/0826-Optimise-collision-checking-in-player-move-packet-ha.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Optimise collision checking in player move packet handling
Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index f4f075c678f30d375d15041860fcc5543eedc7fe..348cecfe1c3ac1debe98e2fcc756c7e32a3187df 100644
+index 1816c3aa0573928c0845b0a23d4dfc078317184e..057fcbc389e54e0c9f7a90a3e8b965cd46db9d58 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -581,12 +581,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -582,12 +582,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return;
}
@@ -24,7 +24,7 @@ index f4f075c678f30d375d15041860fcc5543eedc7fe..348cecfe1c3ac1debe98e2fcc756c7e3
double d11 = d7;
d6 = d3 - entity.getX();
-@@ -600,16 +601,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -601,16 +602,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
boolean flag1 = false;
if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
@@ -52,7 +52,7 @@ index f4f075c678f30d375d15041860fcc5543eedc7fe..348cecfe1c3ac1debe98e2fcc756c7e3
entity.absMoveTo(d0, d1, d2, f, f1);
this.player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
this.connection.send(new ClientboundMoveVehiclePacket(entity));
-@@ -695,7 +703,32 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -696,7 +704,32 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
private boolean noBlocksAround(Entity entity) {
@@ -86,7 +86,7 @@ index f4f075c678f30d375d15041860fcc5543eedc7fe..348cecfe1c3ac1debe98e2fcc756c7e3
}
@Override
-@@ -1237,7 +1270,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1238,7 +1271,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
if (this.awaitingPositionFromClient != null) {
@@ -95,7 +95,7 @@ index f4f075c678f30d375d15041860fcc5543eedc7fe..348cecfe1c3ac1debe98e2fcc756c7e3
this.awaitingTeleportTime = this.tickCount;
this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
}
-@@ -1331,7 +1364,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1332,7 +1365,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
}
@@ -104,7 +104,7 @@ index f4f075c678f30d375d15041860fcc5543eedc7fe..348cecfe1c3ac1debe98e2fcc756c7e3
d7 = d0 - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above
d8 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above
-@@ -1370,6 +1403,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1371,6 +1404,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9));
@@ -112,7 +112,7 @@ index f4f075c678f30d375d15041860fcc5543eedc7fe..348cecfe1c3ac1debe98e2fcc756c7e3
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
// Paper start - prevent position desync
if (this.awaitingPositionFromClient != null) {
-@@ -1389,12 +1423,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1390,12 +1424,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
boolean flag1 = false;
if (!this.player.isChangingDimension() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot
@@ -138,7 +138,7 @@ index f4f075c678f30d375d15041860fcc5543eedc7fe..348cecfe1c3ac1debe98e2fcc756c7e3
this.teleport(d3, d4, d5, f, f1);
} else {
// CraftBukkit start - fire PlayerMoveEvent
-@@ -1481,6 +1526,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1482,6 +1527,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
}
diff --git a/patches/server/0827-Actually-unload-POI-data.patch b/patches/server/0827-Actually-unload-POI-data.patch
index 9f3cbf8327..c03e727b8f 100644
--- a/patches/server/0827-Actually-unload-POI-data.patch
+++ b/patches/server/0827-Actually-unload-POI-data.patch
@@ -10,10 +10,10 @@ This patch also prevents the saving/unloading of POI data when
world saving is disabled.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 7cb613103bca57c82418f4f968922f510819ee70..d8d1b8cd0104f1c916de443af291ec36988405c2 100644
+index 0c046cd0fab44aecd41ef5c1477b13ea9606aee4..0e474819c506e6d5e1731d49610c7cf472aa49c4 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -830,6 +830,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -792,6 +792,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
// Paper end
}
@@ -21,7 +21,7 @@ index 7cb613103bca57c82418f4f968922f510819ee70..d8d1b8cd0104f1c916de443af291ec36
this.updatingChunks.queueUpdate(pos, holder); // Paper - Don't copy
this.modified = true;
-@@ -975,7 +976,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -937,7 +938,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
gameprofilerfiller.pop();
}
@@ -30,7 +30,7 @@ index 7cb613103bca57c82418f4f968922f510819ee70..d8d1b8cd0104f1c916de443af291ec36
private void processUnloads(BooleanSupplier shouldKeepTicking) {
LongIterator longiterator = this.toDrop.iterator();
-@@ -1044,6 +1045,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1006,6 +1007,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z);
}
// Paper end
@@ -38,7 +38,7 @@ index 7cb613103bca57c82418f4f968922f510819ee70..d8d1b8cd0104f1c916de443af291ec36
if (ichunkaccess instanceof LevelChunk) {
((LevelChunk) ichunkaccess).setLoaded(false);
}
-@@ -1072,6 +1074,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1034,6 +1036,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
for (int index = 0, len = this.regionManagers.size(); index < len; ++index) {
this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z);
}
@@ -46,7 +46,7 @@ index 7cb613103bca57c82418f4f968922f510819ee70..d8d1b8cd0104f1c916de443af291ec36
} // Paper end
} finally { this.unloadingPlayerChunk = unloadingBefore; } // Paper - do not allow ticket level changes while unloading chunks
-@@ -1148,6 +1151,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1110,6 +1113,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
this.poiManager.loadInData(pos, chunkHolder.poiData);
chunkHolder.tasks.forEach(Runnable::run);
diff --git a/patches/server/0829-Don-t-disable-log4j-lookups.patch b/patches/server/0829-Don-t-disable-log4j-lookups.patch
deleted file mode 100644
index 3c5c31f118..0000000000
--- a/patches/server/0829-Don-t-disable-log4j-lookups.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Nassim Jahnke <[email protected]>
-Date: Thu, 9 Dec 2021 21:59:08 +0100
-Subject: [PATCH] Don't disable log4j lookups
-
-
-diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 461c086d82514d2558d3f472b675305248619d8c..deb33456b5b194a662cbdbacf17752c87f2cecaf 100644
---- a/src/main/java/org/bukkit/craftbukkit/Main.java
-+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
-@@ -21,7 +21,7 @@ public class Main {
- public static boolean useConsole = true;
-
- public static void main(String[] args) {
-- System.setProperty("log4j2.formatMsgNoLookups", "true");
-+ //System.setProperty("log4j2.formatMsgNoLookups", "true"); // Paper - no...
-
- // Paper start
- final String warnWhenLegacyFormattingDetected = String.join(".", "net", "kyori", "adventure", "text", "warnWhenLegacyFormattingDetected");
diff --git a/patches/server/0830-Update-Log4j.patch b/patches/server/0829-Update-Log4j.patch
index d90be23fef..d90be23fef 100644
--- a/patches/server/0830-Update-Log4j.patch
+++ b/patches/server/0829-Update-Log4j.patch
diff --git a/work/Bukkit b/work/Bukkit
-Subproject ffd8b28939b4ec84855f8a10c93463ec113def1
+Subproject 5906bed05d29c64af69983e2521cc3e9060d95e
diff --git a/work/CraftBukkit b/work/CraftBukkit
-Subproject 35d3986e9ec4ffba0f025897ae87cd5991b9fa9
+Subproject c2e0bbda4ee13ec92c603a7bfe9bd8e5575a299
diff --git a/work/Spigot b/work/Spigot
-Subproject dbf493829eb4bf37ff6492e725058424138cc65
+Subproject f65de01fa82909bd90444c24e49436771663e9c