diff --git a/Paper-MojangAPI/pom.xml b/Paper-MojangAPI/pom.xml
deleted file mode 100644
index 7712a8723c..0000000000
--- a/Paper-MojangAPI/pom.xml
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
- 4.0.0
-
- com.destroystokyo.paper
- paper-parent
- dev-SNAPSHOT
-
-
- com.destroystokyo.paper
- paper-mojangapi
- 1.16.5-R0.1-SNAPSHOT
- jar
-
- Paper-MojangAPI
- https://github.com/PaperMC/Paper
- API additions that utilize Mojang Specific API's
-
-
-
- 1.8
- 1.8
- UTF-8
-
-
-
-
- spigotmc-public
- https://hub.spigotmc.org/nexus/content/groups/public/
-
-
- sonatype
- https://oss.sonatype.org/content/groups/public/
-
-
- minecraft-libraries
- Minecraft Libraries
- https://libraries.minecraft.net
-
-
-
-
-
- spigotmc-public
- https://hub.spigotmc.org/nexus/content/groups/public/
-
-
-
-
-
- com.destroystokyo.paper
- paper-api
- ${project.version}
- provided
-
-
-
- com.mojang
- brigadier
- 1.0.17
- compile
-
-
-
- it.unimi.dsi
- fastutil
- 8.2.2
- provided
-
-
-
- org.jetbrains
- annotations
- 18.0.0
- provided
-
-
-
- junit
- junit
- 4.13.1
- test
-
-
- org.hamcrest
- hamcrest-library
- 1.3
- test
-
-
- org.ow2.asm
- asm-tree
- 7.3.1
- test
-
-
-
-
- clean install
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
-
-
-
- org.codehaus.plexus
- plexus-compiler-eclipse
- 2.8.5-spigotmc
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 2.4
-
-
-
- org.bukkit
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 3.2.1
-
-
- package
-
- shade
-
-
-
-
- ${project.build.directory}/dependency-reduced-pom.xml
-
- true
-
-
-
-
-
-
-
- development
-
- false
-
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
- 3.1.0
-
-
- process-classes
-
- check
-
-
-
-
- checkstyle.xml
- true
-
-
-
- com.puppycrawl.tools
- checkstyle
- 8.29
-
-
-
-
- org.codehaus.mojo
- animal-sniffer-maven-plugin
- 1.18
-
-
- process-classes
-
- check
-
-
-
-
-
- org.codehaus.mojo.signature
- java18
- 1.0
-
-
-
-
-
-
-
-
diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch
index 447189fc59..b1908e572b 100644
--- a/patches/api/0001-Convert-project-to-Gradle.patch
+++ b/patches/api/0001-Convert-project-to-Gradle.patch
@@ -3,6 +3,9 @@ From: Kyle Wood
Date: Thu, 10 Dec 2020 20:50:33 -0800
Subject: [PATCH] Convert project to Gradle
+The pom.xml file is deleted in this patch so the patch will fail to
+apply if there are changes made to it from upstream - thus notifying us
+that changes were made.
diff --git a/.gitignore b/.gitignore
index e431e3435737e28394d81b56568a08b3c3148b9b..c484aff2c192bf42059b5689327909e4af654401 100644
@@ -87,3 +90,271 @@ index 0000000000000000000000000000000000000000..b378772dce6fddf0a3f24e1c48667602
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/"
+ )
+}
+diff --git a/pom.xml b/pom.xml
+deleted file mode 100644
+index 10eeaef61be733e63f6680f1675e0b527eb30fd9..0000000000000000000000000000000000000000
+--- a/pom.xml
++++ /dev/null
+@@ -1,262 +0,0 @@
+-
+-
+- 4.0.0
+-
+- org.spigotmc
+- spigot-api
+- 1.17-R0.1-SNAPSHOT
+- jar
+-
+- Spigot-API
+- https://www.spigotmc.org/
+- An enhanced plugin API for Minecraft servers.
+-
+-
+- true
+- 1.8
+- 1.8
+- UTF-8
+-
+-
+-
+-
+- spigotmc-releases
+- https://hub.spigotmc.org/nexus/content/repositories/releases/
+-
+-
+- spigotmc-snapshots
+- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+-
+-
+-
+-
+-
+- commons-lang
+- commons-lang
+- 2.6
+- compile
+-
+-
+-
+- com.google.guava
+- guava
+- 21.0
+- compile
+-
+-
+-
+- com.google.code.gson
+- gson
+- 2.8.0
+- compile
+-
+-
+- net.md-5
+- bungeecord-chat
+- 1.16-R0.4
+- jar
+- compile
+-
+-
+- org.yaml
+- snakeyaml
+- 1.28
+- compile
+-
+-
+-
+- org.apache.maven
+- maven-resolver-provider
+- 3.8.1
+- provided
+-
+-
+- org.apache.maven.resolver
+- maven-resolver-connector-basic
+- 1.7.0
+- provided
+-
+-
+- org.apache.maven.resolver
+- maven-resolver-transport-http
+- 1.7.0
+- provided
+-
+-
+-
+- org.jetbrains
+- annotations-java5
+- 21.0.1
+- provided
+-
+-
+-
+- junit
+- junit
+- 4.13.1
+- test
+-
+-
+- org.hamcrest
+- hamcrest-library
+- 1.3
+- test
+-
+-
+- org.ow2.asm
+- asm-tree
+- 9.1
+- test
+-
+-
+-
+-
+-
+-
+- net.md-5
+- scriptus
+- 0.4.1
+-
+-
+- initialize
+-
+- describe
+-
+-
+-
+-
+-
+- org.apache.maven.plugins
+- maven-compiler-plugin
+- 3.8.1
+-
+-
+- eclipse
+-
+-
+-
+- org.codehaus.plexus
+- plexus-compiler-eclipse
+- 2.8.8
+-
+-
+- org.eclipse.jdt
+- ecj
+- 3.24.0
+-
+-
+-
+-
+- org.apache.maven.plugins
+- maven-jar-plugin
+- 3.2.0
+-
+-
+-
+- false
+-
+-
+- org.bukkit
+-
+-
+-
+-
+-
+- org.apache.maven.plugins
+- maven-shade-plugin
+- 3.2.3
+-
+-
+- package
+-
+- shade
+-
+-
+-
+-
+-
+-
+- *:*
+-
+- META-INF/MANIFEST.MF
+-
+-
+-
+-
+- true
+-
+-
+-
+- org.apache.maven.plugins
+- maven-javadoc-plugin
+- 3.2.0
+-
+-
+- https://guava.dev/releases/21.0/api/docs/
+- https://javadoc.io/doc/org.yaml/snakeyaml/1.27/
+- https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/
+- https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/
+-
+-
+-
+-
+-
+-
+-
+-
+- development
+-
+- false
+-
+-
+-
+-
+- org.apache.maven.plugins
+- maven-checkstyle-plugin
+- 3.1.1
+-
+-
+- process-classes
+-
+- check
+-
+-
+-
+-
+- checkstyle.xml
+- true
+-
+-
+-
+- com.puppycrawl.tools
+- checkstyle
+- 8.39
+-
+-
+-
+-
+- org.codehaus.mojo
+- animal-sniffer-maven-plugin
+- 1.19
+-
+-
+- process-classes
+-
+- check
+-
+-
+-
+-
+-
+- org.codehaus.mojo.signature
+- java18
+- 1.0
+-
+-
+-
+-
+-
+-
+-
+-
diff --git a/patches/api/0002-Build-system-changes.patch b/patches/api/0002-Build-system-changes.patch
index 3ca987e846..bee7c46e5e 100644
--- a/patches/api/0002-Build-system-changes.patch
+++ b/patches/api/0002-Build-system-changes.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
-index 271a6672e7fe9ce51bf96c8c18f5579fc47b2414..125fee17f7ab37fb2b4deb096f37a43cb9519e96 100644
+index b378772dce6fddf0a3f24e1c48667602fc356e51..c54be6e9df689433a8aa280541cf9366609a3c27 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -17,12 +17,14 @@ dependencies {
@@ -24,103 +24,3 @@ index 271a6672e7fe9ce51bf96c8c18f5579fc47b2414..125fee17f7ab37fb2b4deb096f37a43c
compileOnly(annotations)
testCompileOnly(annotations)
-diff --git a/pom.xml b/pom.xml
-index 10eeaef61be733e63f6680f1675e0b527eb30fd9..e5802bcb6fc2376cff2ee8b3069150127312b154 100644
---- a/pom.xml
-+++ b/pom.xml
-@@ -2,33 +2,34 @@
-
- 4.0.0
-+
-+ com.destroystokyo.paper
-+ paper-parent
-+ dev-SNAPSHOT
-+
-
-- org.spigotmc
-- spigot-api
-+ com.destroystokyo.paper
-+ paper-api
- 1.17-R0.1-SNAPSHOT
- jar
-
-- Spigot-API
-- https://www.spigotmc.org/
-+ Paper-API
-+ https://github.com/PaperMC/Paper
- An enhanced plugin API for Minecraft servers.
-
-
-- true
-+
- 1.8
- 1.8
- UTF-8
-
-
--
-+
-
-- spigotmc-releases
-- https://hub.spigotmc.org/nexus/content/repositories/releases/
-+ sonatype
-+ https://oss.sonatype.org/content/groups/public/
-
--
-- spigotmc-snapshots
-- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
--
--
-+
-
-
-
-@@ -37,6 +38,20 @@
- 2.6
- compile
-
-+
-+
-+ com.google.code.findbugs
-+ jsr305
-+ 1.3.9
-+ compile
-+
-+
-+
-+ com.googlecode.json-simple
-+ json-simple
-+ 1.1.1
-+ compile
-+
-
-
- com.google.guava
-@@ -112,6 +127,7 @@
-
-
-
-+ clean install
-
-
- net.md-5
-@@ -130,10 +146,6 @@
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
--
--
-- eclipse
--
-
-
- org.codehaus.plexus
-@@ -183,6 +195,7 @@
-
-
-
-+ ${project.build.directory}/dependency-reduced-pom.xml
-
- true
-
diff --git a/patches/api/0003-Add-FastUtil-to-Bukkit.patch b/patches/api/0003-Add-FastUtil-to-Bukkit.patch
index c5c0470aa7..fedaaafd6f 100644
--- a/patches/api/0003-Add-FastUtil-to-Bukkit.patch
+++ b/patches/api/0003-Add-FastUtil-to-Bukkit.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Add FastUtil to Bukkit
Doesn't expose to plugins, just allows Paper-API to use it for optimization
diff --git a/build.gradle.kts b/build.gradle.kts
-index 125fee17f7ab37fb2b4deb096f37a43cb9519e96..e4123d5f918a5f21b7f6fddba7084643f86ad5aa 100644
+index c54be6e9df689433a8aa280541cf9366609a3c27..9fe78a9570f7e8dd4c6f94fc3fb1bf176c1481d2 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -18,6 +18,7 @@ dependencies {
@@ -17,20 +17,3 @@ index 125fee17f7ab37fb2b4deb096f37a43cb9519e96..e4123d5f918a5f21b7f6fddba7084643
compileOnly("org.apache.maven:maven-resolver-provider:3.8.1")
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0")
-diff --git a/pom.xml b/pom.xml
-index e5802bcb6fc2376cff2ee8b3069150127312b154..7b44549b508862b207324a6003fcdfa623f40f07 100644
---- a/pom.xml
-+++ b/pom.xml
-@@ -32,6 +32,12 @@
-
-
-
-+
-+ it.unimi.dsi
-+ fastutil
-+ 8.2.2
-+ provided
-+
-
- commons-lang
- commons-lang
diff --git a/patches/api/0006-Adventure.patch b/patches/api/0006-Adventure.patch
index 509c29703f..a648d8875b 100644
--- a/patches/api/0006-Adventure.patch
+++ b/patches/api/0006-Adventure.patch
@@ -22,71 +22,6 @@ index 9fe78a9570f7e8dd4c6f94fc3fb1bf176c1481d2..3a36b2b7f38e3446177f0883083d30c7
compileOnly("org.apache.maven:maven-resolver-provider:3.8.1")
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0")
-diff --git a/pom.xml b/pom.xml
-index 7b44549b508862b207324a6003fcdfa623f40f07..f2238314b948be036d9e7054d7af5bfdac8ebbf6 100644
---- a/pom.xml
-+++ b/pom.xml
-@@ -22,6 +22,7 @@
- 1.8
- 1.8
- UTF-8
-+ 4.7.0
-
-
-
-@@ -31,7 +32,39 @@
-
-
-
-+
-+
-+
-+
-+ net.kyori
-+ adventure-bom
-+ ${adventure.version}
-+ pom
-+ import
-+
-+
-+
-+
-+
-
-+
-+
-+ net.kyori
-+ adventure-api
-+
-+
-+ net.kyori
-+ adventure-text-serializer-gson
-+
-+
-+ net.kyori
-+ adventure-text-serializer-legacy
-+
-+
-+ net.kyori
-+ adventure-text-serializer-plain
-+
-+
-
- it.unimi.dsi
- fastutil
-@@ -216,6 +249,12 @@
- https://javadoc.io/doc/org.yaml/snakeyaml/1.27/
- https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/
- https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/
-+
-+ https://jd.adventure.kyori.net/api/${adventure.version}/
-+ https://jd.adventure.kyori.net/text-serializer-gson/${adventure.version}/
-+ https://jd.adventure.kyori.net/text-serializer-legacy/${adventure.version}/
-+ https://jd.adventure.kyori.net/text-serializer-plain/${adventure.version}/
-+
-
-
-
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
index ef58a6c00f444bd498a2d8fc4e457236f393954f..ecd149157d4fb80444f34bf5633d74bcdb63dec5 100644
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
diff --git a/patches/api/0024-Use-ASM-for-event-executors.patch b/patches/api/0024-Use-ASM-for-event-executors.patch
index 303673fd3d..b886c8d3d4 100644
--- a/patches/api/0024-Use-ASM-for-event-executors.patch
+++ b/patches/api/0024-Use-ASM-for-event-executors.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/build.gradle.kts b/build.gradle.kts
-index 176180570bf2705d975cf349faf08b5ba32cdab3..c10c9f86db276b42d8b7c21c353970691990f125 100644
+index 3a36b2b7f38e3446177f0883083d30c739f6c9b1..9d0675e2afcd9c0f82b6e993b1185d507b32ed0f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -24,6 +24,8 @@ dependencies {
@@ -18,28 +18,6 @@ index 176180570bf2705d975cf349faf08b5ba32cdab3..c10c9f86db276b42d8b7c21c35397069
compileOnly("org.apache.maven:maven-resolver-provider:3.8.1")
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0")
-diff --git a/pom.xml b/pom.xml
-index f2238314b948be036d9e7054d7af5bfdac8ebbf6..aefaeec678b2f6b5ba1c15e43c4886eb9af6b143 100644
---- a/pom.xml
-+++ b/pom.xml
-@@ -163,6 +163,17 @@
- 9.1
- test
-
-+
-+
-+ org.ow2.asm
-+ asm
-+ 9.0
-+
-+
-+ org.ow2.asm
-+ asm-commons
-+ 9.0
-+
-
-
-
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java
new file mode 100644
index 0000000000000000000000000000000000000000..5b28e9b1daba7834af67dbc193dd656bedd9a994
diff --git a/patches/api/0258-Better-AnnotationTest-printout.patch b/patches/api/0258-Better-AnnotationTest-printout.patch
index 557bf7adf4..faa7160d62 100644
--- a/patches/api/0258-Better-AnnotationTest-printout.patch
+++ b/patches/api/0258-Better-AnnotationTest-printout.patch
@@ -4,42 +4,6 @@ Date: Thu, 3 Dec 2020 14:04:57 -0800
Subject: [PATCH] Better AnnotationTest printout
-diff --git a/pom.xml b/pom.xml
-index aefaeec678b2f6b5ba1c15e43c4886eb9af6b143..33771618d2fd7591db020af57df358c891b11d6d 100644
---- a/pom.xml
-+++ b/pom.xml
-@@ -250,6 +250,19 @@
- true
-
-
-+
-+ org.apache.maven.plugins
-+ maven-surefire-plugin
-+ 2.22.2
-+
-+
-+
-+ listener
-+ io.papermc.paper.JunitEventListener
-+
-+
-+
-+
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-diff --git a/src/test/java/io/papermc/paper/JunitEventListener.java b/src/test/java/io/papermc/paper/JunitEventListener.java
-new file mode 100644
-index 0000000000000000000000000000000000000000..072ac1a96394b8d494f42fca8dfe08115eaed3fe
---- /dev/null
-+++ b/src/test/java/io/papermc/paper/JunitEventListener.java
-@@ -0,0 +1,6 @@
-+package io.papermc.paper;
-+
-+import org.junit.runner.notification.RunListener;
-+
-+public class JunitEventListener extends RunListener {
-+}
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
index 03229d5f4ec36a82197beb391356d791ff67fb2f..19271057cf24329757c9419fa6c97848e008a96c 100644
--- a/src/test/java/org/bukkit/AnnotationTest.java
diff --git a/patches/server/0006-MC-Utils.patch b/patches/server/0006-MC-Utils.patch
index ff560e63a1..e54a57ca8d 100644
--- a/patches/server/0006-MC-Utils.patch
+++ b/patches/server/0006-MC-Utils.patch
@@ -2258,7 +2258,7 @@ index 0000000000000000000000000000000000000000..9df0006c1a283f77c4d01d9fce9062fc
+ }
+}
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index eee1fce53df4a35c206364f45cbc06cca198a8a9..a44709de54fc57eec337e560dc4a699a8012c58f 100644
+index 771e4b72589d7117a154ab6917bd4a56d55f19db..65e0ca442980f273d2fe5f131e174cd92f80da20 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
@@ -94,7 +94,7 @@ public class Util {
@@ -2271,18 +2271,10 @@ index eee1fce53df4a35c206364f45cbc06cca198a8a9..a44709de54fc57eec337e560dc4a699a
public static long getEpochMillis() {
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
-index a153ca538d237fab567550b0bfcdf5b2985c56f8..022cccbc52a7dda2f6bf0999905db82dd650b5ef 100644
+index 59240bb0ce088a14f8ccb62de8b69bc7bf313975..cfc2a5145e47de86a5a738d86abf333ff3db7796 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
-@@ -104,6 +104,7 @@ public class BlockPos extends Vec3i {
- return d == 0.0D && e == 0.0D && f == 0.0D ? this : new BlockPos((double)this.getX() + d, (double)this.getY() + e, (double)this.getZ() + f);
- }
-
-+ @Deprecated public final BlockPos add(int i, int j, int k) {return this.offset(i, j, k);} // Paper - OBFHELPER
- @Override
- public BlockPos offset(int i, int j, int k) {
- return i == 0 && j == 0 && k == 0 ? this : new BlockPos(this.getX() + i, this.getY() + j, this.getZ() + k);
-@@ -461,6 +462,7 @@ public class BlockPos extends Vec3i {
+@@ -461,6 +461,7 @@ public class BlockPos extends Vec3i {
return super.rotate(rotation).immutable();
}
@@ -2290,7 +2282,7 @@ index a153ca538d237fab567550b0bfcdf5b2985c56f8..022cccbc52a7dda2f6bf0999905db82d
public BlockPos.MutableBlockPos set(int x, int y, int z) {
this.setX(x);
this.setY(y);
-@@ -468,6 +470,7 @@ public class BlockPos extends Vec3i {
+@@ -468,6 +469,7 @@ public class BlockPos extends Vec3i {
return this;
}
@@ -2298,7 +2290,7 @@ index a153ca538d237fab567550b0bfcdf5b2985c56f8..022cccbc52a7dda2f6bf0999905db82d
public BlockPos.MutableBlockPos set(double x, double y, double z) {
return this.set(Mth.floor(x), Mth.floor(y), Mth.floor(z));
}
-@@ -525,6 +528,7 @@ public class BlockPos extends Vec3i {
+@@ -525,6 +527,7 @@ public class BlockPos extends Vec3i {
}
}
@@ -2306,7 +2298,7 @@ index a153ca538d237fab567550b0bfcdf5b2985c56f8..022cccbc52a7dda2f6bf0999905db82d
@Override
public BlockPos.MutableBlockPos setX(int i) {
super.setX(i);
-@@ -542,6 +546,7 @@ public class BlockPos extends Vec3i {
+@@ -542,6 +545,7 @@ public class BlockPos extends Vec3i {
super.setZ(i);
return this;
}
@@ -2871,7 +2863,7 @@ index 0000000000000000000000000000000000000000..80f8d6ce6dd717d4b37b78539c65b6ac
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index f0aea7c801b3ef3b1a213ecd473ce9e718f1be46..224128235f712c3dc8588b3a5cdd3e776b9c0aba 100644
+index 75801343b14a5555e974168170af95f8513926f5..1b76d1b929b85b130639e7937a118342b568e795 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -941,6 +941,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements EntityTypeTest {
- return this.dimensions.height;
- }
-
-- @Nullable
-- public T create(Level world) {
-+ public T create(Level world) { return this.create(world); } // Paper - OBFHELPER
-+ @Nullable public T create(Level world) { // Paper - OBFHELPER
- return this.factory.create(this, world);
- }
-
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 595e48db4ce6064c25f3802be54ce34e87948cff..9f68aa235949520b445b368782ccde6b0e26859d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3653,7 +3622,7 @@ index 083122a2e051b23b2cb9bdb8eb70af01af9df400..e85e4a2dfceb0aa40e73b43a5e122a59
FluidState getFluidState(BlockPos pos);
diff --git a/src/main/java/net/minecraft/world/level/ChunkPos.java b/src/main/java/net/minecraft/world/level/ChunkPos.java
-index 3f77959c98ee6f19423105d23f69bc56a82df54b..d237ceb887b10f8e002f1aba930348a57f223834 100644
+index 3f77959c98ee6f19423105d23f69bc56a82df54b..439f82a48e6f6ce7b4773505ced32324cacb302d 100644
--- a/src/main/java/net/minecraft/world/level/ChunkPos.java
+++ b/src/main/java/net/minecraft/world/level/ChunkPos.java
@@ -16,6 +16,7 @@ public class ChunkPos {
@@ -3664,7 +3633,7 @@ index 3f77959c98ee6f19423105d23f69bc56a82df54b..d237ceb887b10f8e002f1aba930348a5
private static final int HASH_A = 1664525;
private static final int HASH_C = 1013904223;
private static final int HASH_Z_XOR = -559038737;
-@@ -23,23 +24,27 @@ public class ChunkPos {
+@@ -23,23 +24,26 @@ public class ChunkPos {
public ChunkPos(int x, int z) {
this.x = x;
this.z = z;
@@ -3689,7 +3658,6 @@ index 3f77959c98ee6f19423105d23f69bc56a82df54b..d237ceb887b10f8e002f1aba930348a5
}
- public static long asLong(int chunkX, int chunkZ) {
-+ @Deprecated public static long pair(final BlockPos pos) { return asLong(pos.getX() >> 4, pos.getZ() >> 4); } // Paper - OBFHELPER
+ public static long asLong(int chunkX, int chunkZ) {
return (long)chunkX & 4294967295L | ((long)chunkZ & 4294967295L) << 32;
}
diff --git a/patches/server/0009-Timings-v2.patch b/patches/server/0009-Timings-v2.patch
index 65110823c8..eaa7acc294 100644
--- a/patches/server/0009-Timings-v2.patch
+++ b/patches/server/0009-Timings-v2.patch
@@ -1055,7 +1055,7 @@ index fe83f13d71f84591f5506e1c6b9dfbf9fba680bd..844d3b910cfb1c073b8b58b0eff3f28a
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 2014ba4857e07092de4c3179149563b0ff284e56..fe785c42b6eca6dafb28ffb6b7afaf44135b3949 100644
+index 33d17e69fac035c421345e1a8c6eb214a54efc46..3b1565309165e10b147d08b8245ea0bce50dc3c2 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,7 +1,9 @@
@@ -1371,7 +1371,7 @@ index bcfc6ea89aa3b1df92d2b181d1d23902859e2584..5c5cfc31ced6695af7b1dd06cb867274
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 83e71d07f86c115a0df1eb56ae9f2b127821fe80..78ef2e0d9a32d38c7193859f8ee726c70c9b289e 100644
+index ab32d84cd0f29fefceb080598bdf1283cb0a33d5..f4f6f3e388a39efd2b076616350c49a0e8e65908 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -209,6 +209,7 @@ import org.bukkit.inventory.EquipmentSlot;
@@ -1486,10 +1486,10 @@ index 430d286a73cfdd643e85bdaa97bf91c2c74a342c..0b63d81ecbcb56bf3dc25661cc2b219c
protected void tryCheckInsideBlocks() {
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
-index 89e7d02b88404ac5dce06595432ae95c9a4e5015..b7ab2844b49e97f35a04ac6c9d22ecac689f03a5 100644
+index 7f3d83d3d071f6b441ad119b1c93be035e911e70..8d5c61a77bea2f2f5dbff26cb479f855945f9541 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
-@@ -295,17 +295,29 @@ public class EntityType implements EntityTypeTest {
+@@ -294,17 +294,29 @@ public class EntityType implements EntityTypeTest {
return Registry.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(id));
}
@@ -1526,15 +1526,7 @@ index 89e7d02b88404ac5dce06595432ae95c9a4e5015..b7ab2844b49e97f35a04ac6c9d22ecac
}
@Nullable
-@@ -462,7 +474,6 @@ public class EntityType implements EntityTypeTest {
- return this.dimensions.height;
- }
-
-- public T create(Level world) { return this.create(world); } // Paper - OBFHELPER
- @Nullable public T create(Level world) { // Paper - OBFHELPER
- return this.factory.create(this, world);
- }
-@@ -568,6 +579,12 @@ public class EntityType implements EntityTypeTest {
+@@ -567,6 +579,12 @@ public class EntityType implements EntityTypeTest {
return this.updateInterval;
}
@@ -1547,7 +1539,7 @@ index 89e7d02b88404ac5dce06595432ae95c9a4e5015..b7ab2844b49e97f35a04ac6c9d22ecac
public boolean trackDeltas() {
return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS;
}
-@@ -660,7 +677,7 @@ public class EntityType implements EntityTypeTest {
+@@ -659,7 +677,7 @@ public class EntityType implements EntityTypeTest {
Util.fetchChoiceType(References.ENTITY_TREE, id);
}
diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch
index 962d2c753a..f0466c964e 100644
--- a/patches/server/0010-Adventure.patch
+++ b/patches/server/0010-Adventure.patch
@@ -1251,7 +1251,7 @@ index 2b0d989119c9f69a68a6c1c69fb09dbbedd16716..172536147305f283bd14d356ff4f3953
// CraftBukkit end
this.chatVisibility = packet.getChatVisibility();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 78ef2e0d9a32d38c7193859f8ee726c70c9b289e..3e89612f4bf74179b3461166b17b42af2e59b8e5 100644
+index f4f6f3e388a39efd2b076616350c49a0e8e65908..cfe2361b0af12e6333f65487f27b50e2cbc16168 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -162,6 +162,8 @@ import org.apache.logging.log4j.LogManager;
@@ -1741,7 +1741,7 @@ index bcd056ac91775c72809284bbc20c366e1ca31350..e2564dee0603735d135d1de2af6801a0
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 3c4281ad770598ecf3b9fae0d6ed6e9130136dbb..4df6b2a155a610953d8d5789bffa33d290d62aaa 100644
+index ce548fe73dcef10adb99045b06ce58135935aee6..3fd48807c554b176cd8e925bdcd68e7f808e5881 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -19,6 +19,12 @@ public class Main {
@@ -2038,7 +2038,7 @@ index d4ea706d5456e709b95e34be8220a0d39be2c8f4..2db149bf57c561d7f8f49341fbefafb5
player.initMenu(container);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 969d5071dbf3356b80da38526351d488ab936c08..2cb5427c441e50db23bb59da31654c4f2f218b85 100644
+index 969d5071dbf3356b80da38526351d488ab936c08..bc901793055db9481ec32e668386ba33696bc0a5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -244,14 +244,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2220,7 +2220,7 @@ index 969d5071dbf3356b80da38526351d488ab936c08..2cb5427c441e50db23bb59da31654c4f
@Override
public int getPing() {
return this.getHandle().latency;
-@@ -1727,6 +1798,156 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -1727,6 +1798,158 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getInventory().setItemInMainHand(hand);
}
@@ -2349,6 +2349,8 @@ index 969d5071dbf3356b80da38526351d488ab936c08..2cb5427c441e50db23bb59da31654c4f
+ final java.util.Optional event = net.minecraft.core.Registry.SOUND_EVENT.getOptional(name);
+ if (event.isPresent()) {
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(event.get(), io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), entity, sound.volume(), sound.pitch()));
++ } else {
++ this.getHandle().connection.send(new ClientboundCustomSoundPacket(name, io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), entity.position(), sound.volume(), sound.pitch()));
+ }
+ }
+
diff --git a/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
index 1bec0b608a..fd39f344c6 100644
--- a/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
+++ b/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
@@ -19,7 +19,7 @@ index 78948c42b13194005bdbbbc69c2b7ae0732a78c5..b41e7922dd96c3358eb849ab39982a75
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index e48fe017704b495712b565feff54e1b4ed2d595d..e6abf635281c895505f3201d7329d51f36e24eef 100644
+index 0b63d81ecbcb56bf3dc25661cc2b219cd8c25592..c22eb7451aaf142f6c722715dbfda5ee332e068b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1264,6 +1264,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -31,7 +31,7 @@ index e48fe017704b495712b565feff54e1b4ed2d595d..e6abf635281c895505f3201d7329d51f
return this.isInWater() || this.isInRain() || this.isInBubbleColumn();
}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..9f368f32aa93fe5f94b19a884f44ded3bf69a225 100644
+index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..1456dd2ef7ff28701555f4ac4b7645794ccee640 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -103,6 +103,7 @@ public abstract class Mob extends LivingEntity {
@@ -49,7 +49,7 @@ index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..9f368f32aa93fe5f94b19a884f44ded3
- if (!this.aware) return; // CraftBukkit
+ if (!this.aware) { // Paper start - Allow nerfed mobs to jump, float and take water damage
+ if (goalFloat != null) {
-+ if (goalFloat.validConditions()) goalFloat.update();
++ if (goalFloat.validConditions()) goalFloat.tick();
+ this.getJumpControl().tick();
+ }
+ if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterRainOrBubble()) {
@@ -62,10 +62,10 @@ index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..9f368f32aa93fe5f94b19a884f44ded3
this.sensing.tick();
this.level.getProfiler().pop();
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
-index 54085b104547f2fe7c08ff8aa4839b1230877bca..5a2e3cc833b3fa7d6fcea1474e25c469a53b3bae 100644
+index 54085b104547f2fe7c08ff8aa4839b1230877bca..1e6c92a3e9a28315814b250b56ecfb3e85f151b4 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
-@@ -9,15 +9,18 @@ public class FloatGoal extends Goal {
+@@ -9,10 +9,12 @@ public class FloatGoal extends Goal {
public FloatGoal(Mob mob) {
this.mob = mob;
@@ -78,9 +78,3 @@ index 54085b104547f2fe7c08ff8aa4839b1230877bca..5a2e3cc833b3fa7d6fcea1474e25c469
@Override
public boolean canUse() {
return this.mob.isInWater() && this.mob.getFluidHeight(FluidTags.WATER) > this.mob.getFluidJumpThreshold() || this.mob.isInLava();
- }
-
-+ public void update() { this.tick(); } // Paper - OBFHELPER
- @Override
- public void tick() {
- if (this.mob.getRandom().nextFloat() < 0.8F) {
diff --git a/patches/server/0025-Entity-Origin-API.patch b/patches/server/0025-Entity-Origin-API.patch
index e6bd8ff87d..39ebdd4c30 100644
--- a/patches/server/0025-Entity-Origin-API.patch
+++ b/patches/server/0025-Entity-Origin-API.patch
@@ -4,20 +4,8 @@ Date: Tue, 1 Mar 2016 23:45:08 -0600
Subject: [PATCH] Entity Origin API
-diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
-index 88bac72edf19c578902f49d20353989ed4d96f8f..e79faeb26d079de0108268fd2607cf9eb885c003 100644
---- a/src/main/java/net/minecraft/nbt/ListTag.java
-+++ b/src/main/java/net/minecraft/nbt/ListTag.java
-@@ -179,6 +179,7 @@ public class ListTag extends CollectionTag {
- return new long[0];
- }
-
-+ public final double getDoubleAt(int i) { return this.getDouble(i); } // Paper - OBFHELPER
- public double getDouble(int index) {
- if (index >= 0 && index < this.list.size()) {
- Tag tag = this.list.get(index);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 94c5631820590d31cfd4e8a4fb2395dd6b395841..a1d5519f2133349a805296132bbe84272818091b 100644
+index 5c5cfc31ced6695af7b1dd06cb867274fa38d85f..d5a12238317f1c85b9ad8cb63b936e501a4326ba 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1110,6 +1110,11 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -33,7 +21,7 @@ index 94c5631820590d31cfd4e8a4fb2395dd6b395841..a1d5519f2133349a805296132bbe8427
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 4a86e7e9e81a31d7a785279c294c000c559a76d6..18f98049bd6e48d6d825528b91e79f0e0759ccc3 100644
+index a65646832867e62c758eae3ee1359bdd0d810835..110177551183d1ac33a22b5b8c2c5c39697c220b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -280,6 +280,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -89,7 +77,7 @@ index 4a86e7e9e81a31d7a785279c294c000c559a76d6..18f98049bd6e48d6d825528b91e79f0e
+ originWorld = nbt.getUUID("Paper.OriginWorld");
+ }
+ this.originWorld = originWorld;
-+ origin = new org.bukkit.util.Vector(originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2));
++ origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2));
+ }
+ // Paper end
+
diff --git a/patches/server/0148-Entity-fromMobSpawner.patch b/patches/server/0148-Entity-fromMobSpawner.patch
index 43a9b96d6c..0a6a6fee72 100644
--- a/patches/server/0148-Entity-fromMobSpawner.patch
+++ b/patches/server/0148-Entity-fromMobSpawner.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Entity#fromMobSpawner()
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 927cc59705c662d319fbee47c8da00d8e6256e72..609bffc7d8f21c8733b3fb861fe02f9d1302d796 100644
+index f858da07ca3d49ad338a4e77c986ddd5494d74f0..f3b5df4e693d923796929b79f9a43bfa4cbe03e7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -321,6 +321,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -29,7 +29,7 @@ index 927cc59705c662d319fbee47c8da00d8e6256e72..609bffc7d8f21c8733b3fb861fe02f9d
} catch (Throwable throwable) {
@@ -1997,6 +2002,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
this.originWorld = originWorld;
- origin = new org.bukkit.util.Vector(originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2));
+ origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2));
}
+
+ spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
diff --git a/patches/server/0172-Ability-to-apply-mending-to-XP-API.patch b/patches/server/0172-Ability-to-apply-mending-to-XP-API.patch
index 59ae2fe303..86e1a578bb 100644
--- a/patches/server/0172-Ability-to-apply-mending-to-XP-API.patch
+++ b/patches/server/0172-Ability-to-apply-mending-to-XP-API.patch
@@ -9,23 +9,6 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
-diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-index 4a6a588eeeee3aa7d33d4b4545e9b8bdf043e567..30a3facc1b23ccb508b30c5affa9ea1c527dd48b 100644
---- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-@@ -341,10 +341,12 @@ public class ExperienceOrb extends Entity {
- }
- }
-
-+ public final int durToXp(int i) { return durabilityToXp(i); } // Paper OBFHELPER
- private int durabilityToXp(int repairAmount) {
- return repairAmount / 2;
- }
-
-+ public final int xpToDur(int i) { return xpToDurability(i); } // Paper OBFHELPER
- private int xpToDurability(int experienceAmount) {
- return experienceAmount * 2;
- }
diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
index 27cdfbeb6cb2159075b35dd4f9e9557ec0eac7c2..069ce59faab5184ab9da8ca3fe1cebf7449cd7fe 100644
--- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
@@ -45,7 +28,7 @@ index 27cdfbeb6cb2159075b35dd4f9e9557ec0eac7c2..069ce59faab5184ab9da8ca3fe1cebf7
return true;
});
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 7badc90ec9e3b2dfffac6601e432c41224b701f6..44533533c4860a23a0d469c6a544825297d221de 100644
+index 6549ffa087f9955849024fa62cfca9e91cbecf30..f1c56823e1e89251c518d9d51ab7442b30a85336 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -61,11 +61,14 @@ import net.minecraft.server.level.ServerPlayer;
@@ -80,12 +63,12 @@ index 7badc90ec9e3b2dfffac6601e432c41224b701f6..44533533c4860a23a0d469c6a5448252
+ orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM;
+ orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ());
+
-+ int i = Math.min(orb.xpToDur(amount), itemstack.getDamageValue());
++ int i = Math.min(orb.xpToDurability(amount), itemstack.getDamageValue());
+ org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, i);
+ i = event.getRepairAmount();
+ orb.discard();
+ if (!event.isCancelled()) {
-+ amount -= orb.durToXp(i);
++ amount -= orb.durabilityToXp(i);
+ itemstack.setDamageValue(itemstack.getDamageValue() - i);
+ }
+ }
diff --git a/patches/server/0175-PreCreatureSpawnEvent.patch b/patches/server/0175-PreCreatureSpawnEvent.patch
index a715d952d8..7a303e9c8e 100644
--- a/patches/server/0175-PreCreatureSpawnEvent.patch
+++ b/patches/server/0175-PreCreatureSpawnEvent.patch
@@ -15,10 +15,10 @@ instead and save a lot of server resources.
See: https://github.com/PaperMC/Paper/issues/917
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
-index 9f5f2bd9bdfce14da030b09f56c821ec1989e12f..872f92ac1a6bc86ce54700dbf555ceea4fab2057 100644
+index 8d5c61a77bea2f2f5dbff26cb479f855945f9541..f38ccdecbade43983358dfbeadca86be7d15a68c 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
-@@ -333,6 +333,20 @@ public class EntityType implements EntityTypeTest {
+@@ -332,6 +332,20 @@ public class EntityType implements EntityTypeTest {
@Nullable
public T spawnCreature(ServerLevel worldserver, @Nullable CompoundTag nbttagcompound, @Nullable Component ichatbasecomponent, @Nullable Player entityhuman, BlockPos blockposition, MobSpawnType enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
diff --git a/patches/server/0248-Use-ConcurrentHashMap-in-JsonList.patch b/patches/server/0248-Use-ConcurrentHashMap-in-JsonList.patch
index 61e0a0c89d..9755902d2a 100644
--- a/patches/server/0248-Use-ConcurrentHashMap-in-JsonList.patch
+++ b/patches/server/0248-Use-ConcurrentHashMap-in-JsonList.patch
@@ -38,7 +38,7 @@ index 7c5a75fb34640bb4e7ef839412dbb30b0d0fc8e8..b62aa9f934c33b4d22b985b5e56937ba
chatmessage = new TranslatableComponent("multiplayer.disconnect.banned_ip.reason", new Object[]{ipbanentry.getReason()});
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
-index 00e3662e25618459447d4ce5f56f7e046bfe47e2..0851dca56ae680387d56b3fdc894746c248604f5 100644
+index 00e3662e25618459447d4ce5f56f7e046bfe47e2..2567e51f7de898ea0a2411a176af70bdc4551260 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -12,6 +12,8 @@ import java.io.BufferedReader;
@@ -56,7 +56,7 @@ index 00e3662e25618459447d4ce5f56f7e046bfe47e2..0851dca56ae680387d56b3fdc894746c
private final File file;
- private final Map map = Maps.newHashMap();
+ // Paper - replace HashMap is ConcurrentHashMap
-+ private final Map map = Maps.newConcurrentMap(); private final Map getBackingMap() { return this.map; } // Paper - OBFHELPER
++ private final Map map = Maps.newConcurrentMap();
+ private boolean e = true;
+ private static final ParameterizedType f = new ParameterizedType() {
+ public Type[] getActualTypeArguments() {
@@ -83,7 +83,7 @@ index 00e3662e25618459447d4ce5f56f7e046bfe47e2..0851dca56ae680387d56b3fdc894746c
+ // Paper start
+ // this.g();
+ // return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error
-+ return (V) this.getBackingMap().computeIfPresent(this.getKeyForUser(key), (k, v) -> {
++ return (V) this.map.computeIfPresent(this.getKeyForUser(key), (k, v) -> {
+ return v.hasExpired() ? null : v;
+ });
+ // Paper end
@@ -96,7 +96,7 @@ index 00e3662e25618459447d4ce5f56f7e046bfe47e2..0851dca56ae680387d56b3fdc894746c
public boolean isEmpty() {
- return this.map.size() < 1;
+ // return this.d.size() < 1; // Paper
-+ return this.getBackingMap().isEmpty(); // Paper - readability is the goal. As an aside, isEmpty() uses only sumCount() and a comparison. size() uses sumCount(), casts, and boolean logic
++ return this.map.isEmpty(); // Paper - readability is the goal. As an aside, isEmpty() uses only sumCount() and a comparison. size() uses sumCount(), casts, and boolean logic
}
protected String getKeyForUser(K profile) {
@@ -127,7 +127,7 @@ index 00e3662e25618459447d4ce5f56f7e046bfe47e2..0851dca56ae680387d56b3fdc894746c
+ this.d.remove(this.a(k0));
+ }*/
-+ this.getBackingMap().values().removeIf(StoredUserEntry::hasExpired);
++ this.map.values().removeIf(StoredUserEntry::hasExpired);
+ // Paper end
}
diff --git a/patches/server/0251-Optimize-BlockPosition-helper-methods.patch b/patches/server/0251-Optimize-BlockPosition-helper-methods.patch
index 2c59eaa8ab..cf5055afe5 100644
--- a/patches/server/0251-Optimize-BlockPosition-helper-methods.patch
+++ b/patches/server/0251-Optimize-BlockPosition-helper-methods.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Optimize BlockPosition helper methods
Resolves #1338
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
-index 022cccbc52a7dda2f6bf0999905db82dd650b5ef..86618513e8f777d1d738b230c97eb527ddce7c26 100644
+index cfc2a5145e47de86a5a738d86abf333ff3db7796..c4e622143073edbb4891ac9bd4fe30f32aede8f6 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
-@@ -131,67 +131,84 @@ public class BlockPos extends Vec3i {
+@@ -130,67 +130,84 @@ public class BlockPos extends Vec3i {
@Override
public BlockPos above() {
diff --git a/patches/server/0261-Asynchronous-chunk-IO-and-loading.patch b/patches/server/0261-Asynchronous-chunk-IO-and-loading.patch
index 617b46a6ee..b31c2e1790 100644
--- a/patches/server/0261-Asynchronous-chunk-IO-and-loading.patch
+++ b/patches/server/0261-Asynchronous-chunk-IO-and-loading.patch
@@ -1436,7 +1436,7 @@ index 0000000000000000000000000000000000000000..ee906b594b306906c170180a29a8b619
+}
diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java
new file mode 100644
-index 0000000000000000000000000000000000000000..7c4b19f565a77b63ab9d3b56557af126d0438eac
+index 0000000000000000000000000000000000000000..0eaa4f3cd476c64feab358879eee3d67f46092f4
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java
@@ -0,0 +1,138 @@
@@ -1534,7 +1534,7 @@ index 0000000000000000000000000000000000000000..7c4b19f565a77b63ab9d3b56557af126
+
+ try {
+ chunkData.chunkData = chunkManager.getChunkData(this.world.getTypeKey(),
-+ chunkManager.getWorldPersistentDataSupplier(), chunkData.chunkData, chunkPos, this.world); // clone data for safety, file IO thread does not clone
++ chunkManager.overworldDataStorage, chunkData.chunkData, chunkPos, this.world); // clone data for safety, file IO thread does not clone
+ } catch (final Throwable ex) {
+ PaperFileIOThread.LOGGER.error("Could not apply datafixers for chunk task: " + this.toString(), ex);
+ this.complete(ChunkLoadTask.createEmptyHolder());
@@ -2299,7 +2299,7 @@ index fb0b3c5770f66cc3590f5ac4e690a33cb6179be3..7ce854edba32ffcafaa5268d4bb2822a
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataFixers.getDataFixer(), minecraftsessionservice, gameprofilerepository, usercache, LoggerChunkProgressListener::new);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 880fc4e346549a5d7ed627244bdfd284705ad2fc..24fc2eb3ee067a4164db166aa3e07ecbb426bbba 100644
+index 537efec03939b0f5640dfd974bb0bd68e93b4325..627887227e266155c025592b50defede4271d978 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -976,7 +976,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop mainThreadExecutor;
- public final ChunkGenerator generator;
-- private final Supplier overworldDataStorage;
-+ private final Supplier overworldDataStorage; public final Supplier getWorldPersistentDataSupplier() { return this.overworldDataStorage; } // Paper - OBFHELPER
- private final PoiManager poiManager;
- public final LongSet toDrop;
- private boolean modified;
@@ -406,6 +406,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void close() throws IOException {
try {
@@ -2645,7 +2636,7 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..e6090343eda328ab612a9345978cf8da
return this.poiManager;
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index bd937505244cc9305611815a9274f91395d3a8f8..b15d5c2a8d4d2184a55a16ff2071fd82cb2e0457 100644
+index 853056ad5c5eeff03e7d6fe0dfd6f837a03ad882..672f78d1560ccd45d1a0ca04d6daf8188105c3e9 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -323,10 +323,128 @@ public class ServerChunkCache extends ChunkSource {
@@ -2824,7 +2815,7 @@ index bd937505244cc9305611815a9274f91395d3a8f8..b15d5c2a8d4d2184a55a16ff2071fd82
} 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 e299bf10c0bdd14398d590939d90cc723ecd4ce5..479bea88e497adfe8cfacd53b5de825bba8e4722 100644
+index 774f37e02feb83be3b92620aa4a0227a0c4acc93..434f3a56e373e584801d66c13ba2c045a383beea 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -210,6 +210,79 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -2929,7 +2920,7 @@ index 0d536d72ac918fbd403397ff369d10143ee9c204..be677d437d17b74c6188ce1bd5fc6fdc
private final String name;
private final Comparator comparator;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 1c76d6a616d6967402fb55feffafffa0aa2fd468..2917632c5e974dbfb7d78c497ebd49e742b8ef3c 100644
+index eb52ca159e895608a6a662821f14910970759dd2..05d5d976c18149491124263b056224a384eee06d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -712,6 +712,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
diff --git a/patches/server/0263-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0263-Expose-attack-cooldown-methods-for-Player.patch
index 049fbdf8ce..dcad576eaa 100644
--- a/patches/server/0263-Expose-attack-cooldown-methods-for-Player.patch
+++ b/patches/server/0263-Expose-attack-cooldown-methods-for-Player.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 63f3913815a49eb3e46e89382438cbc7826886ae..873852a77e5e62bd45912a73512edc6f02130349 100644
+index 1800119160d5711b694c14e9dde175b11c06ce61..6950e36b5e0522ba40874d3c786e5dff2ad12fed 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2230,6 +2230,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2232,6 +2232,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
connection.send(new net.minecraft.network.protocol.game.ClientboundOpenBookPacket(net.minecraft.world.InteractionHand.MAIN_HAND));
connection.send(new net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket(0, slot, inventory.getSelected()));
}
diff --git a/patches/server/0268-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/patches/server/0268-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch
index 27cd5aa1c7..9cd5ce0cec 100644
--- a/patches/server/0268-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch
+++ b/patches/server/0268-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch
@@ -4,21 +4,8 @@ Date: Wed, 12 Sep 2018 18:53:55 +0300
Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values
-diff --git a/src/main/java/net/minecraft/commands/arguments/blocks/BlockStateParser.java b/src/main/java/net/minecraft/commands/arguments/blocks/BlockStateParser.java
-index 30c3b24af7efebecc21d190ab89817468bdbee22..147fc3f7648a519441eec7ef1048fd18ea595d98 100644
---- a/src/main/java/net/minecraft/commands/arguments/blocks/BlockStateParser.java
-+++ b/src/main/java/net/minecraft/commands/arguments/blocks/BlockStateParser.java
-@@ -63,7 +63,7 @@ public class BlockStateParser {
- private final boolean forTesting;
- private final Map, Comparable>> properties = Maps.newLinkedHashMap(); // CraftBukkit - stable
- private final Map vagueProperties = Maps.newHashMap();
-- private ResourceLocation id = new ResourceLocation("");
-+ private ResourceLocation id = new ResourceLocation(""); public final ResourceLocation getBlockKey() { return this.id; } // Paper - OBFHELPER
- private StateDefinition definition;
- private BlockState state;
- @Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
-index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..6252c3934d72b0d5e6809842bdd26d344cab98c6 100644
+index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..9288588af4e0f9dd4c9711260cd4b73b66632bb7 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -83,6 +83,12 @@ import org.bukkit.persistence.PersistentDataContainer;
@@ -374,7 +361,7 @@ index 4ad6fd7e110f949f0bd859331ed6a5109ade3008..6252c3934d72b0d5e6809842bdd26d34
+ if (isTag) {
+ key = blockParser.getTag();
+ } else {
-+ key = blockParser.getBlockKey();
++ key = blockParser.id;
+ }
+
+ if (key == null) {
diff --git a/patches/server/0280-Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/0280-Call-player-spectator-target-events-and-improve-impl.patch
index 7137c95fee..a8da6d273d 100644
--- a/patches/server/0280-Call-player-spectator-target-events-and-improve-impl.patch
+++ b/patches/server/0280-Call-player-spectator-target-events-and-improve-impl.patch
@@ -19,7 +19,7 @@ spectate the target entity.
Co-authored-by: Spottedleaf
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index df02d712e7daf1603885547995d69cb7fa3962ca..3ca3a1c16ea0900bfb868a6e2fc88e3522bf7752 100644
+index df02d712e7daf1603885547995d69cb7fa3962ca..72d17bfbe0830721caa7d1fd0aa50916e75b1ed7 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1822,14 +1822,58 @@ public class ServerPlayer extends Player {
@@ -55,12 +55,12 @@ index df02d712e7daf1603885547995d69cb7fa3962ca..3ca3a1c16ea0900bfb868a6e2fc88e35
+ // Validate
+ if (entity != this) {
+ if (entity.isRemoved() || !entity.valid || entity.level == null) {
-+ MinecraftServer.LOGGER.info("Blocking player " + this.toString() + " from spectating invalid entity " + entity.toString());
++ MinecraftServer.LOGGER.info("Blocking player " + this + " from spectating invalid entity " + entity);
+ return;
+ }
+ if (this.isImmobile()) {
+ // use debug: clients might maliciously spam this
-+ MinecraftServer.LOGGER.debug("Blocking frozen player " + this.toString() + " from spectating entity " + entity.toString());
++ MinecraftServer.LOGGER.debug("Blocking frozen player " + this + " from spectating entity " + entity);
+ return;
+ }
+ }
@@ -85,15 +85,3 @@ index df02d712e7daf1603885547995d69cb7fa3962ca..3ca3a1c16ea0900bfb868a6e2fc88e35
}
@Override
-diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 2917632c5e974dbfb7d78c497ebd49e742b8ef3c..4f263837f4111f77e14e4663afeff4e170b2b3da 100644
---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1381,6 +1381,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
- this.a(x, y, z, yaw, pitch, PlayerTeleportEvent.TeleportCause.UNKNOWN);
- }
-
-+ public final void teleport(double d0, double d1, double d2, float f, float f1, PlayerTeleportEvent.TeleportCause cause) { this.a(d0, d1, d2, f, f1, cause); } // Paper - OBFHELPER
- public void a(double d0, double d1, double d2, float f, float f1, PlayerTeleportEvent.TeleportCause cause) {
- this.a(d0, d1, d2, f, f1, Collections.emptySet(), true, cause);
- }
diff --git a/patches/server/0294-Don-t-allow-digging-into-unloaded-chunks.patch b/patches/server/0294-Don-t-allow-digging-into-unloaded-chunks.patch
index 4e5b9a9d32..f674961ed3 100644
--- a/patches/server/0294-Don-t-allow-digging-into-unloaded-chunks.patch
+++ b/patches/server/0294-Don-t-allow-digging-into-unloaded-chunks.patch
@@ -51,10 +51,10 @@ index 315dad4789f5f2582ee9b4fc176affd1f57537ef..f4a056185990181e486f452960159a52
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 17e2219bf69e8282aedf476fea5ee00137a95057..cd95e232e174de5aad462bc968fed5dda16b140d 100644
+index 5999417f4a357a895757e13f9b69fc970595be2e..59154fbdba07e812ca99fbd2d3b70d24ae9dbfd5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1558,6 +1558,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1557,6 +1557,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
case START_DESTROY_BLOCK:
case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK:
diff --git a/patches/server/0306-Block-Entity-remove-from-being-called-on-Players.patch b/patches/server/0306-Block-Entity-remove-from-being-called-on-Players.patch
index a2bf3368e3..e19c98b1cf 100644
--- a/patches/server/0306-Block-Entity-remove-from-being-called-on-Players.patch
+++ b/patches/server/0306-Block-Entity-remove-from-being-called-on-Players.patch
@@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to
be unintentional in the few cases we've seen so far.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index a5772815211b2739b493f2547fae819b9d9b7a39..7887173102ec582740189882064f5610d952d205 100644
+index 0e27598d8b05c09e0ae3aae618573fe774b84cca..8c19f5b79fd846bea4eb5c4776eb9a4a282b24c1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2277,6 +2277,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2279,6 +2279,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void resetCooldown() {
getHandle().resetAttackStrengthTicker();
}
diff --git a/patches/server/0309-Limit-Client-Sign-length-more.patch b/patches/server/0309-Limit-Client-Sign-length-more.patch
index a959b56ca5..4e2bcf3bef 100644
--- a/patches/server/0309-Limit-Client-Sign-length-more.patch
+++ b/patches/server/0309-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 6af9fbf46cb5fcf419fdf8800b5f6b08ef09cc81..c184417a71467abd420c99ba5feb3a1844e92c1d 100644
+index f0eda343820087497d20ed75d925ea6044f70816..58baed7f75ff0b573e072ad19026b7ef94a56172 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -255,6 +255,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -33,7 +33,7 @@ index 6af9fbf46cb5fcf419fdf8800b5f6b08ef09cc81..c184417a71467abd420c99ba5feb3a18
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) {
-@@ -2867,10 +2868,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2866,10 +2867,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
List lines = new java.util.ArrayList<>();
for (int i = 0; i < list.size(); ++i) {
diff --git a/patches/server/0318-Update-entity-Metadata-for-all-tracked-players.patch b/patches/server/0318-Update-entity-Metadata-for-all-tracked-players.patch
index 9dc0d1da1e..f587272e06 100644
--- a/patches/server/0318-Update-entity-Metadata-for-all-tracked-players.patch
+++ b/patches/server/0318-Update-entity-Metadata-for-all-tracked-players.patch
@@ -22,10 +22,10 @@ index ad9bbda31a4cdb306ca40f2b99e4b815c4f136bd..28afe2f238ded241acf77c3272a44068
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 c184417a71467abd420c99ba5feb3a1844e92c1d..61cfe722c01ac8fa89e8ade3e798bc50bed5e186 100644
+index 58baed7f75ff0b573e072ad19026b7ef94a56172..4184b8c002c0d36574c6710558d85930d3f72279 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2289,7 +2289,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2288,7 +2288,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/0331-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/0331-Configurable-Keep-Spawn-Loaded-range-per-world.patch
index 89fb78ccfd..b52c3e5ae7 100644
--- a/patches/server/0331-Configurable-Keep-Spawn-Loaded-range-per-world.patch
+++ b/patches/server/0331-Configurable-Keep-Spawn-Loaded-range-per-world.patch
@@ -23,7 +23,7 @@ index 13e730b18c346934c061fb570048623ad66e7344..090958a30ce20ff01ae77d4cd821a167
config.addDefault("world-settings.default." + path, def);
return config.getBoolean("world-settings." + worldName + "." + path, config.getBoolean("world-settings.default." + path));
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index c8a59de4673d430fc8ec2e53315f107293122e7e..40e48c3f1199b127066732e3c8a6d40c232215b2 100644
+index f24ce5a2543513650a3efb73e2bb5f8cd992ef88..29c1b3a43dd369419e8c93b571679a2ba024e4f6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -775,35 +775,36 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop set, boolean flag) {
diff --git a/patches/server/0419-Load-Chunks-for-Login-Asynchronously.patch b/patches/server/0419-Load-Chunks-for-Login-Asynchronously.patch
index aa3b0897a6..5318c46d30 100644
--- a/patches/server/0419-Load-Chunks-for-Login-Asynchronously.patch
+++ b/patches/server/0419-Load-Chunks-for-Login-Asynchronously.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Load Chunks for Login Asynchronously
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 63f20e7adf80a1b81438262087e33c3a1e63ca7f..f0d574307b24d19d3006e5c53b650c75436bde38 100644
+index 05e520165a86eb52e1fd4130b6f2ccc4c838934a..04260e1e8cf17d2af06504fae949958b91c86bef 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -172,6 +172,7 @@ public class ServerPlayer extends Player {
@@ -37,7 +37,7 @@ index be677d437d17b74c6188ce1bd5fc6fdc228fd92f..78fbb4c3e52e900956ae0811aaf934c8
public static final TicketType UNKNOWN = TicketType.create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1);
public static final TicketType 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 2e7b909750ee512dce40b8574dfb62ed68fbbfb6..0d8a8b3d7a13e2384f8614bdc190768c03bb98c2 100644
+index fae06882217adf20c6f81db2793ee3930cba30c0..c57b5cf7d61eab5a45e3fa69e8804fd0ef4a54ad 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -221,6 +221,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -96,7 +96,7 @@ index 477117affabfe07d52d3b40404613492b0bcdc56..3a7cc4f8ee62c8ff726ecf3e669c9f9b
try {
ServerPlayer entityplayer1 = this.server.getPlayerList().processLogin(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 3a13c151066c8784fdc844e1d6310f77ff32e7f1..c4242a1602bbb02541c330bc02016f15c8644358 100644
+index 3a13c151066c8784fdc844e1d6310f77ff32e7f1..846b0dcee92f71d1c887ea88744c36f6a870c5e2 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -38,6 +38,7 @@ import net.minecraft.network.protocol.Packet;
@@ -107,13 +107,7 @@ index 3a13c151066c8784fdc844e1d6310f77ff32e7f1..c4242a1602bbb02541c330bc02016f15
import net.minecraft.network.protocol.game.ClientboundEntityEventPacket;
import net.minecraft.network.protocol.game.ClientboundGameEventPacket;
import net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket;
-@@ -127,11 +128,12 @@ public abstract class PlayerList {
- private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
- private final MinecraftServer server;
- public final List players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety
-- private final Map playersByUUID = Maps.newHashMap();
-+ private final Map playersByUUID = Maps.newHashMap();Map getUUIDMap() { return playersByUUID; } // Paper - OBFHELPER
- private final UserBanList bans;
+@@ -132,6 +133,7 @@ public abstract class PlayerList {
private final IpBanList ipBans;
private final ServerOpList ops;
private final UserWhiteList whitelist;
@@ -173,7 +167,7 @@ index 3a13c151066c8784fdc844e1d6310f77ff32e7f1..c4242a1602bbb02541c330bc02016f15
+ }
+
+ public ServerPlayer getActivePlayer(UUID uuid) {
-+ ServerPlayer player = this.getUUIDMap().get(uuid);
++ ServerPlayer player = this.playersByUUID.get(uuid);
+ return player != null ? player : pendingPlayers.get(uuid);
+ }
+
@@ -250,7 +244,7 @@ index 3a13c151066c8784fdc844e1d6310f77ff32e7f1..c4242a1602bbb02541c330bc02016f15
Iterator iterator = list.iterator();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 7120400af3e6a36f9b097fe9dfaff655209b03ce..d9ed724d07309f23c91f20c9af888cce5127e323 100644
+index fa63a52cba5355612ce417f4bb8077a89ce59398..32323729f913d27170fca0e69346e8d2943089af 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1511,7 +1511,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
diff --git a/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch
index 5520dd32b5..ea3e20f83d 100644
--- a/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch
+++ b/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch
@@ -5,20 +5,8 @@ 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/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 11fd6d24ed0612e4df1a0493907178fb9c455d1c..d7023cb0974f6c28a0fb8a0a6e5a6600fe30d3e3 100644
---- a/src/main/java/net/minecraft/server/MinecraftServer.java
-+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1718,6 +1718,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 07ecd8fd4d0806309c2ac3a465f1ddae3b164e60..f0ad0eef003067f3b582d6eda2b89964fdd556ea 100644
+index 3464593f1c1af6c6b36549496bc85f2e51655ccf..b92eaa44434e2ee368b90d43f322cb8601d159bb 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -149,6 +149,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -321,7 +321,7 @@ index 07ecd8fd4d0806309c2ac3a465f1ddae3b164e60..f0ad0eef003067f3b582d6eda2b89964
private final BlockableEventLoop mainThreadExecutor;
+ final java.util.concurrent.Executor mainInvokingExecutor; // Paper
public final ChunkGenerator generator;
- private final Supplier overworldDataStorage; public final Supplier getWorldPersistentDataSupplier() { return this.overworldDataStorage; } // Paper - OBFHELPER
+ public final Supplier overworldDataStorage;
private final PoiManager poiManager;
@@ -187,6 +188,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1027,7 +1027,7 @@ index 334f1ad2a5ce236b58a82b1ef2e143eaa3909f12..c0bbb1acd7d83a70c9f2c34f7d19cea0
boolean flag1 = this.chunkMap.promoteChunkMap();
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index fa2eb25cdf7d8b0a80b46bc98dcdde7b67e50813..8f12232bfdf82c140fe83f88ef93b96092d586a8 100644
+index 384f38b3c7dd030f107991137912866ae045f811..29df08d378363d57508dc654a129c60bc38ad21b 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -183,6 +183,14 @@ public class ServerPlayer extends Player {
@@ -1101,10 +1101,10 @@ index 8770fe0db46b01e8b608637df4f1a669a3f4cdde..3c1698ba0d3bc412ab957777d9b5211d
private final String name;
private final Comparator comparator;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index fecb2a6b8674ca110d6af539396873e9dcdc0edb..6476d2a478b85116061a13f7ef2a5fec2ade4a04 100644
+index fb010fb253f490a79e9172d7a3d017ad51dac958..3e91275b318904ffa31183987fcbc7b28692781a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1566,6 +1566,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1565,6 +1565,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.awaitingTeleportTime = this.tickCount;
this.player.absMoveTo(d0, d1, d2, f, f1);
@@ -1113,7 +1113,7 @@ index fecb2a6b8674ca110d6af539396873e9dcdc0edb..6476d2a478b85116061a13f7ef2a5fec
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 66735bbc2528c5812c9df14ef7cd91cb69d903b2..8ebbbecaebea8435232a2ccd9ad1062eb1dbbd6c 100644
+index 247d4959c67d41d2f4995c2e19f4c652e97694f5..f452cddd312793465dedb29c4e52d1c4dd1b4360 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -283,8 +283,8 @@ public abstract class PlayerList {
@@ -1144,7 +1144,7 @@ index 66735bbc2528c5812c9df14ef7cd91cb69d903b2..8ebbbecaebea8435232a2ccd9ad1062e
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 6c4c82fb439a07f62668b625b6ba5d552949964d..6ddef28e869ae8f3b3cbc4bacc44abc364d036d8 100644
+index 2a0f72b98d025f1f140d9118937d41e7b172be60..0fd3d689b80484339f437525130bc34de2e71e54 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -223,7 +223,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -1174,7 +1174,7 @@ index f72471ac82907a0d5112598b3289689495285944..6e1f8323d028790d1f55d51edb3214d0
net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk) either.left().orElse(null);
if (chunk != null) addTicket(x, z); // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 4dae19fec0c4914d7b9cc3d41fb8ce36b08fbc81..160254615dac48af2af474c303b57dd293fb224b 100644
+index a98394d9bab490c1bdb5817cb30806cab85de730..535fb8f029dc09862e42e239a0fc7326e31508ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -889,6 +889,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0494-Move-range-check-for-block-placing-up.patch b/patches/server/0494-Move-range-check-for-block-placing-up.patch
index 38e707701a..11d1765101 100644
--- a/patches/server/0494-Move-range-check-for-block-placing-up.patch
+++ b/patches/server/0494-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 6476d2a478b85116061a13f7ef2a5fec2ade4a04..003cd8a304420671d487c9e55622d9578aa75b3a 100644
+index 3e91275b318904ffa31183987fcbc7b28692781a..ea17f9263bef3a2a36dde15d0d75b8a5a695aa93 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1694,17 +1694,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1693,17 +1693,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
BlockPos blockposition = movingobjectpositionblock.getBlockPos();
Direction enumdirection = movingobjectpositionblock.getDirection();
diff --git a/patches/server/0505-Brand-support.patch b/patches/server/0505-Brand-support.patch
index 8a778d91a2..aa268929d7 100644
--- a/patches/server/0505-Brand-support.patch
+++ b/patches/server/0505-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 003cd8a304420671d487c9e55622d9578aa75b3a..6caae980ab043b8d48479e0849e1e297a78eb97a 100644
+index ea17f9263bef3a2a36dde15d0d75b8a5a695aa93..10126fccdfde8acdb55bbe9c9bfc57435ed13677 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 003cd8a304420671d487c9e55622d9578aa75b3a..6caae980ab043b8d48479e0849e1e297
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.server = server;
this.connection = connection;
-@@ -3001,6 +3005,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3000,6 +3004,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 003cd8a304420671d487c9e55622d9578aa75b3a..6caae980ab043b8d48479e0849e1e297
@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
-@@ -3028,6 +3034,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3027,6 +3033,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
try {
byte[] data = new byte[packet.data.readableBytes()];
packet.data.readBytes(data);
@@ -58,7 +58,7 @@ index 003cd8a304420671d487c9e55622d9578aa75b3a..6caae980ab043b8d48479e0849e1e297
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data);
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
-@@ -3037,6 +3052,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3036,6 +3051,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
@@ -72,10 +72,10 @@ index 003cd8a304420671d487c9e55622d9578aa75b3a..6caae980ab043b8d48479e0849e1e297
return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 160254615dac48af2af474c303b57dd293fb224b..99e35c68875ae807f406acd6f693f216fab749cd 100644
+index 535fb8f029dc09862e42e239a0fc7326e31508ef..6557ae8a996ddb227a9fadd4ac30d44b1c5e47b2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2418,6 +2418,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2420,6 +2420,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end
};
diff --git a/patches/server/0509-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0509-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
index 35efff5d51..9f1e0260b7 100644
--- a/patches/server/0509-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
+++ b/patches/server/0509-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
@@ -5,17 +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 1ffb6c12a2eadc0fee0081f980594ac8b5bc4277..ba34e6a8b210cd1549ad2a49d90d3891ee40511c 100644
+index 070bc5f072163b35868ef234e5f34c3eede4c934..9790d6f7f451233e5abcaad24befb8b638ad8df3 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1660,12 +1660,14 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
- }
- // Paper end
-
-+ public final void setSpawn(BlockPos blockposition, float f) { this.setDefaultSpawnPos(blockposition, f); } // Paper - OBFHELPER
- public void setDefaultSpawnPos(BlockPos pos, float angle) {
- // Paper - configurable spawn radius
- BlockPos prevSpawn = this.getSharedSpawnPos();
+@@ -1666,6 +1666,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
//ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c()));
this.levelData.setSpawn(pos, angle);
@@ -24,7 +17,7 @@ index 1ffb6c12a2eadc0fee0081f980594ac8b5bc4277..ba34e6a8b210cd1549ad2a49d90d3891
// if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add
this.removeTicketsForSpawn(this.paperConfig.keepLoadedRange, prevSpawn);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 6c5b6a5f1b9ee3fb5a6bae4d57c70cfcaba75624..d1c7d5a0918bf4d11c453fe31b3dfda9e146474c 100644
+index 6c5b6a5f1b9ee3fb5a6bae4d57c70cfcaba75624..8c8627f70f29834e19093b6298127008e75b7d74 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -386,11 +386,13 @@ public class CraftWorld implements World {
@@ -32,7 +25,7 @@ index 6c5b6a5f1b9ee3fb5a6bae4d57c70cfcaba75624..d1c7d5a0918bf4d11c453fe31b3dfda9
try {
Location previousLocation = this.getSpawnLocation();
- world.levelData.setSpawn(new BlockPos(x, y, z), angle);
-+ world.setSpawn(new BlockPos(x, y, z), angle); // Paper - use WorldServer#setSpawn
++ world.setDefaultSpawnPos(new BlockPos(x, y, z), angle); // Paper - use WorldServer#setSpawn
+ // Paper start - move to nms.World
// Notify anyone who's listening.
diff --git a/patches/server/0520-Add-a-way-to-get-translation-keys-for-blocks-entitie.patch b/patches/server/0520-Add-a-way-to-get-translation-keys-for-blocks-entitie.patch
index 899ada9bd4..ca7d3b76ae 100644
--- a/patches/server/0520-Add-a-way-to-get-translation-keys-for-blocks-entitie.patch
+++ b/patches/server/0520-Add-a-way-to-get-translation-keys-for-blocks-entitie.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Add a way to get translation keys for blocks, entities and
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
-index 9be6bcd490562ceefcadcfbbb6f650688737278b..f901ac92e5187868a01946c0744773f4f59af82e 100644
+index f38ccdecbade43983358dfbeadca86be7d15a68c..bd51753e3afaa5e025583964b16851dfa5dc8796 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
-@@ -291,6 +291,7 @@ public class EntityType implements EntityTypeTest {
+@@ -290,6 +290,7 @@ public class EntityType implements EntityTypeTest {
return Registry.ENTITY_TYPE.getKey(type);
}
diff --git a/patches/server/0522-Cache-block-data-strings.patch b/patches/server/0522-Cache-block-data-strings.patch
index 1b2222a7fd..a11ebcbbb2 100644
--- a/patches/server/0522-Cache-block-data-strings.patch
+++ b/patches/server/0522-Cache-block-data-strings.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 7ee2099dd22eaab384a16ef6a4ab50791fa16aac..d3aff6b0bbf52855adbcd3baca8ca9cb28d1128b 100644
+index bc839946fd2565ab34278991f09dfddc29257c1b..7894e20484c0b4a48f1cb5181bcb792656db9c94 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2038,6 +2038,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop map = Maps.newHashMap();
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
-index cd51115b7c56e7eeab1248f39a690fc91524efd7..b55d5c14000317db97f2f6e511f97ff6f03fa972 100644
+index cd51115b7c56e7eeab1248f39a690fc91524efd7..2b167b65aae90aefa10dcb852d00b2abd332d2d2 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -307,7 +307,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -39,7 +27,7 @@ index cd51115b7c56e7eeab1248f39a690fc91524efd7..b55d5c14000317db97f2f6e511f97ff6
+ //MinecraftServer.getServer().getPlayerList().reload();
+ MinecraftServer.getServer().getPlayerList().getPlayers().forEach(player -> {
+ player.getAdvancements().reload(MinecraftServer.getServer().getAdvancements());
-+ player.getAdvancements().sendUpdateIfNeeded(player);
++ player.getAdvancements().flushDirty(player);
+ });
+ // Paper end
diff --git a/patches/server/0567-Limit-recipe-packets.patch b/patches/server/0567-Limit-recipe-packets.patch
index a0203e607e..1d9c304fad 100644
--- a/patches/server/0567-Limit-recipe-packets.patch
+++ b/patches/server/0567-Limit-recipe-packets.patch
@@ -23,7 +23,7 @@ index 7d50aded88f5b7dfebaea1aebc86231f7b5c4e25..652d87fc5d566dba8018c81676329f0e
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 c49d9eb34883342e685c5363a4d33bf4519b2b3b..4d4b0c1fd4021367f16a292e6059de7f61a8ca8a 100644
+index 1b6610cc04f6bcb6d3153886e62ce117c6a17e15..6d88ec99a634d58ba51a87db9e25d746ec746862 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -232,6 +232,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -42,7 +42,7 @@ index c49d9eb34883342e685c5363a4d33bf4519b2b3b..4d4b0c1fd4021367f16a292e6059de7f
/* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount;
-@@ -2795,6 +2797,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2794,6 +2796,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
diff --git a/patches/server/0584-Fix-interact-event-not-being-called-in-adventure.patch b/patches/server/0584-Fix-interact-event-not-being-called-in-adventure.patch
index f93d83580b..85341edb6c 100644
--- a/patches/server/0584-Fix-interact-event-not-being-called-in-adventure.patch
+++ b/patches/server/0584-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 4d4b0c1fd4021367f16a292e6059de7f61a8ca8a..703c5de24d2be2462cffe597f3a05d766075b128 100644
+index 6d88ec99a634d58ba51a87db9e25d746ec746862..16e0feef7dc99d0a06252a8d395a7c160d1e16e8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1734,7 +1734,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1733,7 +1733,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
MutableComponent ichatmutablecomponent = (new TranslatableComponent("build.tooHigh", new Object[]{i - 1})).withStyle(ChatFormatting.RED);
this.player.sendMessage((Component) ichatmutablecomponent, ChatType.GAME_INFO, Util.NIL_UUID);
@@ -18,7 +18,7 @@ index 4d4b0c1fd4021367f16a292e6059de7f61a8ca8a..703c5de24d2be2462cffe597f3a05d76
this.player.swing(enumhand, true);
}
}
-@@ -2206,7 +2206,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2205,7 +2205,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/0590-Added-ServerResourcesReloadedEvent.patch b/patches/server/0590-Added-ServerResourcesReloadedEvent.patch
index 8979f285de..a17fa64312 100644
--- a/patches/server/0590-Added-ServerResourcesReloadedEvent.patch
+++ b/patches/server/0590-Added-ServerResourcesReloadedEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Added ServerResourcesReloadedEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 504d14404ed180f5193552983e5dc08e2efcfd6d..6fe5fc1fef179d1f82265290bc701e91616f16b6 100644
+index 16bb7d28c8b0e3b60def7ef0e93e648df22c6302..75782de78255e0d52f85034973dbef3aeca3ac7e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2017,7 +2017,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop completablefuture = CompletableFuture.supplyAsync(() -> {
Stream stream = datapacks.stream(); // CraftBukkit - decompile error
PackRepository resourcepackrepository = this.packRepository;
-@@ -2033,6 +2039,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop {
this.getServer().execute(() -> {
diff --git a/patches/server/0628-Expose-Tracked-Players.patch b/patches/server/0628-Expose-Tracked-Players.patch
index ecc989809e..034e0647b9 100644
--- a/patches/server/0628-Expose-Tracked-Players.patch
+++ b/patches/server/0628-Expose-Tracked-Players.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose Tracked Players
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index a28625f0b6e98b61f395a1b3ee07c2f7bc195893..e5a2fcd390ab5b41d7e482d486cef42a9eef94f5 100644
+index 85187e7b0d965b7930e6b2ab8d321d6d27211a35..4f61acf44b40bf15ae6465d7999e2bc2da837c82 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2337,6 +2337,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+@@ -2339,6 +2339,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end
diff --git a/patches/server/0640-Allow-using-signs-inside-spawn-protection.patch b/patches/server/0640-Allow-using-signs-inside-spawn-protection.patch
index c184d83882..f8d1f96982 100644
--- a/patches/server/0640-Allow-using-signs-inside-spawn-protection.patch
+++ b/patches/server/0640-Allow-using-signs-inside-spawn-protection.patch
@@ -20,10 +20,10 @@ index 20eb4aea24cc6699747b18b2c00e5b01dafb47c6..acd61a9033fdfb91e29a5fa6a10b8983
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 703c5de24d2be2462cffe597f3a05d766075b128..f6cd3c60f1d07b48ce953b1e2eb71121b3790730 100644
+index 16e0feef7dc99d0a06252a8d395a7c160d1e16e8..1a0ab16e1337867e982af8cd1a4e646b06c6e8d2 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1723,7 +1723,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1722,7 +1722,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
int i = this.player.level.getMaxBuildHeight();
if (blockposition.getY() < i) {
diff --git a/patches/server/0644-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch b/patches/server/0644-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
index 51ebb2c82d..f21119507c 100644
--- a/patches/server/0644-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
+++ b/patches/server/0644-Only-set-despawnTimer-for-Wandering-Traders-spawned-.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Only set despawnTimer for Wandering Traders spawned by
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
-index f901ac92e5187868a01946c0744773f4f59af82e..536d979139326191d1199e93e9fc885164766aec 100644
+index bd51753e3afaa5e025583964b16851dfa5dc8796..b48548d284e55c9010b99823325fcc14aa5ab051 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
-@@ -334,6 +334,12 @@ public class EntityType implements EntityTypeTest {
+@@ -333,6 +333,12 @@ public class EntityType implements EntityTypeTest {
@Nullable
public T spawnCreature(ServerLevel worldserver, @Nullable CompoundTag nbttagcompound, @Nullable Component ichatbasecomponent, @Nullable Player entityhuman, BlockPos blockposition, MobSpawnType enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
@@ -22,7 +22,7 @@ index f901ac92e5187868a01946c0744773f4f59af82e..536d979139326191d1199e93e9fc8851
// Paper start - Call PreCreatureSpawnEvent
org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(EntityType.getKey(this).getPath());
if (type != null) {
-@@ -349,6 +355,7 @@ public class EntityType implements EntityTypeTest {
+@@ -348,6 +354,7 @@ public class EntityType implements EntityTypeTest {
}
// Paper end
T t0 = this.create(worldserver, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1);
diff --git a/patches/server/0647-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0647-forced-whitelist-use-configurable-kick-message.patch
index 463e4263ab..b6b290a11f 100644
--- a/patches/server/0647-forced-whitelist-use-configurable-kick-message.patch
+++ b/patches/server/0647-forced-whitelist-use-configurable-kick-message.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] forced whitelist: use configurable kick message
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index e9f5039403847a5483e67f95c900593e2f89cb60..6f68e45bdb01605a93af1a4117743c6b0ee26056 100644
+index 280a7ca4ae3a0ed92dd411c8e4e3f253b60f9a9d..6003dff25e78395a92ab279f1a93f016f4a79c56 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -77,7 +77,6 @@ import net.minecraft.nbt.NbtOps;
@@ -16,7 +16,7 @@ index e9f5039403847a5483e67f95c900593e2f89cb60..6f68e45bdb01605a93af1a4117743c6b
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientboundChangeDifficultyPacket;
import net.minecraft.network.protocol.game.ClientboundSetTimePacket;
-@@ -2124,7 +2123,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements EntityTypeTest {
final Spliterator extends net.minecraft.nbt.Tag> spliterator = entityNbtList.spliterator();
return StreamSupport.stream(new Spliterator() {
-+ final Map, Integer> loadedEntityCounts = new java.util.HashMap<>(); // Paper
++ final java.util.Map, Integer> loadedEntityCounts = new java.util.HashMap<>(); // Paper
public boolean tryAdvance(Consumer super Entity> consumer) {
return spliterator.tryAdvance((nbtbase) -> {
EntityType.loadEntityRecursive((CompoundTag) nbtbase, world, (entity) -> {
diff --git a/patches/server/0663-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0663-fix-PlayerItemHeldEvent-firing-twice.patch
index 5070149b99..17f015d33a 100644
--- a/patches/server/0663-fix-PlayerItemHeldEvent-firing-twice.patch
+++ b/patches/server/0663-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 1f7ac37a1640d5fa4c93929e21bf8b84af136eea..924a2e7fbc9afbda52dda50ddf68fd408462246e 100644
+index 78ad9688a9acab75fb059f2a37528692faf71e86..2958ff7f1ac66120fc9880d17ec4b46c72821aaa 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1927,6 +1927,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1926,6 +1926,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/0670-add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/0670-add-RespawnFlags-to-PlayerRespawnEvent.patch
index 6cf1d26c58..0968a75dd8 100644
--- a/patches/server/0670-add-RespawnFlags-to-PlayerRespawnEvent.patch
+++ b/patches/server/0670-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 924a2e7fbc9afbda52dda50ddf68fd408462246e..0b2cb820b912ddb6366f7ffb79c71047d03f2001 100644
+index 2958ff7f1ac66120fc9880d17ec4b46c72821aaa..d63bc35d37b2d6628ff2fdd97fca7978c2dded0e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2461,7 +2461,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2460,7 +2460,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
case PERFORM_RESPAWN:
if (this.player.wonGame) {
this.player.wonGame = false;
@@ -18,7 +18,7 @@ index 924a2e7fbc9afbda52dda50ddf68fd408462246e..0b2cb820b912ddb6366f7ffb79c71047
} 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 92181c6f3168317a01df0e27daec32f826ff1dee..cc098fd2a2e78caede4d36a61d513406a1ea8908 100644
+index e11bdb3ee9512898dde4575633617658ac4bd951..a1a6c03daf2aa3babef6426e7abd3a37c470b100 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -800,6 +800,12 @@ public abstract class PlayerList {
diff --git a/patches/server/0678-call-PortalCreateEvent-players-and-end-platform.patch b/patches/server/0678-call-PortalCreateEvent-players-and-end-platform.patch
index 6494fbca10..e572442162 100644
--- a/patches/server/0678-call-PortalCreateEvent-players-and-end-platform.patch
+++ b/patches/server/0678-call-PortalCreateEvent-players-and-end-platform.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] call PortalCreateEvent players and end platform
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
-index b98316165c6d10945ccc9e5e0c3f0be9cfc3e889..84eca485a09c6d147f3baa277e398de58a9dc147 100644
+index 1c980abc4fb5cab2a6dc9d1a8a3e8fdd0a7e3a4b..ad444adbd1dc17c52689a2b04ef3fea23fa746ed 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
-@@ -523,6 +523,7 @@ public class BlockPos extends Vec3i {
+@@ -522,6 +522,7 @@ public class BlockPos extends Vec3i {
return this.set(this.getX() + direction.getStepX() * distance, this.getY() + direction.getStepY() * distance, this.getZ() + direction.getStepZ() * distance);
}
@@ -17,7 +17,7 @@ index b98316165c6d10945ccc9e5e0c3f0be9cfc3e889..84eca485a09c6d147f3baa277e398de5
return this.set(this.getX() + dx, this.getY() + dy, this.getZ() + dz);
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 63a89a95cb40d2e39104c2c3f3991dd40cf1ca01..d61f7dc29968b6297c7f3884c0fcb255073ddb99 100644
+index 1d885c1c0709d49c3fddc174300b3fdd478e761b..90b5bfe7bd0deae842bf6ef228f5a0e09326518e 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1168,15 +1168,21 @@ public class ServerPlayer extends Player {
diff --git a/patches/server/0683-additions-to-PlayerGameModeChangeEvent.patch b/patches/server/0683-additions-to-PlayerGameModeChangeEvent.patch
index c4bf09954b..e63d24e10b 100644
--- a/patches/server/0683-additions-to-PlayerGameModeChangeEvent.patch
+++ b/patches/server/0683-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 d61f7dc29968b6297c7f3884c0fcb255073ddb99..fdbc2d74947b2f6e9ba256b0c22d94e7654536c7 100644
+index 90b5bfe7bd0deae842bf6ef228f5a0e09326518e..5561d878ad47b9cd70aebec3a36a9296041e6e2d 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1785,8 +1785,15 @@ public class ServerPlayer extends Player {
@@ -123,10 +123,10 @@ index b096384cdc7596166e010e06272534b8001693c9..4b756c0a4b607faa03b00ab81761335b
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 0b2cb820b912ddb6366f7ffb79c71047d03f2001..52294f5cfce86faf301c835bf1a9c2a5f4f5d721 100644
+index d63bc35d37b2d6628ff2fdd97fca7978c2dded0e..084b17d6496799fd49a9f81bb6bcbff512fd8f78 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
+@@ -2469,7 +2469,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player = this.server.getPlayerList().respawn(this.player, false);
if (this.server.isHardcore()) {
@@ -136,7 +136,7 @@ index 0b2cb820b912ddb6366f7ffb79c71047d03f2001..52294f5cfce86faf301c835bf1a9c2a5
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index e5a2fcd390ab5b41d7e482d486cef42a9eef94f5..6e3bebdb7667bfd39c608412b55f7ec7732e1f7d 100644
+index 4f61acf44b40bf15ae6465d7999e2bc2da837c82..f50772b5c07d5aa7dcd0ed015507c3f6440328c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1249,7 +1249,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
diff --git a/patches/server/0698-Add-PlayerKickEvent-causes.patch b/patches/server/0698-Add-PlayerKickEvent-causes.patch
index 6df4f74bd6..50dc035441 100644
--- a/patches/server/0698-Add-PlayerKickEvent-causes.patch
+++ b/patches/server/0698-Add-PlayerKickEvent-causes.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerKickEvent causes
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index f9e15a804388e2aeff8b45d7fba151651438f1c6..7ff7f60e214d4faebc4c27ee827de780f27a46b3 100644
+index 9feb9e64e64e19d99f6ba01e203b81f13235d12d..6620d1a16522d37746c9300768e21b58b52b764d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -2125,7 +2125,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 20) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!");
@@ -218,7 +218,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
return;
}
}
-@@ -1839,7 +1847,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1838,7 +1846,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());
@@ -227,7 +227,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
}
// Paper start
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()];
-@@ -1944,7 +1952,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1943,7 +1951,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());
@@ -236,7 +236,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
}
}
-@@ -1960,7 +1968,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1959,7 +1967,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@@ -245,7 +245,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
return;
}
}
-@@ -2033,7 +2041,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2032,7 +2040,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
Waitable waitable = new Waitable() {
@Override
protected Object evaluate() {
@@ -254,7 +254,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
return null;
}
};
-@@ -2048,7 +2056,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2047,7 +2055,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
throw new RuntimeException(e);
}
} else {
@@ -263,7 +263,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
}
// CraftBukkit end
}
-@@ -2321,7 +2329,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2320,7 +2328,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// Spigot Start
if ( entity == this.player && !this.player.isSpectator() )
{
@@ -272,7 +272,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
return;
}
// Spigot End
-@@ -2412,7 +2420,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2411,7 +2419,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
// CraftBukkit end
} else {
@@ -281,7 +281,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
}
}
-@@ -2806,7 +2814,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2805,7 +2813,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) {
@@ -290,7 +290,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
return;
}
}
-@@ -2999,7 +3007,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2998,7 +3006,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(() -> {
@@ -299,7 +299,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
});
// Paper end
}
-@@ -3045,7 +3053,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3044,7 +3052,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
@@ -308,7 +308,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
}
} else if (packet.identifier.equals(CUSTOM_UNREGISTER)) {
try {
-@@ -3055,7 +3063,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3054,7 +3062,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
@@ -317,7 +317,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
}
} else {
try {
-@@ -3073,7 +3081,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -3072,7 +3080,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);
@@ -327,7 +327,7 @@ index 52294f5cfce86faf301c835bf1a9c2a5f4f5d721..40d0dac02bb1922483d68f3cdd09a228
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index cc098fd2a2e78caede4d36a61d513406a1ea8908..91985dd7251ea423780bfe21abaa30aeb4b3c92a 100644
+index a1a6c03daf2aa3babef6426e7abd3a37c470b100..94f840924682bf65460a05059a655e1200ecbef8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -708,7 +708,7 @@ public abstract class PlayerList {
@@ -351,7 +351,7 @@ index cc098fd2a2e78caede4d36a61d513406a1ea8908..91985dd7251ea423780bfe21abaa30ae
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 6e3bebdb7667bfd39c608412b55f7ec7732e1f7d..3f0096423ba5db02c1007a8547d8a0497597055f 100644
+index f50772b5c07d5aa7dcd0ed015507c3f6440328c8..76e2ae09855e0efaaa0856d2f49e4968adbccbdc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -498,16 +498,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {