diff --git a/build.gradle.kts b/build.gradle.kts
index 83f28bb8ac..39dae25466 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -56,7 +56,7 @@ repositories {
}
dependencies {
- paramMappings("net.fabricmc:yarn:1.18.1+build.22:mergedv2")
+ paramMappings("net.fabricmc:yarn:1.18.2+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.8.1:fat")
decompiler("net.minecraftforge:forgeflower:1.5.498.22")
paperclip("io.papermc:paperclip:3.0.2")
diff --git a/gradle.properties b/gradle.properties
index a0297b8e1f..398db6bb68 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,7 +1,7 @@
group=io.papermc.paper
-version=1.18.1-R0.1-SNAPSHOT
+version=1.18.2-R0.1-SNAPSHOT
-mcVersion=1.18.1
+mcVersion=1.18.2
org.gradle.caching=true
org.gradle.parallel=true
diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch
index c171598635..3627d13b6a 100644
--- a/patches/api/0001-Convert-project-to-Gradle.patch
+++ b/patches/api/0001-Convert-project-to-Gradle.patch
@@ -27,7 +27,7 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..b23bde3b5e881f146539a307d0a59f21
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
-index 0000000000000000000000000000000000000000..c76bfbcfbe034700bdbd9396643cfca625273a14
+index 0000000000000000000000000000000000000000..bf1f5a8151ac0a4b25370142fef37145033140ef
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,66 @@
@@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..c76bfbcfbe034700bdbd9396643cfca6
+ // api dependencies are listed transitively to API consumers
+ api("commons-lang:commons-lang:2.6")
+ api("com.google.guava:guava:31.0.1-jre")
-+ api("com.google.code.gson:gson:2.8.8")
++ api("com.google.code.gson:gson:2.8.9")
+ api("net.md-5:bungeecord-chat:1.16-R0.4")
+ api("org.yaml:snakeyaml:1.30")
+
@@ -99,7 +99,7 @@ index 0000000000000000000000000000000000000000..c76bfbcfbe034700bdbd9396643cfca6
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
-index 2bd4a47e18c0fb798d52d204a4315a889b0e64b4..0000000000000000000000000000000000000000
+index 7a34ef5514a30bcb61e657970bf087bdf9c2db90..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,263 +0,0 @@
@@ -110,7 +110,7 @@ index 2bd4a47e18c0fb798d52d204a4315a889b0e64b4..00000000000000000000000000000000
-
- org.spigotmc
- spigot-api
-- 1.18.1-R0.1-SNAPSHOT
+- 1.18.2-R0.1-SNAPSHOT
- jar
-
- Spigot-API
@@ -153,7 +153,7 @@ index 2bd4a47e18c0fb798d52d204a4315a889b0e64b4..00000000000000000000000000000000
-
- com.google.code.gson
- gson
-- 2.8.8
+- 2.8.9
- compile
-
-
diff --git a/patches/api/0002-Build-system-changes.patch b/patches/api/0002-Build-system-changes.patch
index b9c0bae06d..95ce3fbbe3 100644
--- a/patches/api/0002-Build-system-changes.patch
+++ b/patches/api/0002-Build-system-changes.patch
@@ -5,11 +5,11 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
-index c76bfbcfbe034700bdbd9396643cfca625273a14..1f680baffba17265e8ce38b3516624bffd034075 100644
+index bf1f5a8151ac0a4b25370142fef37145033140ef..709f9c3a562729970813f47b531bfc51ba192f55 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -15,15 +15,27 @@ dependencies {
- api("com.google.code.gson:gson:2.8.8")
+ api("com.google.code.gson:gson:2.8.9")
api("net.md-5:bungeecord-chat:1.16-R0.4")
api("org.yaml:snakeyaml:1.30")
+ // Paper start
diff --git a/patches/api/0259-Added-Vanilla-Entity-Tags.patch b/patches/api/0259-Added-Vanilla-Entity-Tags.patch
index 68465846aa..9358072a1f 100644
--- a/patches/api/0259-Added-Vanilla-Entity-Tags.patch
+++ b/patches/api/0259-Added-Vanilla-Entity-Tags.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Added Vanilla Entity Tags
diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java
-index 34d23f53acf00620223731c4fdacffde9cff41a8..ddd195a834d1756c903644fc1faffe7ebcb238ed 100644
+index 42d0f31c2be2d39c4481f98c0756c4f1ae337717..20f033b9eda656cf0bdc91c3cf046f90a4be87fd 100644
--- a/src/main/java/org/bukkit/Tag.java
+++ b/src/main/java/org/bukkit/Tag.java
-@@ -698,6 +698,44 @@ public interface Tag extends Keyed {
+@@ -702,6 +702,44 @@ public interface Tag extends Keyed {
* Vanilla tag representing entities extra susceptible to freezing.
*/
Tag ENTITY_TYPES_FREEZE_HURTS_EXTRA_TYPES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("freeze_hurts_extra_types"), EntityType.class);
diff --git a/patches/api/0363-Expand-the-Registry-API.patch b/patches/api/0363-Expand-the-Registry-API.patch
index 8dfa943884..43d9ced4d9 100644
--- a/patches/api/0363-Expand-the-Registry-API.patch
+++ b/patches/api/0363-Expand-the-Registry-API.patch
@@ -34,27 +34,3 @@ index 6242336de18fdd708cc3d7b745cbbace13140bc0..661d424c609a01ad9bee837b4069d9e4
// Paper end
/**
-diff --git a/src/main/java/org/bukkit/StructureType.java b/src/main/java/org/bukkit/StructureType.java
-index 8acb2b9de398ab5f4b18c46e9ab9eb964df8be3f..5558daa9512212a4b05f174b64c4c998ebbccfcc 100644
---- a/src/main/java/org/bukkit/StructureType.java
-+++ b/src/main/java/org/bukkit/StructureType.java
-@@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable;
- * The registration of new {@link StructureType}s is case-sensitive.
- */
- // Order is retrieved from WorldGenFactory
--public final class StructureType {
-+public final class StructureType implements Keyed { // Paper - implement keyed
-
- private static final Map structureTypeMap = new HashMap<>();
-
-@@ -244,4 +244,10 @@ public final class StructureType {
- public static Map getStructureTypes() {
- return ImmutableMap.copyOf(structureTypeMap);
- }
-+ // Paper start
-+ @Override
-+ public @NotNull NamespacedKey getKey() {
-+ return NamespacedKey.minecraft(this.name);
-+ }
-+ // Paper end
- }
diff --git a/patches/api/0367-Add-GameEvent-tags.patch b/patches/api/0367-Add-GameEvent-tags.patch
index c0f7113f5f..668a199030 100644
--- a/patches/api/0367-Add-GameEvent-tags.patch
+++ b/patches/api/0367-Add-GameEvent-tags.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add GameEvent tags
diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java
-index ddd195a834d1756c903644fc1faffe7ebcb238ed..43ab88bb3721ed499549a9d328be352d6f639871 100644
+index 20f033b9eda656cf0bdc91c3cf046f90a4be87fd..fbe2da7aa0d135a35eab3a81599d5df1b709b8ac 100644
--- a/src/main/java/org/bukkit/Tag.java
+++ b/src/main/java/org/bukkit/Tag.java
-@@ -735,6 +735,18 @@ public interface Tag extends Keyed {
+@@ -739,6 +739,18 @@ public interface Tag extends Keyed {
*/
@Deprecated(forRemoval = true)
Tag SKELETONS = ENTITY_TYPES_SKELETONS;
diff --git a/patches/server/0831-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/removed/1.18.2/0831-Fix-entity-type-tags-suggestions-in-selectors.patch
similarity index 100%
rename from patches/server/0831-Fix-entity-type-tags-suggestions-in-selectors.patch
rename to patches/removed/1.18.2/0831-Fix-entity-type-tags-suggestions-in-selectors.patch
diff --git a/patches/server/0840-Fix-riding-distance-statistics.patch b/patches/removed/1.18.2/0840-Fix-riding-distance-statistics.patch
similarity index 100%
rename from patches/server/0840-Fix-riding-distance-statistics.patch
rename to patches/removed/1.18.2/0840-Fix-riding-distance-statistics.patch
diff --git a/patches/server/0851-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch b/patches/removed/1.18.2/0851-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch
similarity index 100%
rename from patches/server/0851-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch
rename to patches/removed/1.18.2/0851-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch
diff --git a/patches/server/0858-Add-config-for-stronghold-seed.patch b/patches/removed/1.18.2/0858-Add-config-for-stronghold-seed.patch
similarity index 100%
rename from patches/server/0858-Add-config-for-stronghold-seed.patch
rename to patches/removed/1.18.2/0858-Add-config-for-stronghold-seed.patch
diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch
index 4e3a716186..8eaf53124d 100644
--- a/patches/server/0001-Setup-Gradle-project.patch
+++ b/patches/server/0001-Setup-Gradle-project.patch
@@ -28,7 +28,7 @@ index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..bb338269c9e3bef4c274157c490d8b8f
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
-index 0000000000000000000000000000000000000000..ce1c653cac81f0d681547a68704a41bbb700f148
+index 0000000000000000000000000000000000000000..be24f2f1c72ffcb033fe99bd9197af2c0bed4e69
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,141 @@
@@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..ce1c653cac81f0d681547a68704a41bb
+dependencies {
+ implementation(project(":paper-api"))
+ implementation("jline:jline:2.12.1")
-+ implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") {
++ implementation("org.apache.logging.log4j:log4j-iostreams:2.17.0") {
+ exclude(group = "org.apache.logging.log4j", module = "log4j-api")
+ }
+ implementation("org.ow2.asm:asm:9.2")
@@ -175,17 +175,17 @@ index 0000000000000000000000000000000000000000..ce1c653cac81f0d681547a68704a41bb
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
-index 5d1e2c51c814281bf50c352f7fa9f99465100068..0000000000000000000000000000000000000000
+index ac2dbe041d8a286ed7a34bf20c88464693f32a25..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
-@@ -1,540 +0,0 @@
+@@ -1,546 +0,0 @@
-
- 4.0.0
- org.spigotmc
- spigot
- jar
-- 1.18.1-R0.1-SNAPSHOT
+- 1.18.2-R0.1-SNAPSHOT
- Spigot
- https://www.spigotmc.org/
-
@@ -201,7 +201,7 @@ index 5d1e2c51c814281bf50c352f7fa9f99465100068..00000000000000000000000000000000
- UTF-8
- unknown
- git
-- 1_18_R1
+- 1_18_R2
- 16
- 16
-
@@ -236,7 +236,7 @@ index 5d1e2c51c814281bf50c352f7fa9f99465100068..00000000000000000000000000000000
-
- org.apache.logging.log4j
- log4j-iostreams
-- 2.14.1
+- 2.17.0
- compile
-
-
@@ -249,13 +249,13 @@ index 5d1e2c51c814281bf50c352f7fa9f99465100068..00000000000000000000000000000000
-
- com.github.oshi
- oshi-core
-- 5.8.2
+- 5.8.5
- compile
-
-
- com.mojang
- authlib
-- 3.2.38
+- 3.3.39
- compile
-
-
@@ -267,7 +267,7 @@ index 5d1e2c51c814281bf50c352f7fa9f99465100068..00000000000000000000000000000000
-
- com.mojang
- datafixerupper
-- 4.0.26
+- 4.1.27
- compile
-
-
@@ -277,6 +277,12 @@ index 5d1e2c51c814281bf50c352f7fa9f99465100068..00000000000000000000000000000000
- compile
-
-
+- com.mojang
+- logging
+- 1.0.0
+- compile
+-
+-
- commons-io
- commons-io
- 2.11.0
@@ -309,13 +315,13 @@ index 5d1e2c51c814281bf50c352f7fa9f99465100068..00000000000000000000000000000000
-
- org.apache.logging.log4j
- log4j-core
-- 2.14.1
+- 2.17.0
- compile
-
-
- org.apache.logging.log4j
- log4j-slf4j18-impl
-- 2.14.1
+- 2.17.0
- compile
-
-
diff --git a/patches/server/0002-Remap-fixes.patch b/patches/server/0002-Remap-fixes.patch
index 68bd5b35fd..1a29bd5285 100644
--- a/patches/server/0002-Remap-fixes.patch
+++ b/patches/server/0002-Remap-fixes.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Remap fixes
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
-index a492a3ff23a6e4bd1a47bdfbe295163ac3ef66c9..dc88152a1458dadd102989d4fc5ffd5bbc7eb523 100644
+index 885445d353b7abc87f4ff863da357dfe480d9ada..8aecabe25510a58041194b0b798236bd652991dc 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -270,9 +270,11 @@ public class BlockPos extends Vec3i {
@@ -78,10 +78,10 @@ index 88258cc1971c0764912d2f3cbfcd426d8f26cd62..e51a78e52969ec687956d16566494fc5
entityliving1 = entityliving2;
} else {
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
-index e235729577a80475eaf6e33487363822691d2dce..28d35bde3207b1c06bd97e7c1cdc3f687a28bbf6 100644
+index babb59497fcd9b5e20d8b3b13ceb9a7856edbb63..92650d816113a0f1c2b589691895ebba3424d661 100644
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
-@@ -175,7 +175,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
+@@ -174,7 +174,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
Builder> builder = ImmutableMap.builder();
recipes.forEach((irecipe) -> {
diff --git a/patches/server/0003-Build-system-changes.patch b/patches/server/0003-Build-system-changes.patch
index 3a265b19fd..9ca9d1a8d1 100644
--- a/patches/server/0003-Build-system-changes.patch
+++ b/patches/server/0003-Build-system-changes.patch
@@ -5,17 +5,17 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
-index dc8f0a7ac3387323428f71139ac07ec98cd33ed8..4db0cc3f8505747e77d314320545eb71904b4eac 100644
+index be24f2f1c72ffcb033fe99bd9197af2c0bed4e69..c1f97f5bb806e3c92a2b4633142d3214e11f7074 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,10 +13,9 @@ repositories {
dependencies {
implementation(project(":paper-api"))
implementation("jline:jline:2.12.1")
-- implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") {
+- implementation("org.apache.logging.log4j:log4j-iostreams:2.17.0") {
- exclude(group = "org.apache.logging.log4j", module = "log4j-api")
- }
-+ implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") // Paper
++ implementation("org.apache.logging.log4j:log4j-iostreams:2.17.1") // Paper
implementation("org.ow2.asm:asm:9.2")
+ implementation("org.ow2.asm:asm-commons:9.2") // Paper - ASM event executor generation
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
@@ -39,7 +39,7 @@ index dc8f0a7ac3387323428f71139ac07ec98cd33ed8..4db0cc3f8505747e77d314320545eb71
for (tld in setOf("net", "com", "org")) {
attributes("$tld/bukkit", "Sealed" to true)
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 38851269bc9eff80f5593e63b61a4b25c328a3cc..0607f13dd2a568e368f96768259e8cba9c25e9c1 100644
+index 3067833570c62e4d135b11b8637b52b8167ab269..b698d6a8d6b59eefd721639b62bfd8bcffcf5c6f 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -190,7 +190,7 @@ public class Main {
@@ -50,7 +50,7 @@ index 38851269bc9eff80f5593e63b61a4b25c328a3cc..0607f13dd2a568e368f96768259e8cba
+ Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
Calendar deadline = Calendar.getInstance();
- deadline.add(Calendar.DAY_OF_YEAR, -28);
+ deadline.add(Calendar.DAY_OF_YEAR, -3);
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 93046379d0cefd5d3236fc59e698809acdc18f80..774556a62eb240da42e84db4502e2ed43495be17 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
diff --git a/patches/server/0004-Paper-config-files.patch b/patches/server/0004-Paper-config-files.patch
index acf5a01323..6be759aa38 100644
--- a/patches/server/0004-Paper-config-files.patch
+++ b/patches/server/0004-Paper-config-files.patch
@@ -591,10 +591,10 @@ index 0000000000000000000000000000000000000000..4adf44026fc6269934dfa4513f06a7f8
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
-index 82d04f803201e39b48cd514cd8d9e2b90b28c1d4..156fa293626119caf0cf414505fdf0e96eaa08b7 100644
+index 9e4cca119722c2edc478fdd1a34af4370649aa5c..b49528d8a2c577def4f74ee694ffd53b481acb32 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
-@@ -106,6 +106,12 @@ public class Main {
+@@ -109,6 +109,12 @@ public class Main {
DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support
dedicatedserversettings.forceSave();
@@ -607,7 +607,7 @@ index 82d04f803201e39b48cd514cd8d9e2b90b28c1d4..156fa293626119caf0cf414505fdf0e9
Path path1 = Paths.get("eula.txt");
Eula eula = new Eula(path1);
-@@ -261,6 +267,20 @@ public class Main {
+@@ -284,6 +290,20 @@ public class Main {
}
@@ -629,10 +629,10 @@ index 82d04f803201e39b48cd514cd8d9e2b90b28c1d4..156fa293626119caf0cf414505fdf0e9
Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit
WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, generatorOptions, eraseCache);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index d75a598576d87644a4226216dcfd685c25b29f12..b3c1373f281adfdd9fa513b597941b60b71bb06c 100644
+index 2a7a6a21d22bec6457845ec972f12321f534800f..8754e5899067bc5e8e83a6264c6fcc38846f6baa 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -602,6 +602,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements EntityTypeTest {
+@@ -674,4 +674,10 @@ public class EntityType implements EntityTypeTest {
T create(EntityType type, Level world);
}
@@ -693,10 +693,10 @@ index 1bee6fc5b9fa70adf2f7cac792778f5ed203d291..e688949fc2f3031dc9c9817bc59554e9
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index c3afe1e60535241bf5f643034d1858de53e3a422..8de437c79e105331165efaf1b154287e16e1b8ef 100644
+index 3dce5044332ee4a8f685ab1cde02cd4c72a85b63..6ded806628f2f3fd5b357eed41990abd7e06a372 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -146,6 +146,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -144,6 +144,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean populating;
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
@@ -705,19 +705,19 @@ index c3afe1e60535241bf5f643034d1858de53e3a422..8de437c79e105331165efaf1b154287e
public final SpigotTimings.WorldTimingsHandler timings; // Spigot
public static BlockPos lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter;
-@@ -164,6 +166,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -162,6 +164,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
- protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, final DimensionType dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
+ protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env) {
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
+ this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), this.spigotConfig); // Paper
this.generator = gen;
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 269f5dd75cc51549af1b50e6ec2dd066ca0dbdf6..355a6af98163079bc60c77d6fb88cd7023264a1b 100644
+index d27dac2620a1b0700db76a1498ed8267c5b5828c..eac877cda0cd37d8717c770b86b590213ee0567e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -869,6 +869,7 @@ public final class CraftServer implements Server {
+@@ -865,6 +865,7 @@ public final class CraftServer implements Server {
}
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
@@ -725,7 +725,7 @@ index 269f5dd75cc51549af1b50e6ec2dd066ca0dbdf6..355a6af98163079bc60c77d6fb88cd70
for (ServerLevel world : this.console.getAllLevels()) {
world.serverLevelData.setDifficulty(config.difficulty);
world.setSpawnSettings(config.spawnMonsters, config.spawnAnimals);
-@@ -884,12 +885,14 @@ public final class CraftServer implements Server {
+@@ -880,12 +881,14 @@ public final class CraftServer implements Server {
}
}
world.spigotConfig.init(); // Spigot
@@ -740,7 +740,7 @@ index 269f5dd75cc51549af1b50e6ec2dd066ca0dbdf6..355a6af98163079bc60c77d6fb88cd70
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
-@@ -2316,4 +2319,35 @@ public final class CraftServer implements Server {
+@@ -2308,4 +2311,35 @@ public final class CraftServer implements Server {
return this.spigot;
}
// Spigot end
@@ -777,7 +777,7 @@ index 269f5dd75cc51549af1b50e6ec2dd066ca0dbdf6..355a6af98163079bc60c77d6fb88cd70
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 0607f13dd2a568e368f96768259e8cba9c25e9c1..399e878210606e9addb535e4efed0ddb424160e8 100644
+index b698d6a8d6b59eefd721639b62bfd8bcffcf5c6f..70aa37fe043f56ef1b2f722ca946c4ac2cf4a98b 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -129,6 +129,14 @@ public class Main {
@@ -796,7 +796,7 @@ index 0607f13dd2a568e368f96768259e8cba9c25e9c1..399e878210606e9addb535e4efed0ddb
};
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
-index 4520eda5308575aa02ef059bb2efd776f56e352b..1d802f0e81b3880e9bb7799ecd46826f4bdcee03 100644
+index a04da0a7d690fe3fcf10810b4e8c92a8ae027b86..feef74e3a6d50344245c4a61ece5b2194af1072f 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -58,8 +58,14 @@ public class SpigotWorldConfig
diff --git a/patches/server/0005-MC-Dev-fixes.patch b/patches/server/0005-MC-Dev-fixes.patch
index 62c73e1c0f..6082088c68 100644
--- a/patches/server/0005-MC-Dev-fixes.patch
+++ b/patches/server/0005-MC-Dev-fixes.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index 820ba0832fb2a7afe37f461a126e90613d775ff4..1851b36f978330651627f902f1c123337cdf9075 100644
+index de0f7cee98ae376ebcb1a48aed5ab5375681f53b..ddef1810b4ffe4623b46157ed0505ff97648867d 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
-@@ -354,7 +354,7 @@ public class Util {
+@@ -352,7 +352,7 @@ public class Util {
}
public static Strategy identityStrategy() {
@@ -16,9 +16,9 @@ index 820ba0832fb2a7afe37f461a126e90613d775ff4..1851b36f978330651627f902f1c12333
+ return (Strategy) Util.IdentityStrategy.INSTANCE; // Paper - decompile fix
}
- public static CompletableFuture> sequence(List extends CompletableFuture extends V>> futures) {
+ public static CompletableFuture> sequence(List extends CompletableFuture> futures) {
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
-index dc88152a1458dadd102989d4fc5ffd5bbc7eb523..53f438b3747ff20dd18bc757b5b672aaa9db7b81 100644
+index 8aecabe25510a58041194b0b798236bd652991dc..c656633870c99cc383d95fadcc0ec7b0f18a3682 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -375,12 +375,12 @@ public class BlockPos extends Vec3i {
@@ -39,21 +39,6 @@ index dc88152a1458dadd102989d4fc5ffd5bbc7eb523..53f438b3747ff20dd18bc757b5b672aa
}
}
};
-diff --git a/src/main/java/net/minecraft/core/MappedRegistry.java b/src/main/java/net/minecraft/core/MappedRegistry.java
-index ed7c3ab78516056bf50a6d885b98ba5c8d8ae0cf..25a6d195c5d6ee456258d2167f8acc5eb717e187 100644
---- a/src/main/java/net/minecraft/core/MappedRegistry.java
-+++ b/src/main/java/net/minecraft/core/MappedRegistry.java
-@@ -249,10 +249,5 @@ public class MappedRegistry extends WritableRegistry {
- }
-
- static record RegistryEntry(ResourceKey key, int id, T value) {
-- RegistryEntry(ResourceKey key, int rawId, T entry) {
-- this.key = key;
-- this.id = rawId;
-- this.value = entry;
-- }
- }
- }
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
index 8c37ed1d70c5874bb1bd96fe33b087d4ddc2d68e..ea68b26e506e48d8238b7ee4266e61b211d52bd2 100644
--- a/src/main/java/net/minecraft/nbt/ListTag.java
@@ -80,10 +65,10 @@ index 8c37ed1d70c5874bb1bd96fe33b087d4ddc2d68e..ea68b26e506e48d8238b7ee4266e61b2
private byte type;
diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java
-index 1f70fdaf08541ad57b2046e85e156be9446b372d..ea69f11e3cd9775998679baaccdaf980ee8fd498 100644
+index f10ea89e64aac2c11ed442ac7f2ffd15b793ac76..5df72f16e6b954ecee23a6f8daa29de0d3d991fe 100644
--- a/src/main/java/net/minecraft/network/ConnectionProtocol.java
+++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java
-@@ -15,6 +15,7 @@ import javax.annotation.Nullable;
+@@ -16,6 +16,7 @@ import javax.annotation.Nullable;
import net.minecraft.Util;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketFlow;
@@ -91,7 +76,7 @@ index 1f70fdaf08541ad57b2046e85e156be9446b372d..ea69f11e3cd9775998679baaccdaf980
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
import net.minecraft.network.protocol.game.ClientboundAddExperienceOrbPacket;
import net.minecraft.network.protocol.game.ClientboundAddMobPacket;
-@@ -117,6 +118,7 @@ import net.minecraft.network.protocol.game.ClientboundUpdateAttributesPacket;
+@@ -118,6 +119,7 @@ import net.minecraft.network.protocol.game.ClientboundUpdateAttributesPacket;
import net.minecraft.network.protocol.game.ClientboundUpdateMobEffectPacket;
import net.minecraft.network.protocol.game.ClientboundUpdateRecipesPacket;
import net.minecraft.network.protocol.game.ClientboundUpdateTagsPacket;
@@ -99,7 +84,7 @@ index 1f70fdaf08541ad57b2046e85e156be9446b372d..ea69f11e3cd9775998679baaccdaf980
import net.minecraft.network.protocol.game.ServerboundAcceptTeleportationPacket;
import net.minecraft.network.protocol.game.ServerboundBlockEntityTagQuery;
import net.minecraft.network.protocol.game.ServerboundChangeDifficultyPacket;
-@@ -163,26 +165,33 @@ import net.minecraft.network.protocol.game.ServerboundTeleportToEntityPacket;
+@@ -164,26 +166,33 @@ import net.minecraft.network.protocol.game.ServerboundTeleportToEntityPacket;
import net.minecraft.network.protocol.game.ServerboundUseItemOnPacket;
import net.minecraft.network.protocol.game.ServerboundUseItemPacket;
import net.minecraft.network.protocol.handshake.ClientIntentionPacket;
@@ -121,7 +106,7 @@ index 1f70fdaf08541ad57b2046e85e156be9446b372d..ea69f11e3cd9775998679baaccdaf980
import net.minecraft.network.protocol.status.ServerboundPingRequestPacket;
import net.minecraft.network.protocol.status.ServerboundStatusRequestPacket;
import net.minecraft.util.VisibleForDebug;
- import org.apache.logging.log4j.LogManager;
+ import org.slf4j.Logger;
public enum ConnectionProtocol {
- HANDSHAKING(-1, protocol().addFlow(PacketFlow.SERVERBOUND, (new ConnectionProtocol.PacketSet()).addPacket(ClientIntentionPacket.class, ClientIntentionPacket::new))),
@@ -138,21 +123,21 @@ index 1f70fdaf08541ad57b2046e85e156be9446b372d..ea69f11e3cd9775998679baaccdaf980
private static final int MIN_PROTOCOL_ID = -1;
private static final int MAX_PROTOCOL_ID = 2;
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLoginPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLoginPacket.java
-index 11d3d7d1a42f342bcbdc313fd39b379ceec3c0eb..f6e043810e654db6497be6720a9fbfb93aff12f6 100644
+index 2a6969baca7c07c52223672de58886dd05c032eb..a620e53021e02da1663b8d8b68d429b22814567f 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLoginPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLoginPacket.java
-@@ -19,25 +19,6 @@ public record ClientboundLoginPacket(int playerId, boolean hardcore, GameType ga
- }), buf.readWithCodec(RegistryAccess.RegistryHolder.NETWORK_CODEC), buf.readWithCodec(DimensionType.CODEC).get(), ResourceKey.create(Registry.DIMENSION_REGISTRY, buf.readResourceLocation()), buf.readLong(), buf.readVarInt(), buf.readVarInt(), buf.readVarInt(), buf.readBoolean(), buf.readBoolean(), buf.readBoolean(), buf.readBoolean());
+@@ -20,25 +20,6 @@ public record ClientboundLoginPacket(int playerId, boolean hardcore, GameType ga
+ }), buf.readWithCodec(RegistryAccess.NETWORK_CODEC).freeze(), buf.readWithCodec(DimensionType.CODEC), ResourceKey.create(Registry.DIMENSION_REGISTRY, buf.readResourceLocation()), buf.readLong(), buf.readVarInt(), buf.readVarInt(), buf.readVarInt(), buf.readBoolean(), buf.readBoolean(), buf.readBoolean(), buf.readBoolean());
}
-- public ClientboundLoginPacket(int playerEntityId, boolean bl, GameType previousGameMode, @Nullable GameType gameType, Set> set, RegistryAccess.RegistryHolder registryHolder, DimensionType dimensionType, ResourceKey resourceKey, long l, int maxPlayers, int chunkLoadDistance, int i, boolean bl2, boolean bl3, boolean bl4, boolean bl5) {
+- public ClientboundLoginPacket(int playerEntityId, boolean bl, GameType previousGameMode, @Nullable GameType gameType, Set> set, RegistryAccess.Frozen frozen, Holder holder, ResourceKey resourceKey, long l, int maxPlayers, int chunkLoadDistance, int i, boolean bl2, boolean bl3, boolean bl4, boolean bl5) {
- this.playerId = playerEntityId;
- this.hardcore = bl;
- this.gameType = previousGameMode;
- this.previousGameType = gameType;
- this.levels = set;
-- this.registryHolder = registryHolder;
-- this.dimensionType = dimensionType;
+- this.registryHolder = frozen;
+- this.dimensionType = holder;
- this.dimension = resourceKey;
- this.seed = l;
- this.maxPlayers = maxPlayers;
@@ -168,18 +153,18 @@ index 11d3d7d1a42f342bcbdc313fd39b379ceec3c0eb..f6e043810e654db6497be6720a9fbfb9
public void write(FriendlyByteBuf buf) {
buf.writeInt(this.playerId);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index b3629065ebbe601802703b8671b24c7156f12d03..4d13345f3caa0c8ec55de465fc486d50b43d1e24 100644
+index 8754e5899067bc5e8e83a6264c6fcc38846f6baa..425fe208a1bf5490421d4256a8c47c16e47362d0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1728,7 +1728,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoopmap(resourcepackrepository::getPack).filter(Objects::nonNull).map(Pack::open).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error // todo: is this needed anymore?
}, this).thenCompose((immutablelist) -> {
- return ServerResources.loadResources(immutablelist, this.registryHolder, this.isDedicatedServer() ? Commands.CommandSelection.DEDICATED : Commands.CommandSelection.INTEGRATED, this.getFunctionCompilationLevel(), this.executor, this);
- }).thenAcceptAsync((datapackresources) -> {
+ MultiPackResourceManager resourcemanager = new MultiPackResourceManager(PackType.SERVER_DATA, immutablelist);
+
diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java
index 062da1bddd9704f5fbc46e974e13e60cd500bbe2..ffc43e5d3d0563c9e9c171064511b2c65ddf67e1 100644
--- a/src/main/java/net/minecraft/server/level/Ticket.java
@@ -207,7 +192,7 @@ index d0f6eb3981a171c0f34870cb0472599d6cca9642..d1b2ba24ef54e01c6249c3b2ca16e80f
public static SortedArraySet create(Comparator comparator) {
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java
-index 93d9b14eb8793b8ee2193f7525306a5e4f1900f6..63f283f32bdad02299d4a16c305a28c3bfbce9a8 100644
+index 3d0b05a9ac049cf751dad0b0df46b5152b0cc9a5..3959eeb9090e8e4c999d89ec32fac8c46d5cdc75 100644
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiSection.java
@@ -30,7 +30,7 @@ public class PoiSection {
@@ -220,10 +205,10 @@ index 93d9b14eb8793b8ee2193f7525306a5e4f1900f6..63f283f32bdad02299d4a16c305a28c3
return poiSet.isValid;
}), PoiRecord.codec(updateListener).listOf().fieldOf("Records").forGetter((poiSet) -> {
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
-index 8daab331dd33c7095ddd9582b091310551003fd7..ef7bde78c134ec4ad464b5b6516626109c362989 100644
+index 92650d816113a0f1c2b589691895ebba3424d661..7ef0075cc16613709e145714204a728d8d8dd82b 100644
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
-@@ -77,7 +77,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
+@@ -76,7 +76,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
}
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
@@ -233,13 +218,13 @@ index 8daab331dd33c7095ddd9582b091310551003fd7..ef7bde78c134ec4ad464b5b651662610
this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
-index 0f7950458dc2dfac51ed0d56f1790395f0b03bc2..fa4544541b9c5f163b633596e73a5197cd081eb8 100644
+index 0422d787593cc65aadcae9f7517ec67a52f1f72b..95bbc1b6964614f3cf520034156e97a0ef32af40 100644
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
-@@ -39,8 +39,32 @@ import org.apache.logging.log4j.Logger;
+@@ -35,8 +35,32 @@ import net.minecraft.world.level.material.FluidState;
+ import net.minecraft.world.level.material.Fluids;
public final class Biome {
- public static final Logger LOGGER = LogManager.getLogger();
- public static final Codec DIRECT_CODEC;
- public static final Codec NETWORK_CODEC;
+ // Paper start - decompile fix: move up verbatim from static block
@@ -256,23 +241,23 @@ index 0f7950458dc2dfac51ed0d56f1790395f0b03bc2..fa4544541b9c5f163b633596e73a5197
+ return biome.mobSettings;
+ })).apply(instance, Biome::new);
+ });
-+ public static final Codec NETWORK_CODEC = RecordCodecBuilder.create((instance) -> {
++ public static final Codec NETWORK_CODE = RecordCodecBuilder.create((instance) -> {
+ return instance.group(Biome.ClimateSettings.CODEC.forGetter((biome) -> {
+ return biome.climateSettings;
+ }), Biome.BiomeCategory.CODEC.fieldOf("category").forGetter((biome) -> {
+ return biome.biomeCategory;
+ }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biome) -> {
+ return biome.specialEffects;
-+ })).apply(instance, (climateSettings, biomeCategory, biomeSpecialEffects) -> {
-+ return new Biome(climateSettings, biomeCategory, biomeSpecialEffects, BiomeGenerationSettings.EMPTY, MobSpawnSettings.EMPTY);
++ })).apply(instance, (weather, category, effects) -> {
++ return new Biome(weather, category, effects, BiomeGenerationSettings.EMPTY, MobSpawnSettings.EMPTY);
+ });
+ });
+ // Paper end
- public static final Codec> CODEC = RegistryFileCodec.create(Registry.BIOME_REGISTRY, DIRECT_CODEC);
- public static final Codec>> LIST_CODEC = RegistryFileCodec.homogeneousList(Registry.BIOME_REGISTRY, DIRECT_CODEC);
+ public static final Codec> CODEC = RegistryFileCodec.create(Registry.BIOME_REGISTRY, DIRECT_CODEC);
+ public static final Codec> LIST_CODEC = RegistryCodecs.homogeneousList(Registry.BIOME_REGISTRY, DIRECT_CODEC);
private static final PerlinSimplexNoise TEMPERATURE_NOISE = new PerlinSimplexNoise(new WorldgenRandom(new LegacyRandomSource(1234L)), ImmutableList.of(0));
-@@ -257,33 +281,6 @@ public final class Biome {
- return resourceLocation == null ? super.toString() : resourceLocation.toString();
+@@ -253,33 +277,6 @@ public final class Biome {
+ return biomeEntry.value().getBiomeCategory();
}
- static {
@@ -296,8 +281,8 @@ index 0f7950458dc2dfac51ed0d56f1790395f0b03bc2..fa4544541b9c5f163b633596e73a5197
- return biome.biomeCategory;
- }), BiomeSpecialEffects.CODEC.fieldOf("effects").forGetter((biome) -> {
- return biome.specialEffects;
-- })).apply(instance, (climateSettings, biomeCategory, biomeSpecialEffects) -> {
-- return new Biome(climateSettings, biomeCategory, biomeSpecialEffects, BiomeGenerationSettings.EMPTY, MobSpawnSettings.EMPTY);
+- })).apply(instance, (weather, category, effects) -> {
+- return new Biome(weather, category, effects, BiomeGenerationSettings.EMPTY, MobSpawnSettings.EMPTY);
- });
- });
- }
diff --git a/patches/server/0006-MC-Utils.patch b/patches/server/0006-MC-Utils.patch
index 23c12fb33d..31374dfb59 100644
--- a/patches/server/0006-MC-Utils.patch
+++ b/patches/server/0006-MC-Utils.patch
@@ -4414,10 +4414,10 @@ index 0000000000000000000000000000000000000000..4d3dc8fba51bf5c0dceb06744781d1df
+ }
+}
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index 0b73c98a880d535b615f89d47f4bc3a22348a195..2a06617cd484f378e87660b11a5eb78052348f39 100644
+index ddef1810b4ffe4623b46157ed0505ff97648867d..90d22b75fd33d8355e59b6bab79757c5b436c9d7 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
-@@ -107,7 +107,7 @@ public class Util {
+@@ -105,7 +105,7 @@ public class Util {
}
public static long getNanos() {
@@ -4427,7 +4427,7 @@ index 0b73c98a880d535b615f89d47f4bc3a22348a195..2a06617cd484f378e87660b11a5eb780
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 53f438b3747ff20dd18bc757b5b672aaa9db7b81..5f23b9ab6540530acac623d2cd8e9ec5d0064f39 100644
+index c656633870c99cc383d95fadcc0ec7b0f18a3682..85bdeafd92aff5d694c4b5dff0b5796f3467a886 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -531,6 +531,7 @@ public class BlockPos extends Vec3i {
@@ -4471,14 +4471,14 @@ index cbe273a012bedc3914b8cf1f5ad1fee1dfee6a7e..d0b523387a194d1649469e8d861b0b78
return NbtUtils.loadUUID(this.get(key));
}
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
-index 4ea6c2f0ac4703a5d67137073a5da0c39d77bdce..b964121f19e6a28df7675e65441c551a55316753 100644
+index 207f1c1fc9d4451d27047bb8362bded8cd53e32f..021a26a6b1c258deffc26c035ab52a4ea027d9a1 100644
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
-@@ -48,7 +48,7 @@ public class PacketEncoder extends MessageToByteEncoder> {
+@@ -45,7 +45,7 @@ public class PacketEncoder extends MessageToByteEncoder> {
JvmProfiler.INSTANCE.onPacketSent(k, integer, channelHandlerContext.channel().remoteAddress(), j);
}
} catch (Throwable var10) {
-- LOGGER.error(var10);
+- LOGGER.error("Error receiving packet {}", integer, var10);
+ LOGGER.error("Packet encoding of packet ID {} threw (skippable? {})", integer, packet.isSkippable(), var10); // Paper - Give proper error message
if (packet.isSkippable()) {
throw new SkipPacketException(var10);
@@ -5001,10 +5001,10 @@ index 0000000000000000000000000000000000000000..9f292deee1b793d52b5774304318e940
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 2b76a87213ea8880ede32a6f3bb91f59ed54e681..8c2b1d1a1e7f2716ee27aa10165b94550dccd19a 100644
+index 425fe208a1bf5490421d4256a8c47c16e47362d0..32dbb6e7add72ca8068e431e607a9ff570157ff8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -295,6 +295,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) {
AtomicReference atomicreference = new AtomicReference();
-@@ -949,6 +950,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop>> futures;
private final LevelHeightAccessor levelHeightAccessor;
@@ -5068,7 +5068,7 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
private CompletableFuture chunkToSave;
@Nullable
private final DebugBuffer chunkToSaveHistory;
-@@ -70,6 +70,8 @@ public class ChunkHolder {
+@@ -73,6 +73,8 @@ public class ChunkHolder {
private boolean resendLight;
private CompletableFuture pendingFullStateConfirmation;
@@ -5077,24 +5077,20 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE;
-@@ -90,10 +92,11 @@ public class ChunkHolder {
+@@ -93,8 +95,30 @@ public class ChunkHolder {
this.queueLevel = this.oldTicketLevel;
this.setTicketLevel(level);
this.changedBlocksPerSection = new ShortSet[world.getSectionsCount()];
+ this.chunkMap = (ChunkMap)playersWatchingChunkProvider; // Paper
- }
-
- // CraftBukkit start
-- public LevelChunk getFullChunk() {
-+ public final LevelChunk getFullChunk() { // Paper - final for inline
- if (!ChunkHolder.getFullChunkStatus(this.oldTicketLevel).isOrAfter(ChunkHolder.FullChunkStatus.BORDER)) return null; // note: using oldTicketLevel for isLoaded checks
- return this.getFullChunkUnchecked();
- }
-@@ -105,6 +108,21 @@ public class ChunkHolder {
- }
- // CraftBukkit end
-
++ }
++
+ // Paper start
++ public LevelChunk getFullChunkUnchecked() {
++ CompletableFuture> statusFuture = this.getFutureIfPresentUnchecked(ChunkStatus.FULL);
++ Either either = (Either) statusFuture.getNow(null);
++ return (either == null) ? null : (LevelChunk) either.left().orElse(null);
+ }
+
+ public ChunkAccess getAvailableChunkNow() {
+ // TODO can we just getStatusFuture(EMPTY)?
+ for (ChunkStatus curr = ChunkStatus.FULL, next = curr.getParent(); curr != next; curr = next, next = next.getParent()) {
@@ -5112,7 +5108,7 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
public CompletableFuture> getFutureIfPresentUnchecked(ChunkStatus leastStatus) {
CompletableFuture> completablefuture = (CompletableFuture) this.futures.get(leastStatus.getIndex());
-@@ -115,20 +133,20 @@ public class ChunkHolder {
+@@ -105,20 +129,20 @@ public class ChunkHolder {
return ChunkHolder.getStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE;
}
@@ -5137,7 +5133,16 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
CompletableFuture> completablefuture = this.getTickingChunkFuture();
Either either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
-@@ -149,6 +167,21 @@ public class ChunkHolder {
+@@ -126,7 +150,7 @@ public class ChunkHolder {
+ }
+
+ @Nullable
+- public LevelChunk getFullChunk() {
++ public final LevelChunk getFullChunk() { // Paper - final for inline
+ CompletableFuture> completablefuture = this.getFullChunkFuture();
+ Either either = (Either) completablefuture.getNow(null); // CraftBukkit - decompile error
+
+@@ -147,6 +171,21 @@ public class ChunkHolder {
return null;
}
@@ -5159,7 +5164,7 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
@Nullable
public ChunkAccess getLastAvailable() {
for (int i = ChunkHolder.CHUNK_STATUSES.size() - 1; i >= 0; --i) {
-@@ -167,7 +200,7 @@ public class ChunkHolder {
+@@ -165,7 +204,7 @@ public class ChunkHolder {
return null;
}
@@ -5168,7 +5173,7 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
return this.chunkToSave;
}
-@@ -335,11 +368,11 @@ public class ChunkHolder {
+@@ -342,11 +381,11 @@ public class ChunkHolder {
return ChunkHolder.getFullChunkStatus(this.ticketLevel);
}
@@ -5182,7 +5187,7 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
return this.ticketLevel;
}
-@@ -428,14 +461,27 @@ public class ChunkHolder {
+@@ -435,14 +474,27 @@ public class ChunkHolder {
this.wasAccessibleSinceLastSave |= flag3;
if (!flag2 && flag3) {
@@ -5210,7 +5215,7 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
}
boolean flag4 = playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.TICKING);
-@@ -444,12 +490,29 @@ public class ChunkHolder {
+@@ -451,12 +503,29 @@ public class ChunkHolder {
if (!flag4 && flag5) {
this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this);
this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, ChunkHolder.FullChunkStatus.TICKING);
@@ -5241,7 +5246,7 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
}
boolean flag6 = playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.ENTITY_TICKING);
-@@ -462,12 +525,28 @@ public class ChunkHolder {
+@@ -469,12 +538,28 @@ public class ChunkHolder {
this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this.pos);
this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, ChunkHolder.FullChunkStatus.ENTITY_TICKING);
@@ -5271,7 +5276,7 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
}
if (!playerchunk_state1.isOrAfter(playerchunk_state)) {
-@@ -573,4 +652,18 @@ public class ChunkHolder {
+@@ -590,4 +675,18 @@ public class ChunkHolder {
}
};
}
@@ -5291,10 +5296,10 @@ index 40dd2077f26a2c1fa15f21861204faa53748140e..45de5e508540b4ba622985d530f1aada
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bcd619e8cf 100644
+index 27592093939d3ee3d0395527eead160ecec9330c..a5eb77f3d7cdbf656d11e97f4c27054b1d38b5d2 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -59,6 +59,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket;
+@@ -62,6 +62,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket;
import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket;
import net.minecraft.network.protocol.game.ClientboundSetPassengersPacket;
import net.minecraft.network.protocol.game.DebugPackets;
@@ -5302,7 +5307,7 @@ index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bc
import net.minecraft.server.level.progress.ChunkProgressListener;
import net.minecraft.server.network.ServerPlayerConnection;
import net.minecraft.util.CsvOutput;
-@@ -158,6 +159,56 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -162,6 +163,56 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
};
// CraftBukkit end
@@ -5359,7 +5364,7 @@ index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bc
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier persistentStateManagerFactory, int viewDistance, boolean dsync) {
super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync);
this.visibleChunkMap = this.updatingChunkMap.clone();
-@@ -193,6 +244,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -198,6 +249,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.overworldDataStorage = persistentStateManagerFactory;
this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, world);
this.setViewDistance(viewDistance);
@@ -5370,7 +5375,7 @@ index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bc
}
protected ChunkGenerator generator() {
-@@ -282,6 +337,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -287,6 +342,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -5385,7 +5390,7 @@ index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bc
private CompletableFuture, ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkPos centerChunk, int margin, IntFunction distanceToStatus) {
List>> list = new ArrayList();
List list1 = new ArrayList();
-@@ -382,6 +445,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -418,6 +481,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
holder.setTicketLevel(level);
} else {
holder = new ChunkHolder(new ChunkPos(pos), level, this.level, this.lightEngine, this.queueSorter, this);
@@ -5397,7 +5402,7 @@ index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bc
}
this.updatingChunkMap.put(pos, holder);
-@@ -507,7 +575,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -547,7 +615,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (completablefuture1 != completablefuture) {
this.scheduleUnload(pos, holder);
} else {
@@ -5412,20 +5417,19 @@ index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bc
if (ichunkaccess instanceof LevelChunk) {
((LevelChunk) ichunkaccess).setLoaded(false);
}
-@@ -522,7 +596,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- this.lightEngine.updateChunkStatus(ichunkaccess.getPos());
+@@ -563,7 +637,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lightEngine.tryScheduleUpdate();
this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null);
-- }
+ this.chunkSaveCooldowns.remove(ichunkaccess.getPos().toLong());
+ } else if (removed) { // Paper start
-+ for (int index = 0, len = this.regionManagers.size(); index < len; ++index) {
-+ this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z);
-+ }
-+ } // Paper end
++ for (int index = 0, len = this.regionManagers.size(); index < len; ++index) {
++ this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z);
+ }
++ } // Paper end
}
};
-@@ -1057,6 +1135,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1111,6 +1189,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!flag1) {
this.distanceManager.addPlayer(SectionPos.of((Entity) player), player);
}
@@ -5433,7 +5437,7 @@ index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bc
} else {
SectionPos sectionposition = player.getLastSectionPos();
-@@ -1064,6 +1143,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1118,6 +1197,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!flag2) {
this.distanceManager.removePlayer(sectionposition, player);
}
@@ -5441,7 +5445,7 @@ index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bc
}
for (int k = i - this.viewDistance - 1; k <= i + this.viewDistance + 1; ++k) {
-@@ -1176,6 +1256,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1230,6 +1310,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -5450,7 +5454,7 @@ index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bc
}
@Override
-@@ -1379,7 +1461,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1433,7 +1515,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public class ChunkDistanceManager extends DistanceManager {
protected ChunkDistanceManager(Executor workerExecutor, Executor mainThreadExecutor) {
@@ -5460,10 +5464,10 @@ index 09f5ce03f842e357bbe0dd6b0fffde8ec5851f1d..504492c3889fab7b95eec3bcd9b0d1bc
@Override
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
-index ef87c37633cee4ab438f1991144188ade1c4e65f..19d3802becd353e130b785f8286e595e08dc5c5f 100644
+index 6c98676827ceb6999f340fa2b06a0b3e1cb4cae2..2012831c4e9573118209672c8a0170573566b491 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
-@@ -59,8 +59,9 @@ public abstract class DistanceManager {
+@@ -60,8 +60,9 @@ public abstract class DistanceManager {
final Executor mainThreadExecutor;
private long ticketTickCounter;
private int simulationDistance = 10;
@@ -5474,7 +5478,7 @@ index ef87c37633cee4ab438f1991144188ade1c4e65f..19d3802becd353e130b785f8286e595e
Objects.requireNonNull(mainThreadExecutor);
ProcessorHandle mailbox = ProcessorHandle.of("player ticket throttler", mainThreadExecutor::execute);
ChunkTaskPriorityQueueSorter chunktaskqueuesorter = new ChunkTaskPriorityQueueSorter(ImmutableList.of(mailbox), workerExecutor, 4);
-@@ -69,6 +70,7 @@ public abstract class DistanceManager {
+@@ -70,6 +71,7 @@ public abstract class DistanceManager {
this.ticketThrottlerInput = chunktaskqueuesorter.getProcessor(mailbox, true);
this.ticketThrottlerReleaser = chunktaskqueuesorter.getReleaseProcessor(mailbox);
this.mainThreadExecutor = mainThreadExecutor;
@@ -5483,25 +5487,24 @@ index ef87c37633cee4ab438f1991144188ade1c4e65f..19d3802becd353e130b785f8286e595e
protected void purgeStaleTickets() {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 0d23c92af7aa381976c45d36e07d965819f19707..9dd0eb49048ceccd82e139dac5d658d168694dda 100644
+index 2015e527044db26bed960b2915b5422a7d7ad0e3..94d717f43336ace9375409b48d1e0e4291072656 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -48,6 +48,8 @@ import net.minecraft.world.level.storage.LevelData;
- import net.minecraft.world.level.storage.LevelStorageSource;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
-+import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper
-+import java.util.function.Function; // Paper
+@@ -49,6 +49,7 @@ import net.minecraft.world.level.storage.LevelStorageSource;
public class ServerChunkCache extends ChunkSource {
-@@ -70,6 +72,334 @@ public class ServerChunkCache extends ChunkSource {
++ public static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger(); // Paper
+ public static final List CHUNK_STATUSES = ChunkStatus.getStatusList();
+ private final DistanceManager distanceManager;
+ final ServerLevel level;
+@@ -67,6 +68,334 @@ public class ServerChunkCache extends ChunkSource {
@Nullable
@VisibleForDebug
private NaturalSpawner.SpawnState lastSpawnState;
+ // Paper start
+ final com.destroystokyo.paper.util.concurrent.WeakSeqLock loadedChunkMapSeqLock = new com.destroystokyo.paper.util.concurrent.WeakSeqLock();
-+ final Long2ObjectOpenHashMap loadedChunkMap = new Long2ObjectOpenHashMap<>(8192, 0.5f);
++ final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap loadedChunkMap = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(8192, 0.5f);
+
+ private final LevelChunk[] lastLoadedChunks = new LevelChunk[4 * 4];
+
@@ -5602,13 +5605,13 @@ index 0d23c92af7aa381976c45d36e07d965819f19707..9dd0eb49048ceccd82e139dac5d658d1
+ this.getChunkFutureAsynchronously(x, z, 33, ChunkHolder::getFullChunkFuture, onLoad);
+ }
+
-+ private void getChunkFutureAsynchronously(int x, int z, int ticketLevel, Function>> futureGet, java.util.function.Consumer onLoad) {
++ private void getChunkFutureAsynchronously(int x, int z, int ticketLevel, java.util.function.Function>> futureGet, java.util.function.Consumer onLoad) {
+ if (Thread.currentThread() != this.mainThread) {
+ throw new IllegalStateException();
+ }
+ ChunkPos chunkPos = new ChunkPos(x, z);
+ Long identifier = this.chunkFutureAwaitCounter++;
-+ this.distanceManager.addTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
++ this.distanceManager.addTicket(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
+ this.runDistanceManagerUpdates();
+
+ ChunkHolder chunk = this.chunkMap.getUpdatingChunkIfPresent(chunkPos.toLong());
@@ -5625,9 +5628,9 @@ index 0d23c92af7aa381976c45d36e07d965819f19707..9dd0eb49048ceccd82e139dac5d658d1
+ if (throwable instanceof ThreadDeath) {
+ throw (ThreadDeath)throwable;
+ }
-+ net.minecraft.server.MinecraftServer.LOGGER.fatal("Failed to complete future await for chunk " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "'", throwable);
++ net.minecraft.server.MinecraftServer.LOGGER.error("Failed to complete future await for chunk " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "'", throwable);
+ } else if (either.right().isPresent()) {
-+ net.minecraft.server.MinecraftServer.LOGGER.fatal("Failed to complete future await for chunk " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "': " + either.right().get().toString());
++ net.minecraft.server.MinecraftServer.LOGGER.error("Failed to complete future await for chunk " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "': " + either.right().get().toString());
+ }
+
+ try {
@@ -5638,13 +5641,13 @@ index 0d23c92af7aa381976c45d36e07d965819f19707..9dd0eb49048ceccd82e139dac5d658d1
+ if (thr instanceof ThreadDeath) {
+ throw (ThreadDeath)thr;
+ }
-+ net.minecraft.server.MinecraftServer.LOGGER.fatal("Load callback for future await failed " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "'", thr);
++ net.minecraft.server.MinecraftServer.LOGGER.error("Load callback for future await failed " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "'", thr);
+ return;
+ }
+ } finally {
+ // due to odd behaviour with CB unload implementation we need to have these AFTER the load callback.
-+ ServerChunkCache.this.distanceManager.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, ticketLevel, chunkPos);
-+ ServerChunkCache.this.distanceManager.removeTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
++ ServerChunkCache.this.distanceManager.addTicket(TicketType.UNKNOWN, chunkPos, ticketLevel, chunkPos);
++ ServerChunkCache.this.distanceManager.removeTicket(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
+ }
+ }, this.mainThreadProcessor);
+ }
@@ -5726,9 +5729,9 @@ index 0d23c92af7aa381976c45d36e07d965819f19707..9dd0eb49048ceccd82e139dac5d658d1
+ if (throwable instanceof ThreadDeath) {
+ throw (ThreadDeath)throwable;
+ }
-+ LOGGER.fatal("Failed to complete future await for chunk " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "'", throwable);
++ LOGGER.error("Failed to complete future await for chunk " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "'", throwable);
+ } else if (either.right().isPresent()) {
-+ LOGGER.fatal("Failed to complete future await for chunk " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "': " + either.right().get().toString());
++ LOGGER.error("Failed to complete future await for chunk " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "': " + either.right().get().toString());
+ }
+
+ try {
@@ -5739,7 +5742,7 @@ index 0d23c92af7aa381976c45d36e07d965819f19707..9dd0eb49048ceccd82e139dac5d658d1
+ if (thr instanceof ThreadDeath) {
+ throw (ThreadDeath)thr;
+ }
-+ LOGGER.fatal("Load callback for future await failed " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "'", thr);
++ LOGGER.error("Load callback for future await failed " + chunkPos.toString() + " in world '" + ServerChunkCache.this.level.getWorld().getName() + "'", thr);
+ return;
+ }
+ } finally {
@@ -5751,11 +5754,11 @@ index 0d23c92af7aa381976c45d36e07d965819f19707..9dd0eb49048ceccd82e139dac5d658d1
+ }
+
+ public void addTicketAtLevel(TicketType ticketType, ChunkPos chunkPos, int ticketLevel, T identifier) {
-+ this.distanceManager.addTicketAtLevel(ticketType, chunkPos, ticketLevel, identifier);
++ this.distanceManager.addTicket(ticketType, chunkPos, ticketLevel, identifier);
+ }
+
+ public void removeTicketAtLevel(TicketType ticketType, ChunkPos chunkPos, int ticketLevel, T identifier) {
-+ this.distanceManager.removeTicketAtLevel(ticketType, chunkPos, ticketLevel, identifier);
++ this.distanceManager.removeTicket(ticketType, chunkPos, ticketLevel, identifier);
+ }
+
+ void chunkLoadAccept(int chunkX, int chunkZ, ChunkAccess chunk, java.util.function.Consumer consumer) {
@@ -5830,7 +5833,7 @@ index 0d23c92af7aa381976c45d36e07d965819f19707..9dd0eb49048ceccd82e139dac5d658d1
public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier persistentStateManagerFactory) {
this.level = world;
-@@ -130,6 +460,49 @@ public class ServerChunkCache extends ChunkSource {
+@@ -127,6 +456,49 @@ public class ServerChunkCache extends ChunkSource {
this.lastChunk[0] = chunk;
}
@@ -5881,10 +5884,10 @@ index 0d23c92af7aa381976c45d36e07d965819f19707..9dd0eb49048ceccd82e139dac5d658d1
@Override
public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index b9ef6e33e584099b77b966774e1ae6aa497dfca1..073cea951644f25c276ba05ff1fc48fda08593da 100644
+index 1e9805b029abd8a59452b185af2eae8d1c9e7267..71e01e8f7b1aa5b607ad37297dbc49e9953aa9be 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -159,6 +159,7 @@ import org.bukkit.event.server.MapInitializeEvent;
+@@ -160,6 +160,7 @@ import org.bukkit.event.server.MapInitializeEvent;
import org.bukkit.event.weather.LightningStrikeEvent;
import org.bukkit.event.world.TimeSkipEvent;
// CraftBukkit end
@@ -5892,7 +5895,7 @@ index b9ef6e33e584099b77b966774e1ae6aa497dfca1..073cea951644f25c276ba05ff1fc48fd
public class ServerLevel extends Level implements WorldGenLevel {
-@@ -215,6 +216,96 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -216,6 +217,96 @@ public class ServerLevel extends Level implements WorldGenLevel {
return convertable.dimensionType;
}
@@ -5987,10 +5990,10 @@ index b9ef6e33e584099b77b966774e1ae6aa497dfca1..073cea951644f25c276ba05ff1fc48fd
+ // Paper end
+
// Add env and gen to constructor, WorldData -> WorldDataServer
- public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, ServerLevelData iworlddataserver, ResourceKey resourcekey, DimensionType dimensionmanager, ChunkProgressListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
+ public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, ServerLevelData iworlddataserver, ResourceKey resourcekey, Holder holder, ChunkProgressListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index b64f9dc47d4f632624fc40bbbafd24cb5ae7cd9b..925ffbddd5475be7fe00570d861b615f707434b4 100644
+index 146d72d8d44cda5fc3f357f52e5fb3775be620f2..9d7d7a44616b2b7849c1abd3b9ac77305fdb0815 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -232,6 +232,8 @@ public class ServerPlayer extends Player {
@@ -6024,10 +6027,10 @@ index 3a4f026c73cdd22d30bdadabbcf24bef969b73e4..0d536d72ac918fbd403397ff369d1014
private final String name;
private final Comparator comparator;
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
-index d679be6c3ce0d57fa2063a45baec1b108a0a2707..de5e18a331178da8f7e82aa2419a0ee606e801ee 100644
+index 0d33910768b111863816f84393613c0cc5142691..8fdda1e5805534d08c0a06b15e89d85b3d9c21e9 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
-@@ -152,6 +152,26 @@ public class WorldGenRegion implements WorldGenLevel {
+@@ -151,6 +151,26 @@ public class WorldGenRegion implements WorldGenLevel {
return chunkX >= this.firstPos.x && chunkX <= this.lastPos.x && chunkZ >= this.firstPos.z && chunkZ <= this.lastPos.z;
}
@@ -6055,10 +6058,10 @@ index d679be6c3ce0d57fa2063a45baec1b108a0a2707..de5e18a331178da8f7e82aa2419a0ee6
public BlockState getBlockState(BlockPos pos) {
return this.getChunk(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ())).getBlockState(pos);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 8b406bc884a974cf46378a9fc38645e38e00f0ab..ee55db9770eb84792200b407defc04f0fd7b7e98 100644
+index c79c4e170a8213fd47e78c43827ddc86d24f7b61..c18bed4728f6813aa8d7cf4b1e5e53a092fb1354 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -217,9 +217,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -218,9 +218,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private final MinecraftServer server;
public ServerPlayer player;
private int tickCount;
@@ -6072,7 +6075,7 @@ index 8b406bc884a974cf46378a9fc38645e38e00f0ab..ee55db9770eb84792200b407defc04f0
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
-index a4c5edee297af6d68d518b77f706732b5ccbe4de..7bf4bf5cb2c1b54a7e2733091f48f3a824336d36 100644
+index 288fdbef407d11ab430d5d7026dfad148c3c1065..6fefa619299d3202158490630d62c16aef71e831 100644
--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
+++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
@@ -78,6 +78,13 @@ public abstract class BlockableEventLoop implements Profiler
@@ -6090,10 +6093,10 @@ index a4c5edee297af6d68d518b77f706732b5ccbe4de..7bf4bf5cb2c1b54a7e2733091f48f3a8
@Override
public void tell(R runnable) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 595a821e3dbbb0ecac8592356149d839624bcd50..78ea2df454919707a938ff75aa655f5bfa12fc99 100644
+index 2bebc5cc03ae34cf1d4003d24da42d0bc06f897b..e778f4da8b3e33b6fc9bbe21a7cbc1f185130e69 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -308,6 +308,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
+@@ -311,6 +311,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.level.hasChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4);
}
// CraftBukkit end
@@ -6106,10 +6109,10 @@ index 595a821e3dbbb0ecac8592356149d839624bcd50..78ea2df454919707a938ff75aa655f5b
public Entity(EntityType> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 1c5f30b199904c74aa3e473b7696c416d93f0efe..a3b6883d7fc856ed8550ffb7aa8dd929922853e2 100644
+index 197a27274c9277c41bb7fcda34afa7ef652e1a9b..c94c62e7e32f55d322ddfed930e1aaa6c1343b29 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -255,6 +255,7 @@ public abstract class LivingEntity extends Entity {
+@@ -258,6 +258,7 @@ public abstract class LivingEntity extends Entity {
public boolean collides = true;
public Set collidableExemptions = new HashSet<>();
public boolean bukkitPickUpLoot;
@@ -6118,7 +6121,7 @@ index 1c5f30b199904c74aa3e473b7696c416d93f0efe..a3b6883d7fc856ed8550ffb7aa8dd929
@Override
public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index 59a54e99baf8219c3878b25a214508e09e819778..31f98763da600c34246d722cb92dda4442a3f046 100644
+index 351f7c08d5903113ba19205509e3fc68fc31e338..711c130a6d725d8a7f2a77e74b51c6123d7856d2 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -238,6 +238,7 @@ public abstract class Mob extends LivingEntity {
@@ -6155,10 +6158,10 @@ index 6c3044b6194dfd3037389d717bbe6783f58b951d..457880c9e894a83d88505cf0b7235df9
super(type, world);
this.xpReward = 5;
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index 770520ace95a1fbc5bdaf5d9d62c09f0f7396602..8335880dbbb31a3f5d10c259b567baa0d5f381a1 100644
+index 62253b9fac567b515bafa06d00c6583b9ac1e216..1a52db84d9630a095347a85e136a9ad118f77325 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -727,6 +727,25 @@ public final class ItemStack {
+@@ -737,6 +737,25 @@ public final class ItemStack {
return this.tag != null ? this.tag.getList("Enchantments", 10) : new ListTag();
}
@@ -6184,7 +6187,7 @@ index 770520ace95a1fbc5bdaf5d9d62c09f0f7396602..8335880dbbb31a3f5d10c259b567baa0
public void setTag(@Nullable CompoundTag nbt) {
this.tag = nbt;
if (this.getItem().canBeDepleted()) {
-@@ -1127,6 +1146,7 @@ public final class ItemStack {
+@@ -1135,6 +1154,7 @@ public final class ItemStack {
// CraftBukkit start
@Deprecated
public void setItem(Item item) {
@@ -6294,10 +6297,10 @@ index 3c707d6674b2594b09503b959a31c1f4ad3981e6..db61b6b0158a9bcc0e1d735e34fe3671
public BlockState getBlockState(BlockPos pos) {
return Blocks.AIR.defaultBlockState();
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 8de437c79e105331165efaf1b154287e16e1b8ef..ff001049d71127a0b9e7a9d73996be02ec0ad044 100644
+index 6ded806628f2f3fd5b357eed41990abd7e06a372..47f625a30f3f2aa95d94f571abf5af95eee68912 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -85,6 +85,7 @@ import org.bukkit.craftbukkit.CraftServer;
+@@ -83,6 +83,7 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.SpigotTimings; // Spigot
import org.bukkit.craftbukkit.block.CapturedBlockState;
@@ -6305,7 +6308,7 @@ index 8de437c79e105331165efaf1b154287e16e1b8ef..ff001049d71127a0b9e7a9d73996be02
import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.craftbukkit.util.CraftSpawnCategory;
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
-@@ -270,18 +271,51 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -269,18 +270,51 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return y < -20000000 || y >= 20000000;
}
@@ -6361,7 +6364,7 @@ index 8de437c79e105331165efaf1b154287e16e1b8ef..ff001049d71127a0b9e7a9d73996be02
ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create);
if (ichunkaccess == null && create) {
-@@ -292,7 +326,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -291,7 +325,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
@Override
@@ -6370,7 +6373,7 @@ index 8de437c79e105331165efaf1b154287e16e1b8ef..ff001049d71127a0b9e7a9d73996be02
return this.setBlock(pos, state, flags, 512);
}
-@@ -597,7 +631,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -596,7 +630,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (this.isOutsideBuildHeight(pos)) {
return Blocks.VOID_AIR.defaultBlockState();
} else {
@@ -6380,10 +6383,10 @@ index 8de437c79e105331165efaf1b154287e16e1b8ef..ff001049d71127a0b9e7a9d73996be02
return chunk.getBlockState(pos);
}
diff --git a/src/main/java/net/minecraft/world/level/LevelReader.java b/src/main/java/net/minecraft/world/level/LevelReader.java
-index a1cb8379ed4062d765659e829ba2262487ce7f8b..aa76f45d18f23997af5a9508559817964ef5e23c 100644
+index fb6ee169e6faa0dfc402f414ada10abbad57189e..34b26ee897209034c9be4d3e61acfd18d59e5e1e 100644
--- a/src/main/java/net/minecraft/world/level/LevelReader.java
+++ b/src/main/java/net/minecraft/world/level/LevelReader.java
-@@ -18,6 +18,7 @@ import net.minecraft.world.level.levelgen.Heightmap;
+@@ -19,6 +19,7 @@ import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.phys.AABB;
public interface LevelReader extends BlockAndTintGetter, CollisionGetter, BiomeManager.NoiseBiomeSource {
@@ -6392,27 +6395,27 @@ index a1cb8379ed4062d765659e829ba2262487ce7f8b..aa76f45d18f23997af5a950855981796
ChunkAccess getChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create);
diff --git a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
-index 47bd74f75f4c49a34a485d1963325a2152756c29..0dcf1c8926e471fa40517a5c92354116dad3c3c2 100644
+index ccf37eb05846f825d9acc874455cbbcdcdd2ecc2..138f5576a1df6714e754d9829f209f1a1678413f 100644
--- a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
+++ b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
-@@ -5,6 +5,7 @@ import javax.annotation.Nullable;
- import net.minecraft.core.BlockPos;
+@@ -9,6 +9,7 @@ import net.minecraft.core.Holder;
+ import net.minecraft.core.Registry;
import net.minecraft.core.SectionPos;
import net.minecraft.util.profiling.ProfilerFiller;
+import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
- import net.minecraft.world.level.block.Blocks;
- import net.minecraft.world.level.block.entity.BlockEntity;
-@@ -60,7 +61,7 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter {
+ import net.minecraft.world.level.biome.Biome;
+ import net.minecraft.world.level.biome.Biomes;
+@@ -70,7 +71,7 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter {
private ChunkAccess getChunk(int chunkX, int chunkZ) {
int i = chunkX - this.centerX;
int j = chunkZ - this.centerZ;
- if (i >= 0 && i < this.chunks.length && j >= 0 && j < this.chunks[i].length) {
+ if (i >= 0 && i < this.chunks.length && j >= 0 && j < this.chunks[i].length) { // Paper - if this changes, update getChunkIfLoaded below
ChunkAccess chunkAccess = this.chunks[i][j];
- return (ChunkAccess)(chunkAccess != null ? chunkAccess : new EmptyLevelChunk(this.level, new ChunkPos(chunkX, chunkZ)));
+ return (ChunkAccess)(chunkAccess != null ? chunkAccess : new EmptyLevelChunk(this.level, new ChunkPos(chunkX, chunkZ), this.plains.get()));
} else {
-@@ -68,6 +69,30 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter {
+@@ -78,6 +79,30 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter {
}
}
@@ -6444,10 +6447,10 @@ index 47bd74f75f4c49a34a485d1963325a2152756c29..0dcf1c8926e471fa40517a5c92354116
public WorldBorder getWorldBorder() {
return this.level.getWorldBorder();
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
-index 0cb0b6143e3307e546c78ecda2c35ac31a8a7001..a3f44e3a44b2ec21ef41f6d598b428448c847c5f 100644
+index 42d68e0df3ff4476a248044c7a727c0c2d3b828a..2b88ea323b7e179015751e87d1a4303bffed7f51 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
-@@ -644,14 +644,14 @@ public abstract class BlockBehaviour {
+@@ -646,14 +646,14 @@ public abstract class BlockBehaviour {
public abstract static class BlockStateBase extends StateHolder {
@@ -6465,7 +6468,7 @@ index 0cb0b6143e3307e546c78ecda2c35ac31a8a7001..a3f44e3a44b2ec21ef41f6d598b42844
private final BlockBehaviour.StatePredicate isRedstoneConductor;
private final BlockBehaviour.StatePredicate isSuffocating;
private final BlockBehaviour.StatePredicate isViewBlocking;
-@@ -679,10 +679,18 @@ public abstract class BlockBehaviour {
+@@ -681,10 +681,18 @@ public abstract class BlockBehaviour {
this.emissiveRendering = blockbase_info.emissiveRendering;
}
@@ -6484,7 +6487,7 @@ index 0cb0b6143e3307e546c78ecda2c35ac31a8a7001..a3f44e3a44b2ec21ef41f6d598b42844
}
-@@ -714,8 +722,8 @@ public abstract class BlockBehaviour {
+@@ -716,8 +724,8 @@ public abstract class BlockBehaviour {
return this.getBlock().getOcclusionShape(this.asState(), world, pos);
}
@@ -6496,10 +6499,10 @@ index 0cb0b6143e3307e546c78ecda2c35ac31a8a7001..a3f44e3a44b2ec21ef41f6d598b42844
public boolean useShapeForLightOcclusion() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
-index bfcaaa69991342f71fba4df46f69aea2ec6adca7..0ea0690ab1d45f60a2b13cf8a69e580256992cdc 100644
+index b629ce7f1aa4592748f3f47ae3637b20461549d2..847ac56f20ab9c5745f9c0fa0e6f16743ba5e471 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
-@@ -58,7 +58,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
+@@ -61,7 +61,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
protected final ShortList[] postProcessing;
protected volatile boolean unsaved;
private volatile boolean isLightCorrect;
@@ -6508,7 +6511,7 @@ index bfcaaa69991342f71fba4df46f69aea2ec6adca7..0ea0690ab1d45f60a2b13cf8a69e5802
private long inhabitedTime;
/** @deprecated */
@Nullable
-@@ -83,7 +83,8 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
+@@ -86,7 +86,8 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
// CraftBukkit end
public ChunkAccess(ChunkPos pos, UpgradeData upgradeData, LevelHeightAccessor heightLimitView, Registry biome, long inhabitedTime, @Nullable LevelChunkSection[] sectionArrayInitializer, @Nullable BlendingData blendingData) {
@@ -6519,10 +6522,10 @@ index bfcaaa69991342f71fba4df46f69aea2ec6adca7..0ea0690ab1d45f60a2b13cf8a69e5802
this.levelHeightAccessor = heightLimitView;
this.sections = new LevelChunkSection[heightLimitView.getSectionsCount()];
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-index 28555314738ba891e0e36d3c85b1623116f743dd..f263022e1d15e78b51cfd148cf024b9a8c761898 100644
+index 5015d09de59cf184c98b1ea45f25a264c6dab1b1..73a99db6c31dec822514392a6102b7f8cc3b2738 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -24,6 +24,7 @@ import net.minecraft.nbt.CompoundTag;
+@@ -25,6 +25,7 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData;
import net.minecraft.server.level.ChunkHolder;
@@ -6718,10 +6721,10 @@ index 28555314738ba891e0e36d3c85b1623116f743dd..f263022e1d15e78b51cfd148cf024b9a
@Override
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
-index 37a75bb9b15356b6fb9c76c1bc1fff8e0a28b1dd..7c2e3331fac1de2e20974c8eed8aeeb9f2c92789 100644
+index 28e02151cb56141545c27d0cd9723e742fc420ad..ee0be5163811ea39efcb2092e5f126c3fd9b1523 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
-@@ -73,6 +73,18 @@ public class ProtoChunk extends ChunkAccess {
+@@ -74,6 +74,18 @@ public class ProtoChunk extends ChunkAccess {
return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks);
}
@@ -6963,7 +6966,7 @@ index 0000000000000000000000000000000000000000..909b2c98e7a9117d2f737245e4661792
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
-index 5c5a0c6695fd68f16792995f9537e05b446ad7e9..8cb510615bc8b4638b4aadfd9732c9a3d65b1fac 100644
+index 950a6238f31d2c76a93831eb025092ecd8ab3a9b..bc89c976e763ec137066f8517dbcc1a3d43303bd 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -97,8 +97,17 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -7000,10 +7003,10 @@ index 5c5a0c6695fd68f16792995f9537e05b446ad7e9..8cb510615bc8b4638b4aadfd9732c9a3
public static byte toLegacyData(BlockState data) {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
-index 939789831f14621800c6792d20119079fc51b6f1..9ab8159975f58a0014edbe3a368490b3590882ea 100644
+index b8d50fd20fea9f84af77de69391d670c7b6cf132..13e887e9d06c3eb8649613d1ecb3d26de6b9d6ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
-@@ -212,7 +212,23 @@ public class DummyGeneratorAccess implements WorldGenLevel {
+@@ -205,7 +205,23 @@ public class DummyGeneratorAccess implements WorldGenLevel {
public FluidState getFluidState(BlockPos pos) {
return Fluids.EMPTY.defaultFluidState(); // SPIGOT-6634
}
diff --git a/patches/server/0009-Add-MinecraftKey-Information-to-Objects.patch b/patches/server/0009-Add-MinecraftKey-Information-to-Objects.patch
index 74111ec18d..a62b06ca65 100644
--- a/patches/server/0009-Add-MinecraftKey-Information-to-Objects.patch
+++ b/patches/server/0009-Add-MinecraftKey-Information-to-Objects.patch
@@ -36,10 +36,10 @@ index 0000000000000000000000000000000000000000..9f0c7fd903f085e70db1785fb8bcdb54
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 52eb344feee9c3bc34a6d22a32de174c52736fb5..0736454dea12d8ffe8ef6873c5d25d17a96504b0 100644
+index e778f4da8b3e33b6fc9bbe21a7cbc1f185130e69..e191f080e781473481712e27763ab80c04fe60ab 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -145,7 +145,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
+@@ -148,7 +148,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.plugin.PluginManager;
// CraftBukkit end
@@ -48,7 +48,7 @@ index 52eb344feee9c3bc34a6d22a32de174c52736fb5..0736454dea12d8ffe8ef6873c5d25d17
// CraftBukkit start
private static final int CURRENT_LEVEL = 2;
-@@ -1963,12 +1963,32 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
+@@ -1968,12 +1968,32 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return true;
}
@@ -83,7 +83,7 @@ index 52eb344feee9c3bc34a6d22a32de174c52736fb5..0736454dea12d8ffe8ef6873c5d25d17
protected abstract void readAdditionalSaveData(CompoundTag nbt);
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
-index 30adcc82bc4e2e7145d29b64fde952d694cdf1e1..d33c2d2ec285179614d21a255cea394682e4cc2c 100644
+index dec38e58e30c84887e9d29436c0f76c70c0a627d..53a8e9a63b2ea5f698acbd80b2eca9e3e3cfedb8 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -23,7 +23,7 @@ import org.bukkit.inventory.InventoryHolder;
diff --git a/patches/server/0010-Timings-v2.patch b/patches/server/0010-Timings-v2.patch
index 8111b58bd1..bb4baaa451 100644
--- a/patches/server/0010-Timings-v2.patch
+++ b/patches/server/0010-Timings-v2.patch
@@ -745,37 +745,24 @@ index ca1a9884ab09fc7e575b1d30e2dd0aaff324fb73..b94038e2da0f986403c1ec9b27384344
public CommandFunction(ResourceLocation id, CommandFunction.Entry[] elements) {
this.id = id;
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
-index b3a6aeba2363d283f03982cf749f25cfa11a5052..449f1b2f5dca350dc0912e14c8c2bf3eb4652b92 100644
+index 13421daa96b4ba302581f36abcd730952713d8cd..049e64c355d5f064009b1107ad15d28c44f999dd 100644
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
-@@ -3,6 +3,8 @@ package net.minecraft.network.protocol;
- import net.minecraft.network.PacketListener;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
-+import co.aikar.timings.MinecraftTimings; // Paper
-+import co.aikar.timings.Timing; // Paper
-
- // CraftBukkit start
- import net.minecraft.server.MinecraftServer;
-@@ -23,10 +25,13 @@ public class PacketUtils {
-
- public static void ensureRunningOnSameThread(Packet packet, T listener, BlockableEventLoop> engine) throws RunningOnDifferentThreadException {
- if (!engine.isSameThread()) {
-+ Timing timing = MinecraftTimings.getPacketTiming(packet); // Paper - timings
- engine.execute(() -> {
+@@ -26,7 +26,8 @@ public class PacketUtils {
+ engine.executeIfPossible(() -> {
if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590
if (listener.getConnection().isConnected()) {
-+ try (Timing ignored = timing.startTiming()) { // Paper - timings
- packet.handle(listener);
-+ } // Paper - timings
- } else {
- PacketUtils.LOGGER.debug("Ignoring packet due to disconnection: {}", packet);
- }
+- try {
++ co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
++ try (co.aikar.timings.Timing ignored = timing.startTiming()) { // Paper - timings
+ packet.handle(listener);
+ } catch (Exception exception) {
+ if (listener.shouldPropagateHandlingExceptions()) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 8c2b1d1a1e7f2716ee27aa10165b94550dccd19a..eba857195121c58d1b63c58904fd4754a8020219 100644
+index 32dbb6e7add72ca8068e431e607a9ff570157ff8..aca0adb9f714f96b10546b837d08fe9ef90b4d89 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -179,7 +179,7 @@ import org.bukkit.craftbukkit.generator.CustomWorldChunkManager;
+@@ -180,7 +180,7 @@ import org.bukkit.craftbukkit.generator.CustomWorldChunkManager;
import org.bukkit.event.server.ServerLoadEvent;
// CraftBukkit end
@@ -784,7 +771,7 @@ index 8c2b1d1a1e7f2716ee27aa10165b94550dccd19a..eba857195121c58d1b63c58904fd4754
import org.spigotmc.SlackActivityAccountant; // Spigot
public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements CommandSource, AutoCloseable {
-@@ -898,6 +898,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 5000000000L) {
-@@ -1231,15 +1252,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit
@@ -867,7 +854,7 @@ index 8c2b1d1a1e7f2716ee27aa10165b94550dccd19a..eba857195121c58d1b63c58904fd4754
this.profiler.push("tallying");
long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
-@@ -1250,30 +1274,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop {
// CraftBukkit start - fire RemoteServerCommandEvent
-@@ -704,10 +706,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+@@ -707,10 +709,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (event.isCancelled()) {
return;
}
@@ -1041,7 +1028,7 @@ index 4dd57007af218ba1c0e666117a49939c5884f2c6..a6cb949b6f048455acc50c897fdd93d3
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 504492c3889fab7b95eec3bcd9b0d1bcd619e8cf..5d1ac4e7afa0f1d9c9face049f768a2030eb411f 100644
+index a5eb77f3d7cdbf656d11e97f4c27054b1d38b5d2..9aaf392876119cfda46f3e80d02020d0e748ae44 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,8 +1,10 @@
@@ -1055,7 +1042,7 @@ index 504492c3889fab7b95eec3bcd9b0d1bcd619e8cf..5d1ac4e7afa0f1d9c9face049f768a20
import com.google.common.collect.Lists;
import com.google.common.collect.Queues;
import com.google.common.collect.Sets;
-@@ -652,11 +654,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -693,11 +695,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
private CompletableFuture> scheduleChunkLoad(ChunkPos pos) {
return CompletableFuture.supplyAsync(() -> {
@@ -1073,7 +1060,7 @@ index 504492c3889fab7b95eec3bcd9b0d1bcd619e8cf..5d1ac4e7afa0f1d9c9face049f768a20
boolean flag = nbttagcompound.contains("Status", 8);
if (flag) {
-@@ -667,7 +672,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -708,7 +713,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
ChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", pos);
@@ -1082,7 +1069,7 @@ index 504492c3889fab7b95eec3bcd9b0d1bcd619e8cf..5d1ac4e7afa0f1d9c9face049f768a20
} catch (ReportedException reportedexception) {
Throwable throwable = reportedexception.getCause();
-@@ -784,6 +789,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -825,6 +830,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkStatus chunkstatus = ChunkHolder.getStatus(chunkHolder.getTicketLevel());
return !chunkstatus.isOrAfter(ChunkStatus.FULL) ? ChunkHolder.UNLOADED_CHUNK : either.mapLeft((ichunkaccess) -> {
@@ -1090,7 +1077,7 @@ index 504492c3889fab7b95eec3bcd9b0d1bcd619e8cf..5d1ac4e7afa0f1d9c9face049f768a20
ChunkPos chunkcoordintpair = chunkHolder.getPos();
ProtoChunk protochunk = (ProtoChunk) ichunkaccess;
LevelChunk chunk;
-@@ -808,6 +814,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -849,6 +855,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
return chunk;
@@ -1098,7 +1085,7 @@ index 504492c3889fab7b95eec3bcd9b0d1bcd619e8cf..5d1ac4e7afa0f1d9c9face049f768a20
});
}, (runnable) -> {
ProcessorHandle mailbox = this.mainThreadMailbox;
-@@ -1342,6 +1349,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1396,6 +1403,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
List list = Lists.newArrayList();
List list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
@@ -1106,7 +1093,7 @@ index 504492c3889fab7b95eec3bcd9b0d1bcd619e8cf..5d1ac4e7afa0f1d9c9face049f768a20
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
-@@ -1366,14 +1374,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1420,14 +1428,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker.serverEntity.sendChanges();
}
}
@@ -1125,10 +1112,10 @@ index 504492c3889fab7b95eec3bcd9b0d1bcd619e8cf..5d1ac4e7afa0f1d9c9face049f768a20
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 9dd0eb49048ceccd82e139dac5d658d168694dda..a1740dd320967aa6d1ce84e081a1f2b9a1ee7d08 100644
+index 94d717f43336ace9375409b48d1e0e4291072656..3bbee4d08f4125a6499c0a8790c6bda6935e5ccc 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -528,13 +528,15 @@ public class ServerChunkCache extends ChunkSource {
+@@ -524,13 +524,15 @@ public class ServerChunkCache extends ChunkSource {
}
gameprofilerfiller.incrementCounter("getChunkCacheMiss");
@@ -1146,7 +1133,7 @@ index 9dd0eb49048ceccd82e139dac5d658d168694dda..a1740dd320967aa6d1ce84e081a1f2b9
ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
return ichunkaccess1;
}, (playerchunk_failure) -> {
-@@ -732,7 +734,9 @@ public class ServerChunkCache extends ChunkSource {
+@@ -728,7 +730,9 @@ public class ServerChunkCache extends ChunkSource {
public void save(boolean flush) {
this.runDistanceManagerUpdates();
@@ -1156,17 +1143,17 @@ index 9dd0eb49048ceccd82e139dac5d658d168694dda..a1740dd320967aa6d1ce84e081a1f2b9
}
@Override
-@@ -770,7 +774,9 @@ public class ServerChunkCache extends ChunkSource {
- this.runDistanceManagerUpdates();
+@@ -767,7 +771,9 @@ public class ServerChunkCache extends ChunkSource {
this.level.timings.doChunkMap.stopTiming(); // Spigot
this.level.getProfiler().popPush("chunks");
-+ this.level.timings.chunks.startTiming(); // Paper - timings
- this.tickChunks();
-+ this.level.timings.chunks.stopTiming(); // Paper - timings
+ if (tickChunks) {
++ this.level.timings.chunks.startTiming(); // Paper - timings
+ this.tickChunks();
++ this.level.timings.chunks.stopTiming(); // Paper - timings
+ }
+
this.level.timings.doChunkUnload.startTiming(); // Spigot
- this.level.getProfiler().popPush("unload");
- this.chunkMap.tick(shouldKeepTicking);
-@@ -797,13 +803,16 @@ public class ServerChunkCache extends ChunkSource {
+@@ -796,13 +802,16 @@ public class ServerChunkCache extends ChunkSource {
boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
gameprofilerfiller.push("naturalSpawnCount");
@@ -1183,7 +1170,7 @@ index 9dd0eb49048ceccd82e139dac5d658d168694dda..a1740dd320967aa6d1ce84e081a1f2b9
while (iterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
-@@ -832,27 +841,27 @@ public class ServerChunkCache extends ChunkSource {
+@@ -831,27 +840,27 @@ public class ServerChunkCache extends ChunkSource {
}
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
@@ -1217,7 +1204,7 @@ index 9dd0eb49048ceccd82e139dac5d658d168694dda..a1740dd320967aa6d1ce84e081a1f2b9
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 073cea951644f25c276ba05ff1fc48fda08593da..c7fe4b6aa8d68bd5dc394752a5ae635eb46c5f31 100644
+index 71e01e8f7b1aa5b607ad37297dbc49e9953aa9be..d491d91e639028fdf9ee75da849d3084b665d93c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1,6 +1,8 @@
@@ -1228,16 +1215,16 @@ index 073cea951644f25c276ba05ff1fc48fda08593da..c7fe4b6aa8d68bd5dc394752a5ae635e
+import co.aikar.timings.Timings; // Paper
import com.google.common.collect.Lists;
import com.mojang.datafixers.DataFixer;
- import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-@@ -151,7 +153,6 @@ import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
+ import com.mojang.datafixers.util.Pair;
+@@ -152,7 +154,6 @@ import net.minecraft.world.ticks.LevelTicks;
+ import org.slf4j.Logger;
import org.bukkit.Bukkit;
import org.bukkit.WeatherType;
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.util.WorldUUID;
import org.bukkit.event.entity.CreatureSpawnEvent;
-@@ -424,7 +425,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -427,7 +428,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.updateSkyBrightness();
this.tickTime();
gameprofilerfiller.popPush("tickPending");
@@ -1246,7 +1233,7 @@ index 073cea951644f25c276ba05ff1fc48fda08593da..c7fe4b6aa8d68bd5dc394752a5ae635e
if (!this.isDebug()) {
j = this.getGameTime();
gameprofilerfiller.push("blockTicks");
-@@ -433,12 +434,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -436,12 +437,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.fluidTicks.tick(j, 65536, this::tickFluid);
gameprofilerfiller.pop();
}
@@ -1259,12 +1246,12 @@ index 073cea951644f25c276ba05ff1fc48fda08593da..c7fe4b6aa8d68bd5dc394752a5ae635e
+ this.timings.raids.stopTiming(); // Paper - timings
gameprofilerfiller.popPush("chunkSource");
+ this.timings.chunkProviderTick.startTiming(); // Paper - timings
- this.getChunkSource().tick(shouldKeepTicking);
+ this.getChunkSource().tick(shouldKeepTicking, true);
+ this.timings.chunkProviderTick.stopTiming(); // Paper - timings
gameprofilerfiller.popPush("blockEvents");
timings.doSounds.startTiming(); // Spigot
this.runBlockEvents();
-@@ -603,6 +608,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -606,6 +611,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
gameprofilerfiller.popPush("tickBlocks");
@@ -1272,7 +1259,7 @@ index 073cea951644f25c276ba05ff1fc48fda08593da..c7fe4b6aa8d68bd5dc394752a5ae635e
if (randomTickSpeed > 0) {
LevelChunkSection[] achunksection = chunk.getSections();
int l = achunksection.length;
-@@ -635,6 +641,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -638,6 +644,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
@@ -1280,7 +1267,7 @@ index 073cea951644f25c276ba05ff1fc48fda08593da..c7fe4b6aa8d68bd5dc394752a5ae635e
gameprofilerfiller.pop();
}
-@@ -869,14 +876,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -872,14 +879,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void tickNonPassenger(Entity entity) {
@@ -1304,7 +1291,7 @@ index 073cea951644f25c276ba05ff1fc48fda08593da..c7fe4b6aa8d68bd5dc394752a5ae635e
entity.setOldPosAndRot();
ProfilerFiller gameprofilerfiller = this.getProfiler();
-@@ -895,7 +910,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -898,7 +913,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1);
}
@@ -1313,7 +1300,7 @@ index 073cea951644f25c276ba05ff1fc48fda08593da..c7fe4b6aa8d68bd5dc394752a5ae635e
}
-@@ -937,6 +952,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -940,6 +955,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!savingDisabled) {
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit
@@ -1321,7 +1308,7 @@ index 073cea951644f25c276ba05ff1fc48fda08593da..c7fe4b6aa8d68bd5dc394752a5ae635e
if (progressListener != null) {
progressListener.progressStartNoAbort(new TranslatableComponent("menu.savingLevel"));
}
-@@ -946,7 +962,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -949,7 +965,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
progressListener.progressStage(new TranslatableComponent("menu.savingChunks"));
}
@@ -1333,10 +1320,10 @@ index 073cea951644f25c276ba05ff1fc48fda08593da..c7fe4b6aa8d68bd5dc394752a5ae635e
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 ee55db9770eb84792200b407defc04f0fd7b7e98..ea652f6394c7e575ce06a6b691d8b2c442eafb03 100644
+index c18bed4728f6813aa8d7cf4b1e5e53a092fb1354..443124a72eef9f60e2941b932a13471dbf1c4f72 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -207,6 +207,7 @@ import org.bukkit.inventory.CraftingInventory;
+@@ -208,6 +208,7 @@ import org.bukkit.inventory.CraftingInventory;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.SmithingInventory;
@@ -1344,7 +1331,7 @@ index ee55db9770eb84792200b407defc04f0fd7b7e98..ea652f6394c7e575ce06a6b691d8b2c4
// CraftBukkit end
public class ServerGamePacketListenerImpl implements ServerPlayerConnection, ServerGamePacketListener {
-@@ -285,7 +286,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -286,7 +287,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end
public void tick() {
@@ -1352,7 +1339,7 @@ index ee55db9770eb84792200b407defc04f0fd7b7e98..ea652f6394c7e575ce06a6b691d8b2c4
this.resetPosition();
this.player.xo = this.player.getX();
this.player.yo = this.player.getY();
-@@ -361,7 +361,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -362,7 +362,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
this.disconnect(new TranslatableComponent("multiplayer.disconnect.idling"));
}
@@ -1360,7 +1347,7 @@ index ee55db9770eb84792200b407defc04f0fd7b7e98..ea652f6394c7e575ce06a6b691d8b2c4
}
-@@ -1919,7 +1918,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1934,7 +1933,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end
private void handleCommand(String input) {
@@ -1369,7 +1356,7 @@ index ee55db9770eb84792200b407defc04f0fd7b7e98..ea652f6394c7e575ce06a6b691d8b2c4
// CraftBukkit start - whole method
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + input);
-@@ -1930,7 +1929,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1945,7 +1944,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.cserver.getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -1378,7 +1365,7 @@ index ee55db9770eb84792200b407defc04f0fd7b7e98..ea652f6394c7e575ce06a6b691d8b2c4
return;
}
-@@ -1943,7 +1942,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1958,7 +1957,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
return;
} finally {
@@ -1388,7 +1375,7 @@ index ee55db9770eb84792200b407defc04f0fd7b7e98..ea652f6394c7e575ce06a6b691d8b2c4
// this.server.getCommands().performCommand(this.player.createCommandSourceStack(), s);
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 8e4325abb2dda74c38b17bb27f9dcfcf97ba2de6..1be4b3ad18d314b0460ce61e01afd0d7d16aee69 100644
+index ea119e5849c90b25b7e836eb5e7454a391865b81..5fa0ce6a7f6b8df8993315a9784764f57d59bcf4 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1,5 +1,6 @@
@@ -1412,10 +1399,10 @@ index 8e4325abb2dda74c38b17bb27f9dcfcf97ba2de6..1be4b3ad18d314b0460ce61e01afd0d7
public UserWhiteList getWhiteList() {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 521e525cac2109a79370321163f4f27ffefb49ad..c9ab40355f02a2abfe10d9c02595e6b761b1a779 100644
+index e191f080e781473481712e27763ab80c04fe60ab..04692fe4e7f2107ffc8c48cebdf88e18e58f4ce9 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -125,7 +125,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent;
+@@ -128,7 +128,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent;
import org.bukkit.entity.Hanging;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Vehicle;
@@ -1423,7 +1410,7 @@ index 521e525cac2109a79370321163f4f27ffefb49ad..c9ab40355f02a2abfe10d9c02595e6b7
import org.bukkit.event.entity.EntityCombustByEntityEvent;
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
-@@ -292,7 +291,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -295,7 +294,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
public boolean lastDamageCancelled; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled
public boolean persistentInvisibility = false;
public BlockPos lastLavaContact;
@@ -1431,7 +1418,7 @@ index 521e525cac2109a79370321163f4f27ffefb49ad..c9ab40355f02a2abfe10d9c02595e6b7
// Spigot start
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState;
-@@ -740,7 +738,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -744,7 +742,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
}
public void move(MoverType movementType, Vec3 movement) {
@@ -1439,7 +1426,7 @@ index 521e525cac2109a79370321163f4f27ffefb49ad..c9ab40355f02a2abfe10d9c02595e6b7
if (this.noPhysics) {
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
} else {
-@@ -893,7 +890,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -906,7 +903,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
this.level.getProfiler().pop();
}
}
@@ -1448,10 +1435,10 @@ index 521e525cac2109a79370321163f4f27ffefb49ad..c9ab40355f02a2abfe10d9c02595e6b7
protected boolean isHorizontalCollisionMinor(Vec3 adjustedMovement) {
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
-index e688949fc2f3031dc9c9817bc59554e9f5a436af..20cfdba68c200e87d00995a6a4e25a5fa8171f6c 100644
+index d790c37753f019b682fe00bea392359ba18bf204..8699a3bd63e2df83615ae39a6873d9874f0fb8da 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
-@@ -293,7 +293,14 @@ public class EntityType implements EntityTypeTest {
+@@ -296,7 +296,14 @@ public class EntityType implements EntityTypeTest {
return Registry.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(id));
}
@@ -1463,10 +1450,10 @@ index e688949fc2f3031dc9c9817bc59554e9f5a436af..20cfdba68c200e87d00995a6a4e25a5f
+ }
+ public EntityType(EntityType.EntityFactory factory, MobCategory spawnGroup, boolean saveable, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, ImmutableSet canSpawnInside, EntityDimensions dimensions, int maxTrackDistance, int trackTickInterval, String id) {
+ // Paper end
+ this.builtInRegistryHolder = Registry.ENTITY_TYPE.createIntrusiveHolder(this);
this.factory = factory;
this.category = spawnGroup;
- this.canSpawnFarFromPlayer = spawnableFarFromPlayer;
-@@ -304,6 +311,14 @@ public class EntityType implements EntityTypeTest {
+@@ -308,6 +315,14 @@ public class EntityType implements EntityTypeTest {
this.dimensions = dimensions;
this.clientTrackingRange = maxTrackDistance;
this.updateInterval = trackTickInterval;
@@ -1481,7 +1468,7 @@ index e688949fc2f3031dc9c9817bc59554e9f5a436af..20cfdba68c200e87d00995a6a4e25a5f
}
@Nullable
-@@ -564,6 +579,12 @@ public class EntityType implements EntityTypeTest {
+@@ -568,6 +583,12 @@ public class EntityType implements EntityTypeTest {
return this.updateInterval;
}
@@ -1494,7 +1481,7 @@ index e688949fc2f3031dc9c9817bc59554e9f5a436af..20cfdba68c200e87d00995a6a4e25a5f
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;
}
-@@ -656,7 +677,7 @@ public class EntityType implements EntityTypeTest {
+@@ -666,7 +687,7 @@ public class EntityType implements EntityTypeTest {
Util.fetchChoiceType(References.ENTITY_TREE, id);
}
@@ -1504,10 +1491,10 @@ index e688949fc2f3031dc9c9817bc59554e9f5a436af..20cfdba68c200e87d00995a6a4e25a5f
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index a3b6883d7fc856ed8550ffb7aa8dd929922853e2..59bb2aafcbc1a4a5c963ef0391b4e9b4f670ff72 100644
+index c94c62e7e32f55d322ddfed930e1aaa6c1343b29..d9244b1d0ac1ae52aa9692884260cce5e2bc74bb 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -137,7 +137,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
+@@ -139,7 +139,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
// CraftBukkit end
@@ -1516,7 +1503,7 @@ index a3b6883d7fc856ed8550ffb7aa8dd929922853e2..59bb2aafcbc1a4a5c963ef0391b4e9b4
public abstract class LivingEntity extends Entity {
-@@ -2759,7 +2759,6 @@ public abstract class LivingEntity extends Entity {
+@@ -2762,7 +2762,6 @@ public abstract class LivingEntity extends Entity {
@Override
public void tick() {
@@ -1524,7 +1511,7 @@ index a3b6883d7fc856ed8550ffb7aa8dd929922853e2..59bb2aafcbc1a4a5c963ef0391b4e9b4
super.tick();
this.updatingUsingItem();
this.updateSwimAmount();
-@@ -2800,9 +2799,7 @@ public abstract class LivingEntity extends Entity {
+@@ -2803,9 +2802,7 @@ public abstract class LivingEntity extends Entity {
}
}
@@ -1534,7 +1521,7 @@ index a3b6883d7fc856ed8550ffb7aa8dd929922853e2..59bb2aafcbc1a4a5c963ef0391b4e9b4
double d0 = this.getX() - this.xo;
double d1 = this.getZ() - this.zo;
float f = (float) (d0 * d0 + d1 * d1);
-@@ -2882,8 +2879,6 @@ public abstract class LivingEntity extends Entity {
+@@ -2885,8 +2882,6 @@ public abstract class LivingEntity extends Entity {
if (this.isSleeping()) {
this.setXRot(0.0F);
}
@@ -1543,7 +1530,7 @@ index a3b6883d7fc856ed8550ffb7aa8dd929922853e2..59bb2aafcbc1a4a5c963ef0391b4e9b4
}
public void detectEquipmentUpdates() {
-@@ -3065,7 +3060,6 @@ public abstract class LivingEntity extends Entity {
+@@ -3068,7 +3063,6 @@ public abstract class LivingEntity extends Entity {
this.setDeltaMovement(d4, d5, d6);
this.level.getProfiler().push("ai");
@@ -1551,7 +1538,7 @@ index a3b6883d7fc856ed8550ffb7aa8dd929922853e2..59bb2aafcbc1a4a5c963ef0391b4e9b4
if (this.isImmobile()) {
this.jumping = false;
this.xxa = 0.0F;
-@@ -3075,7 +3069,6 @@ public abstract class LivingEntity extends Entity {
+@@ -3078,7 +3072,6 @@ public abstract class LivingEntity extends Entity {
this.serverAiStep();
this.level.getProfiler().pop();
}
@@ -1559,7 +1546,7 @@ index a3b6883d7fc856ed8550ffb7aa8dd929922853e2..59bb2aafcbc1a4a5c963ef0391b4e9b4
this.level.getProfiler().pop();
this.level.getProfiler().push("jump");
-@@ -3110,9 +3103,9 @@ public abstract class LivingEntity extends Entity {
+@@ -3113,9 +3106,9 @@ public abstract class LivingEntity extends Entity {
this.updateFallFlying();
AABB axisalignedbb = this.getBoundingBox();
@@ -1571,7 +1558,7 @@ index a3b6883d7fc856ed8550ffb7aa8dd929922853e2..59bb2aafcbc1a4a5c963ef0391b4e9b4
this.level.getProfiler().pop();
this.level.getProfiler().push("freezing");
boolean flag1 = this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES);
-@@ -3141,9 +3134,7 @@ public abstract class LivingEntity extends Entity {
+@@ -3144,9 +3137,7 @@ public abstract class LivingEntity extends Entity {
this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox());
}
@@ -1582,10 +1569,10 @@ index a3b6883d7fc856ed8550ffb7aa8dd929922853e2..59bb2aafcbc1a4a5c963ef0391b4e9b4
if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
this.hurt(DamageSource.DROWN, 1.0F);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index ff001049d71127a0b9e7a9d73996be02ec0ad044..72fd18a307a7e1f769195c7ef44a12bb47f2f49c 100644
+index 47f625a30f3f2aa95d94f571abf5af95eee68912..d097223e30de74d5347792fb6d0eecb254099f73 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -83,7 +83,6 @@ import org.bukkit.Bukkit;
+@@ -81,7 +81,6 @@ import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
@@ -1593,7 +1580,7 @@ index ff001049d71127a0b9e7a9d73996be02ec0ad044..72fd18a307a7e1f769195c7ef44a12bb
import org.bukkit.craftbukkit.block.CapturedBlockState;
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
-@@ -149,7 +148,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -147,7 +146,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper
@@ -1602,7 +1589,7 @@ index ff001049d71127a0b9e7a9d73996be02ec0ad044..72fd18a307a7e1f769195c7ef44a12bb
public static BlockPos lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter;
private org.spigotmc.TickLimiter tileLimiter;
-@@ -239,7 +238,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -238,7 +237,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
});
// CraftBukkit end
@@ -1611,7 +1598,7 @@ index ff001049d71127a0b9e7a9d73996be02ec0ad044..72fd18a307a7e1f769195c7ef44a12bb
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
}
-@@ -728,15 +727,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -727,15 +726,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
timings.tileEntityTick.stopTiming(); // Spigot
this.tickingBlockEntities = false;
@@ -1629,10 +1616,10 @@ index ff001049d71127a0b9e7a9d73996be02ec0ad044..72fd18a307a7e1f769195c7ef44a12bb
CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking entity");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being ticked");
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
-index c9e6cb9f5c3eae53140236e09768ff759e27ace0..5147f67c87ba3b8912a8ae24f876a9e996504600 100644
+index e72f44910f7390da9e2d78c5bb8f14d5abf9562b..54125cf5957f8165551e077c47d02b7daa578efb 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
-@@ -88,6 +88,15 @@ public class Block extends BlockBehaviour implements ItemLike {
+@@ -89,6 +89,15 @@ public class Block extends BlockBehaviour implements ItemLike {
public static final int UPDATE_LIMIT = 512;
protected final StateDefinition stateDefinition;
private BlockState defaultBlockState;
@@ -1649,7 +1636,7 @@ index c9e6cb9f5c3eae53140236e09768ff759e27ace0..5147f67c87ba3b8912a8ae24f876a9e9
private String descriptionId;
@Nullable
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
-index d33c2d2ec285179614d21a255cea394682e4cc2c..65aedffad9bef4ab80eb835e9c05b6d411f6bb15 100644
+index 53a8e9a63b2ea5f698acbd80b2eca9e3e3cfedb8..a35e3f54cbec83e8c691b6f61d4e1ac1ece6156d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -22,10 +22,12 @@ import org.bukkit.inventory.InventoryHolder;
@@ -1667,7 +1654,7 @@ index d33c2d2ec285179614d21a255cea394682e4cc2c..65aedffad9bef4ab80eb835e9c05b6d4
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
public CraftPersistentDataContainer persistentDataContainer;
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-index f263022e1d15e78b51cfd148cf024b9a8c761898..52eda58a085d0a7b6329dd4791e05edf2f644df3 100644
+index 73a99db6c31dec822514392a6102b7f8cc3b2738..5496c9ae4af9658164098356532da47351808b51 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -661,6 +661,7 @@ public class LevelChunk extends ChunkAccess {
@@ -1687,10 +1674,10 @@ index f263022e1d15e78b51cfd148cf024b9a8c761898..52eda58a085d0a7b6329dd4791e05edf
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
-index ed639dbb4ea94839390778654c7dd0437bac41ac..1729af83b979e35a585c8d049b14dc23ddf23803 100644
+index 95abf42577725383a2b49242c28b81beef487ee5..4e5cfc508e356691a9a249013553f97e77c213b0 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
-@@ -488,13 +488,10 @@ public class ChunkSerializer {
+@@ -490,13 +490,10 @@ public class ChunkSerializer {
ListTag nbttaglist1 = ChunkSerializer.getListOfCompoundsOrNull(nbt, "block_entities");
return nbttaglist == null && nbttaglist1 == null ? null : (chunk) -> {
@@ -1704,7 +1691,7 @@ index ed639dbb4ea94839390778654c7dd0437bac41ac..1729af83b979e35a585c8d049b14dc23
if (nbttaglist1 != null) {
for (int i = 0; i < nbttaglist1.size(); ++i) {
CompoundTag nbttagcompound1 = nbttaglist1.getCompound(i);
-@@ -512,7 +509,6 @@ public class ChunkSerializer {
+@@ -514,7 +511,6 @@ public class ChunkSerializer {
}
}
}
@@ -1713,10 +1700,10 @@ index ed639dbb4ea94839390778654c7dd0437bac41ac..1729af83b979e35a585c8d049b14dc23
};
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 355a6af98163079bc60c77d6fb88cd7023264a1b..20d80a7320c6ab9f9e9bd245c4a6e0542b670758 100644
+index eac877cda0cd37d8717c770b86b590213ee0567e..14b028b75470b164e64a60cc47a2938ba54b3652 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2288,12 +2288,31 @@ public final class CraftServer implements Server {
+@@ -2280,12 +2280,31 @@ public final class CraftServer implements Server {
private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
{
@@ -2114,7 +2101,7 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae
this.value = value;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
-index 8cb510615bc8b4638b4aadfd9732c9a3d65b1fac..e0ba1608d83c6007717df3323b916a92906f5a17 100644
+index bc89c976e763ec137066f8517dbcc1a3d43303bd..c7a8e3b4ff46727d7f186497ff0288284eaa6d3b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -182,6 +182,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
diff --git a/patches/server/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch
index b7607423b2..3dc766b221 100644
--- a/patches/server/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch
+++ b/patches/server/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch
@@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 20d80a7320c6ab9f9e9bd245c4a6e0542b670758..c9521d383c77eab823072c0d7569b76b75678d28 100644
+index 14b028b75470b164e64a60cc47a2938ba54b3652..1fe657645c118bc381aeeda0265893a3d4644025 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -402,10 +402,15 @@ public final class CraftServer implements Server {
+@@ -398,10 +398,15 @@ public final class CraftServer implements Server {
public void loadPlugins() {
this.pluginManager.registerInterface(JavaPluginLoader.class);
@@ -29,7 +29,7 @@ index 20d80a7320c6ab9f9e9bd245c4a6e0542b670758..c9521d383c77eab823072c0d7569b76b
for (Plugin plugin : plugins) {
try {
String message = String.format("Loading %s", plugin.getDescription().getFullName());
-@@ -420,6 +425,35 @@ public final class CraftServer implements Server {
+@@ -416,6 +421,35 @@ public final class CraftServer implements Server {
}
}
@@ -66,7 +66,7 @@ index 20d80a7320c6ab9f9e9bd245c4a6e0542b670758..c9521d383c77eab823072c0d7569b76b
if (type == PluginLoadOrder.STARTUP) {
this.helpMap.clear();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 399e878210606e9addb535e4efed0ddb424160e8..707544dfd83839634dc4c1afc8e21c5c6c3d8140 100644
+index 70aa37fe043f56ef1b2f722ca946c4ac2cf4a98b..cf85183a4026fca981fcb44896d7210b5fc31c2f 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -136,6 +136,12 @@ public class Main {
diff --git a/patches/server/0012-Adventure.patch b/patches/server/0012-Adventure.patch
index 2549aab060..66087b2ec9 100644
--- a/patches/server/0012-Adventure.patch
+++ b/patches/server/0012-Adventure.patch
@@ -7,7 +7,7 @@ Co-authored-by: zml
Co-authored-by: Jake Potrebic
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
-index 756a2ab6ad416f55fa3864cff9818473840b04fc..701a2ffd04df48d437b2cb963dd150af99725b6e 100644
+index cc4c008a99bf5a16614d445d2a5e75ce2d5dedb5..043fd38598e36bb96e6d3ab1ab0966435c9aa61b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -225,4 +225,13 @@ public class PaperConfig {
@@ -1045,10 +1045,10 @@ index d5d94ea8070ab5f66f0a3244a5a953b9c9d5c527..0053474ab7c25de6d86c16e3079feb21
public > T readEnum(Class enumClass) {
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
-index b964121f19e6a28df7675e65441c551a55316753..dfeff0da932b0d66b70f3a5dd281c926c048f2f0 100644
+index 021a26a6b1c258deffc26c035ab52a4ea027d9a1..00d432bd395e7f7fb6ee24e371818d13892b2f0c 100644
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
-@@ -3,6 +3,7 @@ package net.minecraft.network;
+@@ -4,6 +4,7 @@ import com.mojang.logging.LogUtils;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
@@ -1056,7 +1056,7 @@ index b964121f19e6a28df7675e65441c551a55316753..dfeff0da932b0d66b70f3a5dd281c926
import java.io.IOException;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketFlow;
-@@ -36,6 +37,7 @@ public class PacketEncoder extends MessageToByteEncoder> {
+@@ -33,6 +34,7 @@ public class PacketEncoder extends MessageToByteEncoder> {
} else {
FriendlyByteBuf friendlyByteBuf = new FriendlyByteBuf(byteBuf);
friendlyByteBuf.writeVarInt(integer);
@@ -1218,7 +1218,7 @@ index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490
buf.writeComponent(this.footer);
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 925ffbddd5475be7fe00570d861b615f707434b4..a3436596d05547a60c9906c92f709bb56a9175bd 100644
+index 9d7d7a44616b2b7849c1abd3b9ac77305fdb0815..592b288c5ded992dc3fdf0db5ed0845884c5be93 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -145,6 +145,7 @@ import net.minecraft.world.scores.Score;
@@ -1292,11 +1292,11 @@ index 925ffbddd5475be7fe00570d861b615f707434b4..a3436596d05547a60c9906c92f709bb5
// CraftBukkit end
this.chatVisibility = packet.chatVisibility();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index ea652f6394c7e575ce06a6b691d8b2c442eafb03..306af349e96967d21ee0dda9cac04d4507bf5b00 100644
+index 443124a72eef9f60e2941b932a13471dbf1c4f72..9b47d8ab57c3b290173247ba25ad7668f3529903 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -154,6 +154,8 @@ import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
+@@ -155,6 +155,8 @@ import org.apache.commons.lang3.StringUtils;
+ import org.slf4j.Logger;
// CraftBukkit start
+import io.papermc.paper.adventure.ChatProcessor; // Paper
@@ -1304,7 +1304,7 @@ index ea652f6394c7e575ce06a6b691d8b2c442eafb03..306af349e96967d21ee0dda9cac04d45
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicInteger;
import net.minecraft.world.entity.animal.Bucketable;
-@@ -382,21 +384,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -383,21 +385,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return this.server.isSingleplayerOwner(this.player.getGameProfile());
}
@@ -1337,7 +1337,7 @@ index ea652f6394c7e575ce06a6b691d8b2c442eafb03..306af349e96967d21ee0dda9cac04d45
if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event);
-@@ -407,8 +412,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -408,8 +413,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return;
}
// Send the possibly modified leave message
@@ -1347,7 +1347,7 @@ index ea652f6394c7e575ce06a6b691d8b2c442eafb03..306af349e96967d21ee0dda9cac04d45
// CraftBukkit end
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), (future) -> {
-@@ -1669,9 +1673,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1684,9 +1688,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
*/
this.player.disconnect();
@@ -1362,7 +1362,7 @@ index ea652f6394c7e575ce06a6b691d8b2c442eafb03..306af349e96967d21ee0dda9cac04d45
}
// CraftBukkit end
this.player.getTextFilter().leave();
-@@ -1853,7 +1859,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1868,7 +1874,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.handleCommand(s);
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin
@@ -1376,7 +1376,7 @@ index ea652f6394c7e575ce06a6b691d8b2c442eafb03..306af349e96967d21ee0dda9cac04d45
Player player = this.getCraftPlayer();
AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server));
this.cserver.getPluginManager().callEvent(event);
-@@ -2643,30 +2654,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2667,30 +2678,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
return;
}
@@ -1416,18 +1416,10 @@ index ea652f6394c7e575ce06a6b691d8b2c442eafb03..306af349e96967d21ee0dda9cac04d45
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-index 8cf42a52732301d0216a348f588d58877d60cb0d..08e7fd48514f9a6e89efc0d8adcbcf14bc92b103 100644
+index 2b9b60c0010069916dbecd22efdb9cec71180363..627931ec09bfb1a84f0659981491cf3b6425aa32 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-@@ -36,6 +36,7 @@ import net.minecraft.world.entity.player.Player;
- import org.apache.commons.lang3.Validate;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
-+import io.papermc.paper.adventure.PaperAdventure; // Paper
- import org.bukkit.craftbukkit.util.Waitable;
- import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
- import org.bukkit.event.player.PlayerPreLoginEvent;
-@@ -316,7 +317,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -323,7 +323,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) {
final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId);
if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) {
@@ -1436,18 +1428,18 @@ index 8cf42a52732301d0216a348f588d58877d60cb0d..08e7fd48514f9a6e89efc0d8adcbcf14
}
Waitable waitable = new Waitable() {
@Override
-@@ -327,12 +328,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -334,12 +334,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable);
if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) {
- ServerLoginPacketListenerImpl.this.disconnect(event.getKickMessage());
-+ ServerLoginPacketListenerImpl.this.disconnect(PaperAdventure.asVanilla(event.kickMessage())); // Paper - Adventure
++ ServerLoginPacketListenerImpl.this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.kickMessage())); // Paper - Adventure
return;
}
} else {
if (asyncEvent.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) {
- ServerLoginPacketListenerImpl.this.disconnect(asyncEvent.getKickMessage());
-+ ServerLoginPacketListenerImpl.this.disconnect(PaperAdventure.asVanilla(asyncEvent.kickMessage())); // Paper - Adventure
++ ServerLoginPacketListenerImpl.this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(asyncEvent.kickMessage())); // Paper - Adventure
return;
}
}
@@ -1465,10 +1457,10 @@ index c9a8d64ef23def0ad8e986a97c34331b8d54c205..2b24a41587fbe1fba70a0ab42d3dc333
@Override
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index 1be4b3ad18d314b0460ce61e01afd0d7d16aee69..96e1618a55597b0a3ac533a3610ba146395b5725 100644
+index 5fa0ce6a7f6b8df8993315a9784764f57d59bcf4..bfec1beb0af39e2af6be7c6423bf1eaab32e1062 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -8,6 +8,7 @@ import com.mojang.authlib.GameProfile;
+@@ -9,6 +9,7 @@ import com.mojang.logging.LogUtils;
import com.mojang.serialization.DataResult;
import com.mojang.serialization.Dynamic;
import io.netty.buffer.Unpooled;
@@ -1476,8 +1468,8 @@ index 1be4b3ad18d314b0460ce61e01afd0d7d16aee69..96e1618a55597b0a3ac533a3610ba146
import java.io.File;
import java.net.SocketAddress;
import java.nio.file.Path;
-@@ -91,6 +92,7 @@ import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
+@@ -91,6 +92,7 @@ import net.minecraft.world.scores.Team;
+ import org.slf4j.Logger;
// CraftBukkit start
+import io.papermc.paper.adventure.PaperAdventure; // Paper
@@ -1589,7 +1581,7 @@ index 1be4b3ad18d314b0460ce61e01afd0d7d16aee69..96e1618a55597b0a3ac533a3610ba146
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/BossEvent.java b/src/main/java/net/minecraft/world/BossEvent.java
-index d289e8321a62f7c8d1e5b83f038e7331a26fc24e..58716ba8f8d12a410bdc66ccef6a61c62fddfbb7 100644
+index 4c62df5a3781ec9df4a5c5f1b528649e6e8a62d1..affd1b8c7589ba59330dc0b6fc803cce4ee57397 100644
--- a/src/main/java/net/minecraft/world/BossEvent.java
+++ b/src/main/java/net/minecraft/world/BossEvent.java
@@ -13,6 +13,7 @@ public abstract class BossEvent {
@@ -1618,9 +1610,9 @@ index d289e8321a62f7c8d1e5b83f038e7331a26fc24e..58716ba8f8d12a410bdc66ccef6a61c6
return this.progress;
}
- public void setProgress(float percentage) {
-+ if (this.adventure != null) this.adventure.progress(percentage); // Paper
- this.progress = percentage;
+ public void setProgress(float percent) {
++ if (this.adventure != null) this.adventure.progress(percent); // Paper
+ this.progress = percent;
}
public BossEvent.BossBarColor getColor() {
@@ -1677,11 +1669,11 @@ index d289e8321a62f7c8d1e5b83f038e7331a26fc24e..58716ba8f8d12a410bdc66ccef6a61c6
}
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
-index 9af14095fa8dbc75fadb84c5a1d263039994e441..3b35ec1df648a3de920ea0c15962388044737bbc 100644
+index 595b56b2ab9a813ba71399d306117294fa90dc65..3527d40102d512d0e276edc969ea3c189aa34ec2 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
-@@ -33,6 +33,7 @@ import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
+@@ -33,6 +33,7 @@ import net.minecraft.world.level.saveddata.SavedData;
+ import org.slf4j.Logger;
// CraftBukkit start
+import io.papermc.paper.adventure.PaperAdventure; // Paper
@@ -1698,10 +1690,10 @@ index 9af14095fa8dbc75fadb84c5a1d263039994e441..3b35ec1df648a3de920ea0c159623880
}
collection = icons;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index c9521d383c77eab823072c0d7569b76b75678d28..66bceb7bd8aa4aa1d398d4d011d59f8441276c7b 100644
+index 1fe657645c118bc381aeeda0265893a3d4644025..e577c2fb100c217faeaf2d85d6a4374d6de047e1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -623,8 +623,10 @@ public final class CraftServer implements Server {
+@@ -619,8 +619,10 @@ public final class CraftServer implements Server {
}
@Override
@@ -1712,7 +1704,7 @@ index c9521d383c77eab823072c0d7569b76b75678d28..66bceb7bd8aa4aa1d398d4d011d59f84
}
@Override
-@@ -1457,7 +1459,15 @@ public final class CraftServer implements Server {
+@@ -1449,7 +1451,15 @@ public final class CraftServer implements Server {
return this.configuration.getInt("settings.spawn-radius", -1);
}
@@ -1728,7 +1720,7 @@ index c9521d383c77eab823072c0d7569b76b75678d28..66bceb7bd8aa4aa1d398d4d011d59f84
public String getShutdownMessage() {
return this.configuration.getString("settings.shutdown-message");
}
-@@ -1615,7 +1625,20 @@ public final class CraftServer implements Server {
+@@ -1607,7 +1617,20 @@ public final class CraftServer implements Server {
}
@Override
@@ -1749,7 +1741,7 @@ index c9521d383c77eab823072c0d7569b76b75678d28..66bceb7bd8aa4aa1d398d4d011d59f84
Set recipients = new HashSet<>();
for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {
if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
-@@ -1623,14 +1646,14 @@ public final class CraftServer implements Server {
+@@ -1615,14 +1638,14 @@ public final class CraftServer implements Server {
}
}
@@ -1766,7 +1758,7 @@ index c9521d383c77eab823072c0d7569b76b75678d28..66bceb7bd8aa4aa1d398d4d011d59f84
for (CommandSender recipient : recipients) {
recipient.sendMessage(message);
-@@ -1881,6 +1904,14 @@ public final class CraftServer implements Server {
+@@ -1873,6 +1896,14 @@ public final class CraftServer implements Server {
return CraftInventoryCreator.INSTANCE.createInventory(owner, type);
}
@@ -1781,7 +1773,7 @@ index c9521d383c77eab823072c0d7569b76b75678d28..66bceb7bd8aa4aa1d398d4d011d59f84
@Override
public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) {
Validate.isTrue(type.isCreatable(), "Cannot open an inventory of type ", type);
-@@ -1893,13 +1924,28 @@ public final class CraftServer implements Server {
+@@ -1885,13 +1916,28 @@ public final class CraftServer implements Server {
return CraftInventoryCreator.INSTANCE.createInventory(owner, size);
}
@@ -1810,7 +1802,7 @@ index c9521d383c77eab823072c0d7569b76b75678d28..66bceb7bd8aa4aa1d398d4d011d59f84
public Merchant createMerchant(String title) {
return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title);
}
-@@ -1959,6 +2005,12 @@ public final class CraftServer implements Server {
+@@ -1951,6 +1997,12 @@ public final class CraftServer implements Server {
return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog)
}
@@ -1823,7 +1815,7 @@ index c9521d383c77eab823072c0d7569b76b75678d28..66bceb7bd8aa4aa1d398d4d011d59f84
@Override
public String getMotd() {
return this.console.getMotd();
-@@ -2402,5 +2454,15 @@ public final class CraftServer implements Server {
+@@ -2394,5 +2446,15 @@ public final class CraftServer implements Server {
return null;
}
}
@@ -1840,10 +1832,10 @@ index c9521d383c77eab823072c0d7569b76b75678d28..66bceb7bd8aa4aa1d398d4d011d59f84
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 962ee738a4cce4d3bd87bfb9b481c6f158ee9756..1d0c745673bfb14966c6d644825604260f2bc69f 100644
+index 794ed40db102370338ee227ffa4e1801fd741284..5963fa56e7dcd61336a14fa1035c6c14143989ad 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -139,6 +139,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -142,6 +142,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
private final BlockMetadataStore blockMetadata = new BlockMetadataStore(this);
private final Object2IntOpenHashMap spawnCategoryLimit = new Object2IntOpenHashMap<>();
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftWorld.DATA_TYPE_REGISTRY);
@@ -1851,7 +1843,7 @@ index 962ee738a4cce4d3bd87bfb9b481c6f158ee9756..1d0c745673bfb14966c6d64482560426
private static final Random rand = new Random();
-@@ -1859,4 +1860,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1862,4 +1863,18 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return this.spigot;
}
// Spigot end
@@ -1871,7 +1863,7 @@ index 962ee738a4cce4d3bd87bfb9b481c6f158ee9756..1d0c745673bfb14966c6d64482560426
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 707544dfd83839634dc4c1afc8e21c5c6c3d8140..c508bfb68bb4bfd06aa0cefa5bfc0bec725a6b03 100644
+index cf85183a4026fca981fcb44896d7210b5fc31c2f..7e5fc58f43836edab3696b9644264434c5a95a2f 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 {
@@ -3520,7 +3512,7 @@ index f9b7b8f7ccc95b73967a51420fd6ce88d80d75fe..0de5a46423ae0403dcbfca630dfd7c5a
boolean hadFormat = false;
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
-index e0ba1608d83c6007717df3323b916a92906f5a17..aea6f16d767a7cc7934688b550376338c63fd807 100644
+index c7a8e3b4ff46727d7f186497ff0288284eaa6d3b..964d15cd3b61a33868e5a9e38d21d97ec144bcad 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -66,6 +66,38 @@ public final class CraftMagicNumbers implements UnsafeValues {
diff --git a/patches/server/0013-Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/0013-Configurable-cactus-bamboo-and-reed-growth-heights.patch
index 94ed00ecde..43e88d37d9 100644
--- a/patches/server/0013-Configurable-cactus-bamboo-and-reed-growth-heights.patch
+++ b/patches/server/0013-Configurable-cactus-bamboo-and-reed-growth-heights.patch
@@ -28,10 +28,10 @@ index 4adf44026fc6269934dfa4513f06a7f8a3b41f90..791ccdebd5d37afd83eb87671034b355
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/block/BambooBlock.java b/src/main/java/net/minecraft/world/level/block/BambooBlock.java
-index 517140666109ae27177c70ca0a41b0a9f636c9c6..1f2d9ae9593193b478375b7b03d6f9fda80a8bca 100644
+index f088f866b8f28d2627e4a60527a1f8dfa243bb47..482d6cd1065df5b0703301d403efb42ca4d5363b 100644
--- a/src/main/java/net/minecraft/world/level/block/BambooBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BambooBlock.java
-@@ -136,7 +136,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
+@@ -135,7 +135,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
if (random.nextInt(Math.max(1, (int) (100.0F / world.spigotConfig.bambooModifier) * 3)) == 0 && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { // Spigot
int i = this.getHeightBelowUpToMax(world, pos) + 1;
@@ -40,7 +40,7 @@ index 517140666109ae27177c70ca0a41b0a9f636c9c6..1f2d9ae9593193b478375b7b03d6f9fd
this.growBamboo(state, world, pos, random, i);
}
}
-@@ -167,7 +167,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
+@@ -166,7 +166,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
int i = this.getHeightAboveUpToMax(world, pos);
int j = this.getHeightBelowUpToMax(world, pos);
@@ -49,7 +49,7 @@ index 517140666109ae27177c70ca0a41b0a9f636c9c6..1f2d9ae9593193b478375b7b03d6f9fd
}
@Override
-@@ -186,7 +186,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
+@@ -185,7 +185,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
BlockPos blockposition1 = pos.above(i);
BlockState iblockdata1 = world.getBlockState(blockposition1);
@@ -58,7 +58,7 @@ index 517140666109ae27177c70ca0a41b0a9f636c9c6..1f2d9ae9593193b478375b7b03d6f9fd
return;
}
-@@ -227,7 +227,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
+@@ -226,7 +226,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
}
int j = (Integer) state.getValue(BambooBlock.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1;
@@ -67,7 +67,7 @@ index 517140666109ae27177c70ca0a41b0a9f636c9c6..1f2d9ae9593193b478375b7b03d6f9fd
// CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, pos, pos.above(), (BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(BambooBlock.AGE, j)).setValue(BambooBlock.LEAVES, blockpropertybamboosize)).setValue(BambooBlock.STAGE, k), 3)) {
-@@ -242,7 +242,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
+@@ -241,7 +241,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
protected int getHeightAboveUpToMax(BlockGetter world, BlockPos pos) {
int i;
@@ -76,7 +76,7 @@ index 517140666109ae27177c70ca0a41b0a9f636c9c6..1f2d9ae9593193b478375b7b03d6f9fd
;
}
-@@ -252,7 +252,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
+@@ -251,7 +251,7 @@ public class BambooBlock extends Block implements BonemealableBlock {
protected int getHeightBelowUpToMax(BlockGetter world, BlockPos pos) {
int i;
@@ -86,10 +86,10 @@ index 517140666109ae27177c70ca0a41b0a9f636c9c6..1f2d9ae9593193b478375b7b03d6f9fd
}
diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
-index a851df8e25781963edb066c46ae75a87ef63a66d..00ada22889dafb7ae8e8740cd3eb8370fbb417eb 100644
+index b6b769fb354187cb31f878b87cce63049c0c7cf8..f1bbfc85582d29a50a82f9207509985dcb76b693 100644
--- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
-@@ -56,7 +56,7 @@ public class CactusBlock extends Block {
+@@ -55,7 +55,7 @@ public class CactusBlock extends Block {
;
}
@@ -99,10 +99,10 @@ index a851df8e25781963edb066c46ae75a87ef63a66d..00ada22889dafb7ae8e8740cd3eb8370
if (j >= (byte) range(3, ((100.0F / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot
diff --git a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
-index f57884fa5f0fbbdbf35c22e692da4f9b6f3f98cc..9b30b359f1559e5f97c3b2a7acffda5b39605e6b 100644
+index d40492e9729f165ed944ab2c9fa81cde042ce49c..66c06e0f7c8d223a2b00bab57a15e3a705fe176a 100644
--- a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
-@@ -53,7 +53,7 @@ public class SugarCaneBlock extends Block {
+@@ -52,7 +52,7 @@ public class SugarCaneBlock extends Block {
;
}
diff --git a/patches/server/0015-Configurable-fishing-time-ranges.patch b/patches/server/0015-Configurable-fishing-time-ranges.patch
index d392e44e3b..9b62e01dba 100644
--- a/patches/server/0015-Configurable-fishing-time-ranges.patch
+++ b/patches/server/0015-Configurable-fishing-time-ranges.patch
@@ -22,10 +22,10 @@ index ec3fb557fa31b153de20c4990066182a774dd489..5896b4e4646d722db5622a424fa26f42
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
-index 73c5a0e6f1db6bf438fe516e213f40f0645ed954..b11f97e4ecc8d623d8a8a69e9e7a6205b96072f1 100644
+index 67fe1a436ca7b0069fabc3a1bfd0206babf07b8a..24192a91d9f5c890a316ec150d4aec84073cb61a 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
-@@ -82,6 +82,10 @@ public class FishingHook extends Projectile {
+@@ -85,6 +85,10 @@ public class FishingHook extends Projectile {
this.noCulling = true;
this.luck = Math.max(0, luckOfTheSeaLevel);
this.lureSpeed = Math.max(0, lureLevel);
@@ -36,7 +36,7 @@ index 73c5a0e6f1db6bf438fe516e213f40f0645ed954..b11f97e4ecc8d623d8a8a69e9e7a6205
}
public FishingHook(EntityType extends FishingHook> type, Level world) {
-@@ -397,7 +401,7 @@ public class FishingHook extends Projectile {
+@@ -400,7 +404,7 @@ public class FishingHook extends Projectile {
} else {
// CraftBukkit start - logic to modify fishing wait time
this.timeUntilLured = Mth.nextInt(this.random, this.minWaitTime, this.maxWaitTime);
diff --git a/patches/server/0016-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/0016-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
index ad53f41d05..6da6ebc0b4 100644
--- a/patches/server/0016-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
+++ b/patches/server/0016-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
@@ -19,10 +19,10 @@ index 5896b4e4646d722db5622a424fa26f42d3f8d9ff..0a6e98ca5534430540044a32c280e568
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 68ccbc193ff6682f505928dc0a29ee990349d299..3321df3bcc0b92277dc18b7f6efa42393e657a52 100644
+index 04692fe4e7f2107ffc8c48cebdf88e18e58f4ce9..8a4f4582a6bd69016a36d611f9c4ac2262f7f3ec 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -1265,6 +1265,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -1278,6 +1278,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
return this.isInWater() || this.isInRain();
}
@@ -31,7 +31,7 @@ index 68ccbc193ff6682f505928dc0a29ee990349d299..3321df3bcc0b92277dc18b7f6efa4239
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 31f98763da600c34246d722cb92dda4442a3f046..1703bc12cd2c04fb34ebe025f305dc7fb2de1864 100644
+index 711c130a6d725d8a7f2a77e74b51c6123d7856d2..84ac8d7dca08495c2d1be9901c59546245a84c11 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -105,6 +105,7 @@ public abstract class Mob extends LivingEntity {
diff --git a/patches/server/0018-Allow-for-toggling-of-spawn-chunks.patch b/patches/server/0018-Allow-for-toggling-of-spawn-chunks.patch
index a5337bb7bf..da729250d4 100644
--- a/patches/server/0018-Allow-for-toggling-of-spawn-chunks.patch
+++ b/patches/server/0018-Allow-for-toggling-of-spawn-chunks.patch
@@ -20,10 +20,10 @@ index 6ee62d06cc2b59c06d0f7acfb59384075aa6521c..9b908c5c66dc454faa479430a908dda0
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 72fd18a307a7e1f769195c7ef44a12bb47f2f49c..3914d0e21b36a480c68c091478ab282826d2b1ae 100644
+index d097223e30de74d5347792fb6d0eecb254099f73..1cb128fb60636016db826ab3120d586346d88cec 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -239,6 +239,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -238,6 +238,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
});
// CraftBukkit end
timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
diff --git a/patches/server/0019-Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/0019-Drop-falling-block-and-tnt-entities-at-the-specified.patch
index fb63af439d..760b6c69a1 100644
--- a/patches/server/0019-Drop-falling-block-and-tnt-entities-at-the-specified.patch
+++ b/patches/server/0019-Drop-falling-block-and-tnt-entities-at-the-specified.patch
@@ -25,10 +25,10 @@ index 9b908c5c66dc454faa479430a908dda0745638c8..6dec1bb96d695f28aae6517e4d782491
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
-index a292a449deb820ce1d7cbeb5d04702b10643ee50..1cc849fadd1e1cf4ef1d1009c8e42febe92a6e28 100644
+index eb67ba3ce1ea68eb5db62f68bf48853fe5023f12..8e7479afd3579e6b732feca059c1e4df1160e450 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
-@@ -136,6 +136,17 @@ public class FallingBlockEntity extends Entity {
+@@ -130,6 +130,17 @@ public class FallingBlockEntity extends Entity {
}
this.move(MoverType.SELF, this.getDeltaMovement());
@@ -44,7 +44,7 @@ index a292a449deb820ce1d7cbeb5d04702b10643ee50..1cc849fadd1e1cf4ef1d1009c8e42feb
+ }
+ // Paper end
if (!this.level.isClientSide) {
- blockposition = this.blockPosition();
+ BlockPos blockposition = this.blockPosition();
boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock;
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
index 9fa752370a43f6d91c019316914a033f213e7126..1f61dcc3d6f33f69fbebaaaee0554403c3e13adf 100644
diff --git a/patches/server/0020-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0020-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
index a285680f9a..4ff448a675 100644
--- a/patches/server/0020-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
+++ b/patches/server/0020-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang
diff --git a/src/main/java/net/minecraft/server/Eula.java b/src/main/java/net/minecraft/server/Eula.java
-index 2c53a400611c78236c5a1c1270d27c02e94251bf..a1d5c0f8fe2adb2ee56f3217e089211ec7c61eb0 100644
+index f092497b6defd28c94393e483a9288d121158a1e..df44790b1c342d0a6ff794bea86319fa7498cbae 100644
--- a/src/main/java/net/minecraft/server/Eula.java
+++ b/src/main/java/net/minecraft/server/Eula.java
@@ -64,7 +64,7 @@ public class Eula {
@@ -19,10 +19,10 @@ index 2c53a400611c78236c5a1c1270d27c02e94251bf..a1d5c0f8fe2adb2ee56f3217e089211e
if (outputStream != null) {
try {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index eba857195121c58d1b63c58904fd4754a8020219..6b9d947484f0b55a86c3ee27c199669153c0a5ea 100644
+index aca0adb9f714f96b10546b837d08fe9ef90b4d89..905dbf6bb3fbbdf7b463c9b9baa59f54b83c3687 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1427,7 +1427,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop withinDistance(double x, double y, double z, double max) {
double d4 = max * max;
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index 07f37c1ca6a98ad8199c873556aac2e9de60fe81..0c0886fe46ad65678a6c6da89659e5991908ba7a 100644
+index 9b06b17c36b76447e75d0d790ba3e352442286da..321276281134ef692f9e50d21a84a135e09a0754 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -774,7 +774,7 @@ public abstract class Mob extends LivingEntity {
@@ -34,10 +34,10 @@ index 07f37c1ca6a98ad8199c873556aac2e9de60fe81..0c0886fe46ad65678a6c6da89659e599
if (entityhuman != null) {
double d0 = entityhuman.distanceToSqr((Entity) this);
diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
-index 53106d7bbfeaaf52bbe69471e70670412e8bdfd3..195cdae3f3a9fe8ecab2895a6000f6f855e9a9b8 100644
+index 6eaedfabf70b604705ad9a772a2e602c8590b500..97c2c1647fa12650e5963c7c1c746fec2429e3d7 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
-@@ -125,7 +125,7 @@ public class Silverfish extends Monster {
+@@ -127,7 +127,7 @@ public class Silverfish extends Monster {
if (checkAnyLightMonsterSpawnRules(type, world, spawnReason, pos, random)) {
Player entityhuman = world.getNearestPlayer((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, 5.0D, true);
@@ -47,10 +47,10 @@ index 53106d7bbfeaaf52bbe69471e70670412e8bdfd3..195cdae3f3a9fe8ecab2895a6000f6f8
return false;
}
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
-index ebe55b9c8e93fec1a1f7efca86d5d3968d1df200..90eb40ee3bf20dcbeb69ead753d424387a0ef42f 100644
+index 612de4e8c26fd41d300ac09eb59d1ceac248778e..71610fa70cdaf3c5a54250a5814809013a6d228e 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
-@@ -174,6 +174,9 @@ public abstract class Player extends LivingEntity {
+@@ -175,6 +175,9 @@ public abstract class Player extends LivingEntity {
private final ItemCooldowns cooldowns;
@Nullable
public FishingHook fishing;
@@ -61,7 +61,7 @@ index ebe55b9c8e93fec1a1f7efca86d5d3968d1df200..90eb40ee3bf20dcbeb69ead753d42438
// CraftBukkit start
public boolean fauxSleeping;
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
-index a30780611b6842e35579f0ca11d75161bf365c70..4be2833b03d24e5d87c23f04c248fbe4b0ca9e59 100644
+index 212b23a380a4bcdb1d2995ca2ccfc8a1709691bd..31bfc0c491c9a4cc6782b6c284121f96972517ea 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -51,7 +51,7 @@ public abstract class BaseSpawner {
diff --git a/patches/server/0025-Further-improve-server-tick-loop.patch b/patches/server/0025-Further-improve-server-tick-loop.patch
index 64dda56b65..3dab3a2855 100644
--- a/patches/server/0025-Further-improve-server-tick-loop.patch
+++ b/patches/server/0025-Further-improve-server-tick-loop.patch
@@ -12,10 +12,10 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 6b9d947484f0b55a86c3ee27c199669153c0a5ea..b16c2c8e173d906097ee9ac3edace1334da11a4b 100644
+index 905dbf6bb3fbbdf7b463c9b9baa59f54b83c3687..9f7d562131c7b4e5bf1e5028c6e4734f73b395d8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -282,7 +282,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue();
public int autosavePeriod;
public Commands vanillaCommandDispatcher;
-@@ -291,7 +291,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop playerView;
public int reloadCount;
@@ -17,7 +17,7 @@ index c50fdc09494895eaf6813493bdc6a370089d4240..c77db10a1c33266da8d4578e828ff039
static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index fdbcf4989f72e1604a2841f565adfeebf8d45622..1e0b8314ef388763aa43055909e48778f0d421a3 100644
+index fdbcf4989f72e1604a2841f565adfeebf8d45622..4ebd7609ec2bf62586feef4da7605dbb89569567 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -438,10 +438,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -25,7 +25,7 @@ index fdbcf4989f72e1604a2841f565adfeebf8d45622..1e0b8314ef388763aa43055909e48778
Preconditions.checkArgument(velocity != null, "velocity");
velocity.checkFinite();
+ // Paper start - Warn server owners when plugins try to set super high velocities
-+ if (!(this instanceof org.bukkit.entity.Projectile || this instanceof org.bukkit.entity.Minecart) && isUnsafeVelocity(velocity)) {
++ if (!(this instanceof org.bukkit.entity.Projectile) && isUnsafeVelocity(velocity)) {
+ CraftServer.excessiveVelEx = new Exception("Excessive velocity set detected: tried to set velocity of entity " + entity.getScoreboardName() + " id #" + getEntityId() + " to (" + velocity.getX() + "," + velocity.getY() + "," + velocity.getZ() + ").");
+ }
+ // Paper end
diff --git a/patches/server/0056-Add-exception-reporting-event.patch b/patches/server/0056-Add-exception-reporting-event.patch
index f3252eb165..43d56e2539 100644
--- a/patches/server/0056-Add-exception-reporting-event.patch
+++ b/patches/server/0056-Add-exception-reporting-event.patch
@@ -49,19 +49,19 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 5d1ac4e7afa0f1d9c9face049f768a2030eb411f..85af59ffb6b11ae1980fef5ef449031c78626b9a 100644
+index 9aaf392876119cfda46f3e80d02020d0e748ae44..a10848e6899853f447f101675e3a6aba9d3d43f3 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -919,6 +919,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -973,6 +973,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return true;
} catch (Exception exception) {
- ChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception);
+ ChunkMap.LOGGER.error("Failed to save chunk {},{}", new Object[]{chunkcoordintpair.x, chunkcoordintpair.z, exception});
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper
return false;
}
}
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
-index 38403f62a9539382d5330f9231fe9ef618b87c21..876658b685ea09adb4c01d436da56daadb7eedaa 100644
+index 7b84b20a4de0d6e95a1d47cb077abd0e00a2336c..b7b98832be6178a2bca534bf974519ede977b282 100644
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
@@ -1,5 +1,6 @@
@@ -88,27 +88,19 @@ index 38403f62a9539382d5330f9231fe9ef618b87c21..876658b685ea09adb4c01d436da56daa
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java b/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java
-index 4cde8d630a0951f297622af4ef781f5b3fabf9af..7044d8c71e85551e11bf2d96b767e08811bdb9fe 100644
+index 1a9dfd8411bb8affdb3ff4c003433ecab203b004..5e526d0feda11d6b73f71b965aa098e0a79457d1 100644
--- a/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java
+++ b/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java
-@@ -1,5 +1,7 @@
- package net.minecraft.world.entity.ai.village;
-
-+import com.destroystokyo.paper.exception.ServerInternalException;
-+
- import java.util.Iterator;
- import javax.annotation.Nullable;
- import net.minecraft.core.BlockPos;
-@@ -118,6 +120,7 @@ public class VillageSiege implements CustomSpawner {
+@@ -118,6 +118,7 @@ public class VillageSiege implements CustomSpawner {
entityzombie.finalizeSpawn(world, world.getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.EVENT, (SpawnGroupData) null, (CompoundTag) null);
} catch (Exception exception) {
VillageSiege.LOGGER.warn("Failed to create zombie for village siege at {}", vec3d, exception);
-+ ServerInternalException.reportInternalException(exception); // Paper
++ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper
return;
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 0e5142f6479787ab26a22b9ec935c3d09a8dfd2c..389cb85aa369dff606b21c10fcbf4825c17bbd4f 100644
+index 922b234865ff5d64049d634d0356f9a068bc8a8c..d923cc91a8f1e71831be8ded1b4818ac3b48fc34 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1,5 +1,10 @@
@@ -122,7 +114,7 @@ index 0e5142f6479787ab26a22b9ec935c3d09a8dfd2c..389cb85aa369dff606b21c10fcbf4825
import com.google.common.collect.Lists;
import com.mojang.serialization.Codec;
import java.io.IOException;
-@@ -739,6 +744,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -738,6 +743,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper start - Prevent tile entity and entity crashes
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, throwable);
@@ -131,7 +123,7 @@ index 0e5142f6479787ab26a22b9ec935c3d09a8dfd2c..389cb85aa369dff606b21c10fcbf4825
// Paper end
}
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
-index 5e2a3baf46175dd92958f47c4503bb8d6f6a0941..373fbdf56dddbae5f793585e31c7e4ff6d31823b 100644
+index 8d4efe65baf28760ee68cecd7ef7c8e65a2912ba..b8666d46e85bc7e9e3a05b4ebd65f59138ac55d1 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -289,6 +289,7 @@ public final class NaturalSpawner {
@@ -142,7 +134,7 @@ index 5e2a3baf46175dd92958f47c4503bb8d6f6a0941..373fbdf56dddbae5f793585e31c7e4ff
return null;
}
}
-@@ -395,6 +396,7 @@ public final class NaturalSpawner {
+@@ -401,6 +402,7 @@ public final class NaturalSpawner {
entity = biomesettingsmobs_c.type.create(world.getLevel());
} catch (Exception exception) {
NaturalSpawner.LOGGER.warn("Failed to create mob", exception);
@@ -151,7 +143,7 @@ index 5e2a3baf46175dd92958f47c4503bb8d6f6a0941..373fbdf56dddbae5f793585e31c7e4ff
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-index 949d8cc16c91390ea573dd566bec566dc95efc18..3ba9f8d7dc12709670dcd94df5d82b8d44f983fa 100644
+index 98fe6a1d2866d029383a5a5d60a2635d2d421f1e..1ddc917772d701ac7b8800df44da890b9b6a6113 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -1,6 +1,7 @@
@@ -161,7 +153,7 @@ index 949d8cc16c91390ea573dd566bec566dc95efc18..3ba9f8d7dc12709670dcd94df5d82b8d
+import com.destroystokyo.paper.exception.ServerInternalException;
import com.google.common.collect.Maps;
import com.google.common.collect.UnmodifiableIterator;
- import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
+ import com.mojang.logging.LogUtils;
@@ -549,10 +550,15 @@ public class LevelChunk extends ChunkAccess {
this.removeBlockEntity(blockEntity.getBlockPos());
// Paper end
@@ -182,7 +174,7 @@ index 949d8cc16c91390ea573dd566bec566dc95efc18..3ba9f8d7dc12709670dcd94df5d82b8d
// CraftBukkit end
}
}
-@@ -1034,6 +1040,7 @@ public class LevelChunk extends ChunkAccess {
+@@ -1032,6 +1038,7 @@ public class LevelChunk extends ChunkAccess {
// Paper start - Prevent tile entity and entity crashes
final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
@@ -191,7 +183,7 @@ index 949d8cc16c91390ea573dd566bec566dc95efc18..3ba9f8d7dc12709670dcd94df5d82b8d
// Paper end
// Spigot start
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
-index c30d7b04e8383aed7d5f3e93f42c612c685a4df7..fd70133714990ad44b4b2b80c52ffc55be8c9b63 100644
+index d51bafd2f5a763b8a49c835ab74a7cf60caa1ab6..fbf5f01a9a7968194fc85589ca7f9fa328da4881 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -274,6 +274,7 @@ public class RegionFile implements AutoCloseable {
@@ -211,7 +203,7 @@ index c30d7b04e8383aed7d5f3e93f42c612c685a4df7..fd70133714990ad44b4b2b80c52ffc55
try {
filechannel.close();
diff --git a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java
-index 68b1a5b6b27f70b0185bb8f0ed924d6d21b43323..e84b99ca10621cb1021d7ec17ba21df24e8c7474 100644
+index 5272a718178b5a2cb1df263ce0c5500c92c9ebda..0465b397b628b11a6fc52e3375945c94d68cfdd5 100644
--- a/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/DimensionDataStorage.java
@@ -120,6 +120,7 @@ public class DimensionDataStorage {
diff --git a/patches/server/0058-Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/0058-Disable-Scoreboards-for-non-players-by-default.patch
index 840919ac27..06d4465661 100644
--- a/patches/server/0058-Disable-Scoreboards-for-non-players-by-default.patch
+++ b/patches/server/0058-Disable-Scoreboards-for-non-players-by-default.patch
@@ -25,10 +25,10 @@ index ada624b5f58381122e59568c2087cf38fd2baf3e..5b55fce59db9ac3ab6030ebe8374c514
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index de15a2231057217fbbf723cf25e869998a1016f1..69f820aa1f29e626c0ae0322281063efae53c470 100644
+index 413de81d30fe4ee6cf7aba88805e0e536f498565..78fd9e84e24b163b4918ba0580abca18806f4988 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2561,6 +2561,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -2577,6 +2577,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
@Nullable
public Team getTeam() {
@@ -37,10 +37,10 @@ index de15a2231057217fbbf723cf25e869998a1016f1..69f820aa1f29e626c0ae0322281063ef
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index b14e9a629430070071b498f719b649af1d4bb926..9168826ac85bc7cd355e73b2d02b7cce9c4c9cee 100644
+index 4ec047456f45bfceb9ba7a249a0fc0774e20b126..3bdc374b604ef1edb4e2925bef5a9586d4d8346a 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -797,6 +797,7 @@ public abstract class LivingEntity extends Entity {
+@@ -800,6 +800,7 @@ public abstract class LivingEntity extends Entity {
if (nbt.contains("Team", 8)) {
String s = nbt.getString("Team");
PlayerTeam scoreboardteam = this.level.getScoreboard().getPlayerTeam(s);
diff --git a/patches/server/0061-Complete-resource-pack-API.patch b/patches/server/0061-Complete-resource-pack-API.patch
index e45aa508bc..99fc857bb9 100644
--- a/patches/server/0061-Complete-resource-pack-API.patch
+++ b/patches/server/0061-Complete-resource-pack-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 979ece36de5c160a188b4c14b2bf991924f6fd98..18854aaa1359dd5c944d7e3a6177152bff9614a2 100644
+index 28c4e16e202876e58447b1f766619e3cee329aaa..8125b2d736594018e89bb3be32262f5e1e8791d5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1638,8 +1638,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1653,8 +1653,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
this.disconnect(new TranslatableComponent("multiplayer.requiredTexturePrompt.disconnect"));
}
diff --git a/patches/server/0062-Default-loading-permissions.yml-before-plugins.patch b/patches/server/0062-Default-loading-permissions.yml-before-plugins.patch
index 6c8c76df99..c66666dfb2 100644
--- a/patches/server/0062-Default-loading-permissions.yml-before-plugins.patch
+++ b/patches/server/0062-Default-loading-permissions.yml-before-plugins.patch
@@ -30,10 +30,10 @@ index 701a2ffd04df48d437b2cb963dd150af99725b6e..817d4572c9991992b720b3ba163188ac
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index b6e9c6fc7f31b06f77cf108ee0f5548cd530ba5a..b06542f4b79bffda579ab91cb3b463063a34d472 100644
+index 02674288c62493c22e5e21b42a2d4386b5a42a1d..c30eb1c910147ddd6237078367ce29f9e015af9e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -459,6 +459,7 @@ public final class CraftServer implements Server {
+@@ -455,6 +455,7 @@ public final class CraftServer implements Server {
if (type == PluginLoadOrder.STARTUP) {
this.helpMap.clear();
this.helpMap.initializeGeneralTopics();
@@ -41,7 +41,7 @@ index b6e9c6fc7f31b06f77cf108ee0f5548cd530ba5a..b06542f4b79bffda579ab91cb3b46306
}
Plugin[] plugins = this.pluginManager.getPlugins();
-@@ -478,7 +479,7 @@ public final class CraftServer implements Server {
+@@ -474,7 +475,7 @@ public final class CraftServer implements Server {
this.commandMap.registerServerAliases();
DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions();
diff --git a/patches/server/0063-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0063-Allow-Reloading-of-Custom-Permissions.patch
index 3b7f9b8208..50b690d23c 100644
--- a/patches/server/0063-Allow-Reloading-of-Custom-Permissions.patch
+++ b/patches/server/0063-Allow-Reloading-of-Custom-Permissions.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index b06542f4b79bffda579ab91cb3b463063a34d472..01d99c5f916d93375f701a5fe9e250102ff57e8a 100644
+index c30eb1c910147ddd6237078367ce29f9e015af9e..39c847d68b9195d082d324485fee83332e07f59a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2500,5 +2500,23 @@ public final class CraftServer implements Server {
+@@ -2492,5 +2492,23 @@ public final class CraftServer implements Server {
}
return this.adventure$audiences;
}
diff --git a/patches/server/0064-Remove-Metadata-on-reload.patch b/patches/server/0064-Remove-Metadata-on-reload.patch
index a8b92e7798..8272286495 100644
--- a/patches/server/0064-Remove-Metadata-on-reload.patch
+++ b/patches/server/0064-Remove-Metadata-on-reload.patch
@@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive
This will remove metadata on reload so it does not crash everything if a plugin uses it.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 01d99c5f916d93375f701a5fe9e250102ff57e8a..1065f69322bb9d068f4ec63e40cc4db6f5425c40 100644
+index 39c847d68b9195d082d324485fee83332e07f59a..ad851aa3a29b6aabfcfe7f95df15303437c48eaa 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -948,8 +948,16 @@ public final class CraftServer implements Server {
+@@ -944,8 +944,16 @@ public final class CraftServer implements Server {
world.paperConfig.init(); // Paper
}
diff --git a/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch
index da1b991600..91d8e83c36 100644
--- a/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch
+++ b/patches/server/0065-Handle-Item-Meta-Inconsistencies.patch
@@ -18,10 +18,10 @@ For consistency, the old API methods now forward to use the
ItemMeta API equivalents, and should deprecate the old API's.
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index 8335880dbbb31a3f5d10c259b567baa0d5f381a1..74e4990888d88f18cb3d800724d9156e9d1ae21d 100644
+index 1a52db84d9630a095347a85e136a9ad118f77325..d66cc030dcd3d98f57803938c8c06342a028ee88 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -12,6 +12,8 @@ import java.text.DecimalFormatSymbols;
+@@ -14,6 +14,8 @@ import java.text.DecimalFormatSymbols;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@@ -30,7 +30,7 @@ index 8335880dbbb31a3f5d10c259b567baa0d5f381a1..74e4990888d88f18cb3d800724d9156e
import java.util.Locale;
import java.util.Map.Entry;
import java.util.Optional;
-@@ -151,6 +153,23 @@ public final class ItemStack {
+@@ -153,6 +155,23 @@ public final class ItemStack {
return this.getItem().getTooltipImage(this);
}
@@ -54,7 +54,7 @@ index 8335880dbbb31a3f5d10c259b567baa0d5f381a1..74e4990888d88f18cb3d800724d9156e
public ItemStack(ItemLike item) {
this(item, 1);
}
-@@ -194,6 +213,7 @@ public final class ItemStack {
+@@ -200,6 +219,7 @@ public final class ItemStack {
// CraftBukkit start - make defensive copy as this data may be coming from the save thread
this.tag = nbttagcompound.getCompound("tag").copy();
// CraftBukkit end
@@ -62,7 +62,7 @@ index 8335880dbbb31a3f5d10c259b567baa0d5f381a1..74e4990888d88f18cb3d800724d9156e
this.getItem().verifyTagAfterLoad(this.tag);
}
-@@ -748,6 +768,7 @@ public final class ItemStack {
+@@ -758,6 +778,7 @@ public final class ItemStack {
public void setTag(@Nullable CompoundTag nbt) {
this.tag = nbt;
@@ -70,7 +70,7 @@ index 8335880dbbb31a3f5d10c259b567baa0d5f381a1..74e4990888d88f18cb3d800724d9156e
if (this.getItem().canBeDepleted()) {
this.setDamageValue(this.getDamageValue());
}
-@@ -1055,6 +1076,7 @@ public final class ItemStack {
+@@ -1063,6 +1084,7 @@ public final class ItemStack {
ListTag nbttaglist = this.tag.getList("Enchantments", 10);
nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (byte) level));
diff --git a/patches/server/0067-Add-World-Util-Methods.patch b/patches/server/0067-Add-World-Util-Methods.patch
index cafe64537d..8e25454902 100644
--- a/patches/server/0067-Add-World-Util-Methods.patch
+++ b/patches/server/0067-Add-World-Util-Methods.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 7a536f30a1ff7f93bad14f734aeb5d5ff69a5c9a..767a48000e41c43ccaf71be521348fcd1c71ee11 100644
+index 6c2e53cf3c3fa5bf2df38d4e87e4d0ee52f3c088..d1b9e82b9c4b90a96d2ae8930b8e33e8d1a55bdb 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -208,7 +208,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -209,7 +209,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
@@ -19,10 +19,10 @@ index 7a536f30a1ff7f93bad14f734aeb5d5ff69a5c9a..767a48000e41c43ccaf71be521348fcd
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 389cb85aa369dff606b21c10fcbf4825c17bbd4f..c2fe955b23383effca7a8d712a08e346d648d2a8 100644
+index d923cc91a8f1e71831be8ded1b4818ac3b48fc34..cccce52ef5a1ac7284bc878c7b8f0d2a312fac57 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -319,6 +319,22 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -318,6 +318,22 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return chunk == null ? null : chunk.getFluidState(blockposition);
}
diff --git a/patches/server/0068-Custom-replacement-for-eaten-items.patch b/patches/server/0068-Custom-replacement-for-eaten-items.patch
index 84cae54000..1bd6dd4cf5 100644
--- a/patches/server/0068-Custom-replacement-for-eaten-items.patch
+++ b/patches/server/0068-Custom-replacement-for-eaten-items.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 9168826ac85bc7cd355e73b2d02b7cce9c4c9cee..e94344170190ae9429b744ec7878c3aa093f01b6 100644
+index 3bdc374b604ef1edb4e2925bef5a9586d4d8346a..f364978ff256aecb078cca2b6c3fd433d9a4820b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3562,9 +3562,10 @@ public abstract class LivingEntity extends Entity {
+@@ -3552,9 +3552,10 @@ public abstract class LivingEntity extends Entity {
this.triggerItemUseEffects(this.useItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
@@ -20,7 +20,7 @@ index 9168826ac85bc7cd355e73b2d02b7cce9c4c9cee..e94344170190ae9429b744ec7878c3aa
level.getCraftServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
-@@ -3578,6 +3579,13 @@ public abstract class LivingEntity extends Entity {
+@@ -3568,6 +3569,13 @@ public abstract class LivingEntity extends Entity {
} else {
itemstack = this.useItem.finishUsingItem(this.level, this);
}
@@ -34,7 +34,7 @@ index 9168826ac85bc7cd355e73b2d02b7cce9c4c9cee..e94344170190ae9429b744ec7878c3aa
// CraftBukkit end
if (itemstack != this.useItem) {
-@@ -3585,6 +3593,11 @@ public abstract class LivingEntity extends Entity {
+@@ -3575,6 +3583,11 @@ public abstract class LivingEntity extends Entity {
}
this.stopUsingItem();
diff --git a/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch
index 1988d44a0c..dc0fcfa0b1 100644
--- a/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch
+++ b/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index e94344170190ae9429b744ec7878c3aa093f01b6..e13808657e0c7dc94fcd2844690a31d0691b6a7b 100644
+index f364978ff256aecb078cca2b6c3fd433d9a4820b..5f7a16651a0ca5497b20d8723e9c170506668267 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -758,7 +758,13 @@ public abstract class LivingEntity extends Entity {
+@@ -761,7 +761,13 @@ public abstract class LivingEntity extends Entity {
@Override
public void readAdditionalSaveData(CompoundTag nbt) {
@@ -23,7 +23,7 @@ index e94344170190ae9429b744ec7878c3aa093f01b6..e13808657e0c7dc94fcd2844690a31d0
if (nbt.contains("Attributes", 9) && this.level != null && !this.level.isClientSide) {
this.getAttributes().load(nbt.getList("Attributes", 10));
}
-@@ -1245,6 +1251,10 @@ public abstract class LivingEntity extends Entity {
+@@ -1248,6 +1254,10 @@ public abstract class LivingEntity extends Entity {
}
public void setHealth(float health) {
@@ -34,7 +34,7 @@ index e94344170190ae9429b744ec7878c3aa093f01b6..e13808657e0c7dc94fcd2844690a31d0
// CraftBukkit start - Handle scaled health
if (this instanceof ServerPlayer) {
org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity();
-@@ -3396,7 +3406,7 @@ public abstract class LivingEntity extends Entity {
+@@ -3386,7 +3396,7 @@ public abstract class LivingEntity extends Entity {
}
public void setAbsorptionAmount(float amount) {
diff --git a/patches/server/0070-Use-a-Shared-Random-for-Entities.patch b/patches/server/0070-Use-a-Shared-Random-for-Entities.patch
index 559824e9f1..505022ba2d 100644
--- a/patches/server/0070-Use-a-Shared-Random-for-Entities.patch
+++ b/patches/server/0070-Use-a-Shared-Random-for-Entities.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Use a Shared Random for Entities
Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 69f820aa1f29e626c0ae0322281063efae53c470..415c746b497d19f359705721874ed65d7e7ca817 100644
+index 78fd9e84e24b163b4918ba0580abca18806f4988..f12e282dc4683d0430b9dba552757c4da5dee988 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -152,6 +152,21 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -155,6 +155,21 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
}
@@ -31,7 +31,7 @@ index 69f820aa1f29e626c0ae0322281063efae53c470..415c746b497d19f359705721874ed65d
private CraftEntity bukkitEntity;
public CraftEntity getBukkitEntity() {
-@@ -339,7 +354,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -342,7 +357,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
this.bb = Entity.INITIAL_AABB;
this.stuckSpeedMultiplier = Vec3.ZERO;
this.nextStep = 1.0F;
@@ -39,12 +39,12 @@ index 69f820aa1f29e626c0ae0322281063efae53c470..415c746b497d19f359705721874ed65d
+ this.random = SHARED_RANDOM; // Paper
this.remainingFireTicks = -this.getFireImmuneTicks();
this.fluidHeight = new Object2DoubleArrayMap(2);
- this.firstTick = true;
+ this.fluidOnEyes = new HashSet();
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
-index 09ec4d66aaa5b9e4ef09750a76cebc389a4306fd..370513fbc39f178f903ce140ced1a97029dd39db 100644
+index 8e63ab510e4c2e458da726ca67be4d3b5274e7b7..a51424d29ac353cf1bec4d1484db0acb63bebba5 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
-@@ -47,7 +47,7 @@ public class Squid extends WaterAnimal {
+@@ -46,7 +46,7 @@ public class Squid extends WaterAnimal {
public Squid(EntityType extends Squid> type, Level world) {
super(type, world);
diff --git a/patches/server/0071-Configurable-spawn-chances-for-skeleton-horses.patch b/patches/server/0071-Configurable-spawn-chances-for-skeleton-horses.patch
index 6e19d6467b..166b4d09e3 100644
--- a/patches/server/0071-Configurable-spawn-chances-for-skeleton-horses.patch
+++ b/patches/server/0071-Configurable-spawn-chances-for-skeleton-horses.patch
@@ -22,10 +22,10 @@ index 71c672eafdce3547eaeb8e31fddcb142ad213094..aa8cd5965632626e4cbd4952acf9b349
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index b106dfc16820d89b9c9792ad85d09fd66b7204b6..4e896cdc395cfb2b976e13ee3f0228d9f475069f 100644
+index d1b9e82b9c4b90a96d2ae8930b8e33e8d1a55bdb..d9198cf7aff9b1c0f05277fb9f1a3276e2292775 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -562,7 +562,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -565,7 +565,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
diff --git a/patches/server/0072-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch b/patches/server/0072-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch
index 53d5374cbc..bc12e77534 100644
--- a/patches/server/0072-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch
+++ b/patches/server/0072-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch
@@ -12,7 +12,7 @@ Replace all calls to the new place to the unnecessary forward.
Optimize getType and getBlockData to manually inline and optimize the calls
diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java
-index dba7872cf337a5c3dc5a6fe508dd50b93462fae5..75aa5df03c162fa10046fbad806b81051fb5765b 100644
+index 4587a3668b6be9222cdd74a38229f89f611d1af6..9f32861d791f7e4cb39d2ad01f48e1916fc2b4b1 100644
--- a/src/main/java/net/minecraft/core/Vec3i.java
+++ b/src/main/java/net/minecraft/core/Vec3i.java
@@ -33,6 +33,12 @@ public class Vec3i implements Comparable {
@@ -29,10 +29,10 @@ index dba7872cf337a5c3dc5a6fe508dd50b93462fae5..75aa5df03c162fa10046fbad806b8105
this.x = x;
this.y = y;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index c2fe955b23383effca7a8d712a08e346d648d2a8..85d3ece733d78897f85a7a02d323fdb025193622 100644
+index cccce52ef5a1ac7284bc878c7b8f0d2a312fac57..f1f713c892e1843fdf5adec6714dc72f8fd4d354 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -262,7 +262,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -261,7 +261,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
public boolean isInWorldBounds(BlockPos pos) {
@@ -42,10 +42,10 @@ index c2fe955b23383effca7a8d712a08e346d648d2a8..85d3ece733d78897f85a7a02d323fdb0
public static boolean isInSpawnableBounds(BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
-index 0ea0690ab1d45f60a2b13cf8a69e580256992cdc..b3b3fa7ece66e1ab467c8ed550d150db541fd02a 100644
+index 847ac56f20ab9c5745f9c0fa0e6f16743ba5e471..eea6816c52e6c0329f3bea0e7789cda9dd4a5a08 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
-@@ -119,6 +119,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
+@@ -122,6 +122,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
return GameEventDispatcher.NOOP;
}
@@ -54,11 +54,11 @@ index 0ea0690ab1d45f60a2b13cf8a69e580256992cdc..b3b3fa7ece66e1ab467c8ed550d150db
public abstract BlockState setBlockState(BlockPos pos, BlockState state, boolean moved);
diff --git a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java
-index 31d01f8df394e718f1f2a268ddccee77b6706eb9..7b0da3956be23e974d3bc2f50f9004046923635f 100644
+index 80e383e9a2d12f9f1b0b0d9ae71a0add9b51c9d4..a9c65c8d36e5c7080133706df1363b3ce52e3370 100644
--- a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java
-@@ -18,6 +18,12 @@ public class EmptyLevelChunk extends LevelChunk {
- super(world, pos);
+@@ -21,6 +21,12 @@ public class EmptyLevelChunk extends LevelChunk {
+ this.biome = holder;
}
+ // Paper start
@@ -71,10 +71,10 @@ index 31d01f8df394e718f1f2a268ddccee77b6706eb9..7b0da3956be23e974d3bc2f50f900404
public BlockState getBlockState(BlockPos pos) {
return Blocks.VOID_AIR.defaultBlockState();
diff --git a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java
-index ef74f37cae96e61d5648fce7bbd793fb67ba9e4a..e15263a152c88371ebc65b47f0be938f7c19a8f2 100644
+index 82a4f5fb84884d229d258134fbfe62d34ad30d80..37e7f766e0de7b47c7240c9365bb134fda26a756 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java
-@@ -46,6 +46,12 @@ public class ImposterProtoChunk extends ProtoChunk {
+@@ -47,6 +47,12 @@ public class ImposterProtoChunk extends ProtoChunk {
public BlockState getBlockState(BlockPos pos) {
return this.wrapped.getBlockState(pos);
}
@@ -88,7 +88,7 @@ index ef74f37cae96e61d5648fce7bbd793fb67ba9e4a..e15263a152c88371ebc65b47f0be938f
@Override
public FluidState getFluidState(BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
-index 3ba9f8d7dc12709670dcd94df5d82b8d44f983fa..cbffb4eb93ba1888666d4b0de98b2fb05c1400a0 100644
+index 1ddc917772d701ac7b8800df44da890b9b6a6113..aff826fb06a16adac8173efcaad0da1724db95c4 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -288,12 +288,29 @@ public class LevelChunk extends ChunkAccess {
@@ -125,10 +125,10 @@ index 3ba9f8d7dc12709670dcd94df5d82b8d44f983fa..cbffb4eb93ba1888666d4b0de98b2fb0
BlockState iblockdata = null;
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
-index 6abd3cf0a388b158252628d8031b92bb8a6d65fb..50b6ecfea7a342be0d21e37ae87777a4b4860026 100644
+index a17d38d08a1f4b3e7ba4ef233a4acaf75177ac4c..c696358102086257033b55adbef84b1a259cb46e 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
-@@ -20,7 +20,7 @@ public class LevelChunkSection {
+@@ -21,7 +21,7 @@ public class LevelChunkSection {
public static final int SECTION_SIZE = 4096;
public static final int BIOME_CONTAINER_BITS = 2;
private final int bottomBlockY;
@@ -138,10 +138,10 @@ index 6abd3cf0a388b158252628d8031b92bb8a6d65fb..50b6ecfea7a342be0d21e37ae87777a4
private short tickingFluidCount;
public final PalettedContainer states;
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
-index 7c2e3331fac1de2e20974c8eed8aeeb9f2c92789..acfd46c7035b4009d61bda8a7c8dd6953e4836e6 100644
+index ee0be5163811ea39efcb2092e5f126c3fd9b1523..d3d2bd5ea57254a4af0572d5dab460127718ce09 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
-@@ -87,14 +87,18 @@ public class ProtoChunk extends ChunkAccess {
+@@ -88,14 +88,18 @@ public class ProtoChunk extends ChunkAccess {
@Override
public BlockState getBlockState(BlockPos pos) {
diff --git a/patches/server/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
index 91630a4baf..ef34955e43 100644
--- a/patches/server/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
+++ b/patches/server/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 4db15f60a5da9594cfc313f6fa97032ffc9259e0..b807bd1e53f39a1d635800f02f6772f0fc878f7a 100644
+index 26646df983507bfb1d75a7a3a9f4c12c7bf9fd49..99478fe8f16783e7d2ae128f32199fa4b465dc83 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1367,6 +1367,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop {
return worldserver + " " + worldserver.dimension().location();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index ddf2468fe4adb5115f21c7eb0d695c999f1c3efe..db3f50d7bdfff919cfaee3b035f6ae4e79beb000 100644
+index d9198cf7aff9b1c0f05277fb9f1a3276e2292775..ca7c4a297e577bf9f0bf9cfd88a56ad87ac88684 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -207,6 +207,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -208,6 +208,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
private int tickPosition;
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
@@ -30,10 +30,10 @@ index ddf2468fe4adb5115f21c7eb0d695c999f1c3efe..db3f50d7bdfff919cfaee3b035f6ae4e
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkSource.getChunk(x, z, false);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 85d3ece733d78897f85a7a02d323fdb025193622..c91652cf949c099145587e758b259e2b3dfbe8c5 100644
+index f1f713c892e1843fdf5adec6714dc72f8fd4d354..b2965b136405bce16f1433411df5beab15231113 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -474,7 +474,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -473,7 +473,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
CraftWorld world = ((ServerLevel) this).getWorld();
@@ -42,7 +42,7 @@ index 85d3ece733d78897f85a7a02d323fdb025193622..c91652cf949c099145587e758b259e2b
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
this.getCraftServer().getPluginManager().callEvent(event);
-@@ -587,7 +587,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -586,7 +586,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try {
// CraftBukkit start
CraftWorld world = ((ServerLevel) this).getWorld();
@@ -52,23 +52,15 @@ index 85d3ece733d78897f85a7a02d323fdb025193622..c91652cf949c099145587e758b259e2b
this.getCraftServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/world/level/block/BushBlock.java b/src/main/java/net/minecraft/world/level/block/BushBlock.java
-index 24227939493f852a88477c84160bda1605291eb0..1f8cf302d2309aec2955832ffafd87f14934e141 100644
+index d40e791529911ca81398ac267a819415da91502a..03fde6e47c4a347c62fe9b4a3351769aedf874f6 100644
--- a/src/main/java/net/minecraft/world/level/block/BushBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BushBlock.java
-@@ -4,6 +4,7 @@ import net.minecraft.core.BlockPos;
- import net.minecraft.core.Direction;
- import net.minecraft.tags.BlockTags;
- import net.minecraft.tags.Tag;
-+import net.minecraft.server.level.ServerLevel;
- import net.minecraft.world.level.BlockGetter;
- import net.minecraft.world.level.LevelAccessor;
- import net.minecraft.world.level.LevelReader;
-@@ -25,7 +26,7 @@ public class BushBlock extends Block {
+@@ -24,7 +24,7 @@ public class BushBlock extends Block {
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
// CraftBukkit start
if (!state.canSurvive(world, pos)) {
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, pos).isCancelled()) {
-+ if (!(world instanceof ServerLevel && ((ServerLevel) world).hasPhysicsEvent) || !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, pos).isCancelled()) { // Paper
++ if (!(world instanceof net.minecraft.server.level.ServerLevel && ((net.minecraft.server.level.ServerLevel) world).hasPhysicsEvent) || !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, pos).isCancelled()) { // Paper
return Blocks.AIR.defaultBlockState();
}
}
diff --git a/patches/server/0074-Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/0074-Entity-AddTo-RemoveFrom-World-Events.patch
index 34cf38f5b8..d1ce4c7244 100644
--- a/patches/server/0074-Entity-AddTo-RemoveFrom-World-Events.patch
+++ b/patches/server/0074-Entity-AddTo-RemoveFrom-World-Events.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 419f539109ca0b8103475e52d0fdda40a7b99cc7..ce13b2b9bcf0984732b3309ec3f14731cc6aef5f 100644
+index ca7c4a297e577bf9f0bf9cfd88a56ad87ac88684..22ba7b534c450a4f9e608c331344e948a0fbf1f9 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -2026,6 +2026,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2033,6 +2033,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.setOrigin(entity.getOriginVector().toLocation(getWorld()));
}
// Paper end
@@ -16,7 +16,7 @@ index 419f539109ca0b8103475e52d0fdda40a7b99cc7..ce13b2b9bcf0984732b3309ec3f14731
}
public void onTrackingEnd(Entity entity) {
-@@ -2106,6 +2107,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2113,6 +2114,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
// CraftBukkit end
diff --git a/patches/server/0078-Do-not-load-chunks-for-Pathfinding.patch b/patches/server/0078-Do-not-load-chunks-for-Pathfinding.patch
index bd65a975c3..0a002dd1f7 100644
--- a/patches/server/0078-Do-not-load-chunks-for-Pathfinding.patch
+++ b/patches/server/0078-Do-not-load-chunks-for-Pathfinding.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Do not load chunks for Pathfinding
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
-index 9e4d43b5846ebebf9169ad906db68804292e7fe0..e23679b8c2bc35de82cb3245f35b53b44058f53d 100644
+index ca45dfc6c05760e00987c09b697efb1f9ff0e78a..2d42df635b1ce8d975278fb36f00fe9b8b8f060f 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
-@@ -453,7 +453,12 @@ public class WalkNodeEvaluator extends NodeEvaluator {
+@@ -457,7 +457,12 @@ public class WalkNodeEvaluator extends NodeEvaluator {
for(int n = -1; n <= 1; ++n) {
if (l != 0 || n != 0) {
pos.set(i + l, j + m, k + n);
@@ -22,7 +22,7 @@ index 9e4d43b5846ebebf9169ad906db68804292e7fe0..e23679b8c2bc35de82cb3245f35b53b4
if (blockState.is(Blocks.CACTUS)) {
return BlockPathTypes.DANGER_CACTUS;
}
-@@ -469,6 +474,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
+@@ -473,6 +478,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
if (world.getFluidState(pos).is(FluidTags.WATER)) {
return BlockPathTypes.WATER_BORDER;
}
@@ -30,7 +30,7 @@ index 9e4d43b5846ebebf9169ad906db68804292e7fe0..e23679b8c2bc35de82cb3245f35b53b4
}
}
}
-@@ -478,7 +484,8 @@ public class WalkNodeEvaluator extends NodeEvaluator {
+@@ -482,7 +488,8 @@ public class WalkNodeEvaluator extends NodeEvaluator {
}
protected static BlockPathTypes getBlockPathTypeRaw(BlockGetter world, BlockPos pos) {
diff --git a/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch
index 4825a680db..31423cadc5 100644
--- a/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch
+++ b/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch
@@ -20,10 +20,10 @@ index 8834ed411a7db86b4d2b88183a1315317107d719..c45b5ab6776f3ac79f856c3a6467c510
static final ServerboundInteractPacket.Action ATTACK_ACTION = new ServerboundInteractPacket.Action() {
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 18854aaa1359dd5c944d7e3a6177152bff9614a2..bacb8ff97a6745847b5e3eb82dd08bde934e8d1f 100644
+index 8125b2d736594018e89bb3be32262f5e1e8791d5..024f6b5bf84a4e55f6237107ae8f8958caa9ef72 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2204,8 +2204,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2219,8 +2219,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
});
}
}
diff --git a/patches/server/0080-Configurable-Grass-Spread-Tick-Rate.patch b/patches/server/0080-Configurable-Grass-Spread-Tick-Rate.patch
index 6e3b12f457..cc11565d1c 100644
--- a/patches/server/0080-Configurable-Grass-Spread-Tick-Rate.patch
+++ b/patches/server/0080-Configurable-Grass-Spread-Tick-Rate.patch
@@ -20,7 +20,7 @@ index e7534ed3f995be64c99399ab76e98086cf37bb7f..c008f1f7f0a1e1b8bf34f2702cb44c5f
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
-index 954defe131bdcd81178e3bd31755eb18b9aef026..29f4da5962bf596da7c557d9aa61677f5604b0a0 100644
+index 4ba446351d8b8b97ebfab1436d8f313f2747901e..b642ced1bc4dd819210db291cfc1837d011431ab 100644
--- a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
@@ -3,6 +3,7 @@ package net.minecraft.world.level.block;
@@ -30,8 +30,8 @@ index 954defe131bdcd81178e3bd31755eb18b9aef026..29f4da5962bf596da7c557d9aa61677f
+import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.tags.FluidTags;
- import net.minecraft.tags.Tag;
-@@ -40,6 +41,7 @@ public abstract class SpreadingSnowyDirtBlock extends SnowyDirtBlock {
+ import net.minecraft.world.level.LevelReader;
+@@ -39,6 +40,7 @@ public abstract class SpreadingSnowyDirtBlock extends SnowyDirtBlock {
@Override
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
diff --git a/patches/server/0081-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/patches/server/0081-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
index 8932404de3..9e15d02785 100644
--- a/patches/server/0081-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
+++ b/patches/server/0081-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index c91652cf949c099145587e758b259e2b3dfbe8c5..46f8fff21c0d91b9326b9270def43bd99c54b3ac 100644
+index b2965b136405bce16f1433411df5beab15231113..522b33f8d78468f07786dc7d6f184d2bc49dfc3f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -545,6 +545,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -544,6 +544,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public void setBlocksDirty(BlockPos pos, BlockState old, BlockState updated) {}
public void updateNeighborsAt(BlockPos pos, Block block) {
diff --git a/patches/server/0085-Configurable-Player-Collision.patch b/patches/server/0085-Configurable-Player-Collision.patch
index 97eeb56d5d..430487b50f 100644
--- a/patches/server/0085-Configurable-Player-Collision.patch
+++ b/patches/server/0085-Configurable-Player-Collision.patch
@@ -32,18 +32,18 @@ index 8993d8809c109212ab278e15c09cebab9e89342f..005a3058c51a41a39f050b1817e2079b
buf.writeComponent(this.playerPrefix);
buf.writeComponent(this.playerSuffix);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index b8938c4118b61758874624229b6986956f30cc8e..8ba4af81f19e20c7d949edc72c0827bab22c19cb 100644
+index 99478fe8f16783e7d2ae128f32199fa4b465dc83..0f743a46195ce83bb3d96a5a65067cfab3a369e8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -159,6 +159,7 @@ import net.minecraft.world.level.storage.loot.LootTables;
+@@ -162,6 +162,7 @@ import net.minecraft.world.level.storage.loot.LootTables;
import net.minecraft.world.level.storage.loot.PredicateManager;
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
+import net.minecraft.world.scores.PlayerTeam; // Paper
import org.apache.commons.lang3.Validate;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
-@@ -609,6 +610,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop playersByName = new java.util.HashMap<>();
+ public @Nullable String collideRuleTeamName; // Paper - Team name used for collideRule
- public PlayerList(MinecraftServer server, RegistryAccess.RegistryHolder registryManager, PlayerDataStorage saveHandler, int maxPlayers) {
+ public PlayerList(MinecraftServer server, RegistryAccess.Frozen registryManager, PlayerDataStorage saveHandler, int maxPlayers) {
this.cserver = server.server = new CraftServer((DedicatedServer) server, this);
@@ -385,6 +387,13 @@ public abstract class PlayerList {
diff --git a/patches/server/0087-Configurable-RCON-IP-address.patch b/patches/server/0087-Configurable-RCON-IP-address.patch
index 4b840100ce..1dc723e8a3 100644
--- a/patches/server/0087-Configurable-RCON-IP-address.patch
+++ b/patches/server/0087-Configurable-RCON-IP-address.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Configurable RCON IP address
For servers with multiple IP's, ability to bind to a specific interface.
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
-index 9682a149d996cc19d7bc0e9506acb1346e5c222e..07fd3da4de300f80516961ae22700dbc741e81dc 100644
+index 703403222763e42566552f2c6f3852e07f727f76..a7938420f6840b9d3880fb895aaf709ebd844312 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
-@@ -70,6 +70,8 @@ public class DedicatedServerProperties extends Settings {
+ return s.toLowerCase(Locale.ROOT);
+ }, "default"));
+ // Paper start - Configurable rcon ip
+ final String rconIp = this.getStringRaw("rcon.ip");
+ this.rconIp = rconIp == null ? this.serverIp : rconIp;
@@ -30,7 +30,7 @@ index 9682a149d996cc19d7bc0e9506acb1346e5c222e..07fd3da4de300f80516961ae22700dbc
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/rcon/thread/RconThread.java b/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
-index 5e642ab9947f054c1741e13170a36f8fe300cdbe..a93e0eb67a78abb2eabd549cd5240095a24e5545 100644
+index cb61eaf8447c8340c4b4e1079c0a6aecd41a6116..3bf60f640aa9fa4cabd2b3e5d3931e8467b9df24 100644
--- a/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
+++ b/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
@@ -60,7 +60,7 @@ public class RconThread extends GenericThread {
diff --git a/patches/server/0088-EntityRegainHealthEvent-isFastRegen-API.patch b/patches/server/0088-EntityRegainHealthEvent-isFastRegen-API.patch
index d5de7b5e30..c698f66703 100644
--- a/patches/server/0088-EntityRegainHealthEvent-isFastRegen-API.patch
+++ b/patches/server/0088-EntityRegainHealthEvent-isFastRegen-API.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] EntityRegainHealthEvent isFastRegen API
Don't even get me started
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index e13808657e0c7dc94fcd2844690a31d0691b6a7b..fcf9206ef317aa22cd644ccb415c2156fd9f2af2 100644
+index 5f7a16651a0ca5497b20d8723e9c170506668267..2ce597f594142d64a239649e1b812b3b7b0af340 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -1224,10 +1224,16 @@ public abstract class LivingEntity extends Entity {
+@@ -1227,10 +1227,16 @@ public abstract class LivingEntity extends Entity {
}
public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) {
diff --git a/patches/server/0090-remove-null-possibility-for-getServer-singleton.patch b/patches/server/0090-remove-null-possibility-for-getServer-singleton.patch
index db7b1d93db..8725cd0c1d 100644
--- a/patches/server/0090-remove-null-possibility-for-getServer-singleton.patch
+++ b/patches/server/0090-remove-null-possibility-for-getServer-singleton.patch
@@ -6,26 +6,26 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 8ba4af81f19e20c7d949edc72c0827bab22c19cb..375045935b7b9a3a8fd8f8f897763caf75e59813 100644
+index 0f743a46195ce83bb3d96a5a65067cfab3a369e8..0eaa13cf0f452fe6604767e40d8c9b6664df31bb 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -185,6 +185,7 @@ import org.spigotmc.SlackActivityAccountant; // Spigot
+@@ -186,6 +186,7 @@ import org.spigotmc.SlackActivityAccountant; // Spigot
public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements CommandSource, AutoCloseable {
+ private static MinecraftServer SERVER; // Paper
- public static final Logger LOGGER = LogManager.getLogger();
+ public static final Logger LOGGER = LogUtils.getLogger();
public static final String VANILLA_BRAND = "vanilla";
private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F;
-@@ -320,6 +321,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop registryreadops, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, @Nullable MinecraftSessionService minecraftsessionservice, @Nullable GameProfileRepository gameprofilerepository, @Nullable GameProfileCache usercache, ChunkProgressListenerFactory worldloadlistenerfactory) {
super("Server");
+ SERVER = this; // Paper - better singleton
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
this.profiler = this.metricsRecorder.getProfiler();
this.onMetricsRecordingStopped = (methodprofilerresults) -> {
-@@ -2259,7 +2261,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
diff --git a/patches/server/0099-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch b/patches/server/0099-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch
index 3b713c18d5..e7dc00e609 100644
--- a/patches/server/0099-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch
+++ b/patches/server/0099-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Only send Dragon/Wither Death sounds to same world
Also fix view distance lookup
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
-index 7de279a1bef44a76173a1b71b98425ca6aa219aa..2584c02a5f6511ade260986a6aacef401c294549 100644
+index 10da58381202f8ec3d49aa2ed08faf30c435883b..89bd094fc31969284d831eaab47a131914d4fb13 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
-@@ -640,8 +640,9 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -637,8 +637,9 @@ public class EnderDragon extends Mob implements Enemy {
if (this.dragonDeathTime == 1 && !this.isSilent()) {
// CraftBukkit start - Use relative location for far away sounds
// this.world.b(1028, this.getChunkCoordinates(), 0);
@@ -22,10 +22,10 @@ index 7de279a1bef44a76173a1b71b98425ca6aa219aa..2584c02a5f6511ade260986a6aacef40
double deltaZ = this.getZ() - player.getZ();
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
-index 6fde138a3da49fee4fdbf36e0ab58438e114e196..4f9f64def9b5da5bd2714c5f3ba36a4339623758 100644
+index 78bffaddbc9e478fb53639396e9c4970e9961b21..32b302aad0319ce3ee412912425c1c8db9979f8a 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
-@@ -272,8 +272,9 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
+@@ -271,8 +271,9 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
if (!this.isSilent()) {
// CraftBukkit start - Use relative location for far away sounds
// this.world.globalLevelEvent(1023, new BlockPosition(this), 0);
diff --git a/patches/server/0100-Fix-Old-Sign-Conversion.patch b/patches/server/0100-Fix-Old-Sign-Conversion.patch
index 63115c0bc5..eb04571684 100644
--- a/patches/server/0100-Fix-Old-Sign-Conversion.patch
+++ b/patches/server/0100-Fix-Old-Sign-Conversion.patch
@@ -9,17 +9,17 @@ Subject: [PATCH] Fix Old Sign Conversion
This causes Igloos and such to render broken signs. We fix this by ignoring sign conversion for Defined Structures
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
-index 14ac3c7b47525b7fd0345d817c9020b5a59d2ebc..1e416b23a38458f16add472cea09b0ac5ac91869 100644
+index 5c2ac7a1de96d9b4830955c2ff108c0881b5949b..32a2fbf4a11a84d5a55e02d3ba21e6f4430379c0 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
-@@ -33,6 +33,7 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject {
+@@ -32,6 +32,7 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject {
+ private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
public CraftPersistentDataContainer persistentDataContainer;
// CraftBukkit end
- private static final Logger LOGGER = LogManager.getLogger();
+ public boolean isLoadingStructure = false; // Paper
+ private static final Logger LOGGER = LogUtils.getLogger();
private final BlockEntityType> type;
@Nullable
- protected Level level;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
index e390cfea5bed64284a97c88a717503f07f073a30..3a2e2adeefe73981b443216724270023408c1feb 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -34,7 +34,7 @@ index e390cfea5bed64284a97c88a717503f07f073a30..3a2e2adeefe73981b443216724270023
continue;
}
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
-index 2aaa7bb03ab200a5df1ae1aab7b81ac8ce85d64c..ef8dd3fa4f7ac8f85ae508999264850659bf9606 100644
+index cf8a38b7d55d229ac556f8a93b25c155381df3a2..129ebb095c2280376a59b54920e5ff90cf1f465a 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
@@ -284,7 +284,9 @@ public class StructureTemplate {
diff --git a/patches/server/0103-Add-setting-for-proxy-online-mode-status.patch b/patches/server/0103-Add-setting-for-proxy-online-mode-status.patch
index e5e736fdcc..c84f4c5ce2 100644
--- a/patches/server/0103-Add-setting-for-proxy-online-mode-status.patch
+++ b/patches/server/0103-Add-setting-for-proxy-online-mode-status.patch
@@ -32,7 +32,7 @@ index c6ca15a5cc53995ca0ada9c9ac9dc1d084963eb5..728835cddd413d778e9628360989724f
+ }
}
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
-index 6914ab77fc868844c391ac41ba2d344a26012208..00f783aafd81fa7e836e4eea5bfeac7434f33b0f 100644
+index 920a1ded577aa1c265137dd72a6f3d13a431d5c8..c3e3a9950ee05dc97f15ab128e40854901f38a2f 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -98,6 +98,7 @@ public class GameProfileCache {
@@ -53,7 +53,7 @@ index 6914ab77fc868844c391ac41ba2d344a26012208..00f783aafd81fa7e836e4eea5bfeac74
public synchronized void add(GameProfile profile) { // Paper - synchronize
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
-index 876658b685ea09adb4c01d436da56daadb7eedaa..5445cb5910ec63408dc4379eec5e12d305182527 100644
+index b7b98832be6178a2bca534bf974519ede977b282..aa3caccc58f1cec8d5f396813d7fc40b05985cc8 100644
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
@@ -66,7 +66,8 @@ public class OldUsersConverter {
@@ -67,10 +67,10 @@ index 876658b685ea09adb4c01d436da56daadb7eedaa..5445cb5910ec63408dc4379eec5e12d3
} else {
String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 1065f69322bb9d068f4ec63e40cc4db6f5425c40..88315ebb3b5e698ecc8332951ad72ef538bc44fd 100644
+index ad851aa3a29b6aabfcfe7f95df15303437c48eaa..2b6df52d586acf28aaf531c39073cf9448c589f9 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -1705,7 +1705,7 @@ public final class CraftServer implements Server {
+@@ -1697,7 +1697,7 @@ public final class CraftServer implements Server {
// Spigot Start
GameProfile profile = null;
// Only fetch an online UUID in online mode
diff --git a/patches/server/0105-Configurable-packet-in-spam-threshold.patch b/patches/server/0105-Configurable-packet-in-spam-threshold.patch
index f7827b058a..1be2ad9b6a 100644
--- a/patches/server/0105-Configurable-packet-in-spam-threshold.patch
+++ b/patches/server/0105-Configurable-packet-in-spam-threshold.patch
@@ -23,10 +23,10 @@ index 728835cddd413d778e9628360989724f65335b46..6c13fe725ca2b2a6f0f375b80f6c2cb6
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index bacb8ff97a6745847b5e3eb82dd08bde934e8d1f..035920097271ce50b21eddbed7c874b9628ac28a 100644
+index 024f6b5bf84a4e55f6237107ae8f8958caa9ef72..6547de3f54ac69af84430d0277f156adacdaa3e7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1494,13 +1494,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1502,13 +1502,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// Spigot start - limit place/interactions
private int limitedPackets;
private long lastLimitedPacket = -1;
diff --git a/patches/server/0106-Configurable-flying-kick-messages.patch b/patches/server/0106-Configurable-flying-kick-messages.patch
index 117a151ad5..fa67571d72 100644
--- a/patches/server/0106-Configurable-flying-kick-messages.patch
+++ b/patches/server/0106-Configurable-flying-kick-messages.patch
@@ -21,11 +21,11 @@ index 6c13fe725ca2b2a6f0f375b80f6c2cb643b9913d..5e23ff0c5e44427a996281ae42fc12c2
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 035920097271ce50b21eddbed7c874b9628ac28a..16bb1d2d5f168d45bef86fad6e9ebc68f2e822f4 100644
+index 6547de3f54ac69af84430d0277f156adacdaa3e7..df5282a1bb7d685f0f322f5976d8cf7d31abed49 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -299,7 +299,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
- if (this.clientIsFloating && !this.player.isSleeping()) {
+@@ -300,7 +300,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+ if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger()) {
if (++this.aboveGroundTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
- this.disconnect(new TranslatableComponent("multiplayer.disconnect.flying"));
@@ -33,7 +33,7 @@ index 035920097271ce50b21eddbed7c874b9628ac28a..16bb1d2d5f168d45bef86fad6e9ebc68
return;
}
} else {
-@@ -318,7 +318,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -319,7 +319,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) {
if (++this.aboveGroundVehicleTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
diff --git a/patches/server/0109-Add-EntityZapEvent.patch b/patches/server/0109-Add-EntityZapEvent.patch
index d6adf42ff7..d3e5095d8a 100644
--- a/patches/server/0109-Add-EntityZapEvent.patch
+++ b/patches/server/0109-Add-EntityZapEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityZapEvent
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
-index e2ac5290751b8c219add3823251e0131c0d2b52e..8785a112519de49e0d61eab5ab5325f9b2068d7e 100644
+index 819f694e96dd21bbc47f345fcd9c5714ab44040f..32a961075b41cd84b24398b9d1a4d58f88439d73 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
-@@ -834,9 +834,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -836,9 +836,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@Override
public void thunderHit(ServerLevel world, LightningBolt lightning) {
if (world.getDifficulty() != Difficulty.PEACEFUL) {
diff --git a/patches/server/0110-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch b/patches/server/0110-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch
index 5c61ef4f95..6b19770c9d 100644
--- a/patches/server/0110-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch
+++ b/patches/server/0110-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch
@@ -22,10 +22,10 @@ index 80345730b8ccc11d3d0833485d25b03f614aeee2..6eb3678177834a4b34b78ba8e359528d
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
-index 0366303a986ae6da8e95ed3051610c432a790194..a8a9cbcece45c3480120cb2fa0fa03523a87d317 100644
+index 2bc46e02779d22adedc1fd9e5c9130c209bd58f7..c1de9740d199dc862f8e85251a5de021499e0031 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
-@@ -324,6 +324,18 @@ public class FallingBlockEntity extends Entity {
+@@ -309,6 +309,18 @@ public class FallingBlockEntity extends Entity {
@Override
protected void readAdditionalSaveData(CompoundTag nbt) {
this.blockState = NbtUtils.readBlockState(nbt.getCompound("BlockState"));
diff --git a/patches/server/0111-Cache-user-authenticator-threads.patch b/patches/server/0111-Cache-user-authenticator-threads.patch
index 2acf356122..a2659f2b46 100644
--- a/patches/server/0111-Cache-user-authenticator-threads.patch
+++ b/patches/server/0111-Cache-user-authenticator-threads.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Cache user authenticator threads
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-index 08e7fd48514f9a6e89efc0d8adcbcf14bc92b103..afa04bbf778e5dd0823a0aab0573e4cc3787858d 100644
+index 627931ec09bfb1a84f0659981491cf3b6425aa32..58ef6874cd6c90e6ccc7c39881cc3bf68fba284b 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-@@ -117,6 +117,18 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -116,6 +116,18 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
}
@@ -48,7 +48,7 @@ index 08e7fd48514f9a6e89efc0d8adcbcf14bc92b103..afa04bbf778e5dd0823a0aab0573e4cc
// Spigot end
}
-@@ -251,7 +264,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -257,7 +270,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
throw new IllegalStateException("Protocol error", cryptographyexception);
}
@@ -58,7 +58,7 @@ index 08e7fd48514f9a6e89efc0d8adcbcf14bc92b103..afa04bbf778e5dd0823a0aab0573e4cc
public void run() {
GameProfile gameprofile = ServerLoginPacketListenerImpl.this.gameProfile;
-@@ -296,10 +310,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -302,10 +316,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
return ServerLoginPacketListenerImpl.this.server.getPreventProxyConnections() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null;
}
diff --git a/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch b/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch
index df81c4e815..d14d3142e0 100644
--- a/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch
+++ b/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 88315ebb3b5e698ecc8332951ad72ef538bc44fd..903e4d866ffd2711c540c8982fe189d6992361f3 100644
+index 2b6df52d586acf28aaf531c39073cf9448c589f9..eacf4e00d7ce0c1458428237e6c67aaddb45b77a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2526,5 +2526,24 @@ public final class CraftServer implements Server {
+@@ -2518,5 +2518,24 @@ public final class CraftServer implements Server {
DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions();
}
diff --git a/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch b/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch
index 77a2014835..55ccd362c3 100644
--- a/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch
+++ b/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add source to PlayerExpChangeEvent
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-index 687904d3e1b3ee7b514c707d9b2eeccabbf56603..f7cbe6819b8c4f7eaca2389de8eaceb50bce4b15 100644
+index dba0bc7dc8fd1993f45716a398b1ccf52d3d868b..b3433ce9c722bdab81848a6c2d121ca510c48509 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-@@ -246,7 +246,7 @@ public class ExperienceOrb extends Entity {
+@@ -247,7 +247,7 @@ public class ExperienceOrb extends Entity {
int i = this.repairPlayerItems(player, this.value);
if (i > 0) {
diff --git a/patches/server/0114-Don-t-let-fishinghooks-use-portals.patch b/patches/server/0114-Don-t-let-fishinghooks-use-portals.patch
index 24eb5689a7..dfedf4f2ed 100644
--- a/patches/server/0114-Don-t-let-fishinghooks-use-portals.patch
+++ b/patches/server/0114-Don-t-let-fishinghooks-use-portals.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't let fishinghooks use portals
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
-index eaa3ed52a57b56fc0f260aadfd23c2fd6dfc0f51..54bd343def9f1ebc987640c5d756db906593f320 100644
+index 24192a91d9f5c890a316ec150d4aec84073cb61a..3b23279ce994b9684dbc10157839f5fc47edfabd 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
-@@ -252,6 +252,11 @@ public class FishingHook extends Projectile {
+@@ -255,6 +255,11 @@ public class FishingHook extends Projectile {
this.setDeltaMovement(this.getDeltaMovement().scale(0.92D));
this.reapplyPosition();
diff --git a/patches/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch b/patches/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch
index ccae63f6f8..c6fb2bcab4 100644
--- a/patches/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch
+++ b/patches/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z
Reduce method invocations for World.isLoaded(BlockPosition)Z
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index e33c9116ebd8ad751774fd0fa736c42214aed654..d65fcf365a2c24c099e70597c843562ec341df3a 100644
+index 9abe4b8bbd97c30d84964d3c66a61e8b43140adb..567cc347af00eed98fdf8832ef6c9468332b94e4 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -320,6 +320,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -319,6 +319,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return chunk == null ? null : chunk.getFluidState(blockposition);
}
diff --git a/patches/server/0118-Bound-Treasure-Maps-to-World-Border.patch b/patches/server/0118-Bound-Treasure-Maps-to-World-Border.patch
index 0e66af94ae..3985c7f8aa 100644
--- a/patches/server/0118-Bound-Treasure-Maps-to-World-Border.patch
+++ b/patches/server/0118-Bound-Treasure-Maps-to-World-Border.patch
@@ -33,15 +33,15 @@ index 6ec5a1525d0b8ced8fe78d3eab29c5eb82996844..2442c287a7f26cfee10a19e9015558cd
public boolean isWithinBounds(ChunkPos pos) {
return (double) pos.getMaxBlockX() > this.getMinX() && (double) pos.getMinBlockX() < this.getMaxX() && (double) pos.getMaxBlockZ() > this.getMinZ() && (double) pos.getMinBlockZ() < this.getMaxZ();
}
-diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java
-index cea24d53d94973218d947ece41be722f1ee79b7e..461464a4208bbb09800d87bcdb54978758863c7b 100644
---- a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java
-+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java
-@@ -168,6 +168,7 @@ public class StructureFeature {
- int o = j + i * m;
- int p = k + i * n;
- ChunkPos chunkPos = this.getPotentialFeatureChunk(config, worldSeed, o, p);
-+ if (!world.getWorldBorder().isChunkInBounds(chunkPos.x, chunkPos.z)) { continue; } // Paper
- StructureCheckResult structureCheckResult = structureAccessor.checkStructurePresence(chunkPos, this, skipExistingChunks);
- if (structureCheckResult != StructureCheckResult.START_NOT_PRESENT) {
- if (!skipExistingChunks && structureCheckResult == StructureCheckResult.START_PRESENT) {
+diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+index ebdf71c5dc31dc002c5bb222e954c39e69ac7449..f9fc2fc63080a60fe61ebb08ddd93c4f189df84d 100644
+--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
++++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+@@ -432,6 +432,7 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource {
+ int l1 = i + i1 * j1;
+ int i2 = j + i1 * k1;
+ ChunkPos chunkcoordintpair = randomspreadstructureplacement.getPotentialFeatureChunk(l, l1, i2);
++ if (!iworldreader.getWorldBorder().isChunkInBounds(chunkcoordintpair.x, chunkcoordintpair.z)) { continue; } // Paper
+ Iterator iterator = set.iterator();
+
+ while (iterator.hasNext()) {
diff --git a/patches/server/0119-Configurable-Cartographer-Treasure-Maps.patch b/patches/server/0119-Configurable-Cartographer-Treasure-Maps.patch
index a869fa0af1..2e6f72a1a7 100644
--- a/patches/server/0119-Configurable-Cartographer-Treasure-Maps.patch
+++ b/patches/server/0119-Configurable-Cartographer-Treasure-Maps.patch
@@ -28,10 +28,10 @@ index 6eb3678177834a4b34b78ba8e359528de7c0d2f0..f383f30b9dd1a7c6cf69d342f99118be
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java
-index a75236c1374919f7640e3b705f696dd8568eb3dc..90d77153d818534b1cb53ce80ea5409a709a2384 100644
+index 7eda0af21ce7662e9bb6d47c79e175a060a8bb13..52382b5b8149351ecf981d5414a0a50025f181c7 100644
--- a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java
+++ b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java
-@@ -383,7 +383,8 @@ public class VillagerTrades {
+@@ -386,7 +386,8 @@ public class VillagerTrades {
return null;
} else {
ServerLevel serverLevel = (ServerLevel)entity.level;
@@ -42,10 +42,10 @@ index a75236c1374919f7640e3b705f696dd8568eb3dc..90d77153d818534b1cb53ce80ea5409a
ItemStack itemStack = MapItem.create(serverLevel, blockPos.getX(), blockPos.getZ(), (byte)2, true, true);
MapItem.renderBiomePreviewMap(serverLevel, itemStack);
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java b/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java
-index bdc0de577d3acca7d9e03d184ac65b97c5b3e68a..6dc8d85f4b8a0aa24ae22d46da4a3f89c7e01871 100644
+index 385cae45ef8cbaf9f09472585e6f639eea3e0331..722930d400a35140542b742ae8ae1784ecfa0e33 100644
--- a/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java
+++ b/src/main/java/net/minecraft/world/level/storage/loot/functions/ExplorationMapFunction.java
-@@ -65,7 +65,16 @@ public class ExplorationMapFunction extends LootItemConditionalFunction {
+@@ -68,7 +68,16 @@ public class ExplorationMapFunction extends LootItemConditionalFunction {
Vec3 vec3 = context.getParamOrNull(LootContextParams.ORIGIN);
if (vec3 != null) {
ServerLevel serverLevel = context.getLevel();
diff --git a/patches/server/0120-Optimize-ItemStack.isEmpty.patch b/patches/server/0120-Optimize-ItemStack.isEmpty.patch
index b3f1e45f9e..d850c3dd8e 100644
--- a/patches/server/0120-Optimize-ItemStack.isEmpty.patch
+++ b/patches/server/0120-Optimize-ItemStack.isEmpty.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Optimize ItemStack.isEmpty()
Remove hashMap lookup every check, simplify code to remove ternary
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index 74e4990888d88f18cb3d800724d9156e9d1ae21d..ce082016d841e3e7ba46b722b85edae9acc3f290 100644
+index d66cc030dcd3d98f57803938c8c06342a028ee88..65189af7acc3e60fc7f2bfe82128ada981bf1271 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -239,7 +239,7 @@ public final class ItemStack {
+@@ -245,7 +245,7 @@ public final class ItemStack {
}
public boolean isEmpty() {
diff --git a/patches/server/0123-Properly-fix-item-duplication-bug.patch b/patches/server/0123-Properly-fix-item-duplication-bug.patch
index 108516c04e..c4ab6603a8 100644
--- a/patches/server/0123-Properly-fix-item-duplication-bug.patch
+++ b/patches/server/0123-Properly-fix-item-duplication-bug.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug
Credit to prplz for figuring out the real issue
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 3a97690a1e65db9a1c184fa4df5899cfda3d44bc..ab73818893b00551f8137704a727e33046d43a6a 100644
+index fa3344c71a9715ad465f39be92cb724368ae2b03..2fbe90ba893393e04b72b9feeff5f6be09d65e16 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2158,7 +2158,7 @@ public class ServerPlayer extends Player {
+@@ -2156,7 +2156,7 @@ public class ServerPlayer extends Player {
@Override
public boolean isImmobile() {
@@ -19,10 +19,10 @@ index 3a97690a1e65db9a1c184fa4df5899cfda3d44bc..ab73818893b00551f8137704a727e330
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 16bb1d2d5f168d45bef86fad6e9ebc68f2e822f4..1a29ea597de65689b5e374e98da988e86afb4d11 100644
+index df5282a1bb7d685f0f322f5976d8cf7d31abed49..0b15188c1357926f72265411eb776726a5aa21f6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2821,7 +2821,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2845,7 +2845,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
public final boolean isDisconnected() {
diff --git a/patches/server/0124-Firework-API-s.patch b/patches/server/0124-Firework-API-s.patch
index d4441c92dc..326eaa7490 100644
--- a/patches/server/0124-Firework-API-s.patch
+++ b/patches/server/0124-Firework-API-s.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Firework API's
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
-index 60d60e368191038537f6a18f336565994a6b23ec..fe502e148e218ae404e0049c0251d3e3ca08c825 100644
+index 231d5923a2df7f1e7428555a3f28b83f95fc4b44..9930f7a0681899017329bd2c599db7308310b395 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
@@ -39,6 +39,7 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
@@ -16,7 +16,7 @@ index 60d60e368191038537f6a18f336565994a6b23ec..fe502e148e218ae404e0049c0251d3e3
public FireworkRocketEntity(EntityType extends FireworkRocketEntity> type, Level world) {
super(type, world);
-@@ -315,6 +316,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
+@@ -318,6 +319,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
}
nbt.putBoolean("ShotAtAngle", (Boolean) this.entityData.get(FireworkRocketEntity.DATA_SHOT_AT_ANGLE));
@@ -28,7 +28,7 @@ index 60d60e368191038537f6a18f336565994a6b23ec..fe502e148e218ae404e0049c0251d3e3
}
@Override
-@@ -331,7 +337,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
+@@ -334,7 +340,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
if (nbt.contains("ShotAtAngle")) {
this.entityData.set(FireworkRocketEntity.DATA_SHOT_AT_ANGLE, nbt.getBoolean("ShotAtAngle"));
}
diff --git a/patches/server/0125-PlayerTeleportEndGatewayEvent.patch b/patches/server/0125-PlayerTeleportEndGatewayEvent.patch
index a668335f00..16c800730a 100644
--- a/patches/server/0125-PlayerTeleportEndGatewayEvent.patch
+++ b/patches/server/0125-PlayerTeleportEndGatewayEvent.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] PlayerTeleportEndGatewayEvent
Allows you to access the Gateway being used in a teleport event
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
-index 1001c318be6e57f5f55a842c148d29cf09d1e138..8af71dd1b916be666ee163904118db46fd3c9850 100644
+index 5b6b827db29756b2db0aaa26c84ddb4bccaade19..d336cf8f845a4d35a2d0a4cbe3b1b373fb00a970 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
-@@ -11,6 +11,7 @@ import net.minecraft.data.worldgen.features.EndFeatures;
+@@ -12,6 +12,7 @@ import net.minecraft.data.worldgen.features.EndFeatures;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
@@ -17,7 +17,7 @@ index 1001c318be6e57f5f55a842c148d29cf09d1e138..8af71dd1b916be666ee163904118db46
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.Mth;
-@@ -209,7 +210,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
+@@ -210,7 +211,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
location.setPitch(player.getLocation().getPitch());
location.setYaw(player.getLocation().getYaw());
diff --git a/patches/server/0126-Provide-E-TE-Chunk-count-stat-methods.patch b/patches/server/0126-Provide-E-TE-Chunk-count-stat-methods.patch
index a13384e257..5cd92db02e 100644
--- a/patches/server/0126-Provide-E-TE-Chunk-count-stat-methods.patch
+++ b/patches/server/0126-Provide-E-TE-Chunk-count-stat-methods.patch
@@ -7,10 +7,10 @@ Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index d65fcf365a2c24c099e70597c843562ec341df3a..41e7474588d8e5ba4cd4af0fed1e62e452389a3e 100644
+index 567cc347af00eed98fdf8832ef6c9468332b94e4..d22b7edc9ddea765c11e82346afd3942e37831de 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -113,7 +113,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -110,7 +110,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public static final int TICKS_PER_DAY = 24000;
public static final int MAX_ENTITY_SPAWN_Y = 20000000;
public static final int MIN_ENTITY_SPAWN_Y = -20000000;
@@ -20,10 +20,10 @@ index d65fcf365a2c24c099e70597c843562ec341df3a..41e7474588d8e5ba4cd4af0fed1e62e4
private boolean tickingBlockEntities;
public final Thread thread;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index deeb4afbbe6d4b6f44dfe20265a1a2d7d7e66e2e..e2289fbfbb59b0b1d2a09d6bb0e17664de209ebb 100644
+index 48812a4fe0c12689dd9d7829019cdf70e0bda65b..e90773c4824edf29a553827dd986209b2dd3f985 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -141,6 +141,57 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -144,6 +144,57 @@ public class CraftWorld extends CraftRegionAccessor implements World {
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftWorld.DATA_TYPE_REGISTRY);
private net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers
diff --git a/patches/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch b/patches/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch
index ef3e224b2a..038c5c2f94 100644
--- a/patches/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch
+++ b/patches/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't allow entities to ride themselves - #572
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 31d5d69ba7e78158bf854a25e2bf43b119e0bf88..ebf9e06b4fdd64d22ad2b56c26b4c994c1a84833 100644
+index 6f33e481e70a7b34a25d1413079288ca59b058c1..5a98227902dfd87cda7c046f6fde0aeb4462353f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2256,6 +2256,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -2260,6 +2260,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
}
protected boolean addPassenger(Entity entity) { // CraftBukkit
diff --git a/patches/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
index e373959abf..f75549faf4 100644
--- a/patches/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
+++ b/patches/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
@@ -8,10 +8,10 @@ Adds lots of information about why this orb exists.
Replaces isFromBottle() with logic that persists entity reloads too.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
-index 252613e3c4c496bd4f6fd061e36fac06c32323c9..12c9efc409e5306fb24b8338d4c60286cff1435c 100644
+index 5a041f178184550a5b839bfa45fa271816e52e3d..c0f712fd4dd57080044341c7c7c8faf09572c2c5 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
-@@ -416,7 +416,7 @@ public class ServerPlayerGameMode {
+@@ -426,7 +426,7 @@ public class ServerPlayerGameMode {
// Drop event experience
if (flag && event != null) {
@@ -21,10 +21,10 @@ index 252613e3c4c496bd4f6fd061e36fac06c32323c9..12c9efc409e5306fb24b8338d4c60286
return true;
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-index f7cbe6819b8c4f7eaca2389de8eaceb50bce4b15..90692df7e02346d4ba785d2eaf724d06b98b4438 100644
+index b3433ce9c722bdab81848a6c2d121ca510c48509..227aca795efc99c4f81dfb30c00d31d2d7524542 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-@@ -38,13 +38,63 @@ public class ExperienceOrb extends Entity {
+@@ -37,13 +37,63 @@ public class ExperienceOrb extends Entity {
public int value;
private int count;
private Player followingPlayer;
@@ -90,7 +90,7 @@ index f7cbe6819b8c4f7eaca2389de8eaceb50bce4b15..90692df7e02346d4ba785d2eaf724d06
}
public ExperienceOrb(EntityType extends ExperienceOrb> type, Level world) {
-@@ -154,12 +204,20 @@ public class ExperienceOrb extends Entity {
+@@ -153,12 +203,20 @@ public class ExperienceOrb extends Entity {
}
public static void award(ServerLevel world, Vec3 pos, int amount) {
@@ -112,7 +112,7 @@ index f7cbe6819b8c4f7eaca2389de8eaceb50bce4b15..90692df7e02346d4ba785d2eaf724d06
}
}
-@@ -227,6 +285,7 @@ public class ExperienceOrb extends Entity {
+@@ -228,6 +286,7 @@ public class ExperienceOrb extends Entity {
nbt.putShort("Age", (short) this.age);
nbt.putShort("Value", (short) this.value);
nbt.putInt("Count", this.count);
@@ -120,7 +120,7 @@ index f7cbe6819b8c4f7eaca2389de8eaceb50bce4b15..90692df7e02346d4ba785d2eaf724d06
}
@Override
-@@ -235,6 +294,7 @@ public class ExperienceOrb extends Entity {
+@@ -236,6 +295,7 @@ public class ExperienceOrb extends Entity {
this.age = nbt.getShort("Age");
this.value = nbt.getShort("Value");
this.count = Math.max(nbt.getInt("Count"), 1);
@@ -129,10 +129,10 @@ index f7cbe6819b8c4f7eaca2389de8eaceb50bce4b15..90692df7e02346d4ba785d2eaf724d06
@Override
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index fcf9206ef317aa22cd644ccb415c2156fd9f2af2..3490b9f1803ea852ad0682e22524b58c3b050510 100644
+index 2ce597f594142d64a239649e1b812b3b7b0af340..7df80e251dbdaff32cdc0f3e7dffc9ea6d163b09 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -1697,7 +1697,8 @@ public abstract class LivingEntity extends Entity {
+@@ -1700,7 +1700,8 @@ public abstract class LivingEntity extends Entity {
protected void dropExperience() {
// CraftBukkit start - Update getExpReward() above if the removed if() changes!
if (true) {
@@ -143,10 +143,10 @@ index fcf9206ef317aa22cd644ccb415c2156fd9f2af2..3490b9f1803ea852ad0682e22524b58c
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java
-index 4f18af2691e149e42567c45b934adf62a589ebe0..2bc77858b4a78e24227b4b096fd44177202d5292 100644
+index 884491126f9a0b1436953ea1721746e9690ca250..3d76b91f43fb2d261e270ba52fafe2648ba6abc9 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Animal.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java
-@@ -272,7 +272,7 @@ public abstract class Animal extends AgeableMob {
+@@ -271,7 +271,7 @@ public abstract class Animal extends AgeableMob {
if (world.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
// CraftBukkit start - use event experience
if (experience > 0) {
@@ -156,10 +156,10 @@ index 4f18af2691e149e42567c45b934adf62a589ebe0..2bc77858b4a78e24227b4b096fd44177
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
-index 5220c9512c2a3e12a183b3c5ee42346f073661d9..2caf3aa6ca876d59deb98ee917e8228df140b414 100644
+index 483703458a374a27a1e30ea1fb1f08ec451046a7..6ffd1aec3563e92f5d5975d3fb4d3d89feec1416 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
-@@ -888,7 +888,7 @@ public class Fox extends Animal {
+@@ -890,7 +890,7 @@ public class Fox extends Animal {
if (this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
// CraftBukkit start - use event experience
if (experience > 0) {
@@ -169,10 +169,10 @@ index 5220c9512c2a3e12a183b3c5ee42346f073661d9..2caf3aa6ca876d59deb98ee917e8228d
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
-index 29ced58a41889b63282ac5abf984e14f007407c3..44679e3b44b03dc20b3763af84df655d81680c06 100644
+index 6af8773e80351f14204b969d7bbdd976b39e99d7..ea1bb6924043dfd05452b793afd7651c867de5dc 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
-@@ -452,7 +452,7 @@ public class Turtle extends Animal {
+@@ -450,7 +450,7 @@ public class Turtle extends Animal {
Random random = this.animal.getRandom();
if (this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
@@ -182,10 +182,10 @@ index 29ced58a41889b63282ac5abf984e14f007407c3..44679e3b44b03dc20b3763af84df655d
}
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
-index 2584c02a5f6511ade260986a6aacef401c294549..19e594757fca90c64c4dc59233ff956e7c316da9 100644
+index 89bd094fc31969284d831eaab47a131914d4fb13..139c98ab86589027873418601dbc7f4ed6358906 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
-@@ -634,7 +634,7 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -631,7 +631,7 @@ public class EnderDragon extends Mob implements Enemy {
if (this.level instanceof ServerLevel) {
if (this.dragonDeathTime > 150 && this.dragonDeathTime % 5 == 0 && flag) {
@@ -194,7 +194,7 @@ index 2584c02a5f6511ade260986a6aacef401c294549..19e594757fca90c64c4dc59233ff956e
}
if (this.dragonDeathTime == 1 && !this.isSilent()) {
-@@ -665,7 +665,7 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -662,7 +662,7 @@ public class EnderDragon extends Mob implements Enemy {
this.yBodyRot = this.getYRot();
if (this.dragonDeathTime == 200 && this.level instanceof ServerLevel) {
if (flag) {
@@ -204,10 +204,10 @@ index 2584c02a5f6511ade260986a6aacef401c294549..19e594757fca90c64c4dc59233ff956e
if (this.dragonFight != null) {
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
-index 8785a112519de49e0d61eab5ab5325f9b2068d7e..bd073ac603be130e649d206992c01860ee72d531 100644
+index 32a961075b41cd84b24398b9d1a4d58f88439d73..ac44ba98d0acc9aa2a75088d8a9a145fdbcbd911 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
-@@ -622,7 +622,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -624,7 +624,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
if (offer.shouldRewardExp()) {
@@ -217,10 +217,10 @@ index 8785a112519de49e0d61eab5ab5325f9b2068d7e..bd073ac603be130e649d206992c01860
}
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
-index 9001d627060b9691b703b4c0e157124b0cdee6bb..1101989e93758294c1adebbef0ab12a3c046e326 100644
+index b9a0fc52460ce0c50deea25112dee20c977e99c5..d7cb3d8b37f225ee4796246aa907da1092fa9a0d 100644
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
-@@ -187,7 +187,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
+@@ -186,7 +186,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
if (offer.shouldRewardExp()) {
int i = 3 + this.random.nextInt(4);
@@ -230,10 +230,10 @@ index 9001d627060b9691b703b4c0e157124b0cdee6bb..1101989e93758294c1adebbef0ab12a3
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
-index c4126c0ced9cd8f7f23f91e2d141c37ba85da6af..c51dbef3bf17405be368d4caec72b713e06bafbc 100644
+index 3b23279ce994b9684dbc10157839f5fc47edfabd..90a5a5ede2c65d74dec4ac247e8411636fc20f78 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
-@@ -515,7 +515,7 @@ public class FishingHook extends Projectile {
+@@ -518,7 +518,7 @@ public class FishingHook extends Projectile {
this.level.addFreshEntity(entityitem);
// CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop()
if (playerFishEvent.getExpToDrop() > 0) {
@@ -241,7 +241,7 @@ index c4126c0ced9cd8f7f23f91e2d141c37ba85da6af..c51dbef3bf17405be368d4caec72b713
+ entityhuman.level.addFreshEntity(new ExperienceOrb(entityhuman.level, entityhuman.getX(), entityhuman.getY() + 0.5D, entityhuman.getZ() + 0.5D, playerFishEvent.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.FISHING, this.getPlayerOwner(), this)); // Paper
}
// CraftBukkit end
- if (itemstack1.is((Tag) ItemTags.FISHES)) {
+ if (itemstack1.is(ItemTags.FISHES)) {
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java
index db6b1a9804a6d75dce22b780044beb04ca69cc94..dcbbff3a8dfcac869f07025e0e8e3d9c47956093 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java
@@ -269,10 +269,10 @@ index dbdba510d8ff3c622ed928151cf525cfd1d1b1b5..aa0ba9c7dcb0ee81c9081031c447eeab
world.levelEvent(1042, blockposition, 0);
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
-index 5147f67c87ba3b8912a8ae24f876a9e996504600..b77eda6af8b430311e502465a2590d83555ff6cf 100644
+index 54125cf5957f8165551e077c47d02b7daa578efb..59a8d1984f3bcc94048a4ce3e530d21cc3f39d7f 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
-@@ -372,8 +372,13 @@ public class Block extends BlockBehaviour implements ItemLike {
+@@ -374,8 +374,13 @@ public class Block extends BlockBehaviour implements ItemLike {
}
public void popExperience(ServerLevel world, BlockPos pos, int size) {
@@ -288,10 +288,10 @@ index 5147f67c87ba3b8912a8ae24f876a9e996504600..b77eda6af8b430311e502465a2590d83
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
-index 16c272856bf9d8f8f2bf18f408cea2de94177f37..d39546b3f8d0c97fefdcc90f638eee60a5db409e 100644
+index b44216c8f5a938a92fda4156ac67988d1c399c99..c3c53a34f645a834256c31951e465ae33aa1a9ff 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
-@@ -627,7 +627,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
+@@ -629,7 +629,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
j = event.getExpToDrop();
// CraftBukkit end
@@ -301,10 +301,10 @@ index 16c272856bf9d8f8f2bf18f408cea2de94177f37..d39546b3f8d0c97fefdcc90f638eee60
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
-index caccb8d7b30e616a4fb367e2e1c42845dd9a1880..ef3874fccb5d8b99c2b6753e7c60b83f5e3f316b 100644
+index 67223f63fdad5c53008c51b774917882c83ab707..8fb3e18303abbedb9c07319d11619c39743cbaf8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
-@@ -883,7 +883,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
+@@ -884,7 +884,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
} else if (TNTPrimed.class.isAssignableFrom(clazz)) {
entity = new PrimedTnt(world, x, y, z, null);
} else if (ExperienceOrb.class.isAssignableFrom(clazz)) {
diff --git a/patches/server/0130-Cap-Entity-Collisions.patch b/patches/server/0130-Cap-Entity-Collisions.patch
index 1de881f659..916e6315f0 100644
--- a/patches/server/0130-Cap-Entity-Collisions.patch
+++ b/patches/server/0130-Cap-Entity-Collisions.patch
@@ -27,10 +27,10 @@ index f383f30b9dd1a7c6cf69d342f99118beec70b206..47b717e8741bb2b8f3aa776dcdc73a3e
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index ebf9e06b4fdd64d22ad2b56c26b4c994c1a84833..fb7487b52af00ae44e669242a4182a49e9b00428 100644
+index 5a98227902dfd87cda7c046f6fde0aeb4462353f..9bf0d7dca8abee27ca5757bc3e56c723d910623b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -314,6 +314,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -317,6 +317,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
public void inactiveTick() { }
// Spigot end
// Paper start
@@ -39,10 +39,10 @@ index ebf9e06b4fdd64d22ad2b56c26b4c994c1a84833..fb7487b52af00ae44e669242a4182a49
private org.bukkit.util.Vector origin;
@javax.annotation.Nullable
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 3490b9f1803ea852ad0682e22524b58c3b050510..9c175c28d152d4a6af9a720cfd95df7fdcc1be81 100644
+index 7df80e251dbdaff32cdc0f3e7dffc9ea6d163b09..f7d100d5fa85cd2e705e78be8dc6373f02d0adc0 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3225,8 +3225,11 @@ public abstract class LivingEntity extends Entity {
+@@ -3228,8 +3228,11 @@ public abstract class LivingEntity extends Entity {
}
}
diff --git a/patches/server/0133-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/patches/server/0133-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch
index dcbdf3eafc..a1b0e025ae 100644
--- a/patches/server/0133-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch
+++ b/patches/server/0133-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch
@@ -5,19 +5,20 @@ Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index c72d19a903a5cbb48d38f493e00e8c54a8e23b9c..065ee0486ec275f9b61dc18afa86023183f0c73b 100644
+index a10848e6899853f447f101675e3a6aba9d3d43f3..50b2dc91f4926ebc4511e44e3aa3062eadc40ea0 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -221,7 +221,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
- this.playerMap = new PlayerMap();
+@@ -226,8 +226,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.entityMap = new Int2ObjectOpenHashMap();
this.chunkTypeCache = new Long2ByteOpenHashMap();
+ this.chunkSaveCooldowns = new Long2LongOpenHashMap();
- this.unloadQueue = Queues.newConcurrentLinkedQueue();
-+ this.unloadQueue = new com.destroystokyo.paper.utils.CachedSizeConcurrentLinkedQueue<>(); // Paper - need constant-time size()
this.structureManager = structureManager;
++ this.unloadQueue = new com.destroystokyo.paper.utils.CachedSizeConcurrentLinkedQueue<>(); // Paper - need constant-time size()
Path path = session.getDimensionPath(world.dimension());
-@@ -529,7 +529,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ this.storageName = path.getFileName().toString();
+@@ -569,7 +569,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Spigot start
org.spigotmc.SlackActivityAccountant activityAccountant = this.level.getServer().slackActivityAccountant;
activityAccountant.startActivity(0.5);
@@ -26,7 +27,7 @@ index c72d19a903a5cbb48d38f493e00e8c54a8e23b9c..065ee0486ec275f9b61dc18afa860231
// Spigot end
while (longiterator.hasNext()) { // Spigot
long j = longiterator.nextLong();
-@@ -549,7 +549,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -589,7 +589,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
activityAccountant.endActivity(); // Spigot
diff --git a/patches/server/0134-Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/0134-Properly-handle-async-calls-to-restart-the-server.patch
index d82ad563d0..6ca594aa9f 100644
--- a/patches/server/0134-Properly-handle-async-calls-to-restart-the-server.patch
+++ b/patches/server/0134-Properly-handle-async-calls-to-restart-the-server.patch
@@ -30,10 +30,10 @@ will have plugins and worlds saving to the disk has a high potential to result
in corruption/dataloss.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 370e9a840a9c8abf8804755c0395d51fd576ee49..0cf83ee46754197b2b639d07bff9a0d21566a641 100644
+index 3e858ae243eaf9e145cbc5288ac2e3467082e369..fc64c29058e68239e25c51cefe97627be2a13d33 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -229,6 +229,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, ServerLevel> levels;
private PlayerList playerList;
private volatile boolean running;
@@ -41,7 +41,7 @@ index 370e9a840a9c8abf8804755c0395d51fd576ee49..0cf83ee46754197b2b639d07bff9a0d2
private boolean stopped;
private int tickCount;
protected final Proxy proxy;
-@@ -929,7 +930,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0.5F || this.isInWater()) || this.abilities.flying || this.isSleeping() || this.isInPowderSnow) {
diff --git a/patches/server/0136-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0136-Add-configuration-option-to-prevent-player-names-fro.patch
index e5cc70d5f8..00da544c8d 100644
--- a/patches/server/0136-Add-configuration-option-to-prevent-player-names-fro.patch
+++ b/patches/server/0136-Add-configuration-option-to-prevent-player-names-fro.patch
@@ -20,10 +20,10 @@ index 5e23ff0c5e44427a996281ae42fc12c28649e158..7a69f9d9bb9c05474d8fbab22d626529
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 903e4d866ffd2711c540c8982fe189d6992361f3..2d782eb547136e1dae123044b114bd77ca23383a 100644
+index eacf4e00d7ce0c1458428237e6c67aaddb45b77a..ef55ae870e341af0087bc99341a77c5d1b851328 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2545,5 +2545,10 @@ public final class CraftServer implements Server {
+@@ -2537,5 +2537,10 @@ public final class CraftServer implements Server {
commandMap.registerServerAliases();
return true;
}
diff --git a/patches/server/0137-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0137-Use-TerminalConsoleAppender-for-console-improvements.patch
index 8906362c5b..cd5ce96e3c 100644
--- a/patches/server/0137-Use-TerminalConsoleAppender-for-console-improvements.patch
+++ b/patches/server/0137-Use-TerminalConsoleAppender-for-console-improvements.patch
@@ -19,7 +19,7 @@ Other changes:
configuration
diff --git a/build.gradle.kts b/build.gradle.kts
-index 4db0cc3f8505747e77d314320545eb71904b4eac..8b424fb5e3c7e9169894438f680be1d43829d060 100644
+index c1f97f5bb806e3c92a2b4633142d3214e11f7074..03e00ea0e09e1b368d5803e094366fe7c38c6270 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -12,7 +12,17 @@ repositories {
@@ -38,7 +38,7 @@ index 4db0cc3f8505747e77d314320545eb71904b4eac..8b424fb5e3c7e9169894438f680be1d4
+ */
+ runtimeOnly("org.apache.logging.log4j:log4j-core:2.14.1")
+ // Paper end
- implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") // Paper
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.17.1") // Paper
implementation("org.ow2.asm:asm:9.2")
implementation("org.ow2.asm:asm-commons:9.2") // Paper - ASM event executor generation
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
@@ -112,27 +112,19 @@ index 0000000000000000000000000000000000000000..685deaa0e5d1ddc13e3a7c0471b1cfcf
+
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 74792811da877dc59c25af5e46e3ab570895b6b6..c3e4aa076e2be77e5a48a4f0a12f26e67ea06476 100644
+index fc64c29058e68239e25c51cefe97627be2a13d33..72dd9c4c8a9266bdcf7f096ade9d6478f4ed30f0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -9,6 +9,7 @@ import com.mojang.authlib.GameProfile;
- import com.mojang.authlib.GameProfileRepository;
- import com.mojang.authlib.minecraft.MinecraftSessionService;
- import com.mojang.datafixers.DataFixer;
-+import io.papermc.paper.adventure.PaperAdventure; // Paper
- import it.unimi.dsi.fastutil.longs.LongIterator;
- import java.awt.image.BufferedImage;
- import java.io.BufferedWriter;
-@@ -167,7 +168,7 @@ import org.apache.logging.log4j.Logger;
+@@ -169,7 +169,7 @@ import org.slf4j.Logger;
// CraftBukkit start
import com.mojang.serialization.DynamicOps;
import com.mojang.serialization.Lifecycle;
-import jline.console.ConsoleReader;
+// import jline.console.ConsoleReader; // Paper
import joptsimple.OptionSet;
- import net.minecraft.resources.RegistryReadOps;
import net.minecraft.server.bossevents.CustomBossEvents;
-@@ -284,7 +285,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue();
public int autosavePeriod;
-@@ -368,7 +369,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0) { // Trim to filter lines which are just spaces
@@ -201,7 +193,7 @@ index 2201aeecd9936402825200dd696dc5607fe0f880..eed1d77a91f19722c2d2a3a43184565c
}
// CraftBukkit end
}
-@@ -146,6 +149,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+@@ -149,6 +152,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
}
@@ -210,7 +202,7 @@ index 2201aeecd9936402825200dd696dc5607fe0f880..eed1d77a91f19722c2d2a3a43184565c
}
};
-@@ -157,6 +162,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+@@ -160,6 +165,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
global.addHandler(new org.bukkit.craftbukkit.util.ForwardLogHandler());
@@ -220,7 +212,7 @@ index 2201aeecd9936402825200dd696dc5607fe0f880..eed1d77a91f19722c2d2a3a43184565c
final org.apache.logging.log4j.core.Logger logger = ((org.apache.logging.log4j.core.Logger) LogManager.getRootLogger());
for (org.apache.logging.log4j.core.Appender appender : logger.getAppenders().values()) {
if (appender instanceof org.apache.logging.log4j.core.appender.ConsoleAppender) {
-@@ -165,6 +173,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+@@ -168,6 +176,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
new org.bukkit.craftbukkit.util.TerminalConsoleWriterThread(System.out, this.reader).start();
@@ -230,12 +222,12 @@ index 2201aeecd9936402825200dd696dc5607fe0f880..eed1d77a91f19722c2d2a3a43184565c
System.setOut(IoBuilder.forLogger(logger).setLevel(Level.INFO).buildPrintStream());
System.setErr(IoBuilder.forLogger(logger).setLevel(Level.WARN).buildPrintStream());
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index e47642c3164f7f7a358d2c7a9722643acf3e0089..dc891a463ec24b0b1b4c6c00b2c199e710204f61 100644
+index 5b1dcf148d24bbd61728d8c2af611b7c4f8dd166..03fc0bca0c1a11db43d315236ca05dfea137ddb3 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -155,8 +155,7 @@ public abstract class PlayerList {
- public PlayerList(MinecraftServer server, RegistryAccess.RegistryHolder registryManager, PlayerDataStorage saveHandler, int maxPlayers) {
+ public PlayerList(MinecraftServer server, RegistryAccess.Frozen registryManager, PlayerDataStorage saveHandler, int maxPlayers) {
this.cserver = server.server = new CraftServer((DedicatedServer) server, this);
- server.console = org.bukkit.craftbukkit.command.ColouredConsoleSender.getInstance();
- server.reader.addCompleter(new org.bukkit.craftbukkit.command.ConsoleCommandCompleter(server.server));
@@ -244,10 +236,10 @@ index e47642c3164f7f7a358d2c7a9722643acf3e0089..dc891a463ec24b0b1b4c6c00b2c199e7
this.bans = new UserBanList(PlayerList.USERBANLIST_FILE);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 6efe539d3a19d5b4b673ec24f36111320daf772f..e5f4c6091e38a298c08dea09f77b9c5a8e61a2ba 100644
+index ef55ae870e341af0087bc99341a77c5d1b851328..89d9ac790b28fedc7d30b54f30cc6235f9b12a64 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -46,7 +46,6 @@ import java.util.logging.Level;
+@@ -45,7 +45,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import javax.imageio.ImageIO;
@@ -255,7 +247,7 @@ index 6efe539d3a19d5b4b673ec24f36111320daf772f..e5f4c6091e38a298c08dea09f77b9c5a
import net.minecraft.advancements.Advancement;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
-@@ -1290,9 +1289,13 @@ public final class CraftServer implements Server {
+@@ -1282,9 +1281,13 @@ public final class CraftServer implements Server {
return this.logger;
}
@@ -270,7 +262,7 @@ index 6efe539d3a19d5b4b673ec24f36111320daf772f..e5f4c6091e38a298c08dea09f77b9c5a
@Override
public PluginCommand getPluginCommand(String name) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index c73d785fce285d4f8eeb6f763ece21c4493071a4..77c065d74ae84f8e003141f050fe01ae582ae44c 100644
+index ff36d930a5fade32942a11f378d1c187f8f9f01a..1e49bff6e1ccd7cf8405785c73f56caada94e399 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -12,7 +12,7 @@ import java.util.logging.Level;
@@ -452,7 +444,7 @@ index 6a073a9dc44d93eba296a0e18a9c7be8a7881725..b4a19d80bbf71591f25729fd0e985903
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
-index 5b63604aeae9a54e2c61cc4a22115a72f34a56bd..fc07f6bd45712ec0f1aec5fe820034e6d54b39c1 100644
+index 1d8b279f3cbe6fde6bb1bfc4985c4133b0d4a95d..cdc52bbe5c6ae4688615a7732b10071f7f51718e 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
@@ -5,12 +5,12 @@ import java.io.IOException;
diff --git a/patches/server/0140-PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/server/0140-PlayerPickupItemEvent-setFlyAtPlayer.patch
index 5cfbdc55d0..dcfbc30eef 100644
--- a/patches/server/0140-PlayerPickupItemEvent-setFlyAtPlayer.patch
+++ b/patches/server/0140-PlayerPickupItemEvent-setFlyAtPlayer.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
-index 6df6204c9d4099afeb8ff07dd747f756d8e380d6..68fdfba22ebb35023299c776d4764d4f1555f435 100644
+index e5c97ffc4ceafcda2939d28fdc7cd729cf902db4..f5afd05e9011e05c4c49a903baa2d1d81e102bee 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
-@@ -378,6 +378,7 @@ public class ItemEntity extends Entity {
+@@ -380,6 +380,7 @@ public class ItemEntity extends Entity {
// CraftBukkit start - fire PlayerPickupItemEvent
int canHold = player.getInventory().canHold(itemstack);
int remaining = i - canHold;
@@ -16,7 +16,7 @@ index 6df6204c9d4099afeb8ff07dd747f756d8e380d6..68fdfba22ebb35023299c776d4764d4f
if (this.pickupDelay <= 0 && canHold > 0) {
itemstack.setCount(canHold);
-@@ -385,8 +386,14 @@ public class ItemEntity extends Entity {
+@@ -387,8 +388,14 @@ public class ItemEntity extends Entity {
PlayerPickupItemEvent playerEvent = new PlayerPickupItemEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining);
playerEvent.setCancelled(!playerEvent.getPlayer().getCanPickupItems());
this.level.getCraftServer().getPluginManager().callEvent(playerEvent);
@@ -31,7 +31,7 @@ index 6df6204c9d4099afeb8ff07dd747f756d8e380d6..68fdfba22ebb35023299c776d4764d4f
return;
}
-@@ -416,7 +423,11 @@ public class ItemEntity extends Entity {
+@@ -418,7 +425,11 @@ public class ItemEntity extends Entity {
// CraftBukkit end
if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(player.getUUID())) && player.getInventory().add(itemstack)) {
diff --git a/patches/server/0141-PlayerAttemptPickupItemEvent.patch b/patches/server/0141-PlayerAttemptPickupItemEvent.patch
index c026ee9879..63863ce126 100644
--- a/patches/server/0141-PlayerAttemptPickupItemEvent.patch
+++ b/patches/server/0141-PlayerAttemptPickupItemEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] PlayerAttemptPickupItemEvent
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
-index 68fdfba22ebb35023299c776d4764d4f1555f435..db42d22f58df5daefc41720206405dda4f7ad633 100644
+index f5afd05e9011e05c4c49a903baa2d1d81e102bee..943c2bd2a0836eda5b4da382c459ade6cbe40fea 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -36,6 +36,7 @@ import net.minecraft.util.Mth;
@@ -16,7 +16,7 @@ index 68fdfba22ebb35023299c776d4764d4f1555f435..db42d22f58df5daefc41720206405dda
public class ItemEntity extends Entity {
-@@ -380,6 +381,22 @@ public class ItemEntity extends Entity {
+@@ -382,6 +383,22 @@ public class ItemEntity extends Entity {
int remaining = i - canHold;
boolean flyAtPlayer = false; // Paper
diff --git a/patches/server/0142-Add-UnknownCommandEvent.patch b/patches/server/0142-Add-UnknownCommandEvent.patch
index f88c26f682..a0d430345e 100644
--- a/patches/server/0142-Add-UnknownCommandEvent.patch
+++ b/patches/server/0142-Add-UnknownCommandEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add UnknownCommandEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index e5f4c6091e38a298c08dea09f77b9c5a8e61a2ba..909724efb99f88f3de0967b85d539e0ab1bec8e8 100644
+index 89d9ac790b28fedc7d30b54f30cc6235f9b12a64..40d9766bbf53f858a3debd83319152cbd11ef7ed 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -889,7 +889,13 @@ public final class CraftServer implements Server {
+@@ -885,7 +885,13 @@ public final class CraftServer implements Server {
// Spigot start
if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) {
diff --git a/patches/server/0143-Basic-PlayerProfile-API.patch b/patches/server/0143-Basic-PlayerProfile-API.patch
index 0095b6f6f1..c378ccf969 100644
--- a/patches/server/0143-Basic-PlayerProfile-API.patch
+++ b/patches/server/0143-Basic-PlayerProfile-API.patch
@@ -586,10 +586,10 @@ index 9f292deee1b793d52b5774304318e940128d1e26..0cf818fceddd76e7704fdc6625456787
* Calculates distance between 2 entities
* @param e1
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
-index 156fa293626119caf0cf414505fdf0e96eaa08b7..e98492adfb83c24e1baa6cab24cca55f3ec151bf 100644
+index b49528d8a2c577def4f74ee694ffd53b481acb32..8f5784ed4df46f3c7d4c6b4ff76ad839d436be1f 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
-@@ -135,7 +135,7 @@ public class Main {
+@@ -138,7 +138,7 @@ public class Main {
}
File file = (File) optionset.valueOf("universe"); // CraftBukkit
@@ -599,7 +599,7 @@ index 156fa293626119caf0cf414505fdf0e96eaa08b7..e98492adfb83c24e1baa6cab24cca55f
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
GameProfileCache usercache = new GameProfileCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName()));
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
-index 00f783aafd81fa7e836e4eea5bfeac7434f33b0f..3789441e2df9410aa1c6efe59054aaba2c738633 100644
+index c3e3a9950ee05dc97f15ab128e40854901f38a2f..95974d78196397136179f8d6acf1597c557e5a23 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -135,6 +135,13 @@ public class GameProfileCache {
@@ -617,10 +617,10 @@ index 00f783aafd81fa7e836e4eea5bfeac7434f33b0f..3789441e2df9410aa1c6efe59054aaba
String s1 = name.toLowerCase(Locale.ROOT);
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 909724efb99f88f3de0967b85d539e0ab1bec8e8..e93c743500e3c439cd32757b16025804e0552181 100644
+index 40d9766bbf53f858a3debd83319152cbd11ef7ed..a380f59ea01cec492f2d2bef6bb6509a07998d07 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -247,6 +247,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
+@@ -243,6 +243,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
import net.md_5.bungee.api.chat.BaseComponent; // Spigot
@@ -630,7 +630,7 @@ index 909724efb99f88f3de0967b85d539e0ab1bec8e8..e93c743500e3c439cd32757b16025804
public final class CraftServer implements Server {
private final String serverName = "Paper"; // Paper
private final String serverVersion;
-@@ -286,6 +289,7 @@ public final class CraftServer implements Server {
+@@ -282,6 +285,7 @@ public final class CraftServer implements Server {
static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
ConfigurationSerialization.registerClass(CraftPlayerProfile.class);
@@ -638,7 +638,7 @@ index 909724efb99f88f3de0967b85d539e0ab1bec8e8..e93c743500e3c439cd32757b16025804
CraftItemFactory.instance();
}
-@@ -2559,5 +2563,24 @@ public final class CraftServer implements Server {
+@@ -2551,5 +2555,24 @@ public final class CraftServer implements Server {
public boolean suggestPlayerNamesWhenNullTabCompletions() {
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
}
diff --git a/patches/server/0144-Shoulder-Entities-Release-API.patch b/patches/server/0144-Shoulder-Entities-Release-API.patch
index bcbf0f60d9..146b442789 100644
--- a/patches/server/0144-Shoulder-Entities-Release-API.patch
+++ b/patches/server/0144-Shoulder-Entities-Release-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
-index 51666c237abda8cce63997a655f4f621dd50ccca..3e007cb4cfef94af14800c47b3f19496c504eca8 100644
+index b15fd75ccbe54ea9169593e02631d2952b0d239a..ca9731d4d963f2615721e3e1f7e1a5e13c94cf52 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
-@@ -1948,20 +1948,44 @@ public abstract class Player extends LivingEntity {
+@@ -1961,20 +1961,44 @@ public abstract class Player extends LivingEntity {
}
diff --git a/patches/server/0146-Block-player-logins-during-server-shutdown.patch b/patches/server/0146-Block-player-logins-during-server-shutdown.patch
index 6a0c802572..b22e55320c 100644
--- a/patches/server/0146-Block-player-logins-during-server-shutdown.patch
+++ b/patches/server/0146-Block-player-logins-during-server-shutdown.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Block player logins during server shutdown
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-index afa04bbf778e5dd0823a0aab0573e4cc3787858d..2f512ca5314103d2f42c822c7bd1268f11161edf 100644
+index 58ef6874cd6c90e6ccc7c39881cc3bf68fba284b..03dc5ae09c46ad7be8e444211728a8418f594733 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-@@ -69,6 +69,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -68,6 +68,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
}
public void tick() {
diff --git a/patches/server/0147-Entity-fromMobSpawner.patch b/patches/server/0147-Entity-fromMobSpawner.patch
index 586267b7bf..e2fce80f26 100644
--- a/patches/server/0147-Entity-fromMobSpawner.patch
+++ b/patches/server/0147-Entity-fromMobSpawner.patch
@@ -5,10 +5,10 @@ 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 e80cfab4b8c384067cf76667fb8ba1f0305f03cf..3e9e5736a6c357fbece9bebfeefbbc88b06e6adc 100644
+index 9bf0d7dca8abee27ca5757bc3e56c723d910623b..4473197fdcad7e6026797c6f494c4e2a90c2fb36 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -315,6 +315,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -318,6 +318,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
// Spigot end
// Paper start
protected int numCollisions = 0; // Paper
@@ -16,7 +16,7 @@ index e80cfab4b8c384067cf76667fb8ba1f0305f03cf..3e9e5736a6c357fbece9bebfeefbbc88
@javax.annotation.Nullable
private org.bukkit.util.Vector origin;
@javax.annotation.Nullable
-@@ -1866,6 +1867,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -1871,6 +1872,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
}
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
}
@@ -27,7 +27,7 @@ index e80cfab4b8c384067cf76667fb8ba1f0305f03cf..3e9e5736a6c357fbece9bebfeefbbc88
// Paper end
return nbt;
} catch (Throwable throwable) {
-@@ -2009,6 +2014,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -2014,6 +2019,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
this.originWorld = originWorld;
origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2));
}
@@ -37,7 +37,7 @@ index e80cfab4b8c384067cf76667fb8ba1f0305f03cf..3e9e5736a6c357fbece9bebfeefbbc88
} catch (Throwable throwable) {
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
-index 002144601e8f75766b9e462579123559e4d651fe..1c5865ee2a9f3b142d92d63c19ffd785ffcf1235 100644
+index 6aab3df317a9612da9b83284aa6056f0c7cf436c..38abf49a86b0d33c6069c6a2b95edeb6c7019eb4 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -157,6 +157,7 @@ public abstract class BaseSpawner {
diff --git a/patches/server/0152-Fix-this-stupid-bullshit.patch b/patches/server/0152-Fix-this-stupid-bullshit.patch
index 0f99632d51..0e67ea0838 100644
--- a/patches/server/0152-Fix-this-stupid-bullshit.patch
+++ b/patches/server/0152-Fix-this-stupid-bullshit.patch
@@ -9,10 +9,10 @@ modified in order to prevent merge conflicts when Spigot changes/disables the wa
and to provide some level of hint without being disruptive.
diff --git a/src/main/java/net/minecraft/server/Bootstrap.java b/src/main/java/net/minecraft/server/Bootstrap.java
-index bf42e5687935022fe5bcb1ed40bab09bfe189e88..b111200a8f5d3255de29c9836f70fc7ffd003c6e 100644
+index 9f23951f6b4c17c2a968fdcb3e8f9f65c296f34a..248b7ca7dbd75d4eab52fb937cace2b2d9ee3467 100644
--- a/src/main/java/net/minecraft/server/Bootstrap.java
+++ b/src/main/java/net/minecraft/server/Bootstrap.java
-@@ -48,7 +48,7 @@ public class Bootstrap {
+@@ -47,7 +47,7 @@ public class Bootstrap {
public static void bootStrap() {
if (!Bootstrap.isBootstrapped) {
// CraftBukkit start
@@ -21,7 +21,7 @@ index bf42e5687935022fe5bcb1ed40bab09bfe189e88..b111200a8f5d3255de29c9836f70fc7f
switch (name) {
case "DispenserRegistry":
break;
-@@ -62,7 +62,7 @@ public class Bootstrap {
+@@ -61,7 +61,7 @@ public class Bootstrap {
System.err.println("*** WARNING: This server jar is unsupported, use at your own risk. ***");
System.err.println("**********************************************************************");
break;
@@ -31,12 +31,12 @@ index bf42e5687935022fe5bcb1ed40bab09bfe189e88..b111200a8f5d3255de29c9836f70fc7f
Bootstrap.isBootstrapped = true;
if (Registry.REGISTRY.keySet().isEmpty()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 77c065d74ae84f8e003141f050fe01ae582ae44c..6f86aa59fa8bcf1b340d7207c5b2be46678c96ec 100644
+index 1e49bff6e1ccd7cf8405785c73f56caada94e399..08f4ba483a6c61365310de6561b314e428a6b978 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -234,10 +234,12 @@ public class Main {
Calendar deadline = Calendar.getInstance();
- deadline.add(Calendar.DAY_OF_YEAR, -28);
+ deadline.add(Calendar.DAY_OF_YEAR, -3);
if (buildDate.before(deadline.getTime())) {
- System.err.println("*** Error, this build is outdated ***");
+ // Paper start - This is some stupid bullshit
diff --git a/patches/server/0154-Ocelot-despawns-should-honor-nametags-and-leash.patch b/patches/server/0154-Ocelot-despawns-should-honor-nametags-and-leash.patch
index 3b58fc5d96..1e82429fcb 100644
--- a/patches/server/0154-Ocelot-despawns-should-honor-nametags-and-leash.patch
+++ b/patches/server/0154-Ocelot-despawns-should-honor-nametags-and-leash.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Ocelot despawns should honor nametags and leash
diff --git a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
-index b18546b6816ee77f1458a7ca44b32f76c33f2fe9..a781048b0c43e63e441e6afecec125d7f838c342 100644
+index 32c5dd9e53a0f421166dd3b84eb321b4e3e0c2fd..24d14c3a98453622e9805298c56625311f69e8dd 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
-@@ -134,7 +134,7 @@ public class Ocelot extends Animal {
+@@ -133,7 +133,7 @@ public class Ocelot extends Animal {
@Override
public boolean removeWhenFarAway(double distanceSquared) {
diff --git a/patches/server/0156-Allow-specifying-a-custom-authentication-servers-dow.patch b/patches/server/0156-Allow-specifying-a-custom-authentication-servers-dow.patch
index 183a5a2e6f..bc877ef713 100644
--- a/patches/server/0156-Allow-specifying-a-custom-authentication-servers-dow.patch
+++ b/patches/server/0156-Allow-specifying-a-custom-authentication-servers-dow.patch
@@ -27,10 +27,10 @@ index 7a69f9d9bb9c05474d8fbab22d626529a41a66a1..f4735cc330822183e098a67f2c0f00f2
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-index 2f512ca5314103d2f42c822c7bd1268f11161edf..ad9fd830d94bdbcf0499861a46b7acdf08c433fc 100644
+index 03dc5ae09c46ad7be8e444211728a8418f594733..6834c67b38f0679497bef4b2174817d9688cbbd8 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-@@ -298,6 +298,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -304,6 +304,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
ServerLoginPacketListenerImpl.this.gameProfile = ServerLoginPacketListenerImpl.this.createFakeProfile(gameprofile);
ServerLoginPacketListenerImpl.this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
} else {
diff --git a/patches/server/0157-Handle-plugin-prefixes-using-Log4J-configuration.patch b/patches/server/0157-Handle-plugin-prefixes-using-Log4J-configuration.patch
index 660da2ec8b..49291a0748 100644
--- a/patches/server/0157-Handle-plugin-prefixes-using-Log4J-configuration.patch
+++ b/patches/server/0157-Handle-plugin-prefixes-using-Log4J-configuration.patch
@@ -15,7 +15,7 @@ This may cause additional prefixes to be disabled for plugins bypassing
the plugin logger.
diff --git a/build.gradle.kts b/build.gradle.kts
-index f19ceb9aa0a4f1d59149ac4a933e191c78b55bda..a20994ee826d42e3b8dff35d3f67e8bcf8fb79a3 100644
+index 03e00ea0e09e1b368d5803e094366fe7c38c6270..31c19767848a3f7c1ef2c95d40d395950dff6fd5 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -21,7 +21,7 @@ dependencies {
@@ -25,10 +25,10 @@ index f19ceb9aa0a4f1d59149ac4a933e191c78b55bda..a20994ee826d42e3b8dff35d3f67e8bc
- runtimeOnly("org.apache.logging.log4j:log4j-core:2.14.1")
+ implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation
// Paper end
- implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") // Paper
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.17.1") // Paper
implementation("org.ow2.asm:asm:9.2")
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
-index 5a912528f82e8f97229a412b0bf72e04a520b556..1c887f152597cbcd83dd3dbcd18c874af4ddda7f 100644
+index 9d3d65de7cb0be25aa7fc40353390280943b55f4..cd5add5a38919dfcf7510758b2d3e2f7c40c18fd 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -290,7 +290,7 @@ public class SpigotConfig
diff --git a/patches/server/0159-Add-PlayerJumpEvent.patch b/patches/server/0159-Add-PlayerJumpEvent.patch
index 7c958b8347..663d4b1380 100644
--- a/patches/server/0159-Add-PlayerJumpEvent.patch
+++ b/patches/server/0159-Add-PlayerJumpEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerJumpEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 92c9254335854067683d98e1576c7d06f28415b1..6c1f2be778b830bf01eb7a1ed01431dd5a568e51 100644
+index 00ab2135a53aecfe327d4fe95073db89936038a8..fb95c76877437710a5a89e8dfcbaa5cea27bda76 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1178,7 +1178,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1185,7 +1185,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
boolean flag = d8 > 0.0D;
if (this.player.isOnGround() && !packet.isOnGround() && flag) {
@@ -43,4 +43,4 @@ index 92c9254335854067683d98e1576c7d06f28415b1..6c1f2be778b830bf01eb7a1ed01431dd
+ // Paper end
}
- this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9));
+ boolean flag1 = this.player.verticalCollisionBelow;
diff --git a/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch b/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch
index 3791aaa88a..f76e611e05 100644
--- a/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch
+++ b/patches/server/0160-handle-PacketPlayInKeepAlive-async.patch
@@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 6c1f2be778b830bf01eb7a1ed01431dd5a568e51..849b94665e20aca54bd1df0cd8f4e3d5be30e31c 100644
+index fb95c76877437710a5a89e8dfcbaa5cea27bda76..4a4a478e8964a9cec8bc61e2435333415b449f8c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2780,14 +2780,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2804,14 +2804,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
diff --git a/patches/server/0161-Expose-client-protocol-version-and-virtual-host.patch b/patches/server/0161-Expose-client-protocol-version-and-virtual-host.patch
index 5d216a9ce3..6131023aab 100644
--- a/patches/server/0161-Expose-client-protocol-version-and-virtual-host.patch
+++ b/patches/server/0161-Expose-client-protocol-version-and-virtual-host.patch
@@ -60,10 +60,10 @@ index 0000000000000000000000000000000000000000..a5a7624f1f372a26b982836cd31cff15
+
+}
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
-index 7d177d38f3311ab941dd126c844d22e0018e25a1..84fe0f6cfc928d95d0967ad368a38afb71543af7 100644
+index dac5ab91fca602cdc2dbc308b24e15ce411659a2..1a2184e23f1e1b8e39141689ebc5f1d13d364038 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
-@@ -83,6 +83,10 @@ public class Connection extends SimpleChannelInboundHandler> {
+@@ -93,6 +93,10 @@ public class Connection extends SimpleChannelInboundHandler> {
private float averageSentPackets;
private int tickCount;
private boolean handlingFault;
diff --git a/patches/server/0162-revert-serverside-behavior-of-keepalives.patch b/patches/server/0162-revert-serverside-behavior-of-keepalives.patch
index 65c8f9b44e..924168458a 100644
--- a/patches/server/0162-revert-serverside-behavior-of-keepalives.patch
+++ b/patches/server/0162-revert-serverside-behavior-of-keepalives.patch
@@ -17,10 +17,10 @@ from networking or during connections flood of chunk packets on slower clients,
at the cost of dead connections being kept open for longer.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 849b94665e20aca54bd1df0cd8f4e3d5be30e31c..5b8ecb96f0a6dbc9e396644b074b50ccb7b38e78 100644
+index 4a4a478e8964a9cec8bc61e2435333415b449f8c..e6cbeccfc1a471783c1b60bcb49df934b82fd36e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -220,9 +220,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -221,9 +221,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private final MinecraftServer server;
public ServerPlayer player;
private int tickCount;
@@ -33,7 +33,7 @@ index 849b94665e20aca54bd1df0cd8f4e3d5be30e31c..5b8ecb96f0a6dbc9e396644b074b50cc
// CraftBukkit start - multithreaded fields
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
// CraftBukkit end
-@@ -251,6 +251,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -252,6 +252,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private int aboveGroundVehicleTickCount;
private int receivedMovePacketCount;
private int knownMovePacketCount;
@@ -41,7 +41,7 @@ index 849b94665e20aca54bd1df0cd8f4e3d5be30e31c..5b8ecb96f0a6dbc9e396644b074b50cc
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.server = server;
-@@ -332,18 +333,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -333,18 +334,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
this.server.getProfiler().push("keepAlive");
diff --git a/patches/server/0163-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/patches/server/0163-Send-attack-SoundEffects-only-to-players-who-can-see.patch
index f0882cb4c7..2034d8b6c7 100644
--- a/patches/server/0163-Send-attack-SoundEffects-only-to-players-who-can-see.patch
+++ b/patches/server/0163-Send-attack-SoundEffects-only-to-players-who-can-see.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
-index 3e007cb4cfef94af14800c47b3f19496c504eca8..396c5040d5fc2b2d0955f2ffcf60deed29b710fc 100644
+index ca9731d4d963f2615721e3e1f7e1a5e13c94cf52..653dbaafb9247653a6d8f549b57f0a5d62b05265 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
-@@ -30,6 +30,7 @@ import net.minecraft.network.chat.MutableComponent;
+@@ -31,6 +31,7 @@ import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket;
@@ -17,7 +17,7 @@ index 3e007cb4cfef94af14800c47b3f19496c504eca8..396c5040d5fc2b2d0955f2ffcf60deed
import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData;
-@@ -1178,7 +1179,7 @@ public abstract class Player extends LivingEntity {
+@@ -1191,7 +1192,7 @@ public abstract class Player extends LivingEntity {
int i = b0 + EnchantmentHelper.getKnockbackBonus(this);
if (this.isSprinting() && flag) {
@@ -26,7 +26,7 @@ index 3e007cb4cfef94af14800c47b3f19496c504eca8..396c5040d5fc2b2d0955f2ffcf60deed
++i;
flag1 = true;
}
-@@ -1253,7 +1254,7 @@ public abstract class Player extends LivingEntity {
+@@ -1266,7 +1267,7 @@ public abstract class Player extends LivingEntity {
}
}
@@ -35,7 +35,7 @@ index 3e007cb4cfef94af14800c47b3f19496c504eca8..396c5040d5fc2b2d0955f2ffcf60deed
this.sweepAttack();
}
-@@ -1281,15 +1282,15 @@ public abstract class Player extends LivingEntity {
+@@ -1294,15 +1295,15 @@ public abstract class Player extends LivingEntity {
}
if (flag2) {
@@ -54,7 +54,7 @@ index 3e007cb4cfef94af14800c47b3f19496c504eca8..396c5040d5fc2b2d0955f2ffcf60deed
}
}
-@@ -1341,7 +1342,7 @@ public abstract class Player extends LivingEntity {
+@@ -1354,7 +1355,7 @@ public abstract class Player extends LivingEntity {
this.causeFoodExhaustion(level.spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value
} else {
@@ -63,7 +63,7 @@ index 3e007cb4cfef94af14800c47b3f19496c504eca8..396c5040d5fc2b2d0955f2ffcf60deed
if (flag4) {
target.clearFire();
}
-@@ -1788,6 +1789,14 @@ public abstract class Player extends LivingEntity {
+@@ -1801,6 +1802,14 @@ public abstract class Player extends LivingEntity {
public int getXpNeededForNextLevel() {
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
}
diff --git a/patches/server/0164-Add-PlayerArmorChangeEvent.patch b/patches/server/0164-Add-PlayerArmorChangeEvent.patch
index 39f4dfcbc2..0154d914e6 100644
--- a/patches/server/0164-Add-PlayerArmorChangeEvent.patch
+++ b/patches/server/0164-Add-PlayerArmorChangeEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerArmorChangeEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 9c175c28d152d4a6af9a720cfd95df7fdcc1be81..0e1085dde127c943eda879b310182af60b8df16c 100644
+index f7d100d5fa85cd2e705e78be8dc6373f02d0adc0..41ffeca4a65a801a81bf7b7f37a39f6bf459e81a 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1,5 +1,6 @@
@@ -15,7 +15,7 @@ index 9c175c28d152d4a6af9a720cfd95df7fdcc1be81..0e1085dde127c943eda879b310182af6
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
-@@ -2938,6 +2939,13 @@ public abstract class LivingEntity extends Entity {
+@@ -2941,6 +2942,13 @@ public abstract class LivingEntity extends Entity {
ItemStack itemstack1 = this.getItemBySlot(enumitemslot);
if (!ItemStack.matches(itemstack1, itemstack)) {
diff --git a/patches/server/0165-Prevent-logins-from-being-processed-when-the-player-.patch b/patches/server/0165-Prevent-logins-from-being-processed-when-the-player-.patch
index 3618451954..9be38dd147 100644
--- a/patches/server/0165-Prevent-logins-from-being-processed-when-the-player-.patch
+++ b/patches/server/0165-Prevent-logins-from-being-processed-when-the-player-.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Prevent logins from being processed when the player has
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-index ad9fd830d94bdbcf0499861a46b7acdf08c433fc..cbe65d2516021946a6d759f91f03dcc886bcd237 100644
+index 6834c67b38f0679497bef4b2174817d9688cbbd8..73efc3084b04914f7f06875651269fd584b60989 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-@@ -76,7 +76,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -75,7 +75,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
}
// Paper end
if (this.state == ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT) {
diff --git a/patches/server/0166-Fix-MC-117075-TE-Unload-Lag-Spike.patch b/patches/server/0166-Fix-MC-117075-TE-Unload-Lag-Spike.patch
index 1d3018cc82..bfd6705b79 100644
--- a/patches/server/0166-Fix-MC-117075-TE-Unload-Lag-Spike.patch
+++ b/patches/server/0166-Fix-MC-117075-TE-Unload-Lag-Spike.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 41e7474588d8e5ba4cd4af0fed1e62e452389a3e..20f73254881e0ed2957329245acef58c99e93fcb 100644
+index d22b7edc9ddea765c11e82346afd3942e37831de..a7fbaa420bf18649cdcb94d53e7d5cfd704d9555 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -731,6 +731,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -730,6 +730,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot start
// Iterator iterator = this.blockEntityTickers.iterator();
int tilesThisCycle = 0;
@@ -17,7 +17,7 @@ index 41e7474588d8e5ba4cd4af0fed1e62e452389a3e..20f73254881e0ed2957329245acef58c
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
-@@ -738,7 +740,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -737,7 +739,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity == null) {
this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
tilesThisCycle--;
@@ -25,7 +25,7 @@ index 41e7474588d8e5ba4cd4af0fed1e62e452389a3e..20f73254881e0ed2957329245acef58c
continue;
}
// Spigot end
-@@ -746,12 +747,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -745,12 +746,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity.isRemoved()) {
// Spigot start
tilesThisCycle--;
diff --git a/patches/server/0167-use-CB-BlockState-implementations-for-captured-block.patch b/patches/server/0167-use-CB-BlockState-implementations-for-captured-block.patch
index 13a86de97b..b448867fdd 100644
--- a/patches/server/0167-use-CB-BlockState-implementations-for-captured-block.patch
+++ b/patches/server/0167-use-CB-BlockState-implementations-for-captured-block.patch
@@ -18,10 +18,10 @@ the blockstate that will be valid for restoration, as opposed to dropping
information on restoration when the event is cancelled.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 20f73254881e0ed2957329245acef58c99e93fcb..cd4c3be34647e772753dc68fbe50060365d8cd29 100644
+index a7fbaa420bf18649cdcb94d53e7d5cfd704d9555..46168d119d10231b8b946015245a476e0b56d567 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -144,7 +144,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -142,7 +142,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710
public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false;
@@ -30,7 +30,7 @@ index 20f73254881e0ed2957329245acef58c99e93fcb..cd4c3be34647e772753dc68fbe500603
public Map capturedTileEntities = new HashMap<>();
public List captureDrops;
public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>();
-@@ -362,7 +362,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -361,7 +361,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
// CraftBukkit start - tree generation
if (this.captureTreeGeneration) {
@@ -39,7 +39,7 @@ index 20f73254881e0ed2957329245acef58c99e93fcb..cd4c3be34647e772753dc68fbe500603
if (blockstate == null) {
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
this.capturedBlockStates.put(pos.immutable(), blockstate);
-@@ -382,7 +382,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -381,7 +381,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start - capture blockstates
boolean captured = false;
if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) {
@@ -49,7 +49,7 @@ index 20f73254881e0ed2957329245acef58c99e93fcb..cd4c3be34647e772753dc68fbe500603
this.capturedBlockStates.put(pos.immutable(), blockstate);
captured = true;
}
-@@ -651,7 +652,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -650,7 +651,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public BlockState getBlockState(BlockPos pos) {
// CraftBukkit start - tree generation
if (this.captureTreeGeneration) {
diff --git a/patches/server/0168-API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/0168-API-to-get-a-BlockState-without-a-snapshot.patch
index 538867c427..6805a47f52 100644
--- a/patches/server/0168-API-to-get-a-BlockState-without-a-snapshot.patch
+++ b/patches/server/0168-API-to-get-a-BlockState-without-a-snapshot.patch
@@ -13,7 +13,7 @@ also Avoid NPE during CraftBlockEntityState load if could not get TE
If Tile Entity was null, correct Sign to return empty lines instead of null
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
-index 1e416b23a38458f16add472cea09b0ac5ac91869..6f61fd8224fb4094f38a851300ab55f94523c252 100644
+index 32a2fbf4a11a84d5a55e02d3ba21e6f4430379c0..a69bbc11b9e003aed1630a6f5cdbca521deb6ff5 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -45,6 +45,7 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject {
@@ -51,10 +51,10 @@ index 1e416b23a38458f16add472cea09b0ac5ac91869..6f61fd8224fb4094f38a851300ab55f9
return null;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
-index c0af4b05b5d77aad99487fa7f8d840e797b6554c..40fc3268e7b662cdd45b569224ccd2abfad0a595 100644
+index f967388fa64aa9d4b2a390c86a2c98ac0fdd4523..7ce727c168a4c0fe6d7cd0bbaa8a4121adc96a90 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
-@@ -320,6 +320,13 @@ public class CraftBlock implements Block {
+@@ -322,6 +322,13 @@ public class CraftBlock implements Block {
return CraftBlockStates.getBlockState(this);
}
diff --git a/patches/server/0169-AsyncTabCompleteEvent.patch b/patches/server/0169-AsyncTabCompleteEvent.patch
index b8c7155547..931c03d7e3 100644
--- a/patches/server/0169-AsyncTabCompleteEvent.patch
+++ b/patches/server/0169-AsyncTabCompleteEvent.patch
@@ -14,10 +14,10 @@ completion, such as offline players.
Also adds isCommand and getLocation to the sync TabCompleteEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 5b8ecb96f0a6dbc9e396644b074b50ccb7b38e78..815901f857d283e2529c01ea81640c6b6d5716ea 100644
+index e6cbeccfc1a471783c1b60bcb49df934b82fd36e..fe414f1f84407574f6cae4f83c9e30caa7b16e33 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -700,10 +700,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -707,10 +707,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
@@ -30,7 +30,7 @@ index 5b8ecb96f0a6dbc9e396644b074b50ccb7b38e78..815901f857d283e2529c01ea81640c6b
return;
}
// CraftBukkit end
-@@ -713,12 +713,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -720,12 +720,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
stringreader.skip();
}
@@ -72,10 +72,10 @@ index 5b8ecb96f0a6dbc9e396644b074b50ccb7b38e78..815901f857d283e2529c01ea81640c6b
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index e93c743500e3c439cd32757b16025804e0552181..d8ae9ab815936712cde9d185d98728a77c0657d9 100644
+index a380f59ea01cec492f2d2bef6bb6509a07998d07..f57050098a49757927fbb4609b7f97c19f5747d1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2080,7 +2080,7 @@ public final class CraftServer implements Server {
+@@ -2072,7 +2072,7 @@ public final class CraftServer implements Server {
offers = this.tabCompleteChat(player, message);
}
diff --git a/patches/server/0170-PlayerPickupExperienceEvent.patch b/patches/server/0170-PlayerPickupExperienceEvent.patch
index 32a0ed093c..6b3e21f677 100644
--- a/patches/server/0170-PlayerPickupExperienceEvent.patch
+++ b/patches/server/0170-PlayerPickupExperienceEvent.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] PlayerPickupExperienceEvent
Allows plugins to cancel a player picking up an experience orb
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-index 90692df7e02346d4ba785d2eaf724d06b98b4438..8a3f2d2c9087b1a5f4dbde8e58af825e334f2432 100644
+index 227aca795efc99c4f81dfb30c00d31d2d7524542..6bf6d6629dfb9338d3e34f433a5698904a2acdad 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-@@ -300,7 +300,7 @@ public class ExperienceOrb extends Entity {
+@@ -301,7 +301,7 @@ public class ExperienceOrb extends Entity {
@Override
public void playerTouch(Player player) {
if (!this.level.isClientSide) {
diff --git a/patches/server/0172-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0172-PlayerNaturallySpawnCreaturesEvent.patch
index 6a31762c8d..3fb8ab5bf8 100644
--- a/patches/server/0172-PlayerNaturallySpawnCreaturesEvent.patch
+++ b/patches/server/0172-PlayerNaturallySpawnCreaturesEvent.patch
@@ -9,10 +9,10 @@ from triggering monster spawns on a server.
Also a highly more effecient way to blanket block spawns in a world
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 065ee0486ec275f9b61dc18afa86023183f0c73b..871c5839ec7ea39282380a42e1a45ea18897a507 100644
+index 50b2dc91f4926ebc4511e44e3aa3062eadc40ea0..610a1ce766d826f3fdca595dd4135f96ef9280d8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1073,7 +1073,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1127,7 +1127,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
chunkRange = (chunkRange > 8) ? 8 : chunkRange;
@@ -23,7 +23,7 @@ index 065ee0486ec275f9b61dc18afa86023183f0c73b..871c5839ec7ea39282380a42e1a45ea1
// Spigot end
long i = chunkcoordintpair.toLong();
-@@ -1090,6 +1092,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1144,6 +1146,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
entityplayer = (ServerPlayer) iterator.next();
@@ -40,10 +40,10 @@ index 065ee0486ec275f9b61dc18afa86023183f0c73b..871c5839ec7ea39282380a42e1a45ea1
return true;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index 8f5e9f1bdfd2e02512e1341f91b147b16e959e5b..87c9a7ffc69206554cf37c7d2c9939eb3cbea3a9 100644
+index 3bbee4d08f4125a6499c0a8790c6bda6935e5ccc..efb735f2cf0d232db83ade7332250e455c276bea 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -827,6 +827,15 @@ public class ServerChunkCache extends ChunkSource {
+@@ -826,6 +826,15 @@ public class ServerChunkCache extends ChunkSource {
boolean flag2 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
Collections.shuffle(list);
@@ -60,7 +60,7 @@ index 8f5e9f1bdfd2e02512e1341f91b147b16e959e5b..87c9a7ffc69206554cf37c7d2c9939eb
while (iterator1.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index ab73818893b00551f8137704a727e33046d43a6a..90bff0dd400a67bcb84f8576bd8326793420919a 100644
+index 2fbe90ba893393e04b72b9feeff5f6be09d65e16..7f2d96722d3f835980ee841a285a585938acfe1a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1,5 +1,6 @@
@@ -70,7 +70,7 @@ index ab73818893b00551f8137704a727e33046d43a6a..90bff0dd400a67bcb84f8576bd832679
import com.google.common.collect.Lists;
import com.mojang.authlib.GameProfile;
import com.mojang.datafixers.util.Either;
-@@ -236,6 +237,7 @@ public class ServerPlayer extends Player {
+@@ -234,6 +235,7 @@ public class ServerPlayer extends Player {
public boolean sentListPacket = false;
public Integer clientViewDistance;
// CraftBukkit end
diff --git a/patches/server/0173-PreCreatureSpawnEvent.patch b/patches/server/0173-PreCreatureSpawnEvent.patch
index e8d11ed824..06cb11ed0a 100644
--- a/patches/server/0173-PreCreatureSpawnEvent.patch
+++ b/patches/server/0173-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 20cfdba68c200e87d00995a6a4e25a5fa8171f6c..05ca012854100013714e3d6e8803a2959938cba4 100644
+index 8699a3bd63e2df83615ae39a6873d9874f0fb8da..05a3d736193775c1aa6ce3759e13a1f76f747d09 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
-@@ -334,6 +334,20 @@ public class EntityType implements EntityTypeTest {
+@@ -338,6 +338,20 @@ public class EntityType implements EntityTypeTest {
@Nullable
public T spawn(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) {
@@ -40,10 +40,10 @@ index 20cfdba68c200e87d00995a6a4e25a5fa8171f6c..05ca012854100013714e3d6e8803a295
if (t0 != null) {
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
-index bd073ac603be130e649d206992c01860ee72d531..6600272bfd5e5ae1699485b143a49a2471c561d9 100644
+index ac44ba98d0acc9aa2a75088d8a9a145fdbcbd911..ecd7083b40ce6230d49ea4487766a6f06b4e96d0 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
-@@ -995,6 +995,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -997,6 +997,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
BlockPos blockposition1 = this.findSpawnPositionForGolemInColumn(blockposition, d0, d1);
if (blockposition1 != null) {
@@ -66,7 +66,7 @@ index bd073ac603be130e649d206992c01860ee72d531..6600272bfd5e5ae1699485b143a49a24
if (entityirongolem != null) {
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
-index 9c27f69f5b8e95ee56428a597e67dc4e8beb6d29..33e7a9eb613a4984ebcb5f3cde5a1fa584f1695e 100644
+index 5bf68b03ddfc7c9554c467e2c0588084a796f6fa..18b1b7c05665ee1fb06670ceded719b19f3a4ee3 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -122,6 +122,27 @@ public abstract class BaseSpawner {
@@ -98,7 +98,7 @@ index 9c27f69f5b8e95ee56428a597e67dc4e8beb6d29..33e7a9eb613a4984ebcb5f3cde5a1fa5
Entity entity = EntityType.loadEntityRecursive(nbttagcompound, world, (entity1) -> {
entity1.moveTo(d0, d1, d2, entity1.getYRot(), entity1.getXRot());
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
-index 373fbdf56dddbae5f793585e31c7e4ff6d31823b..18166f773301bb4eeef9e6892fac85dd58dfd28c 100644
+index b8666d46e85bc7e9e3a05b4ebd65f59138ac55d1..12cd430e7041fab5c3d8a0aa1fe8b28866067088 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -212,7 +212,13 @@ public final class NaturalSpawner {
@@ -117,7 +117,7 @@ index 373fbdf56dddbae5f793585e31c7e4ff6d31823b..18166f773301bb4eeef9e6892fac85dd
if (entityinsentient == null) {
@@ -259,9 +265,25 @@ public final class NaturalSpawner {
- return squaredDistance <= 576.0D ? false : (world.getSharedSpawnPos().closerThan((Position) (new Vec3((double) pos.getX() + 0.5D, (double) pos.getY(), (double) pos.getZ() + 0.5D)), 24.0D) ? false : Objects.equals(new ChunkPos(pos), chunk.getPos()) || world.isPositionEntityTicking((BlockPos) pos));
+ return squaredDistance <= 576.0D ? false : (world.getSharedSpawnPos().closerToCenterThan(new Vec3((double) pos.getX() + 0.5D, (double) pos.getY(), (double) pos.getZ() + 0.5D), 24.0D) ? false : Objects.equals(new ChunkPos(pos), chunk.getPos()) || world.isNaturalSpawningAllowed((BlockPos) pos));
}
- private static boolean isValidSpawnPostitionForType(ServerLevel world, MobCategory group, StructureFeatureManager structureAccessor, ChunkGenerator chunkGenerator, MobSpawnSettings.SpawnerData spawnEntry, BlockPos.MutableBlockPos pos, double squaredDistance) {
diff --git a/patches/server/0178-Extend-Player-Interact-cancellation.patch b/patches/server/0178-Extend-Player-Interact-cancellation.patch
index 02f86edb1c..f775b34e77 100644
--- a/patches/server/0178-Extend-Player-Interact-cancellation.patch
+++ b/patches/server/0178-Extend-Player-Interact-cancellation.patch
@@ -13,10 +13,10 @@ Update adjacent blocks of doors, double plants, pistons and beds
when cancelling interaction.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
-index 12c9efc409e5306fb24b8338d4c60286cff1435c..3ef782b69b9f21d12b1ef214e77bc8af8a94970b 100644
+index c0f712fd4dd57080044341c7c7c8faf09572c2c5..91d6885da13138e1def16e1876910ef893ce244d 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
-@@ -186,6 +186,11 @@ public class ServerPlayerGameMode {
+@@ -196,6 +196,11 @@ public class ServerPlayerGameMode {
PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, pos, direction, this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND);
if (event.isCancelled()) {
// Let the client know the block still exists
@@ -28,7 +28,7 @@ index 12c9efc409e5306fb24b8338d4c60286cff1435c..3ef782b69b9f21d12b1ef214e77bc8af
this.player.connection.send(new ClientboundBlockUpdatePacket(this.level, pos));
// Update any tile entity data for this block
BlockEntity tileentity = this.level.getBlockEntity(pos);
-@@ -503,7 +508,13 @@ public class ServerPlayerGameMode {
+@@ -513,7 +518,13 @@ public class ServerPlayerGameMode {
// send a correcting update to the client for the block above as well, this because of replaceable blocks (such as grass, sea grass etc)
player.connection.send(new ClientboundBlockUpdatePacket(world, blockposition.above()));
diff --git a/patches/server/0180-Toggleable-player-crits-helps-mitigate-hacked-client.patch b/patches/server/0180-Toggleable-player-crits-helps-mitigate-hacked-client.patch
index 2857ef5bf3..6854965082 100644
--- a/patches/server/0180-Toggleable-player-crits-helps-mitigate-hacked-client.patch
+++ b/patches/server/0180-Toggleable-player-crits-helps-mitigate-hacked-client.patch
@@ -21,10 +21,10 @@ index 99d09ff7e9eea776f8c78eda3e89a9613a722172..3bb339658d3253b1cbdcfb789ef234f3
private void allChunksAreSlimeChunks() {
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
-index 396c5040d5fc2b2d0955f2ffcf60deed29b710fc..7324f94c96dc9eb0a06b6475c26c0fcf74713895 100644
+index 653dbaafb9247653a6d8f549b57f0a5d62b05265..8978f3b53ce478d8aa078ac7a16784985f4a2744 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
-@@ -1186,6 +1186,7 @@ public abstract class Player extends LivingEntity {
+@@ -1199,6 +1199,7 @@ public abstract class Player extends LivingEntity {
boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity;
diff --git a/patches/server/0181-Disable-Explicit-Network-Manager-Flushing.patch b/patches/server/0181-Disable-Explicit-Network-Manager-Flushing.patch
index 7513b75abe..1ccb5ac583 100644
--- a/patches/server/0181-Disable-Explicit-Network-Manager-Flushing.patch
+++ b/patches/server/0181-Disable-Explicit-Network-Manager-Flushing.patch
@@ -12,10 +12,10 @@ flushing on the netty event loop, so it won't do the flush on the main thread.
Renable flushing by passing -Dpaper.explicit-flush=true
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
-index 84fe0f6cfc928d95d0967ad368a38afb71543af7..0aacf2e0155a9a7c9dfe9b368a251aee25ed24fc 100644
+index 1a2184e23f1e1b8e39141689ebc5f1d13d364038..7e7d33a843566440f815d779ef2f3db9efc3b92d 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
-@@ -86,6 +86,7 @@ public class Connection extends SimpleChannelInboundHandler> {
+@@ -96,6 +96,7 @@ public class Connection extends SimpleChannelInboundHandler> {
// Paper start - NetworkClient implementation
public int protocolVersion;
public java.net.InetSocketAddress virtualHost;
@@ -23,7 +23,7 @@ index 84fe0f6cfc928d95d0967ad368a38afb71543af7..0aacf2e0155a9a7c9dfe9b368a251aee
// Paper end
public Connection(PacketFlow side) {
-@@ -259,7 +260,7 @@ public class Connection extends SimpleChannelInboundHandler> {
+@@ -271,7 +272,7 @@ public class Connection extends SimpleChannelInboundHandler> {
}
if (this.channel != null) {
diff --git a/patches/server/0182-Implement-extended-PaperServerListPingEvent.patch b/patches/server/0182-Implement-extended-PaperServerListPingEvent.patch
index 4e408188c6..13d4e9ca10 100644
--- a/patches/server/0182-Implement-extended-PaperServerListPingEvent.patch
+++ b/patches/server/0182-Implement-extended-PaperServerListPingEvent.patch
@@ -190,7 +190,7 @@ index 67455a5ba75c9b816213e44d6872c5ddf8e27e98..23efad80934930beadf15e65781551d4
public ClientboundStatusResponsePacket(ServerStatus metadata) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 123da97204af4bb40f98e09a5102227fb1359fd2..f6050e8ee4b43e0405933f6f7f0c234978c0639e 100644
+index 72dd9c4c8a9266bdcf7f096ade9d6478f4ed30f0..d48232d6bef4728242d2cde6b37d95a7041677d8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2,6 +2,9 @@ package net.minecraft.server;
@@ -203,7 +203,7 @@ index 123da97204af4bb40f98e09a5102227fb1359fd2..f6050e8ee4b43e0405933f6f7f0c2349
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
-@@ -1321,7 +1324,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= this.targetChangeTime + 600) {
float f = this.getBrightness();
@@ -33,7 +33,7 @@ index 186054f529cb743e1407fca027792ddb06645d79..18dbf2ad08b835c6e2be9062c0833b44
this.setTarget((LivingEntity) null);
this.teleport();
}
-@@ -375,17 +381,19 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -374,17 +380,19 @@ public class EnderMan extends Monster implements NeutralMob {
flag = false;
}
@@ -54,7 +54,7 @@ index 186054f529cb743e1407fca027792ddb06645d79..18dbf2ad08b835c6e2be9062c0833b44
this.teleport();
}
-@@ -605,7 +613,7 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -604,7 +612,7 @@ public class EnderMan extends Monster implements NeutralMob {
} else {
if (this.target != null && !this.enderman.isPassenger()) {
if (this.enderman.isLookingAtMe((Player) this.target)) {
diff --git a/patches/server/0195-Enderman.teleportRandomly.patch b/patches/server/0195-Enderman.teleportRandomly.patch
index 5ea410652c..86bca4b671 100644
--- a/patches/server/0195-Enderman.teleportRandomly.patch
+++ b/patches/server/0195-Enderman.teleportRandomly.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Enderman.teleportRandomly()
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
-index 18dbf2ad08b835c6e2be9062c0833b440e872e46..d427276e3556f1c8580ea15095424f76e07f0a99 100644
+index 1decbe53207e25ee34f9948c4dcc79fa6f1138bc..47f745bb54ab53674f371cb9dfc580fdb770541c 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
-@@ -283,7 +283,7 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -282,7 +282,7 @@ public class EnderMan extends Monster implements NeutralMob {
super.customServerAiStep();
}
diff --git a/patches/server/0197-Expand-World.spawnParticle-API-and-add-Builder.patch b/patches/server/0197-Expand-World.spawnParticle-API-and-add-Builder.patch
index 347307971c..780f0a1b93 100644
--- a/patches/server/0197-Expand-World.spawnParticle-API-and-add-Builder.patch
+++ b/patches/server/0197-Expand-World.spawnParticle-API-and-add-Builder.patch
@@ -10,10 +10,10 @@ Adds an option to control the force mode of the particle.
This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index c90a3df46ce2d478d7e279a05cd1a876a54a791e..a8d80e2409a98f9e928454b56104295dbc86de7c 100644
+index 8672a2d9a62f091cae06073d57428766efc643bd..c38f6d789eea3bde1a71b14c3d070b000a9a297e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1383,12 +1383,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1386,12 +1386,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public int sendParticles(ServerPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) {
@@ -34,10 +34,10 @@ index c90a3df46ce2d478d7e279a05cd1a876a54a791e..a8d80e2409a98f9e928454b56104295d
if (this.sendParticles(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index e2289fbfbb59b0b1d2a09d6bb0e17664de209ebb..9d9915f2984f87c8cc9d6dd1d445dfcf127bc010 100644
+index e90773c4824edf29a553827dd986209b2dd3f985..681b91f047566c7b2220a2f30e11a55b7338dffe 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -1809,11 +1809,17 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1812,11 +1812,17 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {
diff --git a/patches/server/0199-EndermanAttackPlayerEvent.patch b/patches/server/0199-EndermanAttackPlayerEvent.patch
index e94d28a7dd..be33ff581c 100644
--- a/patches/server/0199-EndermanAttackPlayerEvent.patch
+++ b/patches/server/0199-EndermanAttackPlayerEvent.patch
@@ -8,10 +8,10 @@ Allow control over whether or not an enderman aggros a player.
This allows you to override/extend the pumpkin/stare logic.
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
-index d427276e3556f1c8580ea15095424f76e07f0a99..c7714824d8e85087397047cf9bcb0528968b1f93 100644
+index 47f745bb54ab53674f371cb9dfc580fdb770541c..102cab5a2104d32440ad489847bb7a443beead51 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
-@@ -226,7 +226,15 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -225,7 +225,15 @@ public class EnderMan extends Monster implements NeutralMob {
this.readPersistentAngerSaveData(this.level, nbt);
}
diff --git a/patches/server/0202-Allow-spawning-Item-entities-with-World.spawnEntity.patch b/patches/server/0202-Allow-spawning-Item-entities-with-World.spawnEntity.patch
index bb7b83ee34..5cab56c188 100644
--- a/patches/server/0202-Allow-spawning-Item-entities-with-World.spawnEntity.patch
+++ b/patches/server/0202-Allow-spawning-Item-entities-with-World.spawnEntity.patch
@@ -8,7 +8,7 @@ This API has more capabilities than .dropItem with the Consumer function
Item can be set inside of the Consumer pre spawn function.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
-index ef3874fccb5d8b99c2b6753e7c60b83f5e3f316b..2c5ca6e91269aa27d18358b6f9b6e146a23ad933 100644
+index 8fb3e18303abbedb9c07319d11619c39743cbaf8..9d247664e5867a31376b3681b7ed0c3404ea46d8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -543,6 +543,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
@@ -20,5 +20,5 @@ index ef3874fccb5d8b99c2b6753e7c60b83f5e3f316b..2c5ca6e91269aa27d18358b6f9b6e146
+ entity = new net.minecraft.world.entity.item.ItemEntity(world, x, y, z, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Item.byBlock(net.minecraft.world.level.block.Blocks.DIRT)));
+ // Paper end
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
- entity = new FallingBlockEntity(world, x, y, z, this.getHandle().getBlockState(new BlockPos(x, y, z)));
- } else if (Projectile.class.isAssignableFrom(clazz)) {
+ BlockPos pos = new BlockPos(x, y, z);
+ entity = FallingBlockEntity.fall(world, pos, this.getHandle().getBlockState(pos));
diff --git a/patches/server/0205-Implement-EntityTeleportEndGatewayEvent.patch b/patches/server/0205-Implement-EntityTeleportEndGatewayEvent.patch
index 309201c9c1..541316c571 100644
--- a/patches/server/0205-Implement-EntityTeleportEndGatewayEvent.patch
+++ b/patches/server/0205-Implement-EntityTeleportEndGatewayEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Implement EntityTeleportEndGatewayEvent
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
-index 8af71dd1b916be666ee163904118db46fd3c9850..1d8af8475d0aac71a4ed8a2fed9861dd89d8319b 100644
+index d336cf8f845a4d35a2d0a4cbe3b1b373fb00a970..4e47b641a2aae8e82890cda1bdb209803472b1d4 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
-@@ -223,9 +223,20 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
+@@ -224,9 +224,20 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
}
// CraftBukkit end
diff --git a/patches/server/0210-Make-shield-blocking-delay-configurable.patch b/patches/server/0210-Make-shield-blocking-delay-configurable.patch
index e7dc5f72af..c1a7abb9ea 100644
--- a/patches/server/0210-Make-shield-blocking-delay-configurable.patch
+++ b/patches/server/0210-Make-shield-blocking-delay-configurable.patch
@@ -19,10 +19,10 @@ index 8fc56818a2ba1aed73b8dda4da04ecac748c6ae6..1e9ffb5bc5c9d74c07be14435eb29ef9
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 0e1085dde127c943eda879b310182af60b8df16c..c347c4e6f957118198adb1de7633d369bd012b82 100644
+index 41ffeca4a65a801a81bf7b7f37a39f6bf459e81a..04ba5e773e2e1ecd54023370e986c4c85e54cde5 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3668,12 +3668,24 @@ public abstract class LivingEntity extends Entity {
+@@ -3658,12 +3658,24 @@ public abstract class LivingEntity extends Entity {
if (this.isUsingItem() && !this.useItem.isEmpty()) {
Item item = this.useItem.getItem();
diff --git a/patches/server/0212-PlayerReadyArrowEvent.patch b/patches/server/0212-PlayerReadyArrowEvent.patch
index 72a06078f3..2d3e016e1a 100644
--- a/patches/server/0212-PlayerReadyArrowEvent.patch
+++ b/patches/server/0212-PlayerReadyArrowEvent.patch
@@ -7,10 +7,10 @@ Called when a player is firing a bow and the server is choosing an arrow to use.
Plugins can skip selection of certain arrows and control which is used.
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
-index 4a5488a252bb885842f37cc5e98121e1e1713033..bfd454dfd450e5f9cb0e496ae654562169856de2 100644
+index f1ee710de043ad8b71c8c385a24ab4b7167f45a3..f0da841cf8e37884c40397bb4032eab35e9eec4f 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
-@@ -2181,6 +2181,17 @@ public abstract class Player extends LivingEntity {
+@@ -2194,6 +2194,17 @@ public abstract class Player extends LivingEntity {
return ImmutableList.of(Pose.STANDING, Pose.CROUCHING, Pose.SWIMMING);
}
@@ -28,7 +28,7 @@ index 4a5488a252bb885842f37cc5e98121e1e1713033..bfd454dfd450e5f9cb0e496ae6545621
@Override
public ItemStack getProjectile(ItemStack stack) {
if (!(stack.getItem() instanceof ProjectileWeaponItem)) {
-@@ -2197,7 +2208,7 @@ public abstract class Player extends LivingEntity {
+@@ -2210,7 +2221,7 @@ public abstract class Player extends LivingEntity {
for (int i = 0; i < this.inventory.getContainerSize(); ++i) {
ItemStack itemstack2 = this.inventory.getItem(i);
diff --git a/patches/server/0213-Implement-EntityKnockbackByEntityEvent.patch b/patches/server/0213-Implement-EntityKnockbackByEntityEvent.patch
index 98fcc1c3aa..4d962853a5 100644
--- a/patches/server/0213-Implement-EntityKnockbackByEntityEvent.patch
+++ b/patches/server/0213-Implement-EntityKnockbackByEntityEvent.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Implement EntityKnockbackByEntityEvent
This event is called when an entity receives knockback by another entity.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index c347c4e6f957118198adb1de7633d369bd012b82..9b6fcaaafa84853804f6183d02bd90b4f988d418 100644
+index 04ba5e773e2e1ecd54023370e986c4c85e54cde5..7436cf1b9cce14494bd514cb7f4ed03536170c87 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -1430,7 +1430,7 @@ public abstract class LivingEntity extends Entity {
+@@ -1433,7 +1433,7 @@ public abstract class LivingEntity extends Entity {
}
this.hurtDir = (float) (Mth.atan2(d1, d0) * 57.2957763671875D - (double) this.getYRot());
@@ -18,7 +18,7 @@ index c347c4e6f957118198adb1de7633d369bd012b82..9b6fcaaafa84853804f6183d02bd90b4
} else {
this.hurtDir = (float) ((int) (Math.random() * 2.0D) * 180);
}
-@@ -1478,7 +1478,7 @@ public abstract class LivingEntity extends Entity {
+@@ -1481,7 +1481,7 @@ public abstract class LivingEntity extends Entity {
}
protected void blockedByShield(LivingEntity target) {
@@ -27,7 +27,7 @@ index c347c4e6f957118198adb1de7633d369bd012b82..9b6fcaaafa84853804f6183d02bd90b4
}
private boolean checkTotemDeathProtection(DamageSource source) {
-@@ -1731,6 +1731,11 @@ public abstract class LivingEntity extends Entity {
+@@ -1734,6 +1734,11 @@ public abstract class LivingEntity extends Entity {
}
public void knockback(double strength, double x, double z) {
@@ -39,7 +39,7 @@ index c347c4e6f957118198adb1de7633d369bd012b82..9b6fcaaafa84853804f6183d02bd90b4
strength *= 1.0D - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE);
if (strength > 0.0D) {
this.hasImpulse = true;
-@@ -1738,6 +1743,15 @@ public abstract class LivingEntity extends Entity {
+@@ -1741,6 +1746,15 @@ public abstract class LivingEntity extends Entity {
Vec3 vec3d1 = (new Vec3(x, 0.0D, z)).normalize().scale(strength);
this.setDeltaMovement(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + strength) : vec3d.y, vec3d.z / 2.0D - vec3d1.z);
@@ -56,7 +56,7 @@ index c347c4e6f957118198adb1de7633d369bd012b82..9b6fcaaafa84853804f6183d02bd90b4
}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index 82b8f626f8fa4a446257df4fdc41f17c612c5b74..b937ffef296beed853b47ded1672a2f408be674f 100644
+index dddbc0497c9c6547c025162b0e6fcd865bff464c..d8af0c5977964b8953550120b69ed50198abf114 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1554,7 +1554,7 @@ public abstract class Mob extends LivingEntity {
@@ -82,10 +82,10 @@ index f6fd39823f04f8071c616d40a838b01e7159c5a1..e1cdf3ce38404d3f40be59e4cd3ad2b9
serverLevel.playSound((Player)null, pathfinderMob, this.getImpactSound.apply(pathfinderMob), SoundSource.HOSTILE, 1.0F, 1.0F);
} else {
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
-index bfd454dfd450e5f9cb0e496ae654562169856de2..e72657009686461a28d27883573ecff09a77ccee 100644
+index f0da841cf8e37884c40397bb4032eab35e9eec4f..c522ecc74d2b204986716bccfa555cb54e8bd062 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
-@@ -1229,7 +1229,7 @@ public abstract class Player extends LivingEntity {
+@@ -1242,7 +1242,7 @@ public abstract class Player extends LivingEntity {
if (flag5) {
if (i > 0) {
if (target instanceof LivingEntity) {
@@ -94,7 +94,7 @@ index bfd454dfd450e5f9cb0e496ae654562169856de2..e72657009686461a28d27883573ecff0
} else {
target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * (float) i * 0.5F));
}
-@@ -1253,7 +1253,7 @@ public abstract class Player extends LivingEntity {
+@@ -1266,7 +1266,7 @@ public abstract class Player extends LivingEntity {
if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
// CraftBukkit start - Only apply knockback if the damage hits
if (entityliving.hurt(DamageSource.playerAttack(this).sweep(), f4)) {
diff --git a/patches/server/0214-Expand-Explosions-API.patch b/patches/server/0214-Expand-Explosions-API.patch
index bd066eee8c..8b1566f618 100644
--- a/patches/server/0214-Expand-Explosions-API.patch
+++ b/patches/server/0214-Expand-Explosions-API.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 9d9915f2984f87c8cc9d6dd1d445dfcf127bc010..b084ac797e6512295c1adbf9226270b4607a4359 100644
+index 681b91f047566c7b2220a2f30e11a55b7338dffe..2ccf2315478f6809d4eddffc481c72c3dc618b4d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -697,6 +697,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -700,6 +700,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) {
return !this.world.explode(source == null ? null : ((CraftEntity) source).getHandle(), x, y, z, power, setFire, breakBlocks ? Explosion.BlockInteraction.BREAK : Explosion.BlockInteraction.NONE).wasCanceled;
}
diff --git a/patches/server/0218-Implement-World.getEntity-UUID-API.patch b/patches/server/0218-Implement-World.getEntity-UUID-API.patch
index 55826a7147..d5832ace14 100644
--- a/patches/server/0218-Implement-World.getEntity-UUID-API.patch
+++ b/patches/server/0218-Implement-World.getEntity-UUID-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Implement World.getEntity(UUID) API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index b084ac797e6512295c1adbf9226270b4607a4359..7b98b8639b48504096f8ab1a2cadf98d492b6789 100644
+index 2ccf2315478f6809d4eddffc481c72c3dc618b4d..15455d7be314d32cbda7adede326b33d3306c349 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -1031,6 +1031,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1034,6 +1034,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return list;
}
diff --git a/patches/server/0219-InventoryCloseEvent-Reason-API.patch b/patches/server/0219-InventoryCloseEvent-Reason-API.patch
index 3985bf4557..7790a731ec 100644
--- a/patches/server/0219-InventoryCloseEvent-Reason-API.patch
+++ b/patches/server/0219-InventoryCloseEvent-Reason-API.patch
@@ -7,10 +7,10 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 11b0f1ef4aa02cf719e4d937c98d41b82ffca23a..9f3b3c34e625e27c9c56ccbfd244dd053c2e703f 100644
+index c38f6d789eea3bde1a71b14c3d070b000a9a297e..b2a4fd52eeead4dd2e20cfab47acc9d3fcabab98 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1130,7 +1130,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1133,7 +1133,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) {
if (tileentity instanceof net.minecraft.world.Container) {
for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((net.minecraft.world.Container) tileentity).getViewers())) {
@@ -19,7 +19,7 @@ index 11b0f1ef4aa02cf719e4d937c98d41b82ffca23a..9f3b3c34e625e27c9c56ccbfd244dd05
}
}
}
-@@ -2063,7 +2063,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -2070,7 +2070,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) {
@@ -29,10 +29,10 @@ index 11b0f1ef4aa02cf719e4d937c98d41b82ffca23a..9f3b3c34e625e27c9c56ccbfd244dd05
}
// Spigot End
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 90bff0dd400a67bcb84f8576bd8326793420919a..fd1937f49312204d38510996a5be43b731f38bde 100644
+index 7f2d96722d3f835980ee841a285a585938acfe1a..005856931c27d4e2dbffec65ae59191782508e06 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -601,7 +601,7 @@ public class ServerPlayer extends Player {
+@@ -599,7 +599,7 @@ public class ServerPlayer extends Player {
}
// Paper end
if (!this.level.isClientSide && !this.containerMenu.stillValid(this)) {
@@ -41,7 +41,7 @@ index 90bff0dd400a67bcb84f8576bd8326793420919a..fd1937f49312204d38510996a5be43b7
this.containerMenu = this.inventoryMenu;
}
-@@ -789,7 +789,7 @@ public class ServerPlayer extends Player {
+@@ -787,7 +787,7 @@ public class ServerPlayer extends Player {
// SPIGOT-943 - only call if they have an inventory open
if (this.containerMenu != this.inventoryMenu) {
@@ -50,7 +50,7 @@ index 90bff0dd400a67bcb84f8576bd8326793420919a..fd1937f49312204d38510996a5be43b7
}
net.kyori.adventure.text.Component deathMessage = event.deathMessage() != null ? event.deathMessage() : net.kyori.adventure.text.Component.empty(); // Paper - Adventure
-@@ -1429,7 +1429,7 @@ public class ServerPlayer extends Player {
+@@ -1427,7 +1427,7 @@ public class ServerPlayer extends Player {
}
// CraftBukkit end
if (this.containerMenu != this.inventoryMenu) {
@@ -59,7 +59,7 @@ index 90bff0dd400a67bcb84f8576bd8326793420919a..fd1937f49312204d38510996a5be43b7
}
// this.nextContainerCounter(); // CraftBukkit - moved up
-@@ -1457,7 +1457,13 @@ public class ServerPlayer extends Player {
+@@ -1455,7 +1455,13 @@ public class ServerPlayer extends Player {
@Override
public void closeContainer() {
@@ -75,10 +75,10 @@ index 90bff0dd400a67bcb84f8576bd8326793420919a..fd1937f49312204d38510996a5be43b7
this.doCloseContainer();
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index ed477b6a229ed9e53067a8bb50f76b96945cab71..011b0a6c4fbcf9b5ffa7435c4fb325ce6b3fb262 100644
+index 9854706d1645a5c04e7ba636cf6f139b1ac4c453..1be8c731ab7019a2f93d0b32facbe05fb23371d2 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -187,6 +187,7 @@ import org.bukkit.event.inventory.ClickType;
+@@ -188,6 +188,7 @@ import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
@@ -86,7 +86,7 @@ index ed477b6a229ed9e53067a8bb50f76b96945cab71..011b0a6c4fbcf9b5ffa7435c4fb325ce
import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.inventory.SmithItemEvent;
-@@ -2334,10 +2335,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2349,10 +2350,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handleContainerClose(ServerboundContainerClosePacket packet) {
@@ -105,7 +105,7 @@ index ed477b6a229ed9e53067a8bb50f76b96945cab71..011b0a6c4fbcf9b5ffa7435c4fb325ce
this.player.doCloseContainer();
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index be65d315af3089f49d2f5c9fe59c9ec0e8d3e2f9..f2efbb954ca56040ed39937750c4a01a4b6334fc 100644
+index a1ca0c0c08f6793ce3440733f802a40f99890d85..b2034239e158ce0388c9b09a52d457271a487d8f 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -502,7 +502,7 @@ public abstract class PlayerList {
@@ -118,10 +118,10 @@ index be65d315af3089f49d2f5c9fe59c9ec0e8d3e2f9..f2efbb954ca56040ed39937750c4a01a
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName())));
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
-index e72657009686461a28d27883573ecff09a77ccee..fcd66b668008a0c3be8d20f7f169b213fabe91a5 100644
+index c522ecc74d2b204986716bccfa555cb54e8bd062..2dcbeaed2e84675e95cde9e831b9d552b2e0b32f 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
-@@ -262,7 +262,7 @@ public abstract class Player extends LivingEntity {
+@@ -263,7 +263,7 @@ public abstract class Player extends LivingEntity {
this.updateIsUnderwater();
super.tick();
if (!this.level.isClientSide && this.containerMenu != null && !this.containerMenu.stillValid(this)) {
@@ -130,7 +130,7 @@ index e72657009686461a28d27883573ecff09a77ccee..fcd66b668008a0c3be8d20f7f169b213
this.containerMenu = this.inventoryMenu;
}
-@@ -485,6 +485,13 @@ public abstract class Player extends LivingEntity {
+@@ -486,6 +486,13 @@ public abstract class Player extends LivingEntity {
}
diff --git a/patches/server/0221-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/patches/server/0221-Refresh-player-inventory-when-cancelling-PlayerInter.patch
index 1c6889936b..cc6541e4cb 100644
--- a/patches/server/0221-Refresh-player-inventory-when-cancelling-PlayerInter.patch
+++ b/patches/server/0221-Refresh-player-inventory-when-cancelling-PlayerInter.patch
@@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is
cancelled to avoid this problem.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 011b0a6c4fbcf9b5ffa7435c4fb325ce6b3fb262..cca7ce86c619527c5ec920e68e308af46878fd8e 100644
+index 1be8c731ab7019a2f93d0b32facbe05fb23371d2..27526c1c1b21369fe8ca0f1541a15562555922b5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2219,6 +2219,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2234,6 +2234,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
if (event.isCancelled()) {
diff --git a/patches/server/0224-add-more-information-to-Entity.toString.patch b/patches/server/0224-add-more-information-to-Entity.toString.patch
index d44d174460..4da95a5c33 100644
--- a/patches/server/0224-add-more-information-to-Entity.toString.patch
+++ b/patches/server/0224-add-more-information-to-Entity.toString.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] add more information to Entity.toString()
UUID, ticks lived, valid, dead
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index c2b24ad7ca280972f287cbb876dcc7011fb49db9..612478675192471ffcf937842d522bd179c43c51 100644
+index 4473197fdcad7e6026797c6f494c4e2a90c2fb36..9041feeeb0e2d43abebaa136dc739b3525f48e16 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2827,7 +2827,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -2844,7 +2844,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
public String toString() {
String s = this.level == null ? "~NULL~" : this.level.toString();
diff --git a/patches/server/0230-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/patches/server/0230-Option-to-prevent-armor-stands-from-doing-entity-loo.patch
index bb7b8b0943..03f12b9757 100644
--- a/patches/server/0230-Option-to-prevent-armor-stands-from-doing-entity-loo.patch
+++ b/patches/server/0230-Option-to-prevent-armor-stands-from-doing-entity-loo.patch
@@ -31,10 +31,10 @@ index 138422903dcb3056cd011a72e0625a1a225b4280..b92c2d5f9ad3936f619b51c79379983e
for (int i = 0; i < list.size(); ++i) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index cd4c3be34647e772753dc68fbe50060365d8cd29..d61e598478d297857f5e76d7c42a9e5c157514d5 100644
+index 46168d119d10231b8b946015245a476e0b56d567..e80a9a5df0e4722a12c65c57592879621571a13f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -775,6 +775,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -774,6 +774,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end
}
}
diff --git a/patches/server/0231-Vanished-players-don-t-have-rights.patch b/patches/server/0231-Vanished-players-don-t-have-rights.patch
index 9f99ea6f00..2b61bed882 100644
--- a/patches/server/0231-Vanished-players-don-t-have-rights.patch
+++ b/patches/server/0231-Vanished-players-don-t-have-rights.patch
@@ -38,7 +38,7 @@ index c3fb7d41688855010c643b91c8d9496486dae089..8175bb6331727440da2232998bdad068
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(state), defaultReturn);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index d61e598478d297857f5e76d7c42a9e5c157514d5..fe666bb392ca16a9a6210dcb08bd0ddae22ead85 100644
+index e80a9a5df0e4722a12c65c57592879621571a13f..67566e5f95f7452d31bea485bdb91a4e1a32e5d5 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -72,6 +72,10 @@ import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
@@ -50,9 +50,9 @@ index d61e598478d297857f5e76d7c42a9e5c157514d5..fe666bb392ca16a9a6210dcb08bd0dda
+import net.minecraft.world.phys.shapes.Shapes;
+import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.scores.Scoreboard;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
-@@ -251,6 +255,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+
+ // CraftBukkit start
+@@ -250,6 +254,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
}
diff --git a/patches/server/0236-AnvilDamageEvent.patch b/patches/server/0236-AnvilDamageEvent.patch
index c6a2d47491..f2443baeff 100644
--- a/patches/server/0236-AnvilDamageEvent.patch
+++ b/patches/server/0236-AnvilDamageEvent.patch
@@ -5,11 +5,11 @@ Subject: [PATCH] AnvilDamageEvent
diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
-index 57c2806543e8a183033170bfb7746cfa8f14b448..6b9c39b85e3a21fc0073fc15c8a76c92f75d2487 100644
+index 4348a2f7187b4751ceafe567381ebd9828983fef..21215d27e59d7e6ab4b9511340e642c710fb74da 100644
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
-@@ -89,6 +89,16 @@ public class AnvilMenu extends ItemCombinerMenu {
- if (!player.getAbilities().instabuild && iblockdata.is((Tag) BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) {
+@@ -88,6 +88,16 @@ public class AnvilMenu extends ItemCombinerMenu {
+ if (!player.getAbilities().instabuild && iblockdata.is(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) {
BlockState iblockdata1 = AnvilBlock.damage(iblockdata);
+ // Paper start
diff --git a/patches/server/0237-Add-hand-to-bucket-events.patch b/patches/server/0237-Add-hand-to-bucket-events.patch
index 523d45c4e6..9720caf629 100644
--- a/patches/server/0237-Add-hand-to-bucket-events.patch
+++ b/patches/server/0237-Add-hand-to-bucket-events.patch
@@ -18,10 +18,10 @@ index 0f601ad4629bda75ec90612ad27fdec9ce62f83d..425c6da0de40983b0870c9fd1b53f16b
if (event.isCancelled()) {
return InteractionResult.PASS;
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
-index dc1ef737267aa826d1d2fb10f923fe294a67be83..d3c4f93ee2aa1902eeca197c72eb17199fc41fb2 100644
+index 8017953b623454593fbddbbcf90806c6e07c0974..8618790938f182e4aa0e27ea79dea1d35a36ec6e 100644
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
-@@ -182,7 +182,7 @@ public class Goat extends Animal {
+@@ -177,7 +177,7 @@ public class Goat extends Animal {
if (itemstack.is(Items.BUCKET) && !this.isBaby()) {
// CraftBukkit start - Got milk?
diff --git a/patches/server/0238-Add-TNTPrimeEvent.patch b/patches/server/0238-Add-TNTPrimeEvent.patch
index 4c2f58822c..63784ce3b7 100644
--- a/patches/server/0238-Add-TNTPrimeEvent.patch
+++ b/patches/server/0238-Add-TNTPrimeEvent.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add TNTPrimeEvent
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
-index 19e594757fca90c64c4dc59233ff956e7c316da9..e17a3afa41fd628d2c4a3637ae19418e258a99b8 100644
+index 139c98ab86589027873418601dbc7f4ed6358906..7eebecf836d21fc4ee901d23d7061db64486c0d5 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
-@@ -536,6 +536,11 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -533,6 +533,11 @@ public class EnderDragon extends Mob implements Enemy {
});
craftBlock.getNMS().spawnAfterBreak((ServerLevel) level, blockposition, ItemStack.EMPTY);
}
diff --git a/patches/server/0239-Break-up-and-make-tab-spam-limits-configurable.patch b/patches/server/0239-Break-up-and-make-tab-spam-limits-configurable.patch
index c4907e0883..3383fa2c3d 100644
--- a/patches/server/0239-Break-up-and-make-tab-spam-limits-configurable.patch
+++ b/patches/server/0239-Break-up-and-make-tab-spam-limits-configurable.patch
@@ -45,10 +45,10 @@ index 915e2c5b0ffbd0d459a203e1bfb131be4c5476d4..00dd9dab2b19f3e49f3b41c20eb96a84
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index cca7ce86c619527c5ec920e68e308af46878fd8e..c0f558d3c6f3b4b01e56d453ab136cf2357f2463 100644
+index 27526c1c1b21369fe8ca0f1541a15562555922b5..62fda1dd8d560a8e16118e9d1b044ef59c0e5b02 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -226,6 +226,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -227,6 +227,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private long keepAliveChallenge;
// CraftBukkit start - multithreaded fields
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
@@ -56,7 +56,7 @@ index cca7ce86c619527c5ec920e68e308af46878fd8e..c0f558d3c6f3b4b01e56d453ab136cf2
// CraftBukkit end
private int dropSpamTickCount;
private double firstGoodX;
-@@ -357,6 +358,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -358,6 +359,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.server.getProfiler().pop();
// CraftBukkit start
for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
@@ -64,7 +64,7 @@ index cca7ce86c619527c5ec920e68e308af46878fd8e..c0f558d3c6f3b4b01e56d453ab136cf2
/* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount;
-@@ -703,7 +705,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -710,7 +712,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
// PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async
// CraftBukkit start
diff --git a/patches/server/0240-MC-135506-Experience-should-save-as-Integers.patch b/patches/server/0240-MC-135506-Experience-should-save-as-Integers.patch
index 8398582047..c0c7c171ff 100644
--- a/patches/server/0240-MC-135506-Experience-should-save-as-Integers.patch
+++ b/patches/server/0240-MC-135506-Experience-should-save-as-Integers.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] MC-135506: Experience should save as Integers
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-index 8a3f2d2c9087b1a5f4dbde8e58af825e334f2432..8be7a3527018f9f6ecb91576c928c255b3089342 100644
+index 6bf6d6629dfb9338d3e34f433a5698904a2acdad..4848f26a006f4d4df620ded526134b3b39e90d29 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
-@@ -283,7 +283,7 @@ public class ExperienceOrb extends Entity {
+@@ -284,7 +284,7 @@ public class ExperienceOrb extends Entity {
public void addAdditionalSaveData(CompoundTag nbt) {
nbt.putShort("Health", (short) this.health);
nbt.putShort("Age", (short) this.age);
@@ -17,7 +17,7 @@ index 8a3f2d2c9087b1a5f4dbde8e58af825e334f2432..8be7a3527018f9f6ecb91576c928c255
nbt.putInt("Count", this.count);
this.savePaperNBT(nbt); // Paper
}
-@@ -292,7 +292,7 @@ public class ExperienceOrb extends Entity {
+@@ -293,7 +293,7 @@ public class ExperienceOrb extends Entity {
public void readAdditionalSaveData(CompoundTag nbt) {
this.health = nbt.getShort("Health");
this.age = nbt.getShort("Age");
diff --git a/patches/server/0242-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/0242-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
index 3101f40133..e8dd47033d 100644
--- a/patches/server/0242-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
+++ b/patches/server/0242-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch
@@ -8,10 +8,10 @@ Add -Ddebug.entities=true to your JVM flags to gain more information
1.17: Needs to be reworked for new entity storage system
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
-index 71e0206e31eafca2859fe972214bea0ad74f203e..8593f68b0d2c1043009d02ada5396333c8da4d50 100644
+index 610a1ce766d826f3fdca595dd4135f96ef9280d8..b64f42b9ca1da5b6d5c290c157e510797e524117 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
-@@ -1312,6 +1312,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1366,6 +1366,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else {
ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas());
@@ -19,7 +19,7 @@ index 71e0206e31eafca2859fe972214bea0ad74f203e..8593f68b0d2c1043009d02ada5396333
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
playerchunkmap_entitytracker.updatePlayers(this.level.players());
if (entity instanceof ServerPlayer) {
-@@ -1354,7 +1355,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1408,7 +1409,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.broadcastRemoved();
}
@@ -29,10 +29,10 @@ index 71e0206e31eafca2859fe972214bea0ad74f203e..8593f68b0d2c1043009d02ada5396333
protected void tick() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 9f3b3c34e625e27c9c56ccbfd244dd053c2e703f..cd11361cd2dc12c7b94f3e8505937b484ec19dff 100644
+index b2a4fd52eeead4dd2e20cfab47acc9d3fcabab98..7e2e7ce7ba9b23c813e1a4197ac06d0fe703c22b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -208,6 +208,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -209,6 +209,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper
@@ -42,7 +42,7 @@ index 9f3b3c34e625e27c9c56ccbfd244dd053c2e703f..cd11361cd2dc12c7b94f3e8505937b48
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkSource.getChunk(x, z, false);
-@@ -1093,7 +1096,28 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -1096,7 +1099,28 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit start
private boolean addEntity(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
@@ -72,10 +72,10 @@ index 9f3b3c34e625e27c9c56ccbfd244dd053c2e703f..cd11361cd2dc12c7b94f3e8505937b48
return false;
} else {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 6defa5579f3c7dba3dc9d82937a14edd1bb16cfe..37f337efb7ac164749c73974e4acfde93d649290 100644
+index 9041feeeb0e2d43abebaa136dc739b3525f48e16..c819bd3db7dfab1181288683f2a47bb71a52953d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -170,6 +170,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -173,6 +173,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
private CraftEntity bukkitEntity;
@@ -85,10 +85,10 @@ index 6defa5579f3c7dba3dc9d82937a14edd1bb16cfe..37f337efb7ac164749c73974e4acfde9
if (this.bukkitEntity == null) {
this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index fe666bb392ca16a9a6210dcb08bd0ddae22ead85..5e3d1a36b0eb350536e29730540ee17b68fe315b 100644
+index 67566e5f95f7452d31bea485bdb91a4e1a32e5d5..dc2235824853a0d7ccbff51dd26a71e97fe90ba7 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -144,6 +144,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -142,6 +142,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean pvpMode;
public boolean keepSpawnInMemory = true;
public org.bukkit.generator.ChunkGenerator generator;
@@ -97,7 +97,7 @@ index fe666bb392ca16a9a6210dcb08bd0ddae22ead85..5e3d1a36b0eb350536e29730540ee17b
public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710
public boolean captureBlockStates = false;
diff --git a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java
-index c8cf7da4224dccd9b9e8a73bcfc3ff5babfb8f8c..1d04f35b6755b3a7ee77f93c1a30513a5af7d6cf 100644
+index 3864da01056970ae05cc3ca094f923178b4ffc97..ab6be988a8714d57ee73ce80b9101a1e9917fbbe 100644
--- a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java
+++ b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java
@@ -20,7 +20,7 @@ public class EntityLookup {
diff --git a/patches/server/0243-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0243-Add-Early-Warning-Feature-to-WatchDog.patch
index 410e523f90..e980e9bfb7 100644
--- a/patches/server/0243-Add-Early-Warning-Feature-to-WatchDog.patch
+++ b/patches/server/0243-Add-Early-Warning-Feature-to-WatchDog.patch
@@ -36,10 +36,10 @@ index 00dd9dab2b19f3e49f3b41c20eb96a84bfae1769..d9114c5fa141c37270398100db6bb2a8
public static int tabSpamLimit = 500;
private static void tabSpamLimiters() {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index e89f100e950c6fa85112a67daaa157de665b17cf..37ccbfc3b5ff47fac8cd878f9de5bccec84994e5 100644
+index d48232d6bef4728242d2cde6b37d95a7041677d8..86e789515922345ed3ce623b24f81a5a379a020c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -1085,6 +1085,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> {
- protected static final Logger LOGGER = LogManager.getLogger();
+ private static final Logger LOGGER = LogUtils.getLogger();
private static final Gson GSON = (new GsonBuilder()).setPrettyPrinting().create();
private final File file;
- private final Map map = Maps.newHashMap();
diff --git a/patches/server/0245-Use-a-Queue-for-Queueing-Commands.patch b/patches/server/0245-Use-a-Queue-for-Queueing-Commands.patch
index 79bac78923..742b00ee96 100644
--- a/patches/server/0245-Use-a-Queue-for-Queueing-Commands.patch
+++ b/patches/server/0245-Use-a-Queue-for-Queueing-Commands.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Use a Queue for Queueing Commands
Lists are bad as Queues mmmkay.
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-index eed1d77a91f19722c2d2a3a43184565cd29732f7..9a2c040c3a513fe51c5fa9c5deaba13a01639f38 100644
+index 39a24292f215920bc3121f4ac903040dd73a9978..4357d5c7c66d9490a34f2d591ddc3d58d36cadd1 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
-@@ -75,7 +75,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+@@ -78,7 +78,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
private static final int CONVERSION_RETRY_DELAY_MS = 5000;
private static final int CONVERSION_RETRIES = 2;
private static final Pattern SHA1 = Pattern.compile("^[a-fA-F0-9]{40}$");
@@ -18,7 +18,7 @@ index eed1d77a91f19722c2d2a3a43184565cd29732f7..9a2c040c3a513fe51c5fa9c5deaba13a
@Nullable
private QueryThreadGs4 queryThreadGs4;
public final RconConsoleSource rconConsoleSource;
-@@ -453,13 +453,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+@@ -456,13 +456,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
public void handleConsoleInput(String command, CommandSourceStack commandSource) {
diff --git a/patches/server/0246-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/patches/server/0246-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch
index 28dbf7c0e4..a583e1baff 100644
--- a/patches/server/0246-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch
+++ b/patches/server/0246-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
-index 6c47771e0168e958b22c987bcd8bc100f6208c10..a1fe076d76fe5f84eca39ea68e9820096f58f5a7 100644
+index 404bd3389aaa75ca23f04d23ecea9093443c3976..f3c67a815c570beb14136905cbf5aa4046ee8394 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -4,8 +4,10 @@ import com.google.common.base.Preconditions;
@@ -19,7 +19,7 @@ index 6c47771e0168e958b22c987bcd8bc100f6208c10..a1fe076d76fe5f84eca39ea68e982009
import java.util.Objects;
import java.util.concurrent.locks.LockSupport;
import java.util.function.BooleanSupplier;
-@@ -175,6 +177,13 @@ public class CraftChunk implements Chunk {
+@@ -176,6 +178,13 @@ public class CraftChunk implements Chunk {
@Override
public BlockState[] getTileEntities() {
@@ -33,7 +33,7 @@ index 6c47771e0168e958b22c987bcd8bc100f6208c10..a1fe076d76fe5f84eca39ea68e982009
if (!this.isLoaded()) {
this.getWorld().getChunkAt(x, z); // Transient load for this tick
}
-@@ -189,7 +198,29 @@ public class CraftChunk implements Chunk {
+@@ -190,7 +199,29 @@ public class CraftChunk implements Chunk {
}
BlockPos position = (BlockPos) obj;
diff --git a/patches/server/0249-Slime-Pathfinder-Events.patch b/patches/server/0249-Slime-Pathfinder-Events.patch
index 86987afbe4..40c543b870 100644
--- a/patches/server/0249-Slime-Pathfinder-Events.patch
+++ b/patches/server/0249-Slime-Pathfinder-Events.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Slime Pathfinder Events
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
-index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361eea84ed384 100644
+index 990f2e17aad4a1116482b3aa534686cf8dc3669a..8d03466e2f546aae705c1d4dd2d562d3db2f2671 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
-@@ -44,6 +44,12 @@ import net.minecraft.world.level.biome.Biomes;
+@@ -42,6 +42,12 @@ import net.minecraft.world.level.biome.Biomes;
import net.minecraft.world.level.levelgen.WorldgenRandom;
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
import net.minecraft.world.phys.Vec3;
@@ -21,7 +21,7 @@ index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361ee
// CraftBukkit start
import java.util.ArrayList;
import java.util.List;
-@@ -108,6 +114,7 @@ public class Slime extends Mob implements Enemy {
+@@ -106,6 +112,7 @@ public class Slime extends Mob implements Enemy {
@Override
public void addAdditionalSaveData(CompoundTag nbt) {
super.addAdditionalSaveData(nbt);
@@ -29,7 +29,7 @@ index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361ee
nbt.putInt("Size", this.getSize() - 1);
nbt.putBoolean("wasOnGround", this.wasOnGround);
}
-@@ -116,6 +123,11 @@ public class Slime extends Mob implements Enemy {
+@@ -114,6 +121,11 @@ public class Slime extends Mob implements Enemy {
public void readAdditionalSaveData(CompoundTag nbt) {
this.setSize(nbt.getInt("Size") + 1, false);
super.readAdditionalSaveData(nbt);
@@ -41,7 +41,7 @@ index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361ee
this.wasOnGround = nbt.getBoolean("wasOnGround");
}
-@@ -454,7 +466,7 @@ public class Slime extends Mob implements Enemy {
+@@ -452,7 +464,7 @@ public class Slime extends Mob implements Enemy {
@Override
public boolean canUse() {
@@ -50,7 +50,7 @@ index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361ee
}
@Override
-@@ -486,7 +498,15 @@ public class Slime extends Mob implements Enemy {
+@@ -484,7 +496,15 @@ public class Slime extends Mob implements Enemy {
public boolean canUse() {
LivingEntity entityliving = this.slime.getTarget();
@@ -67,7 +67,7 @@ index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361ee
}
@Override
-@@ -499,7 +519,15 @@ public class Slime extends Mob implements Enemy {
+@@ -497,7 +517,15 @@ public class Slime extends Mob implements Enemy {
public boolean canContinueToUse() {
LivingEntity entityliving = this.slime.getTarget();
@@ -84,7 +84,7 @@ index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361ee
}
@Override
-@@ -517,6 +545,13 @@ public class Slime extends Mob implements Enemy {
+@@ -515,6 +543,13 @@ public class Slime extends Mob implements Enemy {
((Slime.SlimeMoveControl) this.slime.getMoveControl()).setDirection(this.slime.getYRot(), this.slime.isDealsDamage());
}
@@ -98,7 +98,7 @@ index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361ee
}
private static class SlimeRandomDirectionGoal extends Goal {
-@@ -532,7 +567,7 @@ public class Slime extends Mob implements Enemy {
+@@ -530,7 +565,7 @@ public class Slime extends Mob implements Enemy {
@Override
public boolean canUse() {
@@ -107,7 +107,7 @@ index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361ee
}
@Override
-@@ -540,6 +575,11 @@ public class Slime extends Mob implements Enemy {
+@@ -538,6 +573,11 @@ public class Slime extends Mob implements Enemy {
if (--this.nextRandomizeTime <= 0) {
this.nextRandomizeTime = this.adjustedTickDelay(40 + this.slime.getRandom().nextInt(60));
this.chosenDegrees = (float) this.slime.getRandom().nextInt(360);
@@ -119,7 +119,7 @@ index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361ee
}
((Slime.SlimeMoveControl) this.slime.getMoveControl()).setDirection(this.chosenDegrees, false);
-@@ -557,7 +597,7 @@ public class Slime extends Mob implements Enemy {
+@@ -555,7 +595,7 @@ public class Slime extends Mob implements Enemy {
@Override
public boolean canUse() {
@@ -128,7 +128,7 @@ index 11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e..6ec81054bcf25d99aec567d568c361ee
}
@Override
-@@ -565,4 +605,15 @@ public class Slime extends Mob implements Enemy {
+@@ -563,4 +603,15 @@ public class Slime extends Mob implements Enemy {
((Slime.SlimeMoveControl) this.slime.getMoveControl()).setWantedMovement(1.0D);
}
}
diff --git a/patches/server/0250-Configurable-speed-for-water-flowing-over-lava.patch b/patches/server/0250-Configurable-speed-for-water-flowing-over-lava.patch
index f8d88afb90..d9b466d628 100644
--- a/patches/server/0250-Configurable-speed-for-water-flowing-over-lava.patch
+++ b/patches/server/0250-Configurable-speed-for-water-flowing-over-lava.patch
@@ -20,10 +20,10 @@ index 831e874f01d8edcff12a094dbf918d2533939c60..e57ab8a3e6efd78e12385042b7d91dcd
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
-index c3d3c06e06a85ce926a2be69ec9d9b8a3eb9b8e2..11ebadaa2438281a54cffe025a49ee5046a71ba5 100644
+index c3afe362f76eed689c33d05e28b1b2b9107c90c7..8497adcba2570da8875c322e751fca2fdad057e5 100644
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
-@@ -24,6 +24,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
+@@ -23,6 +23,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.material.FlowingFluid;
import net.minecraft.world.level.material.FluidState;
@@ -31,7 +31,7 @@ index c3d3c06e06a85ce926a2be69ec9d9b8a3eb9b8e2..11ebadaa2438281a54cffe025a49ee50
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.phys.shapes.CollisionContext;
-@@ -107,11 +108,27 @@ public class LiquidBlock extends Block implements BucketPickup {
+@@ -106,11 +107,27 @@ public class LiquidBlock extends Block implements BucketPickup {
@Override
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
if (this.shouldSpreadLiquid(world, pos, state)) {
@@ -60,7 +60,7 @@ index c3d3c06e06a85ce926a2be69ec9d9b8a3eb9b8e2..11ebadaa2438281a54cffe025a49ee50
@Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
if (state.getFluidState().isSource() || neighborState.getFluidState().isSource()) {
-@@ -124,7 +141,7 @@ public class LiquidBlock extends Block implements BucketPickup {
+@@ -123,7 +140,7 @@ public class LiquidBlock extends Block implements BucketPickup {
@Override
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) {
if (this.shouldSpreadLiquid(world, pos, state)) {
diff --git a/patches/server/0251-Optimize-CraftBlockData-Creation.patch b/patches/server/0251-Optimize-CraftBlockData-Creation.patch
index a7acf9bded..998ef1e21b 100644
--- a/patches/server/0251-Optimize-CraftBlockData-Creation.patch
+++ b/patches/server/0251-Optimize-CraftBlockData-Creation.patch
@@ -7,10 +7,10 @@ Avoids a hashmap lookup by cacheing a reference to the CraftBlockData
and cloning it when one is needed.
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
-index a3f44e3a44b2ec21ef41f6d598b428448c847c5f..3c6b1b92fedf9986ebb835170c070ebd461f5d25 100644
+index 2b88ea323b7e179015751e87d1a4303bffed7f51..a5b7fbd940bf180b76017442ee7224761741fe52 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
-@@ -678,6 +678,14 @@ public abstract class BlockBehaviour {
+@@ -680,6 +680,14 @@ public abstract class BlockBehaviour {
this.hasPostProcess = blockbase_info.hasPostProcess;
this.emissiveRendering = blockbase_info.emissiveRendering;
}
@@ -26,7 +26,7 @@ index a3f44e3a44b2ec21ef41f6d598b428448c847c5f..3c6b1b92fedf9986ebb835170c070ebd
// Paper start
protected boolean shapeExceedsCube = true;
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
-index c6a9ce2a67591205cbeb436b5043e737331c3527..3594f432a25b580173e8577bf324be954f5eddd1 100644
+index 41702f632ca89158da3d72a6135240ccb2283ad6..275401f9bf7a78e69766e0547c94c3a115a8896c 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
@@ -527,7 +527,17 @@ public class CraftBlockData implements BlockData {
diff --git a/patches/server/0252-Optimize-MappedRegistry.patch b/patches/server/0252-Optimize-MappedRegistry.patch
index ad28f0dfd9..bb17dbc545 100644
--- a/patches/server/0252-Optimize-MappedRegistry.patch
+++ b/patches/server/0252-Optimize-MappedRegistry.patch
@@ -8,33 +8,33 @@ Use larger initial sizes to increase bucket capacity on the BiMap
BiMap.get was seen to be using a good bit of CPU time.
diff --git a/src/main/java/net/minecraft/core/MappedRegistry.java b/src/main/java/net/minecraft/core/MappedRegistry.java
-index 25a6d195c5d6ee456258d2167f8acc5eb717e187..76b0b8b03c1d1c548ff67cfd6e6b127764f951d9 100644
+index d74665f6c3aa05b9e27a712092005e3de81f18a1..a015a097b807d49f60323dacda970db260543561 100644
--- a/src/main/java/net/minecraft/core/MappedRegistry.java
+++ b/src/main/java/net/minecraft/core/MappedRegistry.java
-@@ -36,13 +36,11 @@ import org.apache.logging.log4j.Logger;
-
+@@ -37,13 +37,11 @@ import org.slf4j.Logger;
public class MappedRegistry extends WritableRegistry {
- protected static final Logger LOGGER = LogManager.getLogger();
-- private final ObjectList byId = new ObjectArrayList<>(256);
+ private static final Logger LOGGER = LogUtils.getLogger();
+ private final ObjectList> byId = new ObjectArrayList<>(256);
- private final Object2IntMap toId = Util.make(new Object2IntOpenCustomHashMap<>(Util.identityStrategy()), (object2IntOpenCustomHashMap) -> {
- object2IntOpenCustomHashMap.defaultReturnValue(-1);
- });
-- private final BiMap storage = HashBiMap.create();
-- private final BiMap, T> keyStorage = HashBiMap.create();
-- private final Map lifecycles = Maps.newIdentityHashMap();
-+ private final ObjectList byId = new ObjectArrayList(256);
+- private final Map> byLocation = new HashMap<>();
+- private final Map, Holder.Reference> byKey = new HashMap<>();
+- private final Map> byValue = new IdentityHashMap<>();
+- private final Map lifecycles = new IdentityHashMap<>();
+ private final it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap toId = new it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap(2048);// Paper - use bigger expected size to reduce collisions and direct intent for FastUtil to be identity map
-+ private final BiMap storage = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
-+ private final BiMap, T> keyStorage = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
-+ private final Map lifecycles = new java.util.IdentityHashMap<>(2048); // Paper - use bigger expected size to reduce collisions
++ private final Map> byLocation = new HashMap<>(2048); // Paper - use bigger expected size to reduce collisions
++ private final Map, Holder.Reference> byKey = new HashMap<>(2048); // Paper - use bigger expected size to reduce collisions
++ private final Map> byValue = new IdentityHashMap<>(2048); // Paper - use bigger expected size to reduce collisions
++ private final Map lifecycles = new IdentityHashMap<>(2048); // Paper - use bigger expected size to reduce collisions
private Lifecycle elementsLifecycle;
- @Nullable
- protected Object[] randomCache;
-@@ -51,6 +49,7 @@ public class MappedRegistry extends WritableRegistry {
- public MappedRegistry(ResourceKey extends Registry> key, Lifecycle lifecycle) {
- super(key, lifecycle);
- this.elementsLifecycle = lifecycle;
+ private volatile Map, HolderSet.Named> tags = new IdentityHashMap<>();
+ private boolean frozen;
+@@ -63,6 +61,7 @@ public class MappedRegistry extends WritableRegistry {
+ this.intrusiveHolderCache = new IdentityHashMap<>();
+ }
+
+ this.toId.defaultReturnValue(-1); // Paper
}
- public static MapCodec> withNameAndId(ResourceKey extends Registry> key, MapCodec entryCodec) {
+ private List> holdersInOrder() {
diff --git a/patches/server/0256-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/patches/server/0256-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch
index 4e338bbe94..7abfc4852d 100644
--- a/patches/server/0256-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch
+++ b/patches/server/0256-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 7b98b8639b48504096f8ab1a2cadf98d492b6789..20d0e19851a4e8b62a8f781eb7f5795b2d156eb8 100644
+index 15455d7be314d32cbda7adede326b33d3306c349..65b7a4dc767a3fd5c4d0c00f4a4aaa8e04d13f13 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -378,7 +378,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -381,7 +381,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean loadChunk(int x, int z, boolean generate) {
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
diff --git a/patches/server/0257-Asynchronous-chunk-IO-and-loading.patch b/patches/server/0257-Asynchronous-chunk-IO-and-loading.patch
index e2304c2ede..736fc64b7e 100644
--- a/patches/server/0257-Asynchronous-chunk-IO-and-loading.patch
+++ b/patches/server/0257-Asynchronous-chunk-IO-and-loading.patch
@@ -2306,22 +2306,22 @@ index a5e438a834826161c52ca9db57d234d9ff80a591..b8bc1b9b8e8a33df90a963f9f9769292
@Override
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
-index e98492adfb83c24e1baa6cab24cca55f3ec151bf..afc7606e0df5dc87767444b42bb4e4b1b2f96b2d 100644
+index 8f5784ed4df46f3c7d4c6b4ff76ad839d436be1f..6a006f22d33491be4413fb64649ba9f6f51acac8 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
-@@ -227,6 +227,7 @@ public class Main {
+@@ -250,6 +250,7 @@ public class Main {
- convertable_conversionsession.saveDataTag(iregistrycustom_dimension, (SaveData) object);
+ convertable_conversionsession.saveDataTag(iregistrycustom_dimension, savedata);
*/
+ Class.forName(net.minecraft.world.entity.npc.VillagerTrades.class.getName());// Paper - load this sync so it won't fail later async
final DedicatedServer dedicatedserver = (DedicatedServer) MinecraftServer.spin((thread) -> {
- DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataFixers.getDataFixer(), minecraftsessionservice, gameprofilerepository, usercache, LoggerChunkProgressListener::new);
+ DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, config.get(), ops.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, 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 37ccbfc3b5ff47fac8cd878f9de5bccec84994e5..d8023ef3237fd415a0dd04e01a78c84298a330d1 100644
+index 86e789515922345ed3ce623b24f81a5a379a020c..ca48908148b6d9f4ae03fd55bcaf37e5fdb01cab 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -985,7 +985,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop {
return true;
});
@@ -2365,7 +2365,7 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
} else {
this.visibleChunkMap.values().forEach(this::saveChunkIfNeeded);
}
-@@ -512,17 +514,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -548,11 +550,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
protected void tick(BooleanSupplier shouldKeepTicking) {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
@@ -2381,6 +2381,8 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
}
gameprofilerfiller.pop();
+@@ -562,7 +568,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+ return this.lightEngine.hasLightWork() || !this.pendingUnloads.isEmpty() || !this.updatingChunkMap.isEmpty() || this.poiManager.hasWork() || !this.toDrop.isEmpty() || !this.unloadQueue.isEmpty() || this.queueSorter.hasWork() || this.distanceManager.hasTickets();
}
- private static final double UNLOAD_QUEUE_RESIZE_FACTOR = 0.96; // Spigot
@@ -2388,7 +2390,7 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
private void processUnloads(BooleanSupplier shouldKeepTicking) {
LongIterator longiterator = this.toDrop.iterator();
-@@ -539,12 +545,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -579,12 +585,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (playerchunk != null) {
this.pendingUnloads.put(j, playerchunk);
this.modified = true;
@@ -2403,7 +2405,7 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
}
}
activityAccountant.endActivity(); // Spigot
-@@ -588,7 +595,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -628,7 +635,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
((LevelChunk) ichunkaccess).setLoaded(false);
}
@@ -2414,14 +2416,14 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
+ } catch (ThreadDeath ex) {
+ throw ex; // bye
+ } catch (Throwable ex) {
-+ LOGGER.fatal("Failed to prepare async save, attempting synchronous save", ex);
++ LOGGER.error("Failed to prepare async save, attempting synchronous save", ex);
+ this.save(ichunkaccess);
+ }
+ // Paper end - async chunk saving
if (this.entitiesInLevel.remove(pos) && ichunkaccess instanceof LevelChunk) {
LevelChunk chunk = (LevelChunk) ichunkaccess;
-@@ -653,20 +669,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -694,20 +710,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
private CompletableFuture> scheduleChunkLoad(ChunkPos pos) {
@@ -2454,7 +2456,7 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
this.markPosition(pos, protochunk.getStatus().getChunkType());
return Either.left(protochunk);
}
-@@ -688,7 +705,32 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -729,7 +746,32 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.markPositionReplaceable(pos);
return Either.left(new ProtoChunk(pos, UpgradeData.EMPTY, this.level, this.level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), (BlendingData) null));
@@ -2488,7 +2490,7 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
}
private void markPositionReplaceable(ChunkPos pos) {
-@@ -890,7 +932,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -944,7 +986,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -2537,7 +2539,7 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
this.poiManager.flush(chunk.getPos());
if (!chunk.isUnsaved()) {
return false;
-@@ -902,7 +985,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -956,7 +1039,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkStatus chunkstatus = chunk.getStatus();
if (chunkstatus.getChunkType() != ChunkStatus.ChunkType.LEVELCHUNK) {
@@ -2546,7 +2548,7 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
return false;
}
-@@ -912,9 +995,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -966,9 +1049,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
this.level.getProfiler().incrementCounter("chunkSave");
@@ -2564,7 +2566,7 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
this.markPosition(chunkcoordintpair, chunkstatus.getChunkType());
return true;
} catch (Exception exception) {
-@@ -923,6 +1012,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -977,6 +1066,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return false;
}
}
@@ -2572,7 +2574,7 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
}
private boolean isExistingChunkFull(ChunkPos pos) {
-@@ -1056,6 +1146,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
+@@ -1110,6 +1200,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
}
@@ -2609,10 +2611,10 @@ index 8593f68b0d2c1043009d02ada5396333c8da4d50..244f6a2934e807fa4f67c617dcd08a9a
public CompoundTag readChunk(ChunkPos pos) throws IOException {
CompoundTag nbttagcompound = this.read(pos);
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index dc618a0dde6c15cb2ee812ed21c10b343f75f280..343d54addd67998175db152d38702adda37b7d21 100644
+index efb735f2cf0d232db83ade7332250e455c276bea..b6737c0b74e821c948919ca4184dfe0281a19894 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-@@ -502,10 +502,111 @@ public class ServerChunkCache extends ChunkSource {
+@@ -498,10 +498,111 @@ public class ServerChunkCache extends ChunkSource {
return ret;
}
// Paper end
@@ -2724,7 +2726,7 @@ index dc618a0dde6c15cb2ee812ed21c10b343f75f280..343d54addd67998175db152d38702add
if (Thread.currentThread() != this.mainThread) {
return (ChunkAccess) CompletableFuture.supplyAsync(() -> {
return this.getChunk(x, z, leastStatus, create);
-@@ -528,13 +629,18 @@ public class ServerChunkCache extends ChunkSource {
+@@ -524,13 +625,18 @@ public class ServerChunkCache extends ChunkSource {
}
gameprofilerfiller.incrementCounter("getChunkCacheMiss");
@@ -2744,7 +2746,7 @@ index dc618a0dde6c15cb2ee812ed21c10b343f75f280..343d54addd67998175db152d38702add
this.level.timings.syncChunkLoad.stopTiming(); // Paper
} // Paper
ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
-@@ -621,6 +727,11 @@ public class ServerChunkCache extends ChunkSource {
+@@ -617,6 +723,11 @@ public class ServerChunkCache extends ChunkSource {
}
private CompletableFuture> getChunkFutureMainThread(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) {
@@ -2756,7 +2758,7 @@ index dc618a0dde6c15cb2ee812ed21c10b343f75f280..343d54addd67998175db152d38702add
ChunkPos chunkcoordintpair = new ChunkPos(chunkX, chunkZ);
long k = chunkcoordintpair.toLong();
int l = 33 + ChunkStatus.getDistance(leastStatus);
-@@ -1035,11 +1146,12 @@ public class ServerChunkCache extends ChunkSource {
+@@ -1036,11 +1147,12 @@ public class ServerChunkCache extends ChunkSource {
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
public boolean pollTask() {
try {
@@ -2771,10 +2773,10 @@ index dc618a0dde6c15cb2ee812ed21c10b343f75f280..343d54addd67998175db152d38702add
} 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 2e791dc863e6f41b1d9d4f99e5054caa93f6ca52..fb0d99ca76896a710a16d70aaf7ee714a428430d 100644
+index 7e2e7ce7ba9b23c813e1a4197ac06d0fe703c22b..83fac40b413e8f1ae4bda1e1c87b07c51af832ef 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -309,6 +309,78 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -310,6 +310,78 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
}
@@ -2853,7 +2855,7 @@ index 2e791dc863e6f41b1d9d4f99e5054caa93f6ca52..fb0d99ca76896a710a16d70aaf7ee714
// Paper end
// Add env and gen to constructor, WorldData -> WorldDataServer
-@@ -376,6 +448,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
+@@ -379,6 +451,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.sleepStatus = new SleepStatus();
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
@@ -2875,10 +2877,10 @@ 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 c0f558d3c6f3b4b01e56d453ab136cf2357f2463..607be2544cc163065dcbb7fedd5709cca2453ea2 100644
+index 62fda1dd8d560a8e16118e9d1b044ef59c0e5b02..d0adb066fcea5636c88be838fb5eff79306c5f4a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -709,6 +709,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -716,6 +716,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
server.scheduleOnMain(() -> this.disconnect(new TranslatableComponent("disconnect.spam", new Object[0]))); // Paper
return;
}
@@ -2965,10 +2967,10 @@ index 2b60fc107c309958ec3f20539b243d32765f3518..4a972b26242cf4c9d7e8f655cb1264cd
HAS_SPACE(PoiRecord::hasSpace),
IS_OCCUPIED(PoiRecord::isOccupied),
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
-index 1729af83b979e35a585c8d049b14dc23ddf23803..89de1589833dcce8028fd402aea8a3e57dc29e86 100644
+index 4e5cfc508e356691a9a249013553f97e77c213b0..37a60420b993525852492fd6665fb75afee9796f 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
-@@ -75,7 +75,31 @@ public class ChunkSerializer {
+@@ -77,7 +77,31 @@ public class ChunkSerializer {
public ChunkSerializer() {}
@@ -3000,7 +3002,7 @@ index 1729af83b979e35a585c8d049b14dc23ddf23803..89de1589833dcce8028fd402aea8a3e5
ChunkPos chunkcoordintpair1 = new ChunkPos(nbt.getInt("xPos"), nbt.getInt("zPos"));
if (!Objects.equals(chunkPos, chunkcoordintpair1)) {
-@@ -92,7 +116,9 @@ public class ChunkSerializer {
+@@ -94,7 +118,9 @@ public class ChunkSerializer {
LevelLightEngine lightengine = chunkproviderserver.getLightEngine();
if (flag) {
@@ -3010,7 +3012,7 @@ index 1729af83b979e35a585c8d049b14dc23ddf23803..89de1589833dcce8028fd402aea8a3e5
}
Registry iregistry = world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY);
-@@ -136,16 +162,28 @@ public class ChunkSerializer {
+@@ -138,16 +164,28 @@ public class ChunkSerializer {
LevelChunkSection chunksection = new LevelChunkSection(b0, datapaletteblock, datapaletteblock1);
achunksection[k] = chunksection;
@@ -3041,7 +3043,7 @@ index 1729af83b979e35a585c8d049b14dc23ddf23803..89de1589833dcce8028fd402aea8a3e5
}
}
}
-@@ -265,7 +303,7 @@ public class ChunkSerializer {
+@@ -267,7 +305,7 @@ public class ChunkSerializer {
}
if (chunkstatus_type == ChunkStatus.ChunkType.LEVELCHUNK) {
@@ -3050,7 +3052,7 @@ index 1729af83b979e35a585c8d049b14dc23ddf23803..89de1589833dcce8028fd402aea8a3e5
} else {
ProtoChunk protochunk1 = (ProtoChunk) object;
-@@ -304,9 +342,67 @@ public class ChunkSerializer {
+@@ -306,9 +344,67 @@ public class ChunkSerializer {
protochunk1.setCarvingMask(worldgenstage_features, new CarvingMask(nbttagcompound4.getLongArray(s1), ((ChunkAccess) object).getMinBuildHeight()));
}
@@ -3119,7 +3121,7 @@ index 1729af83b979e35a585c8d049b14dc23ddf23803..89de1589833dcce8028fd402aea8a3e5
private static void logErrors(ChunkPos chunkPos, int y, String message) {
ChunkSerializer.LOGGER.error("Recoverable errors when loading section [" + chunkPos.x + ", " + y + ", " + chunkPos.z + "]: " + message);
-@@ -317,6 +413,11 @@ public class ChunkSerializer {
+@@ -319,6 +415,11 @@ public class ChunkSerializer {
}
public static CompoundTag write(ServerLevel world, ChunkAccess chunk) {
@@ -3131,7 +3133,7 @@ index 1729af83b979e35a585c8d049b14dc23ddf23803..89de1589833dcce8028fd402aea8a3e5
ChunkPos chunkcoordintpair = chunk.getPos();
CompoundTag nbttagcompound = new CompoundTag();
-@@ -324,7 +425,7 @@ public class ChunkSerializer {
+@@ -326,7 +427,7 @@ public class ChunkSerializer {
nbttagcompound.putInt("xPos", chunkcoordintpair.x);
nbttagcompound.putInt("yPos", chunk.getMinSection());
nbttagcompound.putInt("zPos", chunkcoordintpair.z);
@@ -3140,7 +3142,7 @@ index 1729af83b979e35a585c8d049b14dc23ddf23803..89de1589833dcce8028fd402aea8a3e5
nbttagcompound.putLong("InhabitedTime", chunk.getInhabitedTime());
nbttagcompound.putString("Status", chunk.getStatus().getName());
BlendingData blendingdata = chunk.getBlendingData();
-@@ -367,8 +468,17 @@ public class ChunkSerializer {
+@@ -369,8 +470,17 @@ public class ChunkSerializer {
for (int i = lightenginethreaded.getMinLightSection(); i < lightenginethreaded.getMaxLightSection(); ++i) {
int j = chunk.getSectionIndexFromSectionY(i);
boolean flag1 = j >= 0 && j < achunksection.length;
@@ -3160,7 +3162,7 @@ index 1729af83b979e35a585c8d049b14dc23ddf23803..89de1589833dcce8028fd402aea8a3e5
if (flag1 || nibblearray != null || nibblearray1 != null) {
CompoundTag nbttagcompound1 = new CompoundTag();
-@@ -406,8 +516,17 @@ public class ChunkSerializer {
+@@ -408,8 +518,17 @@ public class ChunkSerializer {
nbttagcompound.putBoolean("isLightOn", true);
}
@@ -3180,7 +3182,7 @@ index 1729af83b979e35a585c8d049b14dc23ddf23803..89de1589833dcce8028fd402aea8a3e5
CompoundTag nbttagcompound2;
-@@ -444,7 +563,14 @@ public class ChunkSerializer {
+@@ -446,7 +565,14 @@ public class ChunkSerializer {
nbttagcompound.put("CarvingMasks", nbttagcompound2);
}
@@ -3313,7 +3315,7 @@ index 2d1c8d5cf8ea6739d5e9df91cc16cde72917feff..ba677f282f2c8a05d1bad88226655549
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
-index 87ea11505849cc9d4455d42eaae9af310ad63ae4..04e45b4de2f4e26853a4fed6271cf79ef8607154 100644
+index 2d74ab966a1291895b6248a67a31fe4802b3773f..038e2177182c94baa4af24f9111cf155ec342dfe 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -44,6 +44,7 @@ public class RegionFile implements AutoCloseable {
@@ -3465,16 +3467,16 @@ index deb852aa0fb2ad55a94d3c7ee542a0cc8013be42..40830a2b231df9bbf676d8325e76c825
while (objectiterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
-index 415ec2cb81e956526e7f4965b899c9aa04f62f2e..ff6cadec530dedf9efc5d6226e48a096a1073ad6 100644
+index 4160a35ecfa1c28b88d6ebbfd14a0be1933e3b6d..3e08ff74979c78b27537403bbcaf13459e9e06b1 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
-@@ -30,10 +30,10 @@ import net.minecraft.world.level.LevelHeightAccessor;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
+@@ -30,10 +30,10 @@ import net.minecraft.world.level.ChunkPos;
+ import net.minecraft.world.level.LevelHeightAccessor;
+ import org.slf4j.Logger;
-public class SectionStorage implements AutoCloseable {
+public class SectionStorage extends RegionFileStorage implements AutoCloseable { // Paper - nuke IOWorker
- private static final Logger LOGGER = LogManager.getLogger();
+ private static final Logger LOGGER = LogUtils.getLogger();
private static final String SECTIONS_TAG = "Sections";
- private final IOWorker worker;
+ // Paper - remove mojang I/O thread
@@ -3496,7 +3498,7 @@ index 415ec2cb81e956526e7f4965b899c9aa04f62f2e..ff6cadec530dedf9efc5d6226e48a096
}
protected void tick(BooleanSupplier shouldKeepTicking) {
-@@ -106,13 +107,18 @@ public class SectionStorage implements AutoCloseable {
+@@ -110,13 +111,18 @@ public class SectionStorage implements AutoCloseable {
}
private void readColumn(ChunkPos chunkPos) {
@@ -3517,7 +3519,7 @@ index 415ec2cb81e956526e7f4965b899c9aa04f62f2e..ff6cadec530dedf9efc5d6226e48a096
} catch (IOException var3) {
LOGGER.error("Error reading chunk {} data from disk", pos, var3);
return null;
-@@ -156,13 +162,26 @@ public class SectionStorage implements AutoCloseable {
+@@ -160,13 +166,26 @@ public class SectionStorage implements AutoCloseable {
Dynamic dynamic = this.writeColumn(chunkPos, NbtOps.INSTANCE);
Tag tag = dynamic.getValue();
if (tag instanceof CompoundTag) {
@@ -3545,7 +3547,7 @@ index 415ec2cb81e956526e7f4965b899c9aa04f62f2e..ff6cadec530dedf9efc5d6226e48a096
private Dynamic writeColumn(ChunkPos chunkPos, DynamicOps dynamicOps) {
Map map = Maps.newHashMap();
-@@ -219,6 +238,23 @@ public class SectionStorage implements AutoCloseable {
+@@ -223,6 +242,23 @@ public class SectionStorage implements AutoCloseable {
@Override
public void close() throws IOException {
@@ -3571,10 +3573,10 @@ index 415ec2cb81e956526e7f4965b899c9aa04f62f2e..ff6cadec530dedf9efc5d6226e48a096
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index 20d0e19851a4e8b62a8f781eb7f5795b2d156eb8..e76a98b8144ab0de92263fb00bf521b2683a6b7d 100644
+index 65b7a4dc767a3fd5c4d0c00f4a4aaa8e04d13f13..5dea397fc7f11db39385c1711364a31144979f5c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -1872,6 +1872,34 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -1875,6 +1875,34 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public DragonBattle getEnderDragonBattle() {
return (this.getHandle().dragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().dragonFight());
}
diff --git a/patches/server/0258-Add-ray-tracing-methods-to-LivingEntity.patch b/patches/server/0258-Add-ray-tracing-methods-to-LivingEntity.patch
index ce3f0f5074..a639c0f642 100644
--- a/patches/server/0258-Add-ray-tracing-methods-to-LivingEntity.patch
+++ b/patches/server/0258-Add-ray-tracing-methods-to-LivingEntity.patch
@@ -28,10 +28,10 @@ index 0cf818fceddd76e7704fdc6625456787856b2815..ccdee183f02ab55723e16f41efce55dc
switch (enumDirection) {
case DOWN:
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 9b6fcaaafa84853804f6183d02bd90b4f988d418..c5d6e5c5c35fa3ab444f271c929ee88c30832dc9 100644
+index 7436cf1b9cce14494bd514cb7f4ed03536170c87..f62dd338c5f0618b6235d398bd56cb6737577a0b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3689,6 +3689,23 @@ public abstract class LivingEntity extends Entity {
+@@ -3679,6 +3679,23 @@ public abstract class LivingEntity extends Entity {
}
// Paper start
diff --git a/patches/server/0260-Improve-death-events.patch b/patches/server/0260-Improve-death-events.patch
index 3cb07d39b0..14d818a759 100644
--- a/patches/server/0260-Improve-death-events.patch
+++ b/patches/server/0260-Improve-death-events.patch
@@ -19,10 +19,10 @@ maybe more (please check patch overrides for drops for more):
- players, armor stands, foxes, chested donkeys/llamas
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index fd1937f49312204d38510996a5be43b731f38bde..a2e2b6ea166bf64fe5b49672a6c6f86af3776638 100644
+index 005856931c27d4e2dbffec65ae59191782508e06..36517924b6e1d32bc969b9bc7314a88d531accb2 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -222,6 +222,10 @@ public class ServerPlayer extends Player {
+@@ -220,6 +220,10 @@ public class ServerPlayer extends Player {
public int latency;
public boolean wonGame;
private int containerUpdateDelay; // Paper
@@ -33,7 +33,7 @@ index fd1937f49312204d38510996a5be43b731f38bde..a2e2b6ea166bf64fe5b49672a6c6f86a
// CraftBukkit start
public String displayName;
-@@ -786,6 +790,15 @@ public class ServerPlayer extends Player {
+@@ -784,6 +788,15 @@ public class ServerPlayer extends Player {
String deathmessage = defaultMessage.getString();
this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, PaperAdventure.asAdventure(defaultMessage), defaultMessage.getString(), keepInventory); // Paper - Adventure
@@ -49,7 +49,7 @@ index fd1937f49312204d38510996a5be43b731f38bde..a2e2b6ea166bf64fe5b49672a6c6f86a
// SPIGOT-943 - only call if they have an inventory open
if (this.containerMenu != this.inventoryMenu) {
-@@ -933,8 +946,17 @@ public class ServerPlayer extends Player {
+@@ -931,8 +944,17 @@ public class ServerPlayer extends Player {
}
}
}
@@ -70,10 +70,10 @@ index fd1937f49312204d38510996a5be43b731f38bde..a2e2b6ea166bf64fe5b49672a6c6f86a
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index c5d6e5c5c35fa3ab444f271c929ee88c30832dc9..cd3f18a7484817c5bc7c53585f6deb8889744c0b 100644
+index f62dd338c5f0618b6235d398bd56cb6737577a0b..bd4230a4e5fc9c1264b390b59ddefbd0aa8e73c8 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -257,6 +257,7 @@ public abstract class LivingEntity extends Entity {
+@@ -260,6 +260,7 @@ public abstract class LivingEntity extends Entity {
public Set collidableExemptions = new HashSet<>();
public boolean bukkitPickUpLoot;
public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper
@@ -81,7 +81,7 @@ index c5d6e5c5c35fa3ab444f271c929ee88c30832dc9..cd3f18a7484817c5bc7c53585f6deb88
@Override
public float getBukkitYaw() {
-@@ -1439,13 +1440,12 @@ public abstract class LivingEntity extends Entity {
+@@ -1442,13 +1443,12 @@ public abstract class LivingEntity extends Entity {
if (knockbackCancelled) this.level.broadcastEntityEvent(this, (byte) 2); // Paper - Disable explosion knockback
if (this.isDeadOrDying()) {
if (!this.checkTotemDeathProtection(source)) {
@@ -99,7 +99,7 @@ index c5d6e5c5c35fa3ab444f271c929ee88c30832dc9..cd3f18a7484817c5bc7c53585f6deb88
}
} else if (flag1) {
this.playHurtSound(source);
-@@ -1594,7 +1594,7 @@ public abstract class LivingEntity extends Entity {
+@@ -1597,7 +1597,7 @@ public abstract class LivingEntity extends Entity {
if (!this.isRemoved() && !this.dead) {
Entity entity = source.getEntity();
LivingEntity entityliving = this.getKillCredit();
@@ -108,7 +108,7 @@ index c5d6e5c5c35fa3ab444f271c929ee88c30832dc9..cd3f18a7484817c5bc7c53585f6deb88
if (this.deathScore >= 0 && entityliving != null) {
entityliving.awardKillScore(this, this.deathScore, source);
}
-@@ -1606,20 +1606,54 @@ public abstract class LivingEntity extends Entity {
+@@ -1609,20 +1609,54 @@ public abstract class LivingEntity extends Entity {
if (!this.level.isClientSide && this.hasCustomName()) {
if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
}
@@ -166,7 +166,7 @@ index c5d6e5c5c35fa3ab444f271c929ee88c30832dc9..cd3f18a7484817c5bc7c53585f6deb88
}
}
-@@ -1627,7 +1661,7 @@ public abstract class LivingEntity extends Entity {
+@@ -1630,7 +1664,7 @@ public abstract class LivingEntity extends Entity {
if (!this.level.isClientSide) {
boolean flag = false;
@@ -175,7 +175,7 @@ index c5d6e5c5c35fa3ab444f271c929ee88c30832dc9..cd3f18a7484817c5bc7c53585f6deb88
if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
BlockPos blockposition = this.blockPosition();
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
-@@ -1656,7 +1690,11 @@ public abstract class LivingEntity extends Entity {
+@@ -1659,7 +1693,11 @@ public abstract class LivingEntity extends Entity {
}
}
@@ -188,7 +188,7 @@ index c5d6e5c5c35fa3ab444f271c929ee88c30832dc9..cd3f18a7484817c5bc7c53585f6deb88
Entity entity = source.getEntity();
int i;
-@@ -1671,18 +1709,27 @@ public abstract class LivingEntity extends Entity {
+@@ -1674,18 +1712,27 @@ public abstract class LivingEntity extends Entity {
this.dropEquipment(); // CraftBukkit - from below
if (this.shouldDropLoot() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
this.dropFromLootTable(source, flag);
@@ -218,7 +218,7 @@ index c5d6e5c5c35fa3ab444f271c929ee88c30832dc9..cd3f18a7484817c5bc7c53585f6deb88
// CraftBukkit start
public int getExpReward() {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
-index b13e6bfa449599aafeb97d99c9dc1e0c3885c4be..ecd484a35f9401ffe8f0893749d8d05399166ac2 100644
+index 0dd63184ffc9a4f25261344600336679c902e2ec..bcf7c431f90a917d56933370e9f479f25f009dcb 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1002,7 +1002,13 @@ public abstract class Mob extends LivingEntity {
@@ -236,10 +236,10 @@ index b13e6bfa449599aafeb97d99c9dc1e0c3885c4be..ecd484a35f9401ffe8f0893749d8d053
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
-index 2caf3aa6ca876d59deb98ee917e8228df140b414..63f0ed4c80b7afa091c4a835eefd6d709428f984 100644
+index 6ffd1aec3563e92f5d5975d3fb4d3d89feec1416..e36c01533dc85541c91f7a55690fae46f770b516 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
-@@ -696,15 +696,25 @@ public class Fox extends Animal {
+@@ -698,15 +698,25 @@ public class Fox extends Animal {
}
@Override
diff --git a/patches/server/0261-Allow-chests-to-be-placed-with-NBT-data.patch b/patches/server/0261-Allow-chests-to-be-placed-with-NBT-data.patch
index 1bcd55b62f..d8349a70c7 100644
--- a/patches/server/0261-Allow-chests-to-be-placed-with-NBT-data.patch
+++ b/patches/server/0261-Allow-chests-to-be-placed-with-NBT-data.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Allow chests to be placed with NBT data
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index ce082016d841e3e7ba46b722b85edae9acc3f290..589a9bd9d3bf3cbf88a6efad5f58970a0a4a56c0 100644
+index 65189af7acc3e60fc7f2bfe82128ada981bf1271..f1289d7251783c5203828c2b76785dd22c7e2992 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
-@@ -338,6 +338,7 @@ public final class ItemStack {
+@@ -348,6 +348,7 @@ public final class ItemStack {
enuminteractionresult = InteractionResult.FAIL; // cancel placement
// PAIL: Remove this when MC-99075 fixed
placeEvent.getPlayer().updateInventory();
diff --git a/patches/server/0264-Prevent-chunk-loading-from-Fluid-Flowing.patch b/patches/server/0264-Prevent-chunk-loading-from-Fluid-Flowing.patch
index 6a32dc0682..8e59eff59d 100644
--- a/patches/server/0264-Prevent-chunk-loading-from-Fluid-Flowing.patch
+++ b/patches/server/0264-Prevent-chunk-loading-from-Fluid-Flowing.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Prevent chunk loading from Fluid Flowing
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
-index 4be8fbe06ee97d5fe8f99d5d8137ac7302ffec91..49b8e9a764a868975ec832ea354bb0df99f9721a 100644
+index 89296667d2ad76a706a3f5b817f3ad8c207cac2d..02be7c3d104fe3b3a2772201f5ebdfb6d16e9b49 100644
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
-@@ -175,7 +175,8 @@ public abstract class FlowingFluid extends Fluid {
+@@ -174,7 +174,8 @@ public abstract class FlowingFluid extends Fluid {
Direction enumdirection = (Direction) entry.getKey();
FluidState fluid1 = (FluidState) entry.getValue();
BlockPos blockposition1 = pos.relative(enumdirection);
@@ -18,7 +18,7 @@ index 4be8fbe06ee97d5fe8f99d5d8137ac7302ffec91..49b8e9a764a868975ec832ea354bb0df
if (this.canSpreadTo(world, pos, blockState, enumdirection, blockposition1, iblockdata1, world.getFluidState(blockposition1), fluid1.getType())) {
// CraftBukkit start
-@@ -202,7 +203,9 @@ public abstract class FlowingFluid extends Fluid {
+@@ -201,7 +202,9 @@ public abstract class FlowingFluid extends Fluid {
while (iterator.hasNext()) {
Direction enumdirection = (Direction) iterator.next();
BlockPos blockposition1 = pos.relative(enumdirection);
@@ -29,7 +29,7 @@ index 4be8fbe06ee97d5fe8f99d5d8137ac7302ffec91..49b8e9a764a868975ec832ea354bb0df
FluidState fluid = iblockdata1.getFluidState();
if (fluid.getType().isSame(this) && this.canPassThroughWall(enumdirection, world, pos, state, blockposition1, iblockdata1)) {
-@@ -319,11 +322,18 @@ public abstract class FlowingFluid extends Fluid {
+@@ -318,11 +321,18 @@ public abstract class FlowingFluid extends Fluid {
if (enumdirection1 != enumdirection) {
BlockPos blockposition2 = blockposition.relative(enumdirection1);
short short0 = FlowingFluid.getCacheKey(blockposition1, blockposition2);
@@ -52,7 +52,7 @@ index 4be8fbe06ee97d5fe8f99d5d8137ac7302ffec91..49b8e9a764a868975ec832ea354bb0df
BlockState iblockdata1 = (BlockState) pair.getFirst();
FluidState fluid = (FluidState) pair.getSecond();
-@@ -395,11 +405,16 @@ public abstract class FlowingFluid extends Fluid {
+@@ -394,11 +404,16 @@ public abstract class FlowingFluid extends Fluid {
Direction enumdirection = (Direction) iterator.next();
BlockPos blockposition1 = pos.relative(enumdirection);
short short0 = FlowingFluid.getCacheKey(pos, blockposition1);
diff --git a/patches/server/0267-Implement-furnace-cook-speed-multiplier-API.patch b/patches/server/0267-Implement-furnace-cook-speed-multiplier-API.patch
index f27ec07403..d75b53a879 100644
--- a/patches/server/0267-Implement-furnace-cook-speed-multiplier-API.patch
+++ b/patches/server/0267-Implement-furnace-cook-speed-multiplier-API.patch
@@ -11,10 +11,10 @@ to the nearest Integer when updating its current cook time.
Modified by: Eric Su
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
-index d39546b3f8d0c97fefdcc90f638eee60a5db409e..8c69b817eeb5d5555e8eb2093ff2c5377c884946 100644
+index c3c53a34f645a834256c31951e465ae33aa1a9ff..635d47d4bea679e96736ef891c40f57488cbc6a1 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
-@@ -73,6 +73,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
+@@ -75,6 +75,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
protected NonNullList items;
public int litTime;
int litDuration;
@@ -22,7 +22,7 @@ index d39546b3f8d0c97fefdcc90f638eee60a5db409e..8c69b817eeb5d5555e8eb2093ff2c537
public int cookingProgress;
public int cookingTotalTime;
protected final ContainerData dataAccess;
-@@ -279,6 +280,11 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
+@@ -281,6 +282,11 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
this.recipesUsed.put(new ResourceLocation(s), nbttagcompound1.getInt(s));
}
@@ -34,7 +34,7 @@ index d39546b3f8d0c97fefdcc90f638eee60a5db409e..8c69b817eeb5d5555e8eb2093ff2c537
}
@Override
-@@ -287,6 +293,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
+@@ -289,6 +295,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
nbt.putShort("BurnTime", (short) this.litTime);
nbt.putShort("CookTime", (short) this.cookingProgress);
nbt.putShort("CookTimeTotal", (short) this.cookingTotalTime);
@@ -42,7 +42,7 @@ index d39546b3f8d0c97fefdcc90f638eee60a5db409e..8c69b817eeb5d5555e8eb2093ff2c537
ContainerHelper.saveAllItems(nbt, this.items);
CompoundTag nbttagcompound1 = new CompoundTag();
-@@ -349,7 +356,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
+@@ -351,7 +358,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
CraftItemStack source = CraftItemStack.asCraftMirror(blockEntity.items.get(0));
CookingRecipe> recipe = (CookingRecipe>) irecipe.toBukkitRecipe();
@@ -51,7 +51,7 @@ index d39546b3f8d0c97fefdcc90f638eee60a5db409e..8c69b817eeb5d5555e8eb2093ff2c537
world.getCraftServer().getPluginManager().callEvent(event);
blockEntity.cookingTotalTime = event.getTotalCookTime();
-@@ -357,9 +364,9 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
+@@ -359,9 +366,9 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
// CraftBukkit end
++blockEntity.cookingProgress;
@@ -63,7 +63,7 @@ index d39546b3f8d0c97fefdcc90f638eee60a5db409e..8c69b817eeb5d5555e8eb2093ff2c537
if (AbstractFurnaceBlockEntity.burn(blockEntity.level, blockEntity.worldPosition, irecipe, blockEntity.items, i)) { // CraftBukkit
blockEntity.setRecipeUsed(irecipe);
}
-@@ -459,9 +466,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
+@@ -461,9 +468,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
}
}
@@ -79,7 +79,7 @@ index d39546b3f8d0c97fefdcc90f638eee60a5db409e..8c69b817eeb5d5555e8eb2093ff2c537
public static boolean isFuel(ItemStack stack) {
return AbstractFurnaceBlockEntity.getFuel().containsKey(stack.getItem());
-@@ -530,7 +541,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
+@@ -532,7 +543,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
}
if (slot == 0 && !flag) {
diff --git a/patches/server/0268-Catch-JsonParseException-in-Entity-and-TE-names.patch b/patches/server/0268-Catch-JsonParseException-in-Entity-and-TE-names.patch
index 12e1a6bab2..740e527815 100644
--- a/patches/server/0268-Catch-JsonParseException-in-Entity-and-TE-names.patch
+++ b/patches/server/0268-Catch-JsonParseException-in-Entity-and-TE-names.patch
@@ -61,7 +61,7 @@ index 04a3627667498b841fbff547d1874d99cc708af4..5b125aa77e769983a0aee7c5f6eb6a8a
if (nbt.contains("TrackOutput", 1)) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
-index 8854901b439cdeddc528e02fa5f8539869556a3c..aec30b264e2e24ea101f8b3296a93293b4c9eef4 100644
+index 0de9d86d5e2f0a9043640e3154c11612408e24d8..d58f3beabbdb48cbb36bd4802d12cda41628731f 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
@@ -97,7 +97,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable {
@@ -87,10 +87,10 @@ index cfd1e2fbc029d928daa2d9f12df393c8cf30e850..72c4c367b3531b21f1f28601735a5250
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
-index 76a401bcfdacded2137142ed38d739ed65d9fae6..7c8809e679670ba0e0ea7a1e193913e45b34a97a 100644
+index dca94c75f4531eab3ab788e722363d2065bf4170..4b7da0df927f669845c7d4c9b4a0acfab8efe657 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
-@@ -360,7 +360,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
+@@ -359,7 +359,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
this.levels = nbt.getInt("Levels"); // SPIGOT-5053, use where available
// CraftBukkit end
if (nbt.contains("CustomName", 8)) {
@@ -100,7 +100,7 @@ index 76a401bcfdacded2137142ed38d739ed65d9fae6..7c8809e679670ba0e0ea7a1e193913e4
this.lockKey = LockCode.fromTag(nbt);
diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
-index b03621ebd0a94ab2dceb9006aee43fd5320094e3..424ad38b5522d9b76aa1bf726a9fe2c1e934598d 100644
+index d399d9ea7656d1c96f3b7547049d2e133ef5e847..1eccf9424bd8a4bcbeed4ebb1795fd113fe5af18 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
@@ -43,7 +43,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
diff --git a/patches/server/0269-Honor-EntityAgeable.ageLock.patch b/patches/server/0269-Honor-EntityAgeable.ageLock.patch
index 2a996fbe5b..8a44dcb055 100644
--- a/patches/server/0269-Honor-EntityAgeable.ageLock.patch
+++ b/patches/server/0269-Honor-EntityAgeable.ageLock.patch
@@ -17,10 +17,10 @@ index 123b125a3576903767983c93135086ca7a8ea813..d165117d62fe8a55d624966e8c4b626c
int k = j;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
-index 93f17997ac3f36d0a72e5d4e85c7e748d615801f..0dca7b0f40af9337bdda75ba40cb064f39723bf8 100644
+index afe4991fb69fa303279a4e46d730f482e8a58f01..e4e879cdfe7d257161bf8e98305c0f2e9b9539f9 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
-@@ -295,6 +295,7 @@ public class BeehiveBlockEntity extends BlockEntity {
+@@ -296,6 +296,7 @@ public class BeehiveBlockEntity extends BlockEntity {
}
private static void setBeeReleaseData(int ticks, Bee bee) {
@@ -28,7 +28,7 @@ index 93f17997ac3f36d0a72e5d4e85c7e748d615801f..0dca7b0f40af9337bdda75ba40cb064f
int j = bee.getAge();
if (j < 0) {
-@@ -302,6 +303,7 @@ public class BeehiveBlockEntity extends BlockEntity {
+@@ -303,6 +304,7 @@ public class BeehiveBlockEntity extends BlockEntity {
} else if (j > 0) {
bee.setAge(Math.max(0, j - ticks));
}
diff --git a/patches/server/0273-Add-LivingEntity-getTargetEntity.patch b/patches/server/0273-Add-LivingEntity-getTargetEntity.patch
index d1c80027f7..886dba3bbe 100644
--- a/patches/server/0273-Add-LivingEntity-getTargetEntity.patch
+++ b/patches/server/0273-Add-LivingEntity-getTargetEntity.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index cd3f18a7484817c5bc7c53585f6deb8889744c0b..dc723e1a4d73e06c4b9f275c7b912de1a1cef070 100644
+index bd4230a4e5fc9c1264b390b59ddefbd0aa8e73c8..e5c5bdc83804f335d7163cfefba79b57df97310b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -113,6 +113,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
+@@ -115,6 +115,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.AABB;
@@ -16,7 +16,7 @@ index cd3f18a7484817c5bc7c53585f6deb8889744c0b..dc723e1a4d73e06c4b9f275c7b912de1
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.PlayerTeam;
-@@ -3753,6 +3754,38 @@ public abstract class LivingEntity extends Entity {
+@@ -3743,6 +3744,38 @@ public abstract class LivingEntity extends Entity {
return level.clip(raytrace);
}
diff --git a/patches/server/0274-Add-sun-related-API.patch b/patches/server/0274-Add-sun-related-API.patch
index af139849c9..b20576ceab 100644
--- a/patches/server/0274-Add-sun-related-API.patch
+++ b/patches/server/0274-Add-sun-related-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add sun related API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-index e76a98b8144ab0de92263fb00bf521b2683a6b7d..fd034c619b0615f480d1686d76e0f155cd9f9949 100644
+index 5dea397fc7f11db39385c1711364a31144979f5c..6b54afecfe45fd078a709fc87ab101a4aee4f7f7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -673,6 +673,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+@@ -676,6 +676,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
}
}
diff --git a/patches/server/0275-Turtle-API.patch b/patches/server/0275-Turtle-API.patch
index 75d7b88e5d..619fa7ebfc 100644
--- a/patches/server/0275-Turtle-API.patch
+++ b/patches/server/0275-Turtle-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Turtle API
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
-index dabdce6332c267c3b82698010e284b34dcc0c083..8d8cce87acc5a93afb4b8925a5a5dbf71d371fcd 100644
+index e3983370c09e3e3445c4557fcca50dd25f29cba0..6efba52c2e5d7811ee329ed22c1c76f75d7ddbe1 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
@@ -14,7 +14,7 @@ public abstract class MoveToBlockGoal extends Goal {
@@ -18,10 +18,10 @@ index dabdce6332c267c3b82698010e284b34dcc0c083..8d8cce87acc5a93afb4b8925a5a5dbf7
private final int searchRange;
private final int verticalSearchRange;
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
-index 44679e3b44b03dc20b3763af84df655d81680c06..60e1111f3c2c43398f21c541248f38524f41f4fb 100644
+index ea1bb6924043dfd05452b793afd7651c867de5dc..1b0be28ebfd7ec2f978b5d87f6d26e4d5913fb06 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
-@@ -484,14 +484,17 @@ public class Turtle extends Animal {
+@@ -482,14 +482,17 @@ public class Turtle extends Animal {
if (!this.turtle.isInWater() && this.isReachedTarget()) {
if (this.turtle.layEggCounter < 1) {
@@ -42,12 +42,12 @@ index 44679e3b44b03dc20b3763af84df655d81680c06..60e1111f3c2c43398f21c541248f3852
}
// CraftBukkit end
this.turtle.setHasEgg(false);
-@@ -559,7 +562,7 @@ public class Turtle extends Animal {
+@@ -557,7 +560,7 @@ public class Turtle extends Animal {
@Override
public boolean canUse() {
-- return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(reducedTickDelay(700)) != 0 ? false : !this.turtle.getHomePos().closerThan((Position) this.turtle.position(), 64.0D)));
-+ return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(reducedTickDelay(700)) != 0 ? false : !this.turtle.getHomePos().closerThan((Position) this.turtle.position(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity()).callEvent(); // Paper
+- return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(reducedTickDelay(700)) != 0 ? false : !this.turtle.getHomePos().closerToCenterThan(this.turtle.position(), 64.0D)));
++ return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(reducedTickDelay(700)) != 0 ? false : !this.turtle.getHomePos().closerToCenterThan(this.turtle.position(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity()).callEvent(); // Paper
}
@Override
diff --git a/patches/server/0276-Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/0276-Call-player-spectator-target-events-and-improve-impl.patch
index e4a7c69c89..18797e4cc4 100644
--- a/patches/server/0276-Call-player-spectator-target-events-and-improve-impl.patch
+++ b/patches/server/0276-Call-player-spectator-target-events-and-improve-impl.patch
@@ -19,10 +19,10 @@ 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 a2e2b6ea166bf64fe5b49672a6c6f86af3776638..4a8afc06f58bb608055a0fabc587bf06a7110232 100644
+index 36517924b6e1d32bc969b9bc7314a88d531accb2..c2a4d209b4d736c0c0a8a0f1bf703dd822a84790 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1850,14 +1850,58 @@ public class ServerPlayer extends Player {
+@@ -1848,14 +1848,58 @@ public class ServerPlayer extends Player {
}
public void setCamera(@Nullable Entity entity) {
diff --git a/patches/server/0278-Add-Velocity-IP-Forwarding-Support.patch b/patches/server/0278-Add-Velocity-IP-Forwarding-Support.patch
index b0f090daae..513b5f8a79 100644
--- a/patches/server/0278-Add-Velocity-IP-Forwarding-Support.patch
+++ b/patches/server/0278-Add-Velocity-IP-Forwarding-Support.patch
@@ -128,10 +128,10 @@ index 0000000000000000000000000000000000000000..41d73aa91fb401612e087aa1b7278ba6
+ }
+}
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-index 67b300574655854249c1f7440f56a6e8f0fad351..bb767f5b626225e70a8af273384bb74dbd21430d 100644
+index 5ebc450432805d52457b9f8ff1e2b1981bdd78e6..4c06e62e967f28eb844d74237948834e61daeab0 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
-@@ -18,6 +18,7 @@ import javax.crypto.Cipher;
+@@ -17,6 +17,7 @@ import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import net.minecraft.DefaultUncaughtExceptionHandler;
import net.minecraft.network.Connection;
@@ -139,7 +139,7 @@ index 67b300574655854249c1f7440f56a6e8f0fad351..bb767f5b626225e70a8af273384bb74d
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.TranslatableComponent;
-@@ -44,6 +45,7 @@ import org.bukkit.craftbukkit.util.Waitable;
+@@ -40,6 +41,7 @@ import org.bukkit.craftbukkit.util.Waitable;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
import org.bukkit.event.player.PlayerPreLoginEvent;
// CraftBukkit end
@@ -147,7 +147,7 @@ index 67b300574655854249c1f7440f56a6e8f0fad351..bb767f5b626225e70a8af273384bb74d
public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener {
-@@ -62,6 +64,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -58,6 +60,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
@Nullable
private ServerPlayer delayedAcceptPlayer;
public String hostname = ""; // CraftBukkit - add field
@@ -155,7 +155,7 @@ index 67b300574655854249c1f7440f56a6e8f0fad351..bb767f5b626225e70a8af273384bb74d
public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) {
this.state = ServerLoginPacketListenerImpl.State.HELLO;
-@@ -234,6 +237,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -231,6 +234,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
this.state = ServerLoginPacketListenerImpl.State.KEY;
this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce));
} else {
@@ -170,7 +170,7 @@ index 67b300574655854249c1f7440f56a6e8f0fad351..bb767f5b626225e70a8af273384bb74d
// Spigot start
// Paper start - Cache authenticator threads
authenticatorPool.execute(new Runnable() {
-@@ -335,6 +346,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -338,6 +349,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
public class LoginHandler {
public void fireEvents() throws Exception {
@@ -183,7 +183,7 @@ index 67b300574655854249c1f7440f56a6e8f0fad351..bb767f5b626225e70a8af273384bb74d
String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName();
java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress();
java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId();
-@@ -382,6 +399,40 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
+@@ -385,6 +402,40 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
// Spigot end
public void handleCustomQueryPacket(ServerboundCustomQueryPacket packet) {
@@ -225,10 +225,10 @@ index 67b300574655854249c1f7440f56a6e8f0fad351..bb767f5b626225e70a8af273384bb74d
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 9fc876f3de20b0ad043a9dc6772d4bc6639c943d..8ef4679af2e7ad090f6cbdca9d69a5d88b3c6e93 100644
+index 53650ba59f05d8c7549a71d89c3734e02c6a7fea..532185882420c04c1a996a7d269af554ee106ed1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -763,7 +763,7 @@ public final class CraftServer implements Server {
+@@ -759,7 +759,7 @@ public final class CraftServer implements Server {
@Override
public long getConnectionThrottle() {
// Spigot Start - Automatically set connection throttle for bungee configurations
diff --git a/patches/server/0280-Check-Drowned-for-Villager-Aggression-Config.patch b/patches/server/0280-Check-Drowned-for-Villager-Aggression-Config.patch
index 157a9d1e6c..0e81942661 100644
--- a/patches/server/0280-Check-Drowned-for-Villager-Aggression-Config.patch
+++ b/patches/server/0280-Check-Drowned-for-Villager-Aggression-Config.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Check Drowned for Villager Aggression Config
diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
-index 0a458a88c21c8eece3b08cf7f5d7533efcd879f1..ccaa50d1ba9151bd94333b6b8fc0e77bc4324990 100644
+index b0778270bc9fa5df57974e6f37dc7bfb4b809e3e..030ddefe45563bdd0a7091ae60d365f9aa58b6fc 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
-@@ -79,7 +79,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
+@@ -77,7 +77,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
this.goalSelector.addGoal(7, new RandomStrollGoal(this, 1.0D));
this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, Drowned.class)).setAlertOthers(ZombifiedPiglin.class));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::okTarget));
diff --git a/patches/server/0281-Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/0281-Add-option-to-prevent-players-from-moving-into-unloa.patch
index ad2e41bfbb..f0c000f5f6 100644
--- a/patches/server/0281-Add-option-to-prevent-players-from-moving-into-unloa.patch
+++ b/patches/server/0281-Add-option-to-prevent-players-from-moving-into-unloa.patch
@@ -20,10 +20,10 @@ index e57ab8a3e6efd78e12385042b7d91dcd27fef11d..eb44aef0aecf65f5c1b19f42bf85a3a2
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 607be2544cc163065dcbb7fedd5709cca2453ea2..99f8c661908d6540b8f0bb08a9fd0f5511c885d1 100644
+index d0adb066fcea5636c88be838fb5eff79306c5f4a..b7923ee97eea5c2e285080afba0bd1e93ace41b5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -529,6 +529,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -534,6 +534,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
@@ -36,8 +36,8 @@ index 607be2544cc163065dcbb7fedd5709cca2453ea2..99f8c661908d6540b8f0bb08a9fd0f55
+
if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
// CraftBukkit end
- ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getName().getString(), this.player.getName().getString(), d6, d7, d8);
-@@ -1159,9 +1166,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+ ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
+@@ -1166,9 +1173,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
float prevYaw = this.player.getYRot();
float prevPitch = this.player.getXRot();
// CraftBukkit end
@@ -49,7 +49,7 @@ index 607be2544cc163065dcbb7fedd5709cca2453ea2..99f8c661908d6540b8f0bb08a9fd0f55
double d6 = this.player.getY();
double d7 = d0 - this.firstGoodX;
double d8 = d1 - this.firstGoodY;
-@@ -1199,6 +1206,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1206,6 +1213,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
} else {
speed = this.player.getAbilities().walkingSpeed * 10f;
}
diff --git a/patches/server/0282-Reset-players-airTicks-on-respawn.patch b/patches/server/0282-Reset-players-airTicks-on-respawn.patch
index 6ff1a31d17..6ff23153dd 100644
--- a/patches/server/0282-Reset-players-airTicks-on-respawn.patch
+++ b/patches/server/0282-Reset-players-airTicks-on-respawn.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Reset players airTicks on respawn
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 4a8afc06f58bb608055a0fabc587bf06a7110232..db7f2715534ed71a2b285de095238586fe6a35b0 100644
+index c2a4d209b4d736c0c0a8a0f1bf703dd822a84790..28a5255626b1a4ed893ac66850ed42adbf573a1c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -2252,6 +2252,7 @@ public class ServerPlayer extends Player {
+@@ -2250,6 +2250,7 @@ public class ServerPlayer extends Player {
this.setHealth(this.getMaxHealth());
this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset
diff --git a/patches/server/0284-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/0284-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
index 8c8f9eb9ff..aeda232b23 100644
--- a/patches/server/0284-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
+++ b/patches/server/0284-Improve-Server-Thread-Pool-and-Thread-Priorities.patch
@@ -12,10 +12,10 @@ server threads
Allow usage of a single thread executor by not using ForkJoin so single core CPU's.
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
-index 5c57a6607f1a95ac4d8770d0429d6848351f5452..cc565d1f766d5a6e0fe674ee9e453dbcb890116e 100644
+index 90d22b75fd33d8355e59b6bab79757c5b436c9d7..a8772417eb54e1a52c490b75b470a502a480f925 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
-@@ -74,8 +74,8 @@ public class Util {
+@@ -69,8 +69,8 @@ public class Util {
private static final int DEFAULT_MAX_THREADS = 255;
private static final String MAX_THREADS_SYSTEM_PROPERTY = "max.bg.threads";
private static final AtomicInteger WORKER_COUNT = new AtomicInteger(1);
@@ -25,8 +25,8 @@ index 5c57a6607f1a95ac4d8770d0429d6848351f5452..cc565d1f766d5a6e0fe674ee9e453dbc
+ private static final ExecutorService BACKGROUND_EXECUTOR = makeExecutor("Main", -1); // Paper - add -1 priority
private static final ExecutorService IO_POOL = makeIoExecutor();
public static LongSupplier timeSource = System::nanoTime;
- public static final UUID NIL_UUID = new UUID(0L, 0L);
-@@ -114,14 +114,18 @@ public class Util {
+ public static final Ticker TICKER = new Ticker() {
+@@ -112,14 +112,18 @@ public class Util {
return Instant.now().toEpochMilli();
}
@@ -49,7 +49,7 @@ index 5c57a6607f1a95ac4d8770d0429d6848351f5452..cc565d1f766d5a6e0fe674ee9e453dbc
@Override
protected void onTermination(Throwable throwable) {
if (throwable != null) {
-@@ -137,6 +141,7 @@ public class Util {
+@@ -135,6 +139,7 @@ public class Util {
return forkJoinWorkerThread;
}, Util::onThreadException, true);
}
@@ -58,7 +58,7 @@ index 5c57a6607f1a95ac4d8770d0429d6848351f5452..cc565d1f766d5a6e0fe674ee9e453dbc
return executorService;
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 534c02bc7f4fe925d2e12257e88001801a63444c..dd03544da48a2d8276e3dd16eb1985a251a9cfba 100644
+index ca48908148b6d9f4ae03fd55bcaf37e5fdb01cab..2cc2e496991db1ca4154816ecd6121b82fca07c6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -320,6 +320,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 36.0D) {
+ if (true) return; // Paper - Don't notify if unreasonably far away
- this.player.connection.send(new ClientboundBlockBreakAckPacket(pos, this.level.getBlockState(pos), action, false, "too far"));
- } else if (pos.getY() >= worldHeight) {
- this.player.connection.send(new ClientboundBlockBreakAckPacket(pos, this.level.getBlockState(pos), action, false, "too high"));
-@@ -294,10 +301,12 @@ public class ServerPlayerGameMode {
+ BlockState iblockdata;
+
+ if (this.player.level.getServer() != null && this.player.chunkPosition().getChessboardDistance(new ChunkPos(pos)) < this.player.level.getServer().getPlayerList().getViewDistance()) {
+@@ -304,10 +311,12 @@ public class ServerPlayerGameMode {
this.player.connection.send(new ClientboundBlockBreakAckPacket(pos, this.level.getBlockState(pos), action, true, "stopped destroying"));
} else if (action == ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK) {
this.isDestroyingBlock = false;
@@ -59,10 +59,10 @@ index 3ef782b69b9f21d12b1ef214e77bc8af8a94970b..abc7b15976131dc840f40258ed5cc4ef
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 99f8c661908d6540b8f0bb08a9fd0f5511c885d1..c5800f0e502815bf0e71a389e30e9b604ac6b107 100644
+index b7923ee97eea5c2e285080afba0bd1e93ace41b5..bfdf4072d27b022377beafae877f2d553acae9d3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1555,7 +1555,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1563,7 +1563,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
case START_DESTROY_BLOCK:
case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK:
diff --git a/patches/server/0290-Make-the-default-permission-message-configurable.patch b/patches/server/0290-Make-the-default-permission-message-configurable.patch
index d1b1542038..e28db7fdb0 100644
--- a/patches/server/0290-Make-the-default-permission-message-configurable.patch
+++ b/patches/server/0290-Make-the-default-permission-message-configurable.patch
@@ -42,10 +42,10 @@ index edf0a82ba7e16b86100aa1920fa41508be2ab1e8..c48b175d5511b733bcff9a93a874f5ff
Object val = config.get("settings.save-player-data");
if (val instanceof Boolean) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index 8ef4679af2e7ad090f6cbdca9d69a5d88b3c6e93..23d450f150d2f2acbb6add825add5f9c777d30b3 100644
+index 532185882420c04c1a996a7d269af554ee106ed1..1373f00a5a93fbb34cc7cb47683a1eef48e88c8c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -2585,6 +2585,11 @@ public final class CraftServer implements Server {
+@@ -2577,6 +2577,11 @@ public final class CraftServer implements Server {
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
}
diff --git a/patches/server/0292-Handle-Large-Packets-disconnecting-client.patch b/patches/server/0292-Handle-Large-Packets-disconnecting-client.patch
index dab7c75b93..0482070972 100644
--- a/patches/server/0292-Handle-Large-Packets-disconnecting-client.patch
+++ b/patches/server/0292-Handle-Large-Packets-disconnecting-client.patch
@@ -7,10 +7,10 @@ If a players inventory is too big to send in a single packet,
split the inventory set into multiple packets instead.
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
-index 0aacf2e0155a9a7c9dfe9b368a251aee25ed24fc..0b3f1585618e29685ffcba704f03ff5e581f0851 100644
+index 7e7d33a843566440f815d779ef2f3db9efc3b92d..97b9c53f695d55f8e7d1cb5b300740028c535b7c 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
-@@ -120,6 +120,15 @@ public class Connection extends SimpleChannelInboundHandler> {
+@@ -130,6 +130,15 @@ public class Connection extends SimpleChannelInboundHandler> {
}
public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) {
@@ -27,10 +27,10 @@ index 0aacf2e0155a9a7c9dfe9b368a251aee25ed24fc..0b3f1585618e29685ffcba704f03ff5e
Connection.LOGGER.debug("Skipping packet due to errors", throwable.getCause());
} else {
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
-index dfeff0da932b0d66b70f3a5dd281c926c048f2f0..9cdcd4d92f73d1b9866cdef33d2463e843462516 100644
+index 00d432bd395e7f7fb6ee24e371818d13892b2f0c..5fce1177e7198d791d4ab1c64b394c5b1c145782 100644
--- a/src/main/java/net/minecraft/network/PacketEncoder.java
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java
-@@ -57,7 +57,31 @@ public class PacketEncoder extends MessageToByteEncoder> {
+@@ -54,7 +54,31 @@ public class PacketEncoder extends MessageToByteEncoder> {
throw var10;
}
}
diff --git a/patches/server/0293-force-entity-dismount-during-teleportation.patch b/patches/server/0293-force-entity-dismount-during-teleportation.patch
index 053ab671c7..9c5889a6ae 100644
--- a/patches/server/0293-force-entity-dismount-during-teleportation.patch
+++ b/patches/server/0293-force-entity-dismount-during-teleportation.patch
@@ -20,10 +20,10 @@ this is going to be the best soultion all around.
Improvements/suggestions welcome!
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index db7f2715534ed71a2b285de095238586fe6a35b0..f51c416e7938b7905f7efb154ab14cad643962e9 100644
+index 28a5255626b1a4ed893ac66850ed42adbf573a1c..119a32c11aff63a764eadeca59d5f50fab89cb72 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1323,11 +1323,13 @@ public class ServerPlayer extends Player {
+@@ -1321,11 +1321,13 @@ public class ServerPlayer extends Player {
}
}
@@ -41,10 +41,10 @@ index db7f2715534ed71a2b285de095238586fe6a35b0..f51c416e7938b7905f7efb154ab14cad
if (entity1 != entity && this.connection != null) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 37f337efb7ac164749c73974e4acfde93d649290..3a013ffe5feec6dab478684964f581c354f2a7ae 100644
+index c819bd3db7dfab1181288683f2a47bb71a52953d..1f1442e62c089ef9a922bbee91fc841771e7777f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
-@@ -2252,11 +2252,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -2256,11 +2256,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
}
public void removeVehicle() {
@@ -62,7 +62,7 @@ index 37f337efb7ac164749c73974e4acfde93d649290..3a013ffe5feec6dab478684964f581c3
}
}
-@@ -2319,7 +2324,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -2323,7 +2328,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
return true; // CraftBukkit
}
@@ -74,7 +74,7 @@ index 37f337efb7ac164749c73974e4acfde93d649290..3a013ffe5feec6dab478684964f581c3
if (entity.getVehicle() == this) {
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else {
-@@ -2329,7 +2337,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -2333,7 +2341,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
VehicleExitEvent event = new VehicleExitEvent(
(Vehicle) this.getBukkitEntity(),
@@ -83,7 +83,7 @@ index 37f337efb7ac164749c73974e4acfde93d649290..3a013ffe5feec6dab478684964f581c3
);
// Suppress during worldgen
if (this.valid) {
-@@ -2343,7 +2351,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
+@@ -2347,7 +2355,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
}
// CraftBukkit end
// Spigot start
@@ -93,10 +93,10 @@ index 37f337efb7ac164749c73974e4acfde93d649290..3a013ffe5feec6dab478684964f581c3
if (this.valid) {
Bukkit.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index dc723e1a4d73e06c4b9f275c7b912de1a1cef070..8587ac23b5c98ef2ee90445432da9db130d93464 100644
+index e5c5bdc83804f335d7163cfefba79b57df97310b..853ce6536557b64de134a098d7ed3dde2782ffde 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3352,9 +3352,15 @@ public abstract class LivingEntity extends Entity {
+@@ -3347,9 +3347,15 @@ public abstract class LivingEntity extends Entity {
@Override
public void stopRiding() {
@@ -114,10 +114,10 @@ index dc723e1a4d73e06c4b9f275c7b912de1a1cef070..8587ac23b5c98ef2ee90445432da9db1
this.dismountVehicle(entity);
}
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
-index fcd66b668008a0c3be8d20f7f169b213fabe91a5..7bc6518dd4da041d9f59affc5447a23312790917 100644
+index 2dcbeaed2e84675e95cde9e831b9d552b2e0b32f..a55ee0868fbf85456749ecede30cea7e0c481bb3 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
-@@ -1093,7 +1093,13 @@ public abstract class Player extends LivingEntity {
+@@ -1106,7 +1106,13 @@ public abstract class Player extends LivingEntity {
@Override
public void removeVehicle() {
diff --git a/patches/server/0295-Book-Size-Limits.patch b/patches/server/0295-Book-Size-Limits.patch
index 894f68fa43..bfc0c1610f 100644
--- a/patches/server/0295-Book-Size-Limits.patch
+++ b/patches/server/0295-Book-Size-Limits.patch
@@ -24,10 +24,10 @@ index c48b175d5511b733bcff9a93a874f5ffc0174691..e683e5bf47abe7bd3d2f7e9811a37754
private static void asyncChunks() {
ConfigurationSection section;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index c5800f0e502815bf0e71a389e30e9b604ac6b107..b1ea73320b7927b23d48ee6e80b63b37d1806c97 100644
+index bfdf4072d27b022377beafae877f2d553acae9d3..52de402481607a0f35e43028003593499821ffb7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1005,6 +1005,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -1012,6 +1012,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handleEditBook(ServerboundEditBookPacket packet) {
diff --git a/patches/server/0296-Add-PlayerConnectionCloseEvent.patch b/patches/server/0296-Add-PlayerConnectionCloseEvent.patch
index 015b6d566e..5a881a7a41 100644
--- a/patches/server/0296-Add-PlayerConnectionCloseEvent.patch
+++ b/patches/server/0296-Add-PlayerConnectionCloseEvent.patch
@@ -34,10 +34,10 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent
is undefined.
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
-index 0b3f1585618e29685ffcba704f03ff5e581f0851..821f22b8fde2d76bfcb417138f9bd83af766dcd7 100644
+index 97b9c53f695d55f8e7d1cb5b300740028c535b7c..3559f6c54e7674d3eaf023d2ceaee13edfcae5b2 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
-@@ -418,6 +418,26 @@ public class Connection extends SimpleChannelInboundHandler> {
+@@ -430,6 +430,26 @@ public class Connection extends SimpleChannelInboundHandler> {
this.getPacketListener().onDisconnect(new TranslatableComponent("multiplayer.disconnect.generic"));
}
this.queue.clear(); // Free up packet queue.
diff --git a/patches/server/0297-Prevent-Enderman-from-loading-chunks.patch b/patches/server/0297-Prevent-Enderman-from-loading-chunks.patch
index 5c0a545a60..60ad30486e 100644
--- a/patches/server/0297-Prevent-Enderman-from-loading-chunks.patch
+++ b/patches/server/0297-Prevent-Enderman-from-loading-chunks.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Prevent Enderman from loading chunks
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
-index c7714824d8e85087397047cf9bcb0528968b1f93..d47002d45dabd66f38d25d398d8943f4b911cdc5 100644
+index 102cab5a2104d32440ad489847bb7a443beead51..4920f5465298b4da33b53f80b8af6220cb0e8ccc 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
-@@ -490,7 +490,8 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -489,7 +489,8 @@ public class EnderMan extends Monster implements NeutralMob {
int j = Mth.floor(this.enderman.getY() + random.nextDouble() * 2.0D);
int k = Mth.floor(this.enderman.getZ() - 1.0D + random.nextDouble() * 2.0D);
BlockPos blockposition = new BlockPos(i, j, k);
@@ -18,7 +18,7 @@ index c7714824d8e85087397047cf9bcb0528968b1f93..d47002d45dabd66f38d25d398d8943f4
BlockPos blockposition1 = blockposition.below();
BlockState iblockdata1 = world.getBlockState(blockposition1);
BlockState iblockdata2 = this.enderman.getCarriedBlock();
-@@ -536,7 +537,8 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -535,7 +536,8 @@ public class EnderMan extends Monster implements NeutralMob {
int j = Mth.floor(this.enderman.getY() + random.nextDouble() * 3.0D);
int k = Mth.floor(this.enderman.getZ() - 2.0D + random.nextDouble() * 4.0D);
BlockPos blockposition = new BlockPos(i, j, k);
diff --git a/patches/server/0298-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0298-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch
index 232a30462e..cb5aa60f43 100644
--- a/patches/server/0298-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch
+++ b/patches/server/0298-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch
@@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and
documented as to their purpose.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index f51c416e7938b7905f7efb154ab14cad643962e9..71cd61112fa36d1de2f5fc0dd75993fafc3d76ab 100644
+index 119a32c11aff63a764eadeca59d5f50fab89cb72..4e51975dbab2f4904246a2bcff12d923cd629909 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -222,6 +222,7 @@ public class ServerPlayer extends Player {
+@@ -220,6 +220,7 @@ public class ServerPlayer extends Player {
public int latency;
public boolean wonGame;
private int containerUpdateDelay; // Paper
@@ -28,7 +28,7 @@ index f51c416e7938b7905f7efb154ab14cad643962e9..71cd61112fa36d1de2f5fc0dd75993fa
public boolean queueHealthUpdatePacket = false;
public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index e1603b674823067a55faa12e716b695171b31d32..73dd4776fee3429c42b279ab92050a4b872f64b5 100644
+index 8e8fee668b6a351ef14904e6e065e59014868adb..e889c7f626316ea68e9231d903bd97095f07e9e9 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -173,6 +173,7 @@ public abstract class PlayerList {
diff --git a/patches/server/0299-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/patches/server/0299-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
index fdfe699299..6ad108b93f 100644
--- a/patches/server/0299-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
+++ b/patches/server/0299-Workaround-for-vehicle-tracking-issue-on-disconnect.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-index 71cd61112fa36d1de2f5fc0dd75993fafc3d76ab..e8ef3adad0bfddf17271e095ec928c8acb9413f2 100644
+index 4e51975dbab2f4904246a2bcff12d923cd629909..889881c6835a68b1ada3b613fa7e9ed9cdf82c2a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
-@@ -1565,6 +1565,13 @@ public class ServerPlayer extends Player {
+@@ -1563,6 +1563,13 @@ public class ServerPlayer extends Player {
public void disconnect() {
this.disconnected = true;
this.ejectPassengers();
diff --git a/patches/server/0301-BlockDestroyEvent.patch b/patches/server/0301-BlockDestroyEvent.patch
index 448b9603c6..6671426322 100644
--- a/patches/server/0301-BlockDestroyEvent.patch
+++ b/patches/server/0301-BlockDestroyEvent.patch
@@ -11,10 +11,10 @@ floating in the air.
This can replace many uses of BlockPhysicsEvent
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index 5e3d1a36b0eb350536e29730540ee17b68fe315b..9d963766cce68f5cb837988c73c8b271404c8376 100644
+index dc2235824853a0d7ccbff51dd26a71e97fe90ba7..a00b4c84cc27678c07d0195a90f38dc458a11862 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -28,6 +28,7 @@ import net.minecraft.nbt.CompoundTag;
+@@ -29,6 +29,7 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.Packet;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
@@ -22,7 +22,7 @@ index 5e3d1a36b0eb350536e29730540ee17b68fe315b..9d963766cce68f5cb837988c73c8b271
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ChunkHolder;
import net.minecraft.server.level.ServerLevel;
-@@ -564,8 +565,20 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
+@@ -563,8 +564,20 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return false;
} else {
FluidState fluid = this.getFluidState(pos);
diff --git a/patches/server/0302-Async-command-map-building.patch b/patches/server/0302-Async-command-map-building.patch
index 7581f7fb8f..22cd32cfcc 100644
--- a/patches/server/0302-Async-command-map-building.patch
+++ b/patches/server/0302-Async-command-map-building.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Async command map building
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
-index cc2337ee8a00fab8919a61324899113370bc5018..ee31455158afbed8f3bbac57d2f41a59d01a0670 100644
+index 7d6b416f0889221d63233f8650c530467ea8fbd7..f3bbe012541a71ab75c1863990d0c056c62d8c6e 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
-@@ -30,6 +30,7 @@ import net.minecraft.network.chat.MutableComponent;
+@@ -31,6 +31,7 @@ import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.network.protocol.game.ClientboundCommandsPacket;
@@ -16,7 +16,7 @@ index cc2337ee8a00fab8919a61324899113370bc5018..ee31455158afbed8f3bbac57d2f41a59
import net.minecraft.server.commands.AdvancementCommands;
import net.minecraft.server.commands.AttributeCommand;
import net.minecraft.server.commands.BanIpCommands;
-@@ -344,6 +345,12 @@ public class Commands {
+@@ -346,6 +347,12 @@ public class Commands {
if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot
// CraftBukkit start
// Register Vanilla commands into builtRoot as before
@@ -29,7 +29,7 @@ index cc2337ee8a00fab8919a61324899113370bc5018..ee31455158afbed8f3bbac57d2f41a59
Map, CommandNode> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues
RootCommandNode vanillaRoot = new RootCommandNode();
-@@ -361,7 +368,14 @@ public class Commands {
+@@ -363,7 +370,14 @@ public class Commands {
for (CommandNode node : rootcommandnode.getChildren()) {
bukkit.add(node.getName());
}
diff --git a/patches/server/0303-Implement-Brigadier-Mojang-API.patch b/patches/server/0303-Implement-Brigadier-Mojang-API.patch
index bc55828b42..e675f15171 100644
--- a/patches/server/0303-Implement-Brigadier-Mojang-API.patch
+++ b/patches/server/0303-Implement-Brigadier-Mojang-API.patch
@@ -10,7 +10,7 @@ Adds CommandRegisteredEvent
- Allows manipulating the CommandNode to add more children/metadata for the client
diff --git a/build.gradle.kts b/build.gradle.kts
-index 125630037713c4790636ffd11b14b2c1d83a085a..898e2efb764e5bd97ab4e757e6c4c27fc4efdbef 100644
+index 0c560f91986d5352f1ec42ccb48853366a981fbe..e8badd402381eaae1eafbd751bd2dfecc0427922 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -12,6 +12,7 @@ repositories {
@@ -22,7 +22,7 @@ index 125630037713c4790636ffd11b14b2c1d83a085a..898e2efb764e5bd97ab4e757e6c4c27f
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
-index 9f79c949d18c1ff3bdb49780fcecfc75366a8ff6..530a09fa3c9155459c6a4519e3412408ae658145 100644
+index 5ebf717535eab892898a62ce6aaaf936fe064626..31aaad639b6c285226ca7aca1bd2285cfe0d9117 100644
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
@@ -38,7 +38,7 @@ import net.minecraft.world.phys.Vec2;
@@ -61,10 +61,10 @@ index 9f79c949d18c1ff3bdb49780fcecfc75366a8ff6..530a09fa3c9155459c6a4519e3412408
public boolean hasPermission(int level) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
-index ee31455158afbed8f3bbac57d2f41a59d01a0670..4049576478efed97092b7e1b3d40afda6b114d68 100644
+index f3bbe012541a71ab75c1863990d0c056c62d8c6e..4bc28b66788d06d1446284f5adef6a44be736f92 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
-@@ -369,6 +369,7 @@ public class Commands {
+@@ -371,6 +371,7 @@ public class Commands {
bukkit.add(node.getName());
}
// Paper start - Async command map building
@@ -72,7 +72,7 @@ index ee31455158afbed8f3bbac57d2f41a59d01a0670..4049576478efed97092b7e1b3d40afda
MinecraftServer.getServer().execute(() -> {
runSync(player, bukkit, rootcommandnode);
});
-@@ -376,6 +377,7 @@ public class Commands {
+@@ -378,6 +379,7 @@ public class Commands {
private void runSync(ServerPlayer player, Collection bukkit, RootCommandNode rootcommandnode) {
// Paper end - Async command map building
@@ -81,10 +81,10 @@ index ee31455158afbed8f3bbac57d2f41a59d01a0670..4049576478efed97092b7e1b3d40afda
event.getPlayer().getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index b1ea73320b7927b23d48ee6e80b63b37d1806c97..e2044745f490f99deb993e42385d71fa8d927ab1 100644
+index 52de402481607a0f35e43028003593499821ffb7..fdf45cb0132bc588b9bb3ac8d9f89c0d1082b0e7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -746,8 +746,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -753,8 +753,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
@@ -99,7 +99,7 @@ index b1ea73320b7927b23d48ee6e80b63b37d1806c97..e2044745f490f99deb993e42385d71fa
});
});
}
-@@ -756,7 +760,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -763,7 +767,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
builder = builder.createOffset(builder.getInput().lastIndexOf(' ') + 1);
completions.forEach(builder::suggest);
diff --git a/patches/server/0305-Limit-Client-Sign-length-more.patch b/patches/server/0305-Limit-Client-Sign-length-more.patch
index f556e47a83..6f7d06e2d5 100644
--- a/patches/server/0305-Limit-Client-Sign-length-more.patch
+++ b/patches/server/0305-Limit-Client-Sign-length-more.patch
@@ -22,10 +22,10 @@ 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 e2044745f490f99deb993e42385d71fa8d927ab1..7b639081b1bd5ac0cca7c6be1692c179bc9692fb 100644
+index fdf45cb0132bc588b9bb3ac8d9f89c0d1082b0e7..3ec98749f23e56d52e246d2c94006c5ed4ddf303 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -253,6 +253,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -254,6 +254,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private int aboveGroundVehicleTickCount;
private int receivedMovePacketCount;
private int knownMovePacketCount;
@@ -33,7 +33,7 @@ index e2044745f490f99deb993e42385d71fa8d927ab1..7b639081b1bd5ac0cca7c6be1692c179
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) {
-@@ -2865,6 +2866,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
+@@ -2889,6 +2890,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
for (int i = 0; i < signText.size(); ++i) {
TextFilter.FilteredText currentLine = signText.get(i);
diff --git a/patches/server/0307-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/server/0307-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
index 8ae2ad20e3..bdd97d4256 100644
--- a/patches/server/0307-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
+++ b/patches/server/0307-Optimize-Network-Manager-and-add-advanced-packet-sup.patch
@@ -28,10 +28,10 @@ and then catch exceptions and close if they fire.
Part of this commit was authored by: Spottedleaf
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
-index 821f22b8fde2d76bfcb417138f9bd83af766dcd7..f13e24eede7f09ecc8f375df5e27e385f589005d 100644
+index 3559f6c54e7674d3eaf023d2ceaee13edfcae5b2..a0d3d9e344f530b713167d0663634c40eefce5b5 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
-@@ -87,6 +87,10 @@ public class Connection extends SimpleChannelInboundHandler> {
+@@ -97,6 +97,10 @@ public class Connection extends SimpleChannelInboundHandler> {
public int protocolVersion;
public java.net.InetSocketAddress virtualHost;
private static boolean enableExplicitFlush = Boolean.getBoolean("paper.explicit-flush");
@@ -42,7 +42,7 @@ index 821f22b8fde2d76bfcb417138f9bd83af766dcd7..f13e24eede7f09ecc8f375df5e27e385
// Paper end
public Connection(PacketFlow side) {
-@@ -110,6 +114,7 @@ public class Connection extends SimpleChannelInboundHandler> {
+@@ -120,6 +124,7 @@ public class Connection extends SimpleChannelInboundHandler> {
}
public void setProtocol(ConnectionProtocol state) {
@@ -50,7 +50,7 @@ index 821f22b8fde2d76bfcb417138f9bd83af766dcd7..f13e24eede7f09ecc8f375df5e27e385
this.channel.attr(Connection.ATTRIBUTE_PROTOCOL).set(state);
this.channel.config().setAutoRead(true);
Connection.LOGGER.debug("Enabled auto read");
-@@ -186,19 +191,87 @@ public class Connection extends SimpleChannelInboundHandler> {
+@@ -198,19 +203,87 @@ public class Connection extends SimpleChannelInboundHandler> {
Validate.notNull(listener, "packetListener", new Object[0]);
this.packetListener = listener;
}
@@ -142,7 +142,7 @@ index 821f22b8fde2d76bfcb417138f9bd83af766dcd7..f13e24eede7f09ecc8f375df5e27e385
}
private void sendPacket(Packet> packet, @Nullable GenericFutureListener extends Future super Void>> callback) {
-@@ -226,33 +299,79 @@ public class Connection extends SimpleChannelInboundHandler