diff options
author | Jake Potrebic <[email protected]> | 2024-06-13 10:12:48 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-06-13 10:12:48 -0700 |
commit | 8a37f93925f5a0274745f81bb6d4ee8473551abf (patch) | |
tree | 5862d5be3fabfa84ab538d983e3daaddfb59b858 | |
parent | 7fbb8278e70c1904e09f2144f0e3897468a4906f (diff) | |
download | Paper-8a37f93925f5a0274745f81bb6d4ee8473551abf.tar.gz Paper-8a37f93925f5a0274745f81bb6d4ee8473551abf.zip |
62
-rw-r--r-- | build.gradle.kts | 2 | ||||
-rw-r--r-- | patches/removed/1.21/0063-Configurable-inter-world-teleportation-safety.patch (renamed from patches/unapplied/server/0063-Configurable-inter-world-teleportation-safety.patch) | 0 | ||||
-rw-r--r-- | patches/server/0001-Setup-Gradle-project.patch (renamed from patches/unapplied/server/0001-Setup-Gradle-project.patch) | 20 | ||||
-rw-r--r-- | patches/server/0002-Remap-fixes.patch (renamed from patches/unapplied/server/0002-Remap-fixes.patch) | 20 | ||||
-rw-r--r-- | patches/server/0003-Build-system-changes.patch (renamed from patches/unapplied/server/0003-Build-system-changes.patch) | 14 | ||||
-rw-r--r-- | patches/server/0004-Test-changes.patch (renamed from patches/unapplied/server/0004-Test-changes.patch) | 2 | ||||
-rw-r--r-- | patches/server/0005-Paper-config-files.patch (renamed from patches/unapplied/server/0005-Paper-config-files.patch) | 34 | ||||
-rw-r--r-- | patches/server/0006-MC-Dev-fixes.patch (renamed from patches/unapplied/server/0006-MC-Dev-fixes.patch) | 20 | ||||
-rw-r--r-- | patches/server/0007-ConcurrentUtil.patch (renamed from patches/unapplied/server/0007-ConcurrentUtil.patch) | 0 | ||||
-rw-r--r-- | patches/server/0008-CB-fixes.patch (renamed from patches/unapplied/server/0008-CB-fixes.patch) | 16 | ||||
-rw-r--r-- | patches/server/0009-MC-Utils.patch (renamed from patches/unapplied/server/0009-MC-Utils.patch) | 297 | ||||
-rw-r--r-- | patches/server/0010-Adventure.patch (renamed from patches/unapplied/server/0010-Adventure.patch) | 250 | ||||
-rw-r--r-- | patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch (renamed from patches/unapplied/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch) | 38 | ||||
-rw-r--r-- | patches/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch (renamed from patches/unapplied/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch) | 4 | ||||
-rw-r--r-- | patches/server/0013-Improve-Log4J-Configuration-Plugin-Loggers.patch (renamed from patches/unapplied/server/0013-Improve-Log4J-Configuration-Plugin-Loggers.patch) | 0 | ||||
-rw-r--r-- | patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch (renamed from patches/unapplied/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch) | 6 | ||||
-rw-r--r-- | patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch (renamed from patches/unapplied/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch) | 12 | ||||
-rw-r--r-- | patches/server/0016-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch (renamed from patches/unapplied/server/0016-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch) | 0 | ||||
-rw-r--r-- | patches/server/0017-Paper-command.patch (renamed from patches/unapplied/server/0017-Paper-command.patch) | 10 | ||||
-rw-r--r-- | patches/server/0018-Paper-Metrics.patch (renamed from patches/unapplied/server/0018-Paper-Metrics.patch) | 6 | ||||
-rw-r--r-- | patches/server/0019-Paper-Plugins.patch (renamed from patches/unapplied/server/0019-Paper-Plugins.patch) | 22 | ||||
-rw-r--r-- | patches/server/0020-Plugin-remapping.patch (renamed from patches/unapplied/server/0020-Plugin-remapping.patch) | 16 | ||||
-rw-r--r-- | patches/server/0021-Hook-into-CB-plugin-rewrites.patch (renamed from patches/unapplied/server/0021-Hook-into-CB-plugin-rewrites.patch) | 18 | ||||
-rw-r--r-- | patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch (renamed from patches/unapplied/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch) | 12 | ||||
-rw-r--r-- | patches/server/0023-Timings-v2.patch (renamed from patches/unapplied/server/0023-Timings-v2.patch) | 164 | ||||
-rw-r--r-- | patches/server/0024-Add-TickThread.patch (renamed from patches/unapplied/server/0024-Add-TickThread.patch) | 0 | ||||
-rw-r--r-- | patches/server/0025-Further-improve-server-tick-loop.patch (renamed from patches/unapplied/server/0025-Further-improve-server-tick-loop.patch) | 18 | ||||
-rw-r--r-- | patches/server/0026-Add-command-line-option-to-load-extra-plugin-jars-no.patch (renamed from patches/unapplied/server/0026-Add-command-line-option-to-load-extra-plugin-jars-no.patch) | 6 | ||||
-rw-r--r-- | patches/server/0027-Support-components-in-ItemMeta.patch (renamed from patches/unapplied/server/0027-Support-components-in-ItemMeta.patch) | 10 | ||||
-rw-r--r-- | patches/server/0028-Configurable-cactus-bamboo-and-reed-growth-height.patch (renamed from patches/unapplied/server/0028-Configurable-cactus-bamboo-and-reed-growth-height.patch) | 0 | ||||
-rw-r--r-- | patches/server/0029-Configurable-baby-zombie-movement-speed.patch | 31 | ||||
-rw-r--r-- | patches/server/0030-Configurable-fishing-time-ranges.patch (renamed from patches/unapplied/server/0030-Configurable-fishing-time-ranges.patch) | 14 | ||||
-rw-r--r-- | patches/server/0031-Allow-nerfed-mobs-to-jump.patch (renamed from patches/unapplied/server/0031-Allow-nerfed-mobs-to-jump.patch) | 6 | ||||
-rw-r--r-- | patches/server/0032-Add-configurable-entity-despawn-distances.patch (renamed from patches/unapplied/server/0032-Add-configurable-entity-despawn-distances.patch) | 4 | ||||
-rw-r--r-- | patches/server/0033-Drop-falling-block-and-tnt-entities-at-the-specified.patch (renamed from patches/unapplied/server/0033-Drop-falling-block-and-tnt-entities-at-the-specified.patch) | 14 | ||||
-rw-r--r-- | patches/server/0034-Expose-server-build-information.patch (renamed from patches/unapplied/server/0034-Expose-server-build-information.patch) | 30 | ||||
-rw-r--r-- | patches/server/0035-Player-affects-spawning-API.patch (renamed from patches/unapplied/server/0035-Player-affects-spawning-API.patch) | 22 | ||||
-rw-r--r-- | patches/server/0036-Only-refresh-abilities-if-needed.patch (renamed from patches/unapplied/server/0036-Only-refresh-abilities-if-needed.patch) | 4 | ||||
-rw-r--r-- | patches/server/0037-Entity-Origin-API.patch (renamed from patches/unapplied/server/0037-Entity-Origin-API.patch) | 16 | ||||
-rw-r--r-- | patches/server/0038-Prevent-block-entity-and-entity-crashes.patch (renamed from patches/unapplied/server/0038-Prevent-block-entity-and-entity-crashes.patch) | 8 | ||||
-rw-r--r-- | patches/server/0039-Configurable-top-of-nether-void-damage.patch (renamed from patches/unapplied/server/0039-Configurable-top-of-nether-void-damage.patch) | 28 | ||||
-rw-r--r-- | patches/server/0040-Check-online-mode-before-converting-and-renaming-pla.patch (renamed from patches/unapplied/server/0040-Check-online-mode-before-converting-and-renaming-pla.patch) | 0 | ||||
-rw-r--r-- | patches/server/0041-Add-more-entities-to-activation-range-ignore-list.patch (renamed from patches/unapplied/server/0041-Add-more-entities-to-activation-range-ignore-list.patch) | 0 | ||||
-rw-r--r-- | patches/server/0042-Configurable-end-credits.patch | 18 | ||||
-rw-r--r-- | patches/server/0043-Fix-lag-from-explosions-processing-dead-entities.patch (renamed from patches/unapplied/server/0043-Fix-lag-from-explosions-processing-dead-entities.patch) | 4 | ||||
-rw-r--r-- | patches/server/0044-Optimize-explosions.patch (renamed from patches/unapplied/server/0044-Optimize-explosions.patch) | 14 | ||||
-rw-r--r-- | patches/server/0045-Disable-explosion-knockback.patch (renamed from patches/unapplied/server/0045-Disable-explosion-knockback.patch) | 10 | ||||
-rw-r--r-- | patches/server/0046-Disable-thunder.patch (renamed from patches/unapplied/server/0046-Disable-thunder.patch) | 4 | ||||
-rw-r--r-- | patches/server/0047-Disable-ice-and-snow.patch (renamed from patches/unapplied/server/0047-Disable-ice-and-snow.patch) | 4 | ||||
-rw-r--r-- | patches/server/0048-Configurable-mob-spawner-tick-rate.patch (renamed from patches/unapplied/server/0048-Configurable-mob-spawner-tick-rate.patch) | 0 | ||||
-rw-r--r-- | patches/server/0049-Implement-PlayerLocaleChangeEvent.patch (renamed from patches/unapplied/server/0049-Implement-PlayerLocaleChangeEvent.patch) | 12 | ||||
-rw-r--r-- | patches/server/0050-Add-BeaconEffectEvent.patch (renamed from patches/unapplied/server/0050-Add-BeaconEffectEvent.patch) | 4 | ||||
-rw-r--r-- | patches/server/0051-Configurable-container-update-tick-rate.patch (renamed from patches/unapplied/server/0051-Configurable-container-update-tick-rate.patch) | 6 | ||||
-rw-r--r-- | patches/server/0052-Use-UserCache-for-player-heads.patch (renamed from patches/unapplied/server/0052-Use-UserCache-for-player-heads.patch) | 0 | ||||
-rw-r--r-- | patches/server/0053-Disable-spigot-tick-limiters.patch (renamed from patches/unapplied/server/0053-Disable-spigot-tick-limiters.patch) | 4 | ||||
-rw-r--r-- | patches/server/0054-Add-PlayerInitialSpawnEvent.patch (renamed from patches/unapplied/server/0054-Add-PlayerInitialSpawnEvent.patch) | 2 | ||||
-rw-r--r-- | patches/server/0055-Configurable-Disabling-Cat-Chest-Detection.patch (renamed from patches/unapplied/server/0055-Configurable-Disabling-Cat-Chest-Detection.patch) | 0 | ||||
-rw-r--r-- | patches/server/0056-Improve-Player-chat-API-handling.patch (renamed from patches/unapplied/server/0056-Improve-Player-chat-API-handling.patch) | 14 | ||||
-rw-r--r-- | patches/server/0057-All-chunks-are-slime-spawn-chunks-toggle.patch (renamed from patches/unapplied/server/0057-All-chunks-are-slime-spawn-chunks-toggle.patch) | 6 | ||||
-rw-r--r-- | patches/server/0058-Expose-server-CommandMap.patch (renamed from patches/unapplied/server/0058-Expose-server-CommandMap.patch) | 4 | ||||
-rw-r--r-- | patches/server/0059-Be-a-bit-more-informative-in-maxHealth-exception.patch (renamed from patches/unapplied/server/0059-Be-a-bit-more-informative-in-maxHealth-exception.patch) | 4 | ||||
-rw-r--r-- | patches/server/0060-Player-Tab-List-and-Title-APIs.patch (renamed from patches/unapplied/server/0060-Player-Tab-List-and-Title-APIs.patch) | 4 | ||||
-rw-r--r-- | patches/server/0061-Add-configurable-portal-search-radius.patch | 38 | ||||
-rw-r--r-- | patches/server/0062-Add-velocity-warnings.patch (renamed from patches/unapplied/server/0062-Add-velocity-warnings.patch) | 8 | ||||
-rw-r--r-- | patches/unapplied/server/0029-Configurable-baby-zombie-movement-speed.patch | 30 | ||||
-rw-r--r-- | patches/unapplied/server/0042-Configurable-end-credits.patch | 18 | ||||
-rw-r--r-- | patches/unapplied/server/0061-Add-configurable-portal-search-radius.patch | 38 |
67 files changed, 700 insertions, 740 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index d57853bb3c..e9fb8e46e3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -67,7 +67,7 @@ repositories { } dependencies { - paramMappings("net.fabricmc:yarn:1.20.6+build.1:mergedv2") + paramMappings("net.fabricmc:yarn:1.21+build.1:mergedv2") remapper("net.fabricmc:tiny-remapper:0.10.2:fat") decompiler("org.vineflower:vineflower:1.10.1") spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.13") diff --git a/patches/unapplied/server/0063-Configurable-inter-world-teleportation-safety.patch b/patches/removed/1.21/0063-Configurable-inter-world-teleportation-safety.patch index d83b08b97c..d83b08b97c 100644 --- a/patches/unapplied/server/0063-Configurable-inter-world-teleportation-safety.patch +++ b/patches/removed/1.21/0063-Configurable-inter-world-teleportation-safety.patch diff --git a/patches/unapplied/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index 6b5a62cd37..8cdbf973d7 100644 --- a/patches/unapplied/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -28,7 +28,7 @@ index 37dab9e868dbfb019c271a547d975a48ad1cb571..3811c0d849a3eb028ed1a6b7a2d4747f +/.factorypath diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..a457cf30d37037ce09fbe5d26e051b9555ce9982 +index 0000000000000000000000000000000000000000..9ea079d14a92367629dc8fb30d1be043c9290964 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,126 @@ @@ -47,8 +47,8 @@ index 0000000000000000000000000000000000000000..a457cf30d37037ce09fbe5d26e051b95 + } + implementation("org.ow2.asm:asm-commons:9.7") + implementation("commons-lang:commons-lang:2.6") -+ runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") -+ runtimeOnly("com.mysql:mysql-connector-j:8.3.0") ++ runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") ++ runtimeOnly("com.mysql:mysql-connector-j:8.4.0") + + runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6") + runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") @@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..a457cf30d37037ce09fbe5d26e051b95 +} + +paperweight { -+ craftBukkitPackageVersion.set("v1_20_R4") // also needs to be updated in MappingEnvironment ++ craftBukkitPackageVersion.set("v1_21_R1") // also needs to be updated in MappingEnvironment +} + +tasks.jar { @@ -160,7 +160,7 @@ index 0000000000000000000000000000000000000000..a457cf30d37037ce09fbe5d26e051b95 +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 -index 4fabd6c37587aa6a9af11566d64c6b49f5bfadaa..0000000000000000000000000000000000000000 +index e6f88c20b3a3ba28b917bea9a671b2709d32b3cd..0000000000000000000000000000000000000000 --- a/pom.xml +++ /dev/null @@ -1,604 +0,0 @@ @@ -170,7 +170,7 @@ index 4fabd6c37587aa6a9af11566d64c6b49f5bfadaa..00000000000000000000000000000000 - <groupId>org.spigotmc</groupId> - <artifactId>spigot</artifactId> - <packaging>jar</packaging> -- <version>1.20.6-R0.1-SNAPSHOT</version> +- <version>1.21-R0.1-SNAPSHOT</version> - <name>Spigot</name> - <url>https://www.spigotmc.org/</url> - @@ -186,7 +186,7 @@ index 4fabd6c37587aa6a9af11566d64c6b49f5bfadaa..00000000000000000000000000000000 - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <api.version>unknown</api.version> - <bt.name>git</bt.name> -- <minecraft_version>1_20_R4</minecraft_version> +- <minecraft_version>1_21_R1</minecraft_version> - <maven.compiler.release>21</maven.compiler.release> - </properties> - @@ -251,7 +251,7 @@ index 4fabd6c37587aa6a9af11566d64c6b49f5bfadaa..00000000000000000000000000000000 - <dependency> - <groupId>com.mojang</groupId> - <artifactId>datafixerupper</artifactId> -- <version>7.0.14</version> +- <version>8.0.16</version> - <scope>compile</scope> - </dependency> - <dependency> @@ -405,13 +405,13 @@ index 4fabd6c37587aa6a9af11566d64c6b49f5bfadaa..00000000000000000000000000000000 - <dependency> - <groupId>org.xerial</groupId> - <artifactId>sqlite-jdbc</artifactId> -- <version>3.45.3.0</version> +- <version>3.46.0.0</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>com.mysql</groupId> - <artifactId>mysql-connector-j</artifactId> -- <version>8.3.0</version> +- <version>8.4.0</version> - <scope>runtime</scope> - </dependency> - <!-- add these back in as they are not exposed by the API --> diff --git a/patches/unapplied/server/0002-Remap-fixes.patch b/patches/server/0002-Remap-fixes.patch index ff9ac65c3b..8a10b11f33 100644 --- a/patches/unapplied/server/0002-Remap-fixes.patch +++ b/patches/server/0002-Remap-fixes.patch @@ -5,10 +5,10 @@ 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 f0a764d3e1a756537b8188e9f5361d0dbaca25a9..478d2114fbd5c499a8adbf8b6cefcc8335e830dc 100644 +index 766006fe7ff965d6ca17df1df457ecc629b3be18..0ef1a7b2a17e81144d594f29f7b5e54d5038dcf4 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java -@@ -311,9 +311,11 @@ public class BlockPos extends Vec3i { +@@ -323,9 +323,11 @@ public class BlockPos extends Vec3i { public static Iterable<BlockPos> withinManhattan(BlockPos center, int rangeX, int rangeY, int rangeZ) { int i = rangeX + rangeY + rangeZ; @@ -23,7 +23,7 @@ index f0a764d3e1a756537b8188e9f5361d0dbaca25a9..478d2114fbd5c499a8adbf8b6cefcc83 return () -> new AbstractIterator<BlockPos>() { private final BlockPos.MutableBlockPos cursor = new BlockPos.MutableBlockPos(); private int currentDepth; -@@ -327,7 +329,7 @@ public class BlockPos extends Vec3i { +@@ -339,7 +341,7 @@ public class BlockPos extends Vec3i { protected BlockPos computeNext() { if (this.zMirror) { this.zMirror = false; @@ -32,7 +32,7 @@ index f0a764d3e1a756537b8188e9f5361d0dbaca25a9..478d2114fbd5c499a8adbf8b6cefcc83 return this.cursor; } else { BlockPos blockPos; -@@ -353,7 +355,7 @@ public class BlockPos extends Vec3i { +@@ -365,7 +367,7 @@ public class BlockPos extends Vec3i { int k = this.currentDepth - Math.abs(i) - Math.abs(j); if (k <= rangeZ) { this.zMirror = k != 0; @@ -59,10 +59,10 @@ index 7344cff32fa6fe3dedb74ed98126072c55b0abd2..d98b28e9488a5a7736719cf656736bb0 } else { entityliving1 = null; diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java b/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java -index 61592d57c26c359abda266f4ac8c58419e9beb02..83fce6746aaa3b378da6c5573ec9991d8438b071 100644 +index 9051f0186c09eeb8ecccf62b0116f6da1800a1df..b231f90317fe7df9133674b12d47873520b481cb 100644 --- a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java +++ b/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java -@@ -255,8 +255,8 @@ public class LootTable { +@@ -259,8 +259,8 @@ public class LootTable { public static class Builder implements FunctionUserBuilder<LootTable.Builder> { @@ -74,7 +74,7 @@ index 61592d57c26c359abda266f4ac8c58419e9beb02..83fce6746aaa3b378da6c5573ec9991d private Optional<ResourceLocation> randomSequence; diff --git a/src/test/java/org/bukkit/DyeColorsTest.java b/src/test/java/org/bukkit/DyeColorsTest.java -index b70450722da13bc4d358a70d3d1d2f30a2cca2b9..86d86c292bdeeb7f42685691287c3b4bd476ea14 100644 +index dfc3e4f5a5cfee0456097a44d579587719a231a7..4e1b6c009fe82e970a32dbdb564763c3f9081b2c 100644 --- a/src/test/java/org/bukkit/DyeColorsTest.java +++ b/src/test/java/org/bukkit/DyeColorsTest.java @@ -3,7 +3,6 @@ package org.bukkit; @@ -89,9 +89,9 @@ index b70450722da13bc4d358a70d3d1d2f30a2cca2b9..86d86c292bdeeb7f42685691287c3b4b @EnumSource(DyeColor.class) public void checkColor(DyeColor dye) { Color color = dye.getColor(); -- float[] nmsColorArray = DyeColor.byId(dye.getWoolData()).getTextureDiffuseColors(); -+ float[] nmsColorArray = net.minecraft.world.item.DyeColor.byId(dye.getWoolData()).getTextureDiffuseColors(); // Paper - remap fix - Color nmsColor = Color.fromRGB((int) (nmsColorArray[0] * 255), (int) (nmsColorArray[1] * 255), (int) (nmsColorArray[2] * 255)); +- int nmsColorArray = DyeColor.byId(dye.getWoolData()).getTextureDiffuseColor(); ++ int nmsColorArray = net.minecraft.world.item.DyeColor.byId(dye.getWoolData()).getTextureDiffuseColors(); // Paper - remap fix + Color nmsColor = Color.fromARGB(nmsColorArray); assertThat(color, is(nmsColor)); } @@ -23,7 +22,7 @@ public class DyeColorsTest extends AbstractTestingBase { diff --git a/patches/unapplied/server/0003-Build-system-changes.patch b/patches/server/0003-Build-system-changes.patch index d984c48298..3642230481 100644 --- a/patches/unapplied/server/0003-Build-system-changes.patch +++ b/patches/server/0003-Build-system-changes.patch @@ -9,7 +9,7 @@ public net.minecraft.server.packs.VanillaPackResourcesBuilder safeGetPath(Ljava/ Co-authored-by: Jake Potrebic <[email protected]> diff --git a/build.gradle.kts b/build.gradle.kts -index a457cf30d37037ce09fbe5d26e051b9555ce9982..9ca8ddea1d53076e0f23c6e3bf3e3eca5cceb393 100644 +index 9ea079d14a92367629dc8fb30d1be043c9290964..f276414e9e81abf8f1f80991ebd5ab43472e07b1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,9 +8,7 @@ plugins { @@ -22,7 +22,7 @@ index a457cf30d37037ce09fbe5d26e051b9555ce9982..9ca8ddea1d53076e0f23c6e3bf3e3eca + implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion implementation("org.ow2.asm:asm-commons:9.7") implementation("commons-lang:commons-lang:2.6") - runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") + runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") @@ -38,6 +36,7 @@ tasks.jar { val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim() val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" @@ -66,10 +66,10 @@ index a457cf30d37037ce09fbe5d26e051b9555ce9982..9ca8ddea1d53076e0f23c6e3bf3e3eca + jvmArgs("-DPaper.pushPaperAssetsRoot=true") } diff --git a/src/main/java/net/minecraft/resources/ResourceLocation.java b/src/main/java/net/minecraft/resources/ResourceLocation.java -index 0e93817621bad5d69cf0f9f839d033c47c861457..0ad6d9d417193248f6a9df67f1d1a66cef3ff122 100644 +index bfc8f152fa91dff1dcd5fd07fc067e8e5e480002..262660d115a5d5cbecfbae995955a24283e666b0 100644 --- a/src/main/java/net/minecraft/resources/ResourceLocation.java +++ b/src/main/java/net/minecraft/resources/ResourceLocation.java -@@ -32,6 +32,7 @@ public class ResourceLocation implements Comparable<ResourceLocation> { +@@ -32,6 +32,7 @@ public final class ResourceLocation implements Comparable<ResourceLocation> { public static final char NAMESPACE_SEPARATOR = ':'; public static final String DEFAULT_NAMESPACE = "minecraft"; public static final String REALMS_NAMESPACE = "realms"; @@ -98,7 +98,7 @@ index 14fc03563daea531314c7ceba56dbb47884010ee..fcf95958ef659c7aa8e28026961fa1d6 } diff --git a/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java b/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java -index a5e8713bc0fefae455b666ebf13c9529e7ba94e6..1a528e1aa7b12f8b8cffce6c7bc4b5d5865f026b 100644 +index feca36209fd2405fab70f564f63e627b8b78ac18..396ec10a76bdadbf5be2f0e15e88eed47619004d 100644 --- a/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java +++ b/src/main/java/net/minecraft/server/packs/repository/ServerPacksSource.java @@ -48,7 +48,7 @@ public class ServerPacksSource extends BuiltInPackSource { @@ -131,7 +131,7 @@ index a5e8713bc0fefae455b666ebf13c9529e7ba94e6..1a528e1aa7b12f8b8cffce6c7bc4b5d5 public static PackRepository createPackRepository(Path dataPacksPath, DirectoryValidator symlinkFinder) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 029783f07da0a8d91c2e443f76359b89869bc4cc..bebc3bcffa6dc12d4caf613f05b1e2a28a26f316 100644 +index 5595eb892fa868508c45448942da65d7c11d49fd..4b8602b168f9dd386aa72b4e5d189c441c93542e 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -210,7 +210,7 @@ public class Main { @@ -142,7 +142,7 @@ index 029783f07da0a8d91c2e443f76359b89869bc4cc..bebc3bcffa6dc12d4caf613f05b1e2a2 + 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, -21); + 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/unapplied/server/0004-Test-changes.patch b/patches/server/0004-Test-changes.patch index 06bde04693..1703d167cb 100644 --- a/patches/unapplied/server/0004-Test-changes.patch +++ b/patches/server/0004-Test-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Test changes diff --git a/build.gradle.kts b/build.gradle.kts -index 9ca8ddea1d53076e0f23c6e3bf3e3eca5cceb393..2f73e709dcde063ec7ca2181f2f2d5670fd479f5 100644 +index f276414e9e81abf8f1f80991ebd5ab43472e07b1..7a0f2391a464eeebc5e57856300bc000b8d35e52 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,6 +22,7 @@ dependencies { diff --git a/patches/unapplied/server/0005-Paper-config-files.patch b/patches/server/0005-Paper-config-files.patch index 74ccb05d8b..65cb89f76d 100644 --- a/patches/unapplied/server/0005-Paper-config-files.patch +++ b/patches/server/0005-Paper-config-files.patch @@ -15,7 +15,7 @@ public net.minecraft.server.dedicated.DedicatedServerProperties reload(Lnet/mine public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES diff --git a/build.gradle.kts b/build.gradle.kts -index 2f73e709dcde063ec7ca2181f2f2d5670fd479f5..18221614060ec945cb8b197acd276e45450f7394 100644 +index 7a0f2391a464eeebc5e57856300bc000b8d35e52..94dfc105b197c9eda481cbe90bb48b71c845e702 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,6 +10,7 @@ dependencies { @@ -24,8 +24,8 @@ index 2f73e709dcde063ec7ca2181f2f2d5670fd479f5..18221614060ec945cb8b197acd276e45 implementation("org.ow2.asm:asm-commons:9.7") + implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files implementation("commons-lang:commons-lang:2.6") - runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") - runtimeOnly("com.mysql:mysql-connector-j:8.3.0") + runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") + runtimeOnly("com.mysql:mysql-connector-j:8.4.0") diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..ef41cf3a7d1e6f2bfe81e0fb865d2f969bbc77c1 @@ -4911,10 +4911,10 @@ index b334265d4015fec13d7fedbffba2b6c22f4c8bc8..5b4ac7b4fd0077e900e9f788963f1613 String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4506669b1e970daa78974d22349e5dc38cf31c5e..c2c20eb7fedbadc56b1f8ee8bf4b03092e62a26b 100644 +index db2031ffbc802bd850ab40acaec2a9624b753f4c..299afe72a2fc2affca196f2fdfbf27e5533c51a6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -302,6 +302,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -309,6 +309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa private static final int SAMPLE_INTERVAL = 100; public final double[] recentTps = new double[ 3 ]; // Spigot end @@ -4922,7 +4922,7 @@ index 4506669b1e970daa78974d22349e5dc38cf31c5e..c2c20eb7fedbadc56b1f8ee8bf4b0309 public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { AtomicReference<S> atomicreference = new AtomicReference(); -@@ -398,6 +399,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -405,6 +406,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); // CraftBukkit end @@ -4971,10 +4971,10 @@ index dfbb04800d6f1dcbb909fcdfeb1ebf1a5efa6a48..5928e5f1934b8e247ba516595018ed5c @Nullable diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 277a66863f76d9a7bf59ca87553fc1d335fc73ca..1b5e2e07a7723f61d4c4d4e3141c60b2f63e2b69 100644 +index d3c7c1e016af5d04b5a18a6ced898cf4dc9b1700..cd26616aba6abd44abc5eb8b01cc96f29248aecd 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -196,6 +196,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -200,6 +200,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface org.spigotmc.SpigotConfig.init((java.io.File) this.options.valueOf("spigot-settings")); org.spigotmc.SpigotConfig.registerCommands(); // Spigot end @@ -4998,10 +4998,10 @@ index 6d89a5414f46a0c30badb4fcd25bc6cb6d18db3a..0ec3b546db0cf3858dd9cd9ea067d1d6 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index d7c5e872136d0452311b316c5703050c45960230..b84078f8105bccc40da0c14932ad3160c96d371c 100644 +index 63ad1280667a02e00f9c636193e38f933cad0185..a696a0d168987aaa4e59c471a23eeb48d683c1b2 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -241,7 +241,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -242,7 +242,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // Holder holder = worlddimension.type(); // CraftBukkit - decompile error // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error @@ -5011,10 +5011,10 @@ index d7c5e872136d0452311b316c5703050c45960230..b84078f8105bccc40da0c14932ad3160 this.convertable = convertable_conversionsession; this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile()); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index ecbb926986bbc0ad6fe108b782cdc17ee8a9f035..b06ffa8d5953c8f0a47daf056495cd424d9ac843 100644 +index e433037a03ffafabb952887ae3980e1d51411d4c..c061813d275fbc48d7629cc59d90dbb4c347516c 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -155,6 +155,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -156,6 +156,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>(); public boolean populating; public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot @@ -5027,7 +5027,7 @@ index ecbb926986bbc0ad6fe108b782cdc17ee8a9f035..b06ffa8d5953c8f0a47daf056495cd42 public final SpigotTimings.WorldTimingsHandler timings; // Spigot public static BlockPos lastPhysicsProblem; // Spigot -@@ -172,8 +178,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -173,8 +179,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public abstract ResourceKey<LevelStem> getTypeKey(); @@ -5039,10 +5039,10 @@ index ecbb926986bbc0ad6fe108b782cdc17ee8a9f035..b06ffa8d5953c8f0a47daf056495cd42 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 5b40c1198f4bbe84c5e1b45b32cce5c451fc28aa..4a4f7af9c7377e79a20398310ef7cf719d3cc0b5 100644 +index 6d1d3f9cf7451494af7c57d8bb1cd0ed25ea63e2..f1302dfb68bf8e4e1f4d8b084ad81422f65eecc4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -951,6 +951,7 @@ public final class CraftServer implements Server { +@@ -954,6 +954,7 @@ public final class CraftServer implements Server { } org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot @@ -5051,7 +5051,7 @@ index 5b40c1198f4bbe84c5e1b45b32cce5c451fc28aa..4a4f7af9c7377e79a20398310ef7cf71 world.serverLevelData.setDifficulty(config.difficulty); world.setSpawnSettings(config.spawnMonsters, config.spawnAnimals); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index bebc3bcffa6dc12d4caf613f05b1e2a28a26f316..bbc880e136c8fba9634fd4fee9e3e6838ef3f377 100644 +index 4b8602b168f9dd386aa72b4e5d189c441c93542e..1e3ca7ca98abfd5be233a7eeb6dad201776d2d6a 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -142,6 +142,19 @@ public class Main { @@ -5075,7 +5075,7 @@ index bebc3bcffa6dc12d4caf613f05b1e2a28a26f316..bbc880e136c8fba9634fd4fee9e3e683 }; diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 9658f2961d9b5632ad1abdba26a2443642624f69..38219af7d0ba2d871711102b6a29139a49678f6b 100644 +index 192b6fbd34b9b90112f869ae6e367ab9ba5a5906..08b0ca7b68bf238366f4d6904478852ecbe9394a 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -96,7 +96,7 @@ public class SpigotConfig diff --git a/patches/unapplied/server/0006-MC-Dev-fixes.patch b/patches/server/0006-MC-Dev-fixes.patch index 01e046d5cd..536a66afb3 100644 --- a/patches/unapplied/server/0006-MC-Dev-fixes.patch +++ b/patches/server/0006-MC-Dev-fixes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] MC Dev fixes diff --git a/src/main/java/net/minecraft/commands/arguments/item/ItemInput.java b/src/main/java/net/minecraft/commands/arguments/item/ItemInput.java -index a9617232c488a7a641b6657b265a5e42e77bc117..3d24fbca90bc7d8bdbac1be2176555c15ae75039 100644 +index 643bb8860962ad691b11073f6dbf406bf7ec5fb1..9b8ec1fd158f6e51779be263fd56b9119d0d9bbb 100644 --- a/src/main/java/net/minecraft/commands/arguments/item/ItemInput.java +++ b/src/main/java/net/minecraft/commands/arguments/item/ItemInput.java -@@ -68,6 +68,6 @@ public class ItemInput { +@@ -78,6 +78,6 @@ public class ItemInput { } private String getItemName() { @@ -17,10 +17,10 @@ index a9617232c488a7a641b6657b265a5e42e77bc117..3d24fbca90bc7d8bdbac1be2176555c1 } } diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index 478d2114fbd5c499a8adbf8b6cefcc8335e830dc..2074d4327f0c356c220f3a6a9761439e76a15fc3 100644 +index 0ef1a7b2a17e81144d594f29f7b5e54d5038dcf4..8994a381b05dcdd1163d2e7a0b63a8875b6063ed 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java -@@ -427,12 +427,12 @@ public class BlockPos extends Vec3i { +@@ -439,12 +439,12 @@ public class BlockPos extends Vec3i { if (this.index == l) { return this.endOfData(); } else { @@ -39,10 +39,10 @@ index 478d2114fbd5c499a8adbf8b6cefcc8335e830dc..2074d4327f0c356c220f3a6a9761439e } }; diff --git a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java -index 433b6673ea62d466c466c1ff3732041a8fcbb6b5..bc91370654f5da33cbfe7d42431568915c1159d6 100644 +index a467eb6b3b74cdb5378ff5f3043efbe6f4a6f06e..34b3b3251da21bce616870d312fd42fd58ba7881 100644 --- a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java +++ b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java -@@ -299,7 +299,7 @@ public class BuiltInRegistries { +@@ -317,7 +317,7 @@ public class BuiltInRegistries { Bootstrap.checkBootstrapCalled(() -> "registry " + key); ResourceLocation resourceLocation = key.location(); LOADERS.put(resourceLocation, () -> initializer.run(registry)); @@ -71,10 +71,10 @@ index a614e960fcd5958ad17b679eee8a8e6926f58e62..da101bca71f4710812621b98f0a0d8ca if (!this.hasElementSeparator()) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c2c20eb7fedbadc56b1f8ee8bf4b03092e62a26b..925c2c83191bdb70b0d14a6177183e4d9a190a97 100644 +index 299afe72a2fc2affca196f2fdfbf27e5533c51a6..40adb6117b9e0d5f70103113202a07715e403e2a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1924,7 +1924,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1952,7 +1952,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa PackRepository resourcepackrepository = this.packRepository; Objects.requireNonNull(this.packRepository); @@ -97,10 +97,10 @@ index 661a6274a800ca9b91bdb809d026972d23c3b263..ea72dcb064a35bc6245bc5c94d592efe public static <T> SortedArraySet<T> create(Comparator<T> comparator) { diff --git a/src/main/java/net/minecraft/world/entity/monster/Pillager.java b/src/main/java/net/minecraft/world/entity/monster/Pillager.java -index 328888db50c7ef7cae8305a6aa19d1af9a8c880d..ac411202c0029052a962b51b015da191b124de5f 100644 +index 8eb1aca72df0bca292473e90ecb74159db4fe034..4b4dcee6abe7a6db43638d04665125eec560496e 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Pillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Pillager.java -@@ -62,7 +62,7 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve +@@ -66,7 +66,7 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); diff --git a/patches/unapplied/server/0007-ConcurrentUtil.patch b/patches/server/0007-ConcurrentUtil.patch index b5d70f9b38..b5d70f9b38 100644 --- a/patches/unapplied/server/0007-ConcurrentUtil.patch +++ b/patches/server/0007-ConcurrentUtil.patch diff --git a/patches/unapplied/server/0008-CB-fixes.patch b/patches/server/0008-CB-fixes.patch index 1eb41bd9f6..285cc0ff21 100644 --- a/patches/unapplied/server/0008-CB-fixes.patch +++ b/patches/server/0008-CB-fixes.patch @@ -17,10 +17,10 @@ Subject: [PATCH] CB fixes Co-authored-by: Spottedleaf <[email protected]> diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index b84078f8105bccc40da0c14932ad3160c96d371c..c4bd9be9d1884be1f5040ff1417f44f8ac4b655f 100644 +index a696a0d168987aaa4e59c471a23eeb48d683c1b2..9d11fcb3df12182ae00ce73f7e30091fd199a341 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -302,7 +302,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -303,7 +303,7 @@ public class ServerLevel extends Level implements WorldGenLevel { long l = minecraftserver.getWorldData().worldGenOptions().seed(); @@ -52,10 +52,10 @@ index 0dc7f88877020bddd5a84db51d349f52b673048e..aae73586265593ee7830fb8dd5c2e3d7 RandomState noiseConfig, LevelHeightAccessor world, diff --git a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java -index 9b90649f71849b3830ca9b6a3c5a722c66b02f1f..209c6b64e79c29ea3bb84ddbe89a8bff66f81d0f 100644 +index 85c7f3027978b1d7d6c31b7ad21b3377cdda5925..e34deaf398dc6722c3128bdd6b9bc16da2d33bf7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftLootTable.java -@@ -197,4 +197,11 @@ public class CraftLootTable implements org.bukkit.loot.LootTable { +@@ -187,4 +187,11 @@ public class CraftLootTable implements org.bukkit.loot.LootTable { org.bukkit.loot.LootTable table = (org.bukkit.loot.LootTable) obj; return table.getKey().equals(this.getKey()); } @@ -68,10 +68,10 @@ index 9b90649f71849b3830ca9b6a3c5a722c66b02f1f..209c6b64e79c29ea3bb84ddbe89a8bff + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4a4f7af9c7377e79a20398310ef7cf719d3cc0b5..10549f2f4d6ae01c080cdba16c71656b764314c3 100644 +index f1302dfb68bf8e4e1f4d8b084ad81422f65eecc4..fe0f57dbeecc4b5a0c81863f33e41d11eb60943a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2506,7 +2506,13 @@ public final class CraftServer implements Server { +@@ -2514,7 +2514,13 @@ public final class CraftServer implements Server { Preconditions.checkArgument(key != null, "NamespacedKey key cannot be null"); ReloadableServerRegistries.Holder registry = this.getServer().reloadableRegistries(); @@ -87,7 +87,7 @@ index 4a4f7af9c7377e79a20398310ef7cf719d3cc0b5..10549f2f4d6ae01c080cdba16c71656b @Override diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index bbc880e136c8fba9634fd4fee9e3e6838ef3f377..e5f070de12b63487b71c54d8020a895e5eda862c 100644 +index 1e3ca7ca98abfd5be233a7eeb6dad201776d2d6a..9ec50bbb262b25fea157ae48e8395f5cd38f8906 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -123,6 +123,7 @@ public class Main { @@ -119,7 +119,7 @@ index 905adf97c0d1f0d1c774a6835a5dffcfea884e58..c017ce2ca1bc535795c958a2e509af2a public class CraftScheduler implements BukkitScheduler { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 8021fa01542a5dd203a834e88e286903093690cd..3879f1f69e13f4e90bd66c533bf76b257f041394 100644 +index 4c3c9c0e01ba8eeb9bd3f31cd795445cf03f8278..e08d4a45e313ef1b9005ef00ee0185a188171207 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -244,7 +244,7 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch index 6f20b1bad9..d437efd43b 100644 --- a/patches/unapplied/server/0009-MC-Utils.patch +++ b/patches/server/0009-MC-Utils.patch @@ -5937,7 +5937,7 @@ index 0000000000000000000000000000000000000000..d603887f4d0464f4463172fd79bcd529 + } +} diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java -index 2014fdb15c31b8d5ec520f9a39c973972ceb6060..9d91e7890d8cba72f0aa2ca9661f6de7ae8a0dcd 100644 +index 5135cd504ec5864a4603c004e748947a7d88d2b4..396f368a7e21a7c7b1630b4e20cdbc452c4b0f84 100644 --- a/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java @@ -133,7 +133,7 @@ public class Util { @@ -5974,7 +5974,7 @@ index 6b588a4e639da11edeb933ec2bc4afde8f0b47f1..1cbc42c44911b71dfadebc2d60e0e5cb return NbtUtils.loadUUID(this.get(key)); } diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 7de2bf05e9ab33ded7a6c49efe5e35a232153c2e..256a983c7345902600d52d7b7e3056162275f4c7 100644 +index 821de8e17031bf54edb61fc577d7c5a90aabfd2e..77985072928a1b892fb4f7dec1d0899324780082 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -121,6 +121,18 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -6074,10 +6074,10 @@ index 3e5a85a7ad6149b04622c254fbc2e174896a4128..3f662692ed4846e026a9d48595e7b3b2 + } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 925c2c83191bdb70b0d14a6177183e4d9a190a97..da3cc749b3b1f3738e7e7cd77fb0b0fd6eea0b0b 100644 +index 40adb6117b9e0d5f70103113202a07715e403e2a..b1325e090f2c7aff31d27fc38ca7173efe31ed7c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -303,6 +303,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -310,6 +310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public final double[] recentTps = new double[ 3 ]; // Spigot end public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files @@ -6085,7 +6085,7 @@ index 925c2c83191bdb70b0d14a6177183e4d9a190a97..da3cc749b3b1f3738e7e7cd77fb0b0fd public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { AtomicReference<S> atomicreference = new AtomicReference(); -@@ -966,6 +967,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -973,6 +974,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1); } // Spigot start @@ -6095,7 +6095,7 @@ index 925c2c83191bdb70b0d14a6177183e4d9a190a97..da3cc749b3b1f3738e7e7cd77fb0b0fd if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { MinecraftServer.LOGGER.info("Saving usercache.json"); this.getProfileCache().save(); -@@ -1039,6 +1043,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1046,6 +1050,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } } // Spigot start @@ -6103,7 +6103,7 @@ index 925c2c83191bdb70b0d14a6177183e4d9a190a97..da3cc749b3b1f3738e7e7cd77fb0b0fd if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 ) { long curTime = Util.getMillis(); -@@ -1309,7 +1314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1337,7 +1342,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa MinecraftServer.LOGGER.debug("Autosave finished"); SpigotTimings.worldSaveTimer.stopTiming(); // Spigot } @@ -6112,7 +6112,7 @@ index 925c2c83191bdb70b0d14a6177183e4d9a190a97..da3cc749b3b1f3738e7e7cd77fb0b0fd this.profiler.push("tallying"); long j = Util.getNanos() - i; int k = this.tickCount % 100; -@@ -1442,6 +1447,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1470,6 +1475,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa try { worldserver.timings.doTick.startTiming(); // Spigot worldserver.tick(shouldKeepTicking); @@ -6125,12 +6125,12 @@ index 925c2c83191bdb70b0d14a6177183e4d9a190a97..da3cc749b3b1f3738e7e7cd77fb0b0fd } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world"); diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f843624ea 100644 +index 5d4336210e11ee39521b4096a5f0874329053cdc..526d5b9bd6ce8eade59d3d3cf8bd7ad700483eff 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java -@@ -48,9 +48,9 @@ public class ChunkHolder { - private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList(); - private final AtomicReferenceArray<CompletableFuture<ChunkResult<ChunkAccess>>> futures; +@@ -37,9 +37,9 @@ public class ChunkHolder extends GenerationChunkHolder { + public static final ChunkResult<LevelChunk> UNLOADED_LEVEL_CHUNK = ChunkResult.error("Unloaded level chunk"); + private static final CompletableFuture<ChunkResult<LevelChunk>> UNLOADED_LEVEL_CHUNK_FUTURE = CompletableFuture.completedFuture(ChunkHolder.UNLOADED_LEVEL_CHUNK); private final LevelHeightAccessor levelHeightAccessor; - private volatile CompletableFuture<ChunkResult<LevelChunk>> fullChunkFuture; - private volatile CompletableFuture<ChunkResult<LevelChunk>> tickingChunkFuture; @@ -6138,12 +6138,12 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f + private volatile CompletableFuture<ChunkResult<LevelChunk>> fullChunkFuture; private int fullChunkCreateCount; private volatile boolean isFullChunkReady; // Paper - cache chunk ticking stage + private volatile CompletableFuture<ChunkResult<LevelChunk>> tickingChunkFuture; private volatile boolean isTickingReady; // Paper - cache chunk ticking stage + private volatile CompletableFuture<ChunkResult<LevelChunk>> entityTickingChunkFuture; private volatile boolean isEntityTickingReady; // Paper - cache chunk ticking stage - private CompletableFuture<ChunkAccess> chunkToSave; - @Nullable - private final DebugBuffer<ChunkHolder.ChunkSaveDebug> chunkToSaveHistory; -@@ -69,6 +69,18 @@ public class ChunkHolder { - private CompletableFuture<Void> pendingFullStateConfirmation; + public int oldTicketLevel; + private int ticketLevel; + private int queueLevel; +@@ -55,6 +55,18 @@ public class ChunkHolder extends GenerationChunkHolder { private CompletableFuture<?> sendSync; + private CompletableFuture<?> saveSync; + private final ChunkMap chunkMap; // Paper + @@ -6158,9 +6158,9 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f + // Paper end + public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) { - this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size()); + super(pos); this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; -@@ -90,8 +102,23 @@ public class ChunkHolder { +@@ -74,8 +86,23 @@ public class ChunkHolder extends GenerationChunkHolder { this.queueLevel = this.oldTicketLevel; this.setTicketLevel(level); this.changedBlocksPerSection = new ShortSet[world.getSectionsCount()]; @@ -6183,10 +6183,10 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f + // Paper end // CraftBukkit start public LevelChunk getFullChunkNow() { - // Note: We use the oldTicketLevel for isLoaded checks. -@@ -116,20 +143,20 @@ public class ChunkHolder { - return ChunkLevel.generationStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE; + return (LevelChunk) this.getChunkIfPresent(ChunkStatus.FULL); +@@ -86,20 +113,20 @@ public class ChunkHolder extends GenerationChunkHolder { } + // CraftBukkit end - public CompletableFuture<ChunkResult<LevelChunk>> getTickingChunkFuture() { + public final CompletableFuture<ChunkResult<LevelChunk>> getTickingChunkFuture() { // Paper - final for inline @@ -6209,8 +6209,8 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f return (LevelChunk) ((ChunkResult) this.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).orElse(null); // CraftBukkit - decompile error } -@@ -156,6 +183,21 @@ public class ChunkHolder { - return null; +@@ -123,6 +150,21 @@ public class ChunkHolder extends GenerationChunkHolder { + } + // Paper start @@ -6228,39 +6228,25 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f + } + // Paper end + - @Nullable - public ChunkAccess getLastAvailable() { - for (int i = ChunkHolder.CHUNK_STATUSES.size() - 1; i >= 0; --i) { -@@ -174,7 +216,7 @@ public class ChunkHolder { - return null; - } - -- public CompletableFuture<ChunkAccess> getChunkToSave() { -+ public final CompletableFuture<ChunkAccess> getChunkToSave() { // Paper - final for inline - return this.chunkToSave; - } - -@@ -366,11 +408,11 @@ public class ChunkHolder { - return ChunkLevel.fullStatus(this.ticketLevel); + public CompletableFuture<?> getSaveSyncFuture() { + return this.saveSync; } - -- public ChunkPos getPos() { -+ public final ChunkPos getPos() { // Paper - final for inline - return this.pos; +@@ -266,7 +308,7 @@ public class ChunkHolder extends GenerationChunkHolder { } + @Override - public int getTicketLevel() { + public final int getTicketLevel() { // Paper - final for inline return this.ticketLevel; } -@@ -457,14 +499,31 @@ public class ChunkHolder { +@@ -335,12 +377,28 @@ public class ChunkHolder extends GenerationChunkHolder { - this.wasAccessibleSinceLastSave |= flag3; - if (!flag2 && flag3) { + this.wasAccessibleSinceLastSave |= flag1; + if (!flag && flag1) { + int expectCreateCount = ++this.fullChunkCreateCount; // Paper - this.fullChunkFuture = chunkStorage.prepareAccessibleChunk(this); - this.scheduleFullChunkPromotion(chunkStorage, this.fullChunkFuture, executor, FullChunkStatus.FULL); + this.fullChunkFuture = chunkLoadingManager.prepareAccessibleChunk(this); + this.scheduleFullChunkPromotion(chunkLoadingManager, this.fullChunkFuture, executor, FullChunkStatus.FULL); + // Paper start - cache ticking ready status + this.fullChunkFuture.thenAccept(chunkResult -> { + chunkResult.ifSuccess(chunk -> { @@ -6270,10 +6256,11 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f + } + }); + }); - this.updateChunkToSave(this.fullChunkFuture, "full"); ++ // Paper end - cache ticking ready status + this.addSaveDependency(this.fullChunkFuture); } - if (flag2 && !flag3) { + if (flag && !flag1) { + // Paper start + if (this.isFullChunkReady) { + io.papermc.paper.chunk.system.ChunkSystem.onChunkNotBorder(this.fullChunkFuture.join().orElseThrow(IllegalStateException::new), this); // Paper @@ -6281,15 +6268,11 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f + // Paper end this.fullChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; -+ ++this.fullChunkCreateCount; // Paper - cache ticking ready status -+ this.isFullChunkReady = false; // Paper - cache ticking ready status } - - boolean flag4 = fullchunkstatus.isOrAfter(FullChunkStatus.BLOCK_TICKING); -@@ -473,11 +532,25 @@ public class ChunkHolder { - if (!flag4 && flag5) { - this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this); - this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, FullChunkStatus.BLOCK_TICKING); +@@ -351,11 +409,25 @@ public class ChunkHolder extends GenerationChunkHolder { + if (!flag2 && flag3) { + this.tickingChunkFuture = chunkLoadingManager.prepareTickingChunk(this); + this.scheduleFullChunkPromotion(chunkLoadingManager, this.tickingChunkFuture, executor, FullChunkStatus.BLOCK_TICKING); + // Paper start - cache ticking ready status + this.tickingChunkFuture.thenAccept(chunkResult -> { + chunkResult.ifSuccess(chunk -> { @@ -6299,10 +6282,10 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f + }); + }); + // Paper end - this.updateChunkToSave(this.tickingChunkFuture, "ticking"); + this.addSaveDependency(this.tickingChunkFuture); } - if (flag4 && !flag5) { + if (flag2 && !flag3) { - this.tickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); + // Paper start + if (this.isTickingReady) { @@ -6313,10 +6296,10 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f this.tickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; } -@@ -491,11 +564,24 @@ public class ChunkHolder { +@@ -369,11 +441,24 @@ public class ChunkHolder extends GenerationChunkHolder { - this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this); - this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, FullChunkStatus.ENTITY_TICKING); + this.entityTickingChunkFuture = chunkLoadingManager.prepareEntityTickingChunk(this); + this.scheduleFullChunkPromotion(chunkLoadingManager, this.entityTickingChunkFuture, executor, FullChunkStatus.ENTITY_TICKING); + // Paper start - cache ticking ready status + this.entityTickingChunkFuture.thenAccept(chunkResult -> { + chunkResult.ifSuccess(chunk -> { @@ -6325,10 +6308,10 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f + }); + }); + // Paper end - this.updateChunkToSave(this.entityTickingChunkFuture, "entity ticking"); + this.addSaveDependency(this.entityTickingChunkFuture); } - if (flag6 && !flag7) { + if (flag4 && !flag5) { - this.entityTickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); + // Paper start + if (this.isEntityTickingReady) { @@ -6339,9 +6322,9 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f this.entityTickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; } -@@ -575,4 +661,18 @@ public class ChunkHolder { - private static record ChunkSaveDebug(Thread thread, CompletableFuture<?> future, String source) { +@@ -423,4 +508,18 @@ public class ChunkHolder extends GenerationChunkHolder { + List<ServerPlayer> getPlayers(ChunkPos chunkPos, boolean onlyOnWatchDistanceEdge); } + + // Paper start @@ -6359,10 +6342,10 @@ index 2119fc6f72461199ae8969ab0d9b8fab26d775a8..b12921579cb9ab3cbf5607841cc84f2f + // 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 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc212aec02c6 100644 +index 419a27a8bdc8adfeb6ea89e3bfe1838a80d75a33..ce0d22452171857e3cf070bf01450a7653ec7142 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -171,6 +171,62 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -170,6 +170,62 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }; // CraftBukkit end @@ -6425,10 +6408,10 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) { super(new RegionStorageInfo(session.getLevelId(), world.dimension(), "chunk"), session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); this.visibleChunkMap = this.updatingChunkMap.clone(); -@@ -223,7 +279,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - this.poiManager = new PoiManager(new RegionStorageInfo(session.getLevelId(), world.dimension(), "poi"), path.resolve("poi"), dataFixer, dsync, iregistrycustom, world); +@@ -221,8 +277,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + this.poiManager = new PoiManager(new RegionStorageInfo(session.getLevelId(), world.dimension(), "poi"), path.resolve("poi"), dataFixer, dsync, iregistrycustom, world.getServer(), world); this.setServerViewDistance(viewDistance); - this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine); + this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine, this.mainThreadMailbox); + // Paper start + this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new); + this.regionManagers.add(this.dataRegionManager); @@ -6441,22 +6424,16 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 + public final io.papermc.paper.util.player.NearbyPlayers getNearbyPlayers() { + return this.nearbyPlayers; } -+ // Paper end - - protected ChunkGenerator generator() { - return this.generator; -@@ -249,6 +317,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - }); - } + public int getMobCountNear(final ServerPlayer player, final net.minecraft.world.entity.MobCategory mobCategory) { + return -1; + } ++ // Paper end + - private static double euclideanDistanceSquared(ChunkPos pos, Entity entity) { - double d0 = (double) SectionPos.sectionToBlockCoord(pos.x, 8); - double d1 = (double) SectionPos.sectionToBlockCoord(pos.z, 8); -@@ -417,9 +489,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + protected ChunkGenerator generator() { + return this.worldGenContext.generator(); + } +@@ -378,9 +450,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }; stringbuilder.append("Updating:").append(System.lineSeparator()); @@ -6468,7 +6445,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 CrashReport crashreport = CrashReport.forThrowable(exception, "Chunk loading"); CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Chunk loading"); -@@ -461,8 +533,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -422,8 +494,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider holder.setTicketLevel(level); } else { holder = new ChunkHolder(new ChunkPos(pos), level, this.level, this.lightEngine, this.queueSorter, this); @@ -6483,7 +6460,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 this.updatingChunkMap.put(pos, holder); this.modified = true; } -@@ -484,7 +562,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -445,7 +523,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider protected void saveAllChunks(boolean flush) { if (flush) { @@ -6492,7 +6469,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 MutableBoolean mutableboolean = new MutableBoolean(); do { -@@ -513,7 +591,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -468,7 +546,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }); this.flushWorker(); } else { @@ -6501,7 +6478,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 } } -@@ -532,7 +610,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -487,7 +565,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public boolean hasWork() { @@ -6510,15 +6487,15 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 } private void processUnloads(BooleanSupplier shouldKeepTicking) { -@@ -543,6 +621,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - ChunkHolder playerchunk = (ChunkHolder) this.updatingChunkMap.remove(j); +@@ -504,6 +582,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + } - if (playerchunk != null) { + this.updatingChunkMap.remove(j); + playerchunk.onChunkRemove(); // Paper this.pendingUnloads.put(j, playerchunk); this.modified = true; ++i; -@@ -560,7 +639,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -523,7 +602,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } int l = 0; @@ -6527,20 +6504,20 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) { if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) { -@@ -578,7 +657,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - if (completablefuture1 != completablefuture) { - this.scheduleUnload(pos, holder); +@@ -541,7 +620,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } else { + ChunkAccess ichunkaccess = holder.getLatestChunk(); + - if (this.pendingUnloads.remove(pos, holder) && ichunkaccess != null) { + // Paper start + boolean removed; + if ((removed = this.pendingUnloads.remove(pos, holder)) && ichunkaccess != null) { + io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderDelete(this.level, holder); + // Paper end + LevelChunk chunk; + if (ichunkaccess instanceof LevelChunk) { - ((LevelChunk) ichunkaccess).setLoaded(false); - } -@@ -594,7 +677,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -559,7 +642,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.lightEngine.tryScheduleUpdate(); this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null); this.chunkSaveCooldowns.remove(ichunkaccess.getPos().toLong()); @@ -6551,7 +6528,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 } }; -@@ -1016,7 +1101,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -896,7 +981,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } @@ -6560,7 +6537,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 int j = Mth.clamp(watchDistance, 2, 32); if (j != this.serverViewDistance) { -@@ -1033,7 +1118,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -913,7 +998,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } @@ -6569,7 +6546,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 return Mth.clamp(player.requestedViewDistance(), 2, this.serverViewDistance); } -@@ -1062,7 +1147,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -942,7 +1027,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public int size() { @@ -6578,7 +6555,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 } public DistanceManager getDistanceManager() { -@@ -1070,19 +1155,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -950,19 +1035,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } protected Iterable<ChunkHolder> getChunks() { @@ -6599,11 +6576,11 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 + long i = playerchunk.pos.toLong(); // Paper ChunkPos chunkcoordintpair = new ChunkPos(i); - ChunkHolder playerchunk = (ChunkHolder) entry.getValue(); -+ // Paper - Optional<ChunkAccess> optional = Optional.ofNullable(playerchunk.getLastAvailable()); ++ // Paper - move up + Optional<ChunkAccess> optional = Optional.ofNullable(playerchunk.getLatestChunk()); Optional<LevelChunk> optional1 = optional.flatMap((ichunkaccess) -> { return ichunkaccess instanceof LevelChunk ? Optional.of((LevelChunk) ichunkaccess) : Optional.empty(); -@@ -1203,6 +1288,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1083,6 +1168,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider player.setChunkTrackingView(ChunkTrackingView.EMPTY); this.updateChunkTracking(player); @@ -6611,7 +6588,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 } else { SectionPos sectionposition = player.getLastSectionPos(); -@@ -1211,6 +1297,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1091,6 +1177,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.distanceManager.removePlayer(sectionposition, player); } @@ -6619,7 +6596,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 this.applyChunkTrackingView(player, ChunkTrackingView.EMPTY); } -@@ -1262,6 +1349,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1142,6 +1229,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.updateChunkTracking(player); } @@ -6627,7 +6604,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 } private void updateChunkTracking(ServerPlayer player) { -@@ -1505,10 +1593,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1385,10 +1473,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }); } @@ -6641,7 +6618,7 @@ index 49fefb67a51ef4b27598ff15a30f24e511b49cc3..e53b68f91183c8abcc9a0f7d97adfc21 @Override diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java -index 7a604df2cec802f7da78935647990fe8b575307b..e8640bcbc1d4e2965049974385585f5060cb6a44 100644 +index b6cc33943fe7e4667944f3e6f868b3033ea9ca18..27065ffc5473c518acee3a3096b83fac61eb7860 100644 --- a/src/main/java/net/minecraft/server/level/DistanceManager.java +++ b/src/main/java/net/minecraft/server/level/DistanceManager.java @@ -55,8 +55,9 @@ public abstract class DistanceManager { @@ -6663,20 +6640,20 @@ index 7a604df2cec802f7da78935647990fe8b575307b..e8640bcbc1d4e2965049974385585f50 } protected void purgeStaleTickets() { -@@ -377,7 +379,7 @@ public abstract class DistanceManager { +@@ -365,7 +367,7 @@ public abstract class DistanceManager { } public void removeTicketsOnClosing() { -- ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT); -+ ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve +- ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT); ++ ImmutableSet<TicketType<?>> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve ObjectIterator<Entry<SortedArraySet<Ticket<?>>>> objectiterator = this.tickets.long2ObjectEntrySet().fastIterator(); while (objectiterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 87e76f3c9f5185ee15a80eed37f72b0f376b00e5..712670230b6b881101b4128c1d275f2559fa705a 100644 +index 47ae79cb2a03b43cbb881bcdea7ca231082b6614..ff68eff051c5f50b20b26d33001e12741dd3000e 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -47,6 +47,7 @@ import net.minecraft.world.level.storage.LevelStorageSource; +@@ -48,6 +48,7 @@ import net.minecraft.world.level.storage.LevelStorageSource; public class ServerChunkCache extends ChunkSource { @@ -6684,7 +6661,7 @@ index 87e76f3c9f5185ee15a80eed37f72b0f376b00e5..712670230b6b881101b4128c1d275f25 private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList(); private final DistanceManager distanceManager; final ServerLevel level; -@@ -65,6 +66,14 @@ public class ServerChunkCache extends ChunkSource { +@@ -66,6 +67,14 @@ public class ServerChunkCache extends ChunkSource { @Nullable @VisibleForDebug private NaturalSpawner.SpawnState lastSpawnState; @@ -6699,7 +6676,7 @@ index 87e76f3c9f5185ee15a80eed37f72b0f376b00e5..712670230b6b881101b4128c1d275f25 public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory) { this.level = world; -@@ -90,6 +99,124 @@ public class ServerChunkCache extends ChunkSource { +@@ -91,6 +100,124 @@ public class ServerChunkCache extends ChunkSource { return chunk.getFullChunkNow() != null; } // CraftBukkit end @@ -6824,7 +6801,7 @@ index 87e76f3c9f5185ee15a80eed37f72b0f376b00e5..712670230b6b881101b4128c1d275f25 @Override public ThreadedLevelLightEngine getLightEngine() { -@@ -310,7 +437,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -286,7 +413,7 @@ public class ServerChunkCache extends ChunkSource { return this.mainThreadProcessor.pollTask(); } @@ -6833,7 +6810,7 @@ index 87e76f3c9f5185ee15a80eed37f72b0f376b00e5..712670230b6b881101b4128c1d275f25 boolean flag = this.distanceManager.runAllUpdates(this.chunkMap); boolean flag1 = this.chunkMap.promoteChunkMap(); -@@ -322,6 +449,12 @@ public class ServerChunkCache extends ChunkSource { +@@ -299,6 +426,12 @@ public class ServerChunkCache extends ChunkSource { } } @@ -6847,10 +6824,10 @@ index 87e76f3c9f5185ee15a80eed37f72b0f376b00e5..712670230b6b881101b4128c1d275f25 ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c4bd9be9d1884be1f5040ff1417f44f8ac4b655f..319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b 100644 +index 9d11fcb3df12182ae00ce73f7e30091fd199a341..eea8bafd98e3a8d82b3216488537ab898cc4ae7a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -235,6 +235,98 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -236,6 +236,98 @@ public class ServerLevel extends Level implements WorldGenLevel { return this.convertable.dimensionType; } @@ -6950,10 +6927,10 @@ index c4bd9be9d1884be1f5040ff1417f44f8ac4b655f..319cb644c0a42e9cc0d3ce9d1cbaa93b public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { // IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index adccf79524d8a1003e2e700274b2e1b3353d9daf..a1d4d3a66c48abdddd2bcdd957417f81290c7a6e 100644 +index e2eb76e8993dd556606b5bb38814fe848fbf01a6..5f8adf662e5ab9114e2891cfacb8db5d4d40a297 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -276,6 +276,8 @@ public class ServerPlayer extends Player { +@@ -280,6 +280,8 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { public boolean sentListPacket = false; public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent // CraftBukkit end @@ -6962,7 +6939,7 @@ index adccf79524d8a1003e2e700274b2e1b3353d9daf..a1d4d3a66c48abdddd2bcdd957417f81 public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); -@@ -344,6 +346,8 @@ public class ServerPlayer extends Player { +@@ -349,6 +351,8 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { this.updateOptions(clientOptions); this.object = null; @@ -6972,7 +6949,7 @@ index adccf79524d8a1003e2e700274b2e1b3353d9daf..a1d4d3a66c48abdddd2bcdd957417f81 this.displayName = this.getScoreboardName(); this.bukkitPickUpLoot = true; diff --git a/src/main/java/net/minecraft/server/level/TicketType.java b/src/main/java/net/minecraft/server/level/TicketType.java -index 3a4f026c73cdd22d30bdadabbcf24bef969b73e4..0d536d72ac918fbd403397ff369d10143ee9c204 100644 +index 045b754b5b70bbd1e7732ad2142dfadd6cc2305c..f56e5c0f53f9b52a9247b9be9265b949494fc924 100644 --- a/src/main/java/net/minecraft/server/level/TicketType.java +++ b/src/main/java/net/minecraft/server/level/TicketType.java @@ -7,6 +7,7 @@ import net.minecraft.util.Unit; @@ -6984,11 +6961,11 @@ index 3a4f026c73cdd22d30bdadabbcf24bef969b73e4..0d536d72ac918fbd403397ff369d1014 private final String name; private final Comparator<T> comparator; diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index 7cc559730325a18953d7cb75ed252aefa379c324..744efc6cdc99f653a1eb9d4f26af8a7c34627f5e 100644 +index 7d69da7e761ccfe736656e8c89dd1ae08956695f..421f146ea9c35b852251c0ddb29856c13e11aef3 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -@@ -168,6 +168,26 @@ public class WorldGenRegion implements WorldGenLevel { - return chunkX >= this.firstPos.x && chunkX <= this.lastPos.x && chunkZ >= this.firstPos.z && chunkZ <= this.lastPos.z; +@@ -169,6 +169,26 @@ public class WorldGenRegion implements WorldGenLevel { + return k < this.generatingStep.directDependencies().size(); } + // Paper start - if loaded util @@ -7015,7 +6992,7 @@ index 7cc559730325a18953d7cb75ed252aefa379c324..744efc6cdc99f653a1eb9d4f26af8a7c 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/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index aef7c373261bc150a19fa642bb9c5dc7ae1d7f53..54fee00a462c2f6fcc567d762b1afd24cf5c7d06 100644 +index 0914b2f9fef1f49df9f0ce7c85cdde94c2c39b6c..6abe921099ff00ecfaf0f423ef27d708420f6f48 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -180,6 +180,7 @@ public abstract class PlayerList { @@ -7045,10 +7022,10 @@ index aede9b65e799a1f123f71f9390fb05acddda676b..2510589400b3012b827efcab477c6483 @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 b64ec67ebd3b30d29cca36086a7aa70a6dd1fac3..cc3304e2ea7f58b4649da09b68ac3749bad08b00 100644 +index 687c0683ee5b3366d936a178fb4bf9faffc2a556..6041033b3ea201bde1a73ce4e429e8b80e05e2eb 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -333,6 +333,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -339,6 +339,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return this.level.hasChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4); } // CraftBukkit end @@ -7061,10 +7038,10 @@ index b64ec67ebd3b30d29cca36086a7aa70a6dd1fac3..cc3304e2ea7f58b4649da09b68ac3749 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 20ad73994af8e4a25a60662a7ccb549d5704fab3..a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e 100644 +index 791c647de951f996f25bcc4418a6e820ab0512c9..9deb6b90f3c4281280deb2f609a55923147a675a 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -270,6 +270,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -282,6 +282,7 @@ public abstract class LivingEntity extends Entity implements Attackable { public boolean collides = true; public Set<UUID> collidableExemptions = new HashSet<>(); public boolean bukkitPickUpLoot; @@ -7073,10 +7050,10 @@ index 20ad73994af8e4a25a60662a7ccb549d5704fab3..a3ebdbb231fb7bc6ed24747105ef02bb @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 1e599ab9c9576a42b32533abbd021f32223e53a2..d615649c67b54cfd1cb083e3ddb9719255e90bc7 100644 +index 930b5002aa6eaa1137314f7b38fad99778b6edaa..fcc8b66702f761c443fb647a8ab6e1ab49e5acfe 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -287,6 +287,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -282,6 +282,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab return this.target; } @@ -7086,7 +7063,7 @@ index 1e599ab9c9576a42b32533abbd021f32223e53a2..d615649c67b54cfd1cb083e3ddb97192 protected final LivingEntity getTargetFromBrain() { return (LivingEntity) this.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java -index 566c28169c68a9699ddba3fdd37edfd1bae64fe4..5e2f10f5fd7219ebaefb1c5b5ac9bc7c71fae179 100644 +index 812aecb88641c09fb5030d145620b95aff19c9cb..bd8d56aa5a3557e7a2aa1dd066b27c2054d1eef8 100644 --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java +++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java @@ -22,6 +22,8 @@ public abstract class PathfinderMob extends Mob { @@ -7111,10 +7088,10 @@ index f73604d762efbac400d40f536ec1782fca584efa..4701bf9ee203f2f15b0b68e84bbfa2c4 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 12516ac7c18a90d12e0d9ec90448ebb64a468766..d7f427bf5c84d1bb405e4aaf16e3a8f1fed5ad79 100644 +index 15f0b0977fe7b41e29346df9d49120f14f02ea43..b6cb1de08e955dfc99a0cb736b2ed456c99fde5c 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -952,6 +952,25 @@ public final class ItemStack implements DataComponentHolder { +@@ -953,6 +953,25 @@ public final class ItemStack implements DataComponentHolder { } } @@ -7140,7 +7117,7 @@ index 12516ac7c18a90d12e0d9ec90448ebb64a468766..d7f427bf5c84d1bb405e4aaf16e3a8f1 public void applyComponents(DataComponentPatch changes) { this.components.applyPatch(changes); this.getItem().verifyComponentsAfterLoad(this); -@@ -1205,6 +1224,7 @@ public final class ItemStack implements DataComponentHolder { +@@ -1219,6 +1238,7 @@ public final class ItemStack implements DataComponentHolder { // CraftBukkit start @Deprecated public void setItem(Item item) { @@ -7177,7 +7154,7 @@ index 1c71d2c1b16bdba1e14a8230787e4cb4ad530163..d6d8bbc98fc71997cb52521d59ebb59d FluidState getFluidState(BlockPos pos); diff --git a/src/main/java/net/minecraft/world/level/ChunkPos.java b/src/main/java/net/minecraft/world/level/ChunkPos.java -index 4cea6b4cad66d26a0fc66d06fa73af1eaf01b146..54cd046587c2f9dd26204bfa4eb65b8ad52b2d5e 100644 +index 171c9c4ab2d1a7988935e09b49286f30e36741e2..fa58eeec2b652f0fa251eedf11cfabde5fd3198b 100644 --- a/src/main/java/net/minecraft/world/level/ChunkPos.java +++ b/src/main/java/net/minecraft/world/level/ChunkPos.java @@ -20,6 +20,7 @@ public class ChunkPos { @@ -7241,10 +7218,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 b06ffa8d5953c8f0a47daf056495cd424d9ac843..68715d9fd69addad07384efa10eeb09bc78c1e28 100644 +index c061813d275fbc48d7629cc59d90dbb4c347516c..55b30e1df4a05802977b0c3f3b518ef0676eae2d 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -94,6 +94,7 @@ import org.bukkit.craftbukkit.CraftServer; +@@ -95,6 +95,7 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.SpigotTimings; // Spigot import org.bukkit.craftbukkit.block.CapturedBlockState; @@ -7252,7 +7229,7 @@ index b06ffa8d5953c8f0a47daf056495cd424d9ac843..68715d9fd69addad07384efa10eeb09b import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.util.CraftSpawnCategory; import org.bukkit.entity.SpawnCategory; -@@ -273,6 +274,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -274,6 +275,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return null; } @@ -7266,7 +7243,7 @@ index b06ffa8d5953c8f0a47daf056495cd424d9ac843..68715d9fd69addad07384efa10eeb09b public boolean isInWorldBounds(BlockPos pos) { return !this.isOutsideBuildHeight(pos) && Level.isInWorldBoundsHorizontal(pos); } -@@ -289,18 +297,52 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -290,18 +298,52 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return y < -20000000 || y >= 20000000; } @@ -7323,7 +7300,7 @@ index b06ffa8d5953c8f0a47daf056495cd424d9ac843..68715d9fd69addad07384efa10eeb09b ChunkAccess ichunkaccess = this.getChunkSource().getChunk(chunkX, chunkZ, leastStatus, create); if (ichunkaccess == null && create) { -@@ -311,7 +353,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -312,7 +354,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } @Override @@ -7332,7 +7309,7 @@ index b06ffa8d5953c8f0a47daf056495cd424d9ac843..68715d9fd69addad07384efa10eeb09b return this.setBlock(pos, state, flags, 512); } -@@ -550,7 +592,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -551,7 +593,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if (this.isOutsideBuildHeight(pos)) { return Blocks.VOID_AIR.defaultBlockState(); } else { @@ -7408,10 +7385,10 @@ index 497792978bdf0e6a53d772304770e8df3e7416ea..c5454b92ca2565461c799d7340160f9f 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 295f5d34fbc39016807274d7f5b841f3e1f9919f..e8815210405152696a9f7ddae64f87ff456fa9bd 100644 +index 9569d9d1c8f809420e08038e5bc38c2c7887ff90..4ac248f9f5f4f7aa95ddd6e3c3dab1ce94e73d66 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 -@@ -828,12 +828,20 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -834,12 +834,20 @@ public abstract class BlockBehaviour implements FeatureElement { } } @@ -7432,7 +7409,7 @@ index 295f5d34fbc39016807274d7f5b841f3e1f9919f..e8815210405152696a9f7ddae64f87ff this.legacySolid = this.calculateSolid(); } -@@ -880,8 +888,8 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -886,8 +894,8 @@ public abstract class BlockBehaviour implements FeatureElement { return this.getBlock().getOcclusionShape(this.asState(), world, pos); } @@ -7444,7 +7421,7 @@ index 295f5d34fbc39016807274d7f5b841f3e1f9919f..e8815210405152696a9f7ddae64f87ff 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 75cfa73a6a32d9e1f5c07af4af6e16e66c993968..f4e3bd2ae4f63e6d3d25463a3635b8f89fecc068 100644 +index 35c4bf87870c0dfa1f648547115238dacbb87426..db4d95ce98eb1490d5306d1f74b282d27264871a 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java @@ -65,7 +65,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom @@ -7467,7 +7444,7 @@ index 75cfa73a6a32d9e1f5c07af4af6e16e66c993968..f4e3bd2ae4f63e6d3d25463a3635b8f8 this.levelHeightAccessor = heightLimitView; this.sections = new LevelChunkSection[heightLimitView.getSectionsCount()]; 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 ca0991b07def35b4697ba6d5569bf9a080e48a1c..2ee1658532cb00d7bcd1d11e03f19d21ca7f2a9e 100644 +index a52077f0d93c94b0ea644bc14b9b28e84fd1b154..dcc0acd259920463a4464213b9a5e793603852f9 100644 --- a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java @@ -25,6 +25,12 @@ public class EmptyLevelChunk extends LevelChunk { @@ -7484,7 +7461,7 @@ index ca0991b07def35b4697ba6d5569bf9a080e48a1c..2ee1658532cb00d7bcd1d11e03f19d21 @Nullable @Override 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 3978407cf96c0eb527c16f161af570a2bf030631..bb0f16aef406bdc627e1263859dd4637bec90c63 100644 +index b537e7a079497db428db405edfccde74f32f4208..7898e1aaf82f096fa74bd3f5859f0f4303ea677f 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -116,6 +116,109 @@ public class LevelChunk extends ChunkAccess { @@ -7642,7 +7619,7 @@ index 3978407cf96c0eb527c16f161af570a2bf030631..bb0f16aef406bdc627e1263859dd4637 @Override public FluidState getFluidState(BlockPos pos) { return this.getFluidState(pos.getX(), pos.getY(), pos.getZ()); -@@ -537,7 +669,25 @@ public class LevelChunk extends ChunkAccess { +@@ -549,7 +681,25 @@ public class LevelChunk extends ChunkAccess { // CraftBukkit start public void loadCallback() { @@ -7668,7 +7645,7 @@ index 3978407cf96c0eb527c16f161af570a2bf030631..bb0f16aef406bdc627e1263859dd4637 if (server != null) { /* * If it's a new world, the first few chunks are generated inside -@@ -578,6 +728,22 @@ public class LevelChunk extends ChunkAccess { +@@ -590,6 +740,22 @@ public class LevelChunk extends ChunkAccess { server.getPluginManager().callEvent(unloadEvent); // note: saving can be prevented, but not forced if no saving is actually required this.mustNotSave = !unloadEvent.isSaveChunk(); @@ -7705,7 +7682,7 @@ index ca4c8f74a1ab2a8b36e193a2c40c3bd76565d258..2c153af611399e884752f8256bee4fe3 private short tickingFluidCount; public final PalettedContainer<BlockState> 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 0f2b1dcf536f6d5f2d65e0060418511944ff6ab8..bcc70883d23d38c408130ffe778205e371ff4e8a 100644 +index ae16b014abd52ee10d523fb003cce166b846b222..7f302405a88766c2112539d24d3dd2e513f94985 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java @@ -83,6 +83,18 @@ public class ProtoChunk extends ChunkAccess { @@ -7751,10 +7728,10 @@ index 34933c5324126f9afdc5cba9dea997ace8f01806..219062cff8a05c765b092f1525043d9d return false; } else { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 10549f2f4d6ae01c080cdba16c71656b764314c3..69d27337f13ca85ba74d611a0ca635c8af1d694e 100644 +index fe0f57dbeecc4b5a0c81863f33e41d11eb60943a..9babfd8e6c847ea26863be6243f17fc252dc9e1d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2585,4 +2585,9 @@ public final class CraftServer implements Server { +@@ -2593,4 +2593,9 @@ public final class CraftServer implements Server { return this.spigot; } // Spigot end @@ -7765,7 +7742,7 @@ index 10549f2f4d6ae01c080cdba16c71656b764314c3..69d27337f13ca85ba74d611a0ca635c8 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 25787af664c6bb0c28a53265e308e3bf7a78ec8d..bd32f4e6ab8c41404ebcc8ef3b448c71db7b0650 100644 +index 508419378c88ba8688edbd5142d9d8ba52396507..a59eebb89d11788b999d1e5cb4fd2f4e55e023ab 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -252,8 +252,8 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -7845,10 +7822,10 @@ index 25787af664c6bb0c28a53265e308e3bf7a78ec8d..bd32f4e6ab8c41404ebcc8ef3b448c71 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 99a16850b1cb0d66092524e04727874524b7ec03..1c0b19a8d7ce31802436bd5f0910f4fba8a391b7 100644 +index 91539582b65a87e2ed9901f2837c3148455d2669..c025542b1073ce7e6e30a43744276fd1fa1ca484 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2406,4 +2406,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2419,4 +2419,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.spigot; } // Spigot end @@ -7884,7 +7861,7 @@ index 99a16850b1cb0d66092524e04727874524b7ec03..1c0b19a8d7ce31802436bd5f0910f4fb + } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 93dc507732395332adc462cb133f2ba5053edf8f..f44502a51c9fb393746e866e1a93ae9cedc2b656 100644 +index 9e8526a1d1f4f66031903cac7eecbc4edc22a33b..c557a54f15943e07d272c3ad41ca4f90c4dc82ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -22,6 +22,20 @@ import org.bukkit.material.MaterialData; @@ -8131,7 +8108,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 3879f1f69e13f4e90bd66c533bf76b257f041394..8a5d5d3bccc974feea09119eb90732934c8ae6a1 100644 +index e08d4a45e313ef1b9005ef00ee0185a188171207..2fc68d129e2fdfd51e310ea5bdfb83322666c87b 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -110,8 +110,17 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -8284,7 +8261,7 @@ index 0c7c97f27853843ec714e47f5b570f9d09bbba14..ff422d4d4f2b764370f0ee2af1303485 ANIMAL, RAIDER, diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 38219af7d0ba2d871711102b6a29139a49678f6b..60e354fe1d32cd315ed42cea4484c83c4b5e7e25 100644 +index 08b0ca7b68bf238366f4d6904478852ecbe9394a..fbbc08c5a189b99f8047e0f0f5cd31101149dbec 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -118,7 +118,11 @@ public class SpigotConfig diff --git a/patches/unapplied/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index 1adb0e5f3c..c47b6a48fc 100644 --- a/patches/unapplied/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -2146,10 +2146,10 @@ index 0000000000000000000000000000000000000000..c0701d4f93a4d77a8177d2dd8d5076f9 + } +} diff --git a/src/main/java/net/minecraft/ChatFormatting.java b/src/main/java/net/minecraft/ChatFormatting.java -index f5ec57f68dff18c8b2622b58df5df2fd83761b7e..5c01964acd4182467c4de437d6a3b79b268b50dd 100644 +index 08dcd817bfe1ba0121d4ce701825e4aee384db85..d5f63d06d921d731b4e64b38228377712fe9c75b 100644 --- a/src/main/java/net/minecraft/ChatFormatting.java +++ b/src/main/java/net/minecraft/ChatFormatting.java -@@ -110,6 +110,18 @@ public enum ChatFormatting implements StringRepresentable { +@@ -112,6 +112,18 @@ public enum ChatFormatting implements StringRepresentable { return name == null ? null : FORMATTING_BY_NAME.get(cleanName(name)); } @@ -2212,10 +2212,10 @@ index 0047fd758ad43cc7b13355b60c410a9bcc37bec0..982b2bab27e3d55d0ba07060862c0c31 private static CompletableFuture<FilteredText> filterPlainText(CommandSourceStack source, PlayerChatMessage message) { diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java -index d120fff432d9c4fc7a35ddffdc4186459e45e950..d78ad5eccd18d89050a486a0c40090a09683bd16 100644 +index dd66979bcae33096d72001678e8e55569bea6f53..c8d39e6e1c570c9219f6066da273dc0130920519 100644 --- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java +++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java -@@ -92,7 +92,7 @@ public class EntitySelector { +@@ -93,7 +93,7 @@ public class EntitySelector { } private void checkPermissions(CommandSourceStack source) throws CommandSyntaxException { @@ -2225,7 +2225,7 @@ index d120fff432d9c4fc7a35ddffdc4186459e45e950..d78ad5eccd18d89050a486a0c40090a0 } } diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index a7419bcb0954f0adbf7ce2d1e9738e690c265f4d..aafeb9c61ddba6a8671f0238eda47b227619f1af 100644 +index 6d7545a925156aef6badcfa2bc40dbdad18c4ac0..0cd6a50837efce87ca052a0e1e24db2b75761196 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java @@ -72,6 +72,7 @@ public class FriendlyByteBuf extends ByteBuf { @@ -2434,7 +2434,7 @@ index 739ef5fb6f4fa37382153ba6a308ca3b451e6b05..7c3154af5d7732037c0ee965f6f8b894 public static final int BYTES = 256; diff --git a/src/main/java/net/minecraft/network/chat/MutableComponent.java b/src/main/java/net/minecraft/network/chat/MutableComponent.java -index 1ce6b84e0d0bb708ced06955cd62281369b5fd4f..82e2a02336da4ee8cfd84bc82b143f8b9dbcf449 100644 +index 0a70fb7df0d4532edbc2468b13520c34ae1500e9..e34a8a66411b7571813117ce47d9dec08e567978 100644 --- a/src/main/java/net/minecraft/network/chat/MutableComponent.java +++ b/src/main/java/net/minecraft/network/chat/MutableComponent.java @@ -94,6 +94,11 @@ public class MutableComponent implements Component { @@ -2596,18 +2596,18 @@ index bb97fdb9aa6167083442a928276ebe4225a586ef..5d1758086ed4fce5b36a5b31df44ccea @Override diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index da3cc749b3b1f3738e7e7cd77fb0b0fd6eea0b0b..84ad6aae39b5fe4c4ad5ec08890d4383829cbe50 100644 +index b1325e090f2c7aff31d27fc38ca7173efe31ed7c..0742aaf07f37e51d24295e7819ac6cec961c7626 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -195,6 +195,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot - public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable { +@@ -201,6 +201,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot + public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, ChunkIOErrorReporter, CommandSource, AutoCloseable { public static final Logger LOGGER = LogUtils.getLogger(); + public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper public static final String VANILLA_BRAND = "vanilla"; private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F; private static final int TICK_STATS_SPAN = 100; -@@ -245,8 +246,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -251,8 +252,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa private boolean preventProxyConnections; private boolean pvp; private boolean allowFlight; @@ -2617,7 +2617,7 @@ index da3cc749b3b1f3738e7e7cd77fb0b0fd6eea0b0b..84ad6aae39b5fe4c4ad5ec08890d4383 private int playerIdleTimeout; private final long[] tickTimesNanos; private long aggregatedTickTimesNanos; -@@ -1369,7 +1369,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1397,7 +1397,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa private ServerStatus buildServerStatus() { ServerStatus.Players serverping_serverpingplayersample = this.buildPlayerStatus(); @@ -2626,7 +2626,7 @@ index da3cc749b3b1f3738e7e7cd77fb0b0fd6eea0b0b..84ad6aae39b5fe4c4ad5ec08890d4383 } private ServerStatus.Players buildPlayerStatus() { -@@ -1401,6 +1401,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1429,6 +1429,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa SpigotTimings.schedulerTimer.startTiming(); // Spigot this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit SpigotTimings.schedulerTimer.stopTiming(); // Spigot @@ -2634,7 +2634,7 @@ index da3cc749b3b1f3738e7e7cd77fb0b0fd6eea0b0b..84ad6aae39b5fe4c4ad5ec08890d4383 this.profiler.push("commandFunctions"); SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot this.getFunctions().tick(); -@@ -1777,10 +1778,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1805,10 +1806,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @Override public String getMotd() { @@ -2656,7 +2656,7 @@ index da3cc749b3b1f3738e7e7cd77fb0b0fd6eea0b0b..84ad6aae39b5fe4c4ad5ec08890d4383 this.motd = motd; } -@@ -2542,23 +2553,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2570,23 +2581,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) { @@ -2689,10 +2689,10 @@ index da3cc749b3b1f3738e7e7cd77fb0b0fd6eea0b0b..84ad6aae39b5fe4c4ad5ec08890d4383 public boolean logIPs() { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index a1d4d3a66c48abdddd2bcdd957417f81290c7a6e..08b2d5c6fb6d236b805ca6556270ad1891b411f5 100644 +index 5f8adf662e5ab9114e2891cfacb8db5d4d40a297..a8a7f1fcf235508d9437ec7c550c3a3853321b78 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -170,6 +170,7 @@ import net.minecraft.world.damagesource.CombatTracker; +@@ -171,6 +171,7 @@ import net.minecraft.world.item.trading.MerchantOffers; import net.minecraft.world.scores.Scoreboard; import net.minecraft.world.scores.Team; import net.minecraft.world.scores.criteria.ObjectiveCriteria; @@ -2700,7 +2700,7 @@ index a1d4d3a66c48abdddd2bcdd957417f81290c7a6e..08b2d5c6fb6d236b805ca6556270ad18 import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.WeatherType; -@@ -233,6 +234,7 @@ public class ServerPlayer extends Player { +@@ -236,6 +237,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { private boolean disconnected; private int requestedViewDistance; public String language = "en_us"; // CraftBukkit - default @@ -2708,7 +2708,7 @@ index a1d4d3a66c48abdddd2bcdd957417f81290c7a6e..08b2d5c6fb6d236b805ca6556270ad18 @Nullable private Vec3 startingToFallPosition; @Nullable -@@ -265,6 +267,7 @@ public class ServerPlayer extends Player { +@@ -269,6 +271,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { // CraftBukkit start public CraftPlayer.TransferCookieConnection transferCookieConnection; public String displayName; @@ -2716,7 +2716,7 @@ index a1d4d3a66c48abdddd2bcdd957417f81290c7a6e..08b2d5c6fb6d236b805ca6556270ad18 public Component listName; public org.bukkit.Location compassTarget; public int newExp = 0; -@@ -350,6 +353,7 @@ public class ServerPlayer extends Player { +@@ -355,6 +358,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { // CraftBukkit start this.displayName = this.getScoreboardName(); @@ -2724,7 +2724,7 @@ index a1d4d3a66c48abdddd2bcdd957417f81290c7a6e..08b2d5c6fb6d236b805ca6556270ad18 this.bukkitPickUpLoot = true; this.maxHealthCache = this.getMaxHealth(); } -@@ -903,22 +907,17 @@ public class ServerPlayer extends Player { +@@ -912,22 +916,17 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { String deathmessage = defaultMessage.getString(); this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel @@ -2751,7 +2751,7 @@ index a1d4d3a66c48abdddd2bcdd957417f81290c7a6e..08b2d5c6fb6d236b805ca6556270ad18 this.connection.send(new ClientboundPlayerCombatKillPacket(this.getId(), ichatbasecomponent), PacketSendListener.exceptionallySend(() -> { boolean flag1 = true; -@@ -1985,8 +1984,13 @@ public class ServerPlayer extends Player { +@@ -2027,8 +2026,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { } public void sendChatMessage(OutgoingChatMessage message, boolean filterMaskEnabled, ChatType.Bound params) { @@ -2766,7 +2766,7 @@ index a1d4d3a66c48abdddd2bcdd957417f81290c7a6e..08b2d5c6fb6d236b805ca6556270ad18 } } -@@ -2013,6 +2017,7 @@ public class ServerPlayer extends Player { +@@ -2055,6 +2059,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { } // CraftBukkit end this.language = clientOptions.language(); @@ -2775,10 +2775,10 @@ index a1d4d3a66c48abdddd2bcdd957417f81290c7a6e..08b2d5c6fb6d236b805ca6556270ad18 this.chatVisibility = clientOptions.chatVisibility(); this.canChatColor = clientOptions.chatColors(); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index 6f17aeae2941c43205fa6db5950d65f510774104..26b8a69a528db8a836b138a2a223c385508ce2c4 100644 +index 677ee8dfa0d2f5bcb23ee870a76bcee63e557813..94008b8a1f2dafdb9efa1fec6096d3eb632b9a5e 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -@@ -66,7 +66,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -67,7 +67,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack private static final Component TIMEOUT_DISCONNECTION_MESSAGE = Component.translatable("disconnect.timeout"); static final Component DISCONNECT_UNEXPECTED_QUERY = Component.translatable("multiplayer.disconnect.unexpected_query_response"); protected final MinecraftServer server; @@ -2787,7 +2787,7 @@ index 6f17aeae2941c43205fa6db5950d65f510774104..26b8a69a528db8a836b138a2a223c385 private final boolean transferred; private long keepAliveTime; private boolean keepAlivePending; -@@ -75,6 +75,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -76,6 +76,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack private boolean closed = false; private int latency; private volatile boolean suspendFlushingOnServerThread = false; @@ -2795,9 +2795,9 @@ index 6f17aeae2941c43205fa6db5950d65f510774104..26b8a69a528db8a836b138a2a223c385 public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit this.server = minecraftserver; -@@ -188,6 +189,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -189,6 +190,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack {} rejection", this.playerProfile().getName(), packet.id()); - this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); + this.disconnect((Component) Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); } + // Paper start - adventure pack callbacks + // call the callbacks before the previously-existing event so the event has final say @@ -2814,63 +2814,45 @@ index 6f17aeae2941c43205fa6db5950d65f510774104..26b8a69a528db8a836b138a2a223c385 this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packet.id(), PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()])); // CraftBukkit } -@@ -276,12 +289,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack - - // CraftBukkit start - @Deprecated -- public void disconnect(Component reason) { -- this.disconnect(CraftChatMessage.fromComponent(reason)); -+ public void disconnect(String s) { // Paper -+ this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s)); // Paper +@@ -275,6 +288,12 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + } } - // CraftBukkit end -- public void disconnect(String s) { -+ // Paper start -+ public void disconnect(final Component reason) { -+ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asAdventure(reason)); ++ // Paper start - adventure ++ public void disconnect(@Nullable final net.kyori.adventure.text.Component reason) { ++ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(reason)); + } ++ // Paper end - adventure + -+ public void disconnect(net.kyori.adventure.text.Component reason) { -+ // Paper end - // CraftBukkit start - fire PlayerKickEvent - if (this.processedDisconnect) { - return; -@@ -290,7 +309,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack - Waitable waitable = new Waitable() { - @Override - protected Object evaluate() { -- ServerCommonPacketListenerImpl.this.disconnect(s); -+ ServerCommonPacketListenerImpl.this.disconnect(reason); // Paper - adventure - return null; - } - }; -@@ -307,9 +326,9 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + public void disconnect(Component reason) { + this.disconnect(new DisconnectionDetails(reason)); + } +@@ -305,9 +324,9 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack return; } - String leaveMessage = ChatFormatting.YELLOW + this.player.getScoreboardName() + " left the game."; + net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure -- PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), s, leaveMessage); -+ PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage); // Paper - adventure +- PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), CraftChatMessage.fromComponent(disconnectionInfo.reason()), leaveMessage); ++ PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(disconnectionInfo.reason()), leaveMessage); // Paper - adventure if (this.cserver.getServer().isRunning()) { this.cserver.getPluginManager().callEvent(event); -@@ -321,7 +340,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -319,7 +338,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent // Send the possibly modified leave message -- final Component ichatbasecomponent = CraftChatMessage.fromString(event.getReason(), true)[0]; -+ final Component ichatbasecomponent = io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()); // Paper - Adventure - // CraftBukkit end +- this.disconnect0(new DisconnectionDetails(CraftChatMessage.fromString(event.getReason(), true)[0], disconnectionInfo.report(), disconnectionInfo.bugReportLink())); ++ this.disconnect0(new DisconnectionDetails(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()), disconnectionInfo.report(), disconnectionInfo.bugReportLink())); // Paper - Adventure + } - this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> { + private void disconnect0(DisconnectionDetails disconnectiondetails) { diff --git a/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java -index bd7107279ca004f35c932e5d6e82f8302ec781ae..970d1ddf0a014b47b0ac97440489706137324991 100644 +index e7c407039fef88ef01ba9b6be9ae5bcc3edc026f..5457358bc76889153036818fdfd70a043ec4e40f 100644 --- a/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java -@@ -100,6 +100,7 @@ public class ServerConfigurationPacketListenerImpl extends ServerCommonPacketLis +@@ -120,6 +120,7 @@ public class ServerConfigurationPacketListenerImpl extends ServerCommonPacketLis @Override public void handleClientInformation(ServerboundClientInformationPacket packet) { this.clientInformation = packet.information(); @@ -2879,12 +2861,12 @@ index bd7107279ca004f35c932e5d6e82f8302ec781ae..970d1ddf0a014b47b0ac974404897061 @Override diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 912fe77278ba085ef9cea7187e43a3ad3bb2e0d5..7788f703c47480b009b26c23fa5e075b581c3aca 100644 +index 65b23aad3ea71d409253d3365fc1e37480b8e5ee..27cf5dceba5835f94f5397ec011f409e7b226ad5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -44,6 +44,7 @@ import net.minecraft.core.registries.Registries; - import net.minecraft.nbt.CompoundTag; +@@ -45,6 +45,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.Connection; + import net.minecraft.network.DisconnectionDetails; import net.minecraft.network.TickablePacketListener; +import net.minecraft.network.chat.ChatDecorator; import net.minecraft.network.chat.ChatType; @@ -2899,7 +2881,7 @@ index 912fe77278ba085ef9cea7187e43a3ad3bb2e0d5..7788f703c47480b009b26c23fa5e075b import com.mojang.datafixers.util.Pair; import java.util.Arrays; import java.util.concurrent.ExecutionException; -@@ -1711,9 +1714,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1728,9 +1731,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl */ this.player.disconnect(); @@ -2914,7 +2896,7 @@ index 912fe77278ba085ef9cea7187e43a3ad3bb2e0d5..7788f703c47480b009b26c23fa5e075b } // CraftBukkit end this.player.getTextFilter().leave(); -@@ -1774,10 +1779,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1791,10 +1796,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } CompletableFuture<FilteredText> completablefuture = this.filterTextPacket(playerchatmessage.signedContent()).thenApplyAsync(Function.identity(), this.server.chatExecutor); // CraftBukkit - async chat @@ -2928,7 +2910,7 @@ index 912fe77278ba085ef9cea7187e43a3ad3bb2e0d5..7788f703c47480b009b26c23fa5e075b this.broadcastChatMessage(playerchatmessage1); }); -@@ -1997,7 +2002,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2014,7 +2019,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin @@ -2945,7 +2927,7 @@ index 912fe77278ba085ef9cea7187e43a3ad3bb2e0d5..7788f703c47480b009b26c23fa5e075b Player player = this.getCraftPlayer(); AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server)); String originalFormat = event.getFormat(), originalMessage = event.getMessage(); -@@ -2994,6 +3007,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3011,6 +3024,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void handleClientInformation(ServerboundClientInformationPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); this.player.updateOptions(packet.information()); @@ -2954,10 +2936,10 @@ index 912fe77278ba085ef9cea7187e43a3ad3bb2e0d5..7788f703c47480b009b26c23fa5e075b @Override diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 47a1c62dd6f927cb01f679a597d1526bbca9e433..7beda9a16addb2dbcd4bdc45e58b343e91323af5 100644 +index 8e715261b99bcc19b6f4b9787987c59aa19ba70e..851e4bdf1739736fd193786a6541ffb341525dcb 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -331,7 +331,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -333,7 +333,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) { @@ -2966,7 +2948,7 @@ index 47a1c62dd6f927cb01f679a597d1526bbca9e433..7beda9a16addb2dbcd4bdc45e58b343e } Waitable<PlayerPreLoginEvent.Result> waitable = new Waitable<PlayerPreLoginEvent.Result>() { @Override -@@ -343,12 +343,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -345,12 +345,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable); if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { @@ -2982,10 +2964,10 @@ index 47a1c62dd6f927cb01f679a597d1526bbca9e433..7beda9a16addb2dbcd4bdc45e58b343e } } diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java -index a4d8d4400a1f6f6d05a3c362f2bc4a391d4ee9a1..9e62aa13845f19faf0dc0b7b27d958626e77d96e 100644 +index 2c555c5ad05992b19f67b883c3c0ec7018180747..71540687b4212702cdaaad5fd4815fb3eb97ddd6 100644 --- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java -@@ -57,7 +57,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene +@@ -58,7 +58,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene CraftIconCache icon = server.server.getServerIcon(); ServerListPingEvent() { @@ -2995,7 +2977,7 @@ index a4d8d4400a1f6f6d05a3c362f2bc4a391d4ee9a1..9e62aa13845f19faf0dc0b7b27d95862 @Override diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 54fee00a462c2f6fcc567d762b1afd24cf5c7d06..0ff094a90bf471ce57a3054c7701dc3d67742d9d 100644 +index 6abe921099ff00ecfaf0f423ef27d708420f6f48..9113c183f1e977f71eea95a891618883b075ce5a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -271,7 +271,7 @@ public abstract class PlayerList { @@ -3032,7 +3014,7 @@ index 54fee00a462c2f6fcc567d762b1afd24cf5c7d06..0ff094a90bf471ce57a3054c7701dc3d } // CraftBukkit end -@@ -499,7 +498,7 @@ public abstract class PlayerList { +@@ -492,7 +491,7 @@ public abstract class PlayerList { } @@ -3041,7 +3023,7 @@ index 54fee00a462c2f6fcc567d762b1afd24cf5c7d06..0ff094a90bf471ce57a3054c7701dc3d ServerLevel worldserver = entityplayer.serverLevel(); entityplayer.awardStat(Stats.LEAVE_GAME); -@@ -510,7 +509,7 @@ public abstract class PlayerList { +@@ -503,7 +502,7 @@ public abstract class PlayerList { entityplayer.closeContainer(); } @@ -3050,7 +3032,7 @@ index 54fee00a462c2f6fcc567d762b1afd24cf5c7d06..0ff094a90bf471ce57a3054c7701dc3d this.cserver.getPluginManager().callEvent(playerQuitEvent); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); -@@ -563,7 +562,7 @@ public abstract class PlayerList { +@@ -556,7 +555,7 @@ public abstract class PlayerList { this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity()); // CraftBukkit end @@ -3059,7 +3041,7 @@ index 54fee00a462c2f6fcc567d762b1afd24cf5c7d06..0ff094a90bf471ce57a3054c7701dc3d } // CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer -@@ -610,11 +609,11 @@ public abstract class PlayerList { +@@ -603,11 +602,11 @@ public abstract class PlayerList { } // return chatmessage; @@ -3074,7 +3056,7 @@ index 54fee00a462c2f6fcc567d762b1afd24cf5c7d06..0ff094a90bf471ce57a3054c7701dc3d IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); ichatmutablecomponent = Component.translatable("multiplayer.disconnect.banned_ip.reason", ipbanentry.getReason()); -@@ -623,17 +622,17 @@ public abstract class PlayerList { +@@ -616,17 +615,17 @@ public abstract class PlayerList { } // return chatmessage; @@ -3095,16 +3077,16 @@ index 54fee00a462c2f6fcc567d762b1afd24cf5c7d06..0ff094a90bf471ce57a3054c7701dc3d return null; } return entity; -@@ -1153,7 +1152,7 @@ public abstract class PlayerList { +@@ -1122,7 +1121,7 @@ public abstract class PlayerList { public void removeAll() { // CraftBukkit start - disconnect safely for (ServerPlayer player : this.players) { -- player.connection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message +- player.connection.disconnect(CraftChatMessage.fromStringOrEmpty(this.server.server.getShutdownMessage())); // CraftBukkit - add custom shutdown message + player.connection.disconnect(this.server.server.shutdownMessage()); // CraftBukkit - add custom shutdown message // Paper - Adventure } // CraftBukkit end -@@ -1194,24 +1193,43 @@ public abstract class PlayerList { +@@ -1163,24 +1162,43 @@ public abstract class PlayerList { } public void broadcastChatMessage(PlayerChatMessage message, ServerPlayer sender, ChatType.Bound params) { @@ -3151,7 +3133,7 @@ index 54fee00a462c2f6fcc567d762b1afd24cf5c7d06..0ff094a90bf471ce57a3054c7701dc3d } if (flag1 && sender != null) { -@@ -1220,7 +1238,7 @@ public abstract class PlayerList { +@@ -1189,7 +1207,7 @@ public abstract class PlayerList { } @@ -3249,10 +3231,10 @@ index ed54c81a3269360acce674aa4e1d54ccb2461841..c9c849534c3998cfcab7ddcb12a71ccb } diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index d7f427bf5c84d1bb405e4aaf16e3a8f1fed5ad79..e65a5abfaac1f68bbefe0b7f3877823a548d56cc 100644 +index b6cb1de08e955dfc99a0cb736b2ed456c99fde5c..abf502b8395bb0a8a32c1fdcd62532790deb1c6e 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -186,7 +186,15 @@ public final class ItemStack implements DataComponentHolder { +@@ -183,7 +183,15 @@ public final class ItemStack implements DataComponentHolder { CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); // Spigot end ITEM_STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.getItemHolder()); // CraftBukkit - decompile error @@ -3301,7 +3283,7 @@ index 8ec376f453ac1f4c9423483f5ae1625b295858c7..e535fb3b5194b8412c0c26c079934091 } } 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 3db3c6858d98d2eaf7c9bd8d395b83b22c447bb9..d42d39dff5aeb91c5b1e6a7fb967ce70f1a88b7e 100644 +index 6acee03278c8005a06d9cd2577761f2f5355a7ec..5e469bd4d9ca428abdd9d758993164635dc86f27 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 @@ -45,6 +45,7 @@ import net.minecraft.world.level.saveddata.SavedData; @@ -3312,7 +3294,7 @@ index 3db3c6858d98d2eaf7c9bd8d395b83b22c447bb9..d42d39dff5aeb91c5b1e6a7fb967ce70 import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; -@@ -610,7 +611,7 @@ public class MapItemSavedData extends SavedData { +@@ -615,7 +616,7 @@ public class MapItemSavedData extends SavedData { for (org.bukkit.map.MapCursor cursor : render.cursors) { if (cursor.isVisible()) { @@ -3322,10 +3304,10 @@ index 3db3c6858d98d2eaf7c9bd8d395b83b22c447bb9..d42d39dff5aeb91c5b1e6a7fb967ce70 } collection = icons; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 69d27337f13ca85ba74d611a0ca635c8af1d694e..beff0bfe2502a17fd297524c51f96b33f889db93 100644 +index 9babfd8e6c847ea26863be6243f17fc252dc9e1d..0e3ff653211b0210f8679b475d5f62eecbdfd946 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -633,8 +633,10 @@ public final class CraftServer implements Server { +@@ -636,8 +636,10 @@ public final class CraftServer implements Server { } @Override @@ -3336,7 +3318,7 @@ index 69d27337f13ca85ba74d611a0ca635c8af1d694e..beff0bfe2502a17fd297524c51f96b33 } @Override -@@ -1610,7 +1612,15 @@ public final class CraftServer implements Server { +@@ -1613,7 +1615,15 @@ public final class CraftServer implements Server { return this.configuration.getInt("settings.spawn-radius", -1); } @@ -3352,7 +3334,7 @@ index 69d27337f13ca85ba74d611a0ca635c8af1d694e..beff0bfe2502a17fd297524c51f96b33 public String getShutdownMessage() { return this.configuration.getString("settings.shutdown-message"); } -@@ -1784,7 +1794,20 @@ public final class CraftServer implements Server { +@@ -1787,7 +1797,20 @@ public final class CraftServer implements Server { } @Override @@ -3373,7 +3355,7 @@ index 69d27337f13ca85ba74d611a0ca635c8af1d694e..beff0bfe2502a17fd297524c51f96b33 Set<CommandSender> recipients = new HashSet<>(); for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) { if (permissible instanceof CommandSender && permissible.hasPermission(permission)) { -@@ -1792,14 +1815,14 @@ public final class CraftServer implements Server { +@@ -1795,14 +1818,14 @@ public final class CraftServer implements Server { } } @@ -3390,7 +3372,7 @@ index 69d27337f13ca85ba74d611a0ca635c8af1d694e..beff0bfe2502a17fd297524c51f96b33 for (CommandSender recipient : recipients) { recipient.sendMessage(message); -@@ -2061,6 +2084,14 @@ public final class CraftServer implements Server { +@@ -2064,6 +2087,14 @@ public final class CraftServer implements Server { return CraftInventoryCreator.INSTANCE.createInventory(owner, type); } @@ -3405,7 +3387,7 @@ index 69d27337f13ca85ba74d611a0ca635c8af1d694e..beff0bfe2502a17fd297524c51f96b33 @Override public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) { Preconditions.checkArgument(type != null, "InventoryType cannot be null"); -@@ -2075,13 +2106,28 @@ public final class CraftServer implements Server { +@@ -2078,13 +2109,28 @@ public final class CraftServer implements Server { return CraftInventoryCreator.INSTANCE.createInventory(owner, size); } @@ -3434,7 +3416,7 @@ index 69d27337f13ca85ba74d611a0ca635c8af1d694e..beff0bfe2502a17fd297524c51f96b33 public Merchant createMerchant(String title) { return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title); } -@@ -2146,6 +2192,17 @@ public final class CraftServer implements Server { +@@ -2149,6 +2195,17 @@ public final class CraftServer implements Server { return Thread.currentThread().equals(this.console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog) } @@ -3452,7 +3434,7 @@ index 69d27337f13ca85ba74d611a0ca635c8af1d694e..beff0bfe2502a17fd297524c51f96b33 @Override public String getMotd() { return this.console.getMotd(); -@@ -2590,4 +2647,57 @@ public final class CraftServer implements Server { +@@ -2598,4 +2655,57 @@ public final class CraftServer implements Server { public double[] getTPS() { return new double[]{0, 0, 0}; // TODO } @@ -3511,7 +3493,7 @@ index 69d27337f13ca85ba74d611a0ca635c8af1d694e..beff0bfe2502a17fd297524c51f96b33 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index bd32f4e6ab8c41404ebcc8ef3b448c71db7b0650..ee5b61c476abc1f9a2babf350ac9dfa45b2c3253 100644 +index a59eebb89d11788b999d1e5cb4fd2f4e55e023ab..1e8d93d81b7a391bbd1e9926ff35a68d4c563f0f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -162,6 +162,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -3585,7 +3567,7 @@ index bd32f4e6ab8c41404ebcc8ef3b448c71db7b0650..ee5b61c476abc1f9a2babf350ac9dfa4 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index e5f070de12b63487b71c54d8020a895e5eda862c..73c44f94aac069fa3ea9e82be6b95e77a2421c63 100644 +index 9ec50bbb262b25fea157ae48e8395f5cd38f8906..985b77911d03bc60a0210b796e901f31e2676268 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -20,6 +20,12 @@ public class Main { @@ -3973,12 +3955,12 @@ index 1e82312c24cb752d63b165926861fc178cd7849b..7f22950ae61436e91a59cd29a345809c + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index 85cef6c2ebe8f53c3a63c17055c48c2d46e6c680..5ed90ed0461165da02c7a1acae805c12466e38d6 100644 +index ed6944418382dbd02e5ddbf50c6ac4bb26415807..97a7dc31fe7a2defed2202ccc518c66b7ff4b0da 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -@@ -163,6 +163,12 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine +@@ -166,6 +166,12 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine CraftEnchantment ench = (CraftEnchantment) other; - return !this.handle.isCompatibleWith(ench.getHandle()); + return !net.minecraft.world.item.enchantment.Enchantment.areCompatible(this.handle, ench.handle); } + // Paper start + @Override @@ -3990,10 +3972,10 @@ index 85cef6c2ebe8f53c3a63c17055c48c2d46e6c680..5ed90ed0461165da02c7a1acae805c12 @Override public String getTranslationKey() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 941035a6cf73c8757e3ea75358d5d405b22c1a6f..0996bfe664e0085dcacdd2b6c08a2737d3b2fa6a 100644 +index d09102fe44dffa61dff883488f47715effaa8211..269326e7689eba91bcfd3475006e8cbf8f5694ef 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -67,6 +67,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -69,6 +69,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { private final EntityType entityType; private EntityDamageEvent lastDamageEvent; private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftEntity.DATA_TYPE_REGISTRY); @@ -4001,7 +3983,7 @@ index 941035a6cf73c8757e3ea75358d5d405b22c1a6f..0996bfe664e0085dcacdd2b6c08a2737 public CraftEntity(final CraftServer server, final Entity entity) { this.server = server; -@@ -523,6 +524,32 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -525,6 +526,32 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return this.getHandle().getVehicle().getBukkitEntity(); } @@ -4034,7 +4016,7 @@ index 941035a6cf73c8757e3ea75358d5d405b22c1a6f..0996bfe664e0085dcacdd2b6c08a2737 @Override public void setCustomName(String name) { // sane limit for name length -@@ -619,6 +646,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -621,6 +648,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public String getName() { return CraftChatMessage.fromComponent(this.getHandle().getName()); } @@ -4105,10 +4087,10 @@ index 55945b83a5426b352bad9507cc9e94afb1278032..9ea1537408ff2d790747b6e5a681d917 public boolean isOp() { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35ddb4a9eb66 100644 +index c025542b1073ce7e6e30a43744276fd1fa1ca484..64aed98084aeb3f29db301adf3c8c49ee9236a0b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -386,14 +386,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -388,14 +388,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getDisplayName() { @@ -4149,7 +4131,7 @@ index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35dd @Override public String getPlayerListName() { return this.getHandle().listName == null ? this.getName() : CraftChatMessage.fromComponent(this.getHandle().listName); -@@ -405,6 +431,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -407,6 +433,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { name = this.getName(); } this.getHandle().listName = name.equals(this.getName()) ? null : CraftChatMessage.fromStringOrNull(name); @@ -4157,7 +4139,7 @@ index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35dd for (ServerPlayer player : (List<ServerPlayer>) this.server.getHandle().players) { if (player.getBukkitEntity().canSee(this)) { player.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME, this.getHandle())); -@@ -412,42 +439,42 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -414,42 +441,42 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } @@ -4209,8 +4191,8 @@ index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35dd this.getHandle().connection.send(packet); } -@@ -479,6 +506,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - this.getHandle().connection.disconnect(message == null ? "" : message); +@@ -481,6 +508,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + this.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message)); } + // Paper start @@ -4233,7 +4215,7 @@ index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35dd @Override public void setCompassTarget(Location loc) { Preconditions.checkArgument(loc != null, "Location cannot be null"); -@@ -775,6 +819,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -777,6 +821,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(packet); } @@ -4258,7 +4240,7 @@ index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35dd @Override public void sendSignChange(Location loc, String[] lines) { this.sendSignChange(loc, lines, DyeColor.BLACK); -@@ -798,6 +860,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -800,6 +862,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (this.getHandle().connection == null) return; Component[] components = CraftSign.sanitizeLines(lines); @@ -4271,7 +4253,7 @@ index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35dd SignBlockEntity sign = new SignBlockEntity(CraftLocation.toBlockPosition(loc), Blocks.OAK_SIGN.defaultBlockState()); SignText text = sign.getFrontText(); text = text.setColor(net.minecraft.world.item.DyeColor.byId(dyeColor.getWoolData())); -@@ -1802,7 +1870,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1815,7 +1883,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setResourcePack(String url) { @@ -4280,7 +4262,7 @@ index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35dd } @Override -@@ -1817,7 +1885,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1830,7 +1898,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setResourcePack(String url, byte[] hash, boolean force) { @@ -4289,7 +4271,7 @@ index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35dd } @Override -@@ -1854,6 +1922,59 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1867,6 +1935,59 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.handlePushResourcePack(new ClientboundResourcePackPushPacket(id, url, hashStr, force, CraftChatMessage.fromStringOrOptional(prompt, true)), false); } @@ -4349,7 +4331,7 @@ index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35dd @Override public void removeResourcePack(UUID id) { Preconditions.checkArgument(id != null, "Resource pack id cannot be null"); -@@ -2274,6 +2395,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2287,6 +2408,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return (this.getHandle().requestedViewDistance() == 0) ? Bukkit.getViewDistance() : this.getHandle().requestedViewDistance(); } @@ -4362,7 +4344,7 @@ index 1c0b19a8d7ce31802436bd5f0910f4fba8a391b7..e59f2ae85126061ee35812eaa02a35dd @Override public int getPing() { return this.getHandle().connection.latency(); -@@ -2324,6 +2451,248 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2337,6 +2464,248 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().allowsListing(); } @@ -4634,10 +4616,10 @@ index 5725b0281ac53a2354b233223259d6784353bc6e..9ef939b76d06874b856e0c850addb364 @Override public int getLineWidth() { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index d6b2352d5f64a85f7c7e817f395d5cd69275ff0c..4c59520355a21249d2a3132dbaae97fd4e17c86b 100644 +index 02b52e182ce89d20a873076ca3180ff6f68219d3..968c5588659990d1e29252413881cf6dd867b984 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -906,7 +906,7 @@ public class CraftEventFactory { +@@ -907,7 +907,7 @@ public class CraftEventFactory { return event; } @@ -4645,8 +4627,8 @@ index d6b2352d5f64a85f7c7e817f395d5cd69275ff0c..4c59520355a21249d2a3132dbaae97fd + public static PlayerDeathEvent callPlayerDeathEvent(ServerPlayer victim, DamageSource damageSource, List<org.bukkit.inventory.ItemStack> drops, net.kyori.adventure.text.Component deathMessage, boolean keepInventory) { // Paper - Adventure CraftPlayer entity = victim.getBukkitEntity(); CraftDamageSource bukkitDamageSource = new CraftDamageSource(damageSource); - PlayerDeathEvent event = new PlayerDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(), 0, deathMessage); -@@ -934,7 +934,7 @@ public class CraftEventFactory { + PlayerDeathEvent event = new PlayerDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(damageSource.getEntity()), 0, deathMessage); +@@ -935,7 +935,7 @@ public class CraftEventFactory { * Server methods */ public static ServerListPingEvent callServerListPingEvent(SocketAddress address, String motd, int numPlayers, int maxPlayers) { @@ -4778,12 +4760,12 @@ index 4dd9a80af9901287ab6740b072f2b89678c3d0cb..b2586684295b295a3196a2a9cf724cec public String getTitle() { return this.title; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index efbef9a72e1ee7c4928ffc9e3a818dbbca6aa002..e8dd4ba93c09c514f3594f0d4b5f1167b719a17d 100644 +index a24a397f7e2bc2293aee290b3fc39087c79388ac..78c96b43d611f70814b80a05dfded794858e2eda 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -499,4 +499,21 @@ public final class CraftItemFactory implements ItemFactory { - CraftItemStack craft = (CraftItemStack) itemStack; - return CraftItemStack.asCraftMirror(EnchantmentHelper.enchantItem(MinecraftServer.getServer().getWorldData().enabledFeatures(), source, craft.handle, level, allowTreasures)); +@@ -510,4 +510,21 @@ public final class CraftItemFactory implements ItemFactory { + Optional<HolderSet.Named<Enchantment>> optional = (allowTreasures) ? Optional.empty() : registry.registryOrThrow(Registries.ENCHANTMENT).getTag(EnchantmentTags.IN_ENCHANTING_TABLE); + return CraftItemStack.asCraftMirror(EnchantmentHelper.enchantItem(source, craft.handle, level, registry, optional)); } + + // Paper start - Adventure @@ -5135,10 +5117,10 @@ index 2e6f0a0f4bbe4ae3c7c85e679f6187e89d1298ff..c7360e2b2d6e50abc371c21b09cdadd6 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index c33161090f6f746c04a87ca5b71f4df80f4fd246..41ba64593bd548131d1cdbecc79b2f38406aa78b 100644 +index 23b6575326446441a3fa3cb5788d7068e49705af..fd147ea7fb5d143c11e7e2bf09f31bcb6e513f76 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -883,6 +883,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -906,6 +906,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return !(this.hasDisplayName() || this.hasItemName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.build().isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isHideTooltip() || this.isUnbreakable() || this.hasEnchantmentGlintOverride() || this.isFireResistant() || this.hasMaxStackSize() || this.hasRarity() || this.hasFood() || this.hasTool() || this.hasDamage() || this.hasMaxDamage() || this.hasAttributeModifiers() || this.customTag != null); } @@ -5157,7 +5139,7 @@ index c33161090f6f746c04a87ca5b71f4df80f4fd246..41ba64593bd548131d1cdbecc79b2f38 @Override public String getDisplayName() { return CraftChatMessage.fromComponent(this.displayName); -@@ -913,6 +925,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -936,6 +948,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return this.itemName != null; } @@ -5176,7 +5158,7 @@ index c33161090f6f746c04a87ca5b71f4df80f4fd246..41ba64593bd548131d1cdbecc79b2f38 @Override public String getLocalizedName() { return this.getDisplayName(); -@@ -932,6 +956,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -955,6 +979,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return this.lore != null && !this.lore.isEmpty(); } @@ -5559,7 +5541,7 @@ index 28038c3a531680201dcc8f2716b8f46f3886e769..5a9ddf71dc186c537a23083ac59434fb 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 8a5d5d3bccc974feea09119eb90732934c8ae6a1..8727d09566cba3b7223e4c72f960e568a9d8bb62 100644 +index 2fc68d129e2fdfd51e310ea5bdfb83322666c87b..fb22e04a4a9f039f0e942ff837124b00ca1b12be 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -81,6 +81,43 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch index 50a85c9a5a..720176d247 100644 --- a/patches/unapplied/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -25,7 +25,7 @@ Other changes: Co-Authored-By: Emilia Kond <[email protected]> diff --git a/build.gradle.kts b/build.gradle.kts -index 18221614060ec945cb8b197acd276e45450f7394..90ca693814a82c30de238b0228750b769a9a9c80 100644 +index 94dfc105b197c9eda481cbe90bb48b71c845e702..0a05e753ff5e7b1d741c7719524715d7364cac4f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,9 +5,29 @@ plugins { @@ -260,19 +260,19 @@ index 8323f135d6bf2e1f12525e05094ffa3f2420e7e1..a143ea1e58464a3122fbd8ccafe417bd } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 84ad6aae39b5fe4c4ad5ec08890d4383829cbe50..8dfa0fae4d5129688b7e2897da1fc51683aed6c3 100644 +index 0742aaf07f37e51d24295e7819ac6cec961c7626..e82218de79759dfaa7fe2a5a78e150f135bf01a3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -148,7 +148,7 @@ import org.slf4j.Logger; - import com.mojang.serialization.Dynamic; +@@ -154,7 +154,7 @@ import com.mojang.serialization.Dynamic; import com.mojang.serialization.Lifecycle; + import java.io.File; import java.util.Random; -import jline.console.ConsoleReader; +// import jline.console.ConsoleReader; // Paper import joptsimple.OptionSet; import net.minecraft.nbt.NbtException; import net.minecraft.nbt.ReportedNbtException; -@@ -289,7 +289,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -296,7 +296,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public org.bukkit.craftbukkit.CraftServer server; public OptionSet options; public org.bukkit.command.ConsoleCommandSender console; @@ -280,7 +280,7 @@ index 84ad6aae39b5fe4c4ad5ec08890d4383829cbe50..8dfa0fae4d5129688b7e2897da1fc516 public static int currentTick = (int) (System.currentTimeMillis() / 50); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public int autosavePeriod; -@@ -377,7 +376,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -384,7 +383,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.options = options; this.worldLoader = worldLoader; this.vanillaCommandDispatcher = worldstem.dataPackResources().commands; // CraftBukkit @@ -290,7 +290,7 @@ index 84ad6aae39b5fe4c4ad5ec08890d4383829cbe50..8dfa0fae4d5129688b7e2897da1fc516 if (System.console() == null && System.getProperty("jline.terminal") == null) { System.setProperty("jline.terminal", "jline.UnsupportedTerminal"); Main.useJline = false; -@@ -398,6 +399,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -405,6 +406,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa MinecraftServer.LOGGER.warn((String) null, ex); } } @@ -299,7 +299,7 @@ index 84ad6aae39b5fe4c4ad5ec08890d4383829cbe50..8dfa0fae4d5129688b7e2897da1fc516 Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); // CraftBukkit end this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files -@@ -1113,7 +1116,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1120,7 +1123,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa org.spigotmc.WatchdogThread.doStop(); // Spigot // CraftBukkit start - Restore terminal to original settings try { @@ -308,7 +308,7 @@ index 84ad6aae39b5fe4c4ad5ec08890d4383829cbe50..8dfa0fae4d5129688b7e2897da1fc516 } catch (Exception ignored) { } // CraftBukkit end -@@ -1636,7 +1639,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1664,7 +1667,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @Override public void sendSystemMessage(Component message) { @@ -318,10 +318,10 @@ index 84ad6aae39b5fe4c4ad5ec08890d4383829cbe50..8dfa0fae4d5129688b7e2897da1fc516 public KeyPair getKeyPair() { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 1b5e2e07a7723f61d4c4d4e3141c60b2f63e2b69..9249122da7282929f87613f41984b8085d7b53ec 100644 +index cd26616aba6abd44abc5eb8b01cc96f29248aecd..b41eb920b5665b7a1b7cd9f38955c31eeb350847 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -108,6 +108,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -112,6 +112,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface if (!org.bukkit.craftbukkit.Main.useConsole) { return; } @@ -331,7 +331,7 @@ index 1b5e2e07a7723f61d4c4d4e3141c60b2f63e2b69..9249122da7282929f87613f41984b808 jline.console.ConsoleReader bufferedreader = DedicatedServer.this.reader; // MC-33041, SPIGOT-5538: if System.in is not valid due to javaw, then return -@@ -139,7 +142,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -143,7 +146,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface continue; } if (s.trim().length() > 0) { // Trim to filter lines which are just spaces @@ -340,7 +340,7 @@ index 1b5e2e07a7723f61d4c4d4e3141c60b2f63e2b69..9249122da7282929f87613f41984b808 } // CraftBukkit end } -@@ -147,6 +150,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -151,6 +154,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface DedicatedServer.LOGGER.error("Exception handling console input", ioexception); } @@ -349,7 +349,7 @@ index 1b5e2e07a7723f61d4c4d4e3141c60b2f63e2b69..9249122da7282929f87613f41984b808 } }; -@@ -158,6 +163,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -162,6 +167,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } global.addHandler(new org.bukkit.craftbukkit.util.ForwardLogHandler()); @@ -359,7 +359,7 @@ index 1b5e2e07a7723f61d4c4d4e3141c60b2f63e2b69..9249122da7282929f87613f41984b808 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) { -@@ -168,6 +176,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -172,6 +180,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface TerminalConsoleWriterThread writerThread = new TerminalConsoleWriterThread(System.out, this.reader); this.reader.setCompletionHandler(new TerminalCompletionHandler(writerThread, this.reader.getCompletionHandler())); writerThread.start(); @@ -382,7 +382,7 @@ index 3d92c61f7781221cfdc0324d11bd0088954e4a68..84a2c6c397604279ba821286f5c3c855 if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(() -> { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 0ff094a90bf471ce57a3054c7701dc3d67742d9d..50f4b77c83854932050cc543c7c2deeae641794f 100644 +index 9113c183f1e977f71eea95a891618883b075ce5a..9807c5b2b248a62a476bfe3ae023d57d35811049 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -161,8 +161,7 @@ public abstract class PlayerList { @@ -396,7 +396,7 @@ index 0ff094a90bf471ce57a3054c7701dc3d67742d9d..50f4b77c83854932050cc543c7c2deea 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 beff0bfe2502a17fd297524c51f96b33f889db93..749a4f1e8e46e0b072832056186d709a93df4b58 100644 +index 0e3ff653211b0210f8679b475d5f62eecbdfd946..7eb94216cc556ad4c6c76ffab0ca81861d2c1883 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -43,7 +43,7 @@ import java.util.logging.Level; @@ -408,7 +408,7 @@ index beff0bfe2502a17fd297524c51f96b33f889db93..749a4f1e8e46e0b072832056186d709a import net.minecraft.advancements.AdvancementHolder; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; -@@ -1343,9 +1343,13 @@ public final class CraftServer implements Server { +@@ -1346,9 +1346,13 @@ public final class CraftServer implements Server { return this.logger; } @@ -423,7 +423,7 @@ index beff0bfe2502a17fd297524c51f96b33f889db93..749a4f1e8e46e0b072832056186d709a @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 73c44f94aac069fa3ea9e82be6b95e77a2421c63..2ef6386ea4b95211e26c8759cae849cbe68e3f40 100644 +index 985b77911d03bc60a0210b796e901f31e2676268..9de87edb75947382fda114df883fb4b31c1a7141 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -13,7 +13,6 @@ import java.util.logging.Logger; diff --git a/patches/unapplied/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch b/patches/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch index 06f72a1d84..714d232818 100644 --- a/patches/unapplied/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch +++ b/patches/server/0012-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 90ca693814a82c30de238b0228750b769a9a9c80..b3160912aeaddf8990e3bab9fce29532cefd8dcc 100644 +index 0a05e753ff5e7b1d741c7719524715d7364cac4f..d82d1e90cbda544b3d20edcc13d1cb955c48f731 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,7 +23,7 @@ dependencies { @@ -28,7 +28,7 @@ index 90ca693814a82c30de238b0228750b769a9a9c80..b3160912aeaddf8990e3bab9fce29532 runtimeOnly(log4jPlugins.output) alsoShade(log4jPlugins.output) diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 60e354fe1d32cd315ed42cea4484c83c4b5e7e25..899e85ea70edfb6553dc27462690da8caa793f77 100644 +index fbbc08c5a189b99f8047e0f0f5cd31101149dbec..b717c9d8b6edc2cafc9281140913b7bdb6108cf0 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -288,7 +288,7 @@ public class SpigotConfig diff --git a/patches/unapplied/server/0013-Improve-Log4J-Configuration-Plugin-Loggers.patch b/patches/server/0013-Improve-Log4J-Configuration-Plugin-Loggers.patch index 4f654facd6..4f654facd6 100644 --- a/patches/unapplied/server/0013-Improve-Log4J-Configuration-Plugin-Loggers.patch +++ b/patches/server/0013-Improve-Log4J-Configuration-Plugin-Loggers.patch diff --git a/patches/unapplied/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch b/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch index bbcf902fd1..1d920095cb 100644 --- a/patches/unapplied/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch +++ b/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread diff --git a/build.gradle.kts b/build.gradle.kts -index b3160912aeaddf8990e3bab9fce29532cefd8dcc..5a4beeb031538af9e34914066a9b848b7beb1dc3 100644 +index d82d1e90cbda544b3d20edcc13d1cb955c48f731..3bd5c2a2add9b462523beb9dfaf2eb5a00d470b9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,6 +34,7 @@ dependencies { implementation("commons-lang:commons-lang:2.6") - runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") - runtimeOnly("com.mysql:mysql-connector-j:8.3.0") + runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") + runtimeOnly("com.mysql:mysql-connector-j:8.4.0") + runtimeOnly("com.lmax:disruptor:3.4.4") // Paper runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6") diff --git a/patches/unapplied/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index a434b7b283..7e2c824c7e 100644 --- a/patches/unapplied/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and diff --git a/build.gradle.kts b/build.gradle.kts -index 5a4beeb031538af9e34914066a9b848b7beb1dc3..66cdd81e4b65ce00973f86763cea566e43053722 100644 +index 3bd5c2a2add9b462523beb9dfaf2eb5a00d470b9..a2bb659ae3a502d4c181d1ccbd15eefc38e4823b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -45,6 +45,7 @@ dependencies { @@ -442,7 +442,7 @@ index 0000000000000000000000000000000000000000..c0a486cb46ff30353c3ff09567891cd3 + } +} diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java -index a23407fa1b906743890cff74f5051ad55d59c85e..06c514b2d0674cd7df6692981f020437ea0f2f91 100644 +index 1938ae691dafec1fc1e5a68792d1191bd52b4e5c..268310642181a715815d3b2d1c0f090e6252971a 100644 --- a/src/main/java/net/minecraft/CrashReport.java +++ b/src/main/java/net/minecraft/CrashReport.java @@ -34,6 +34,7 @@ public class CrashReport { @@ -466,7 +466,7 @@ index f367ba058018074bfe6e4fe88bcc875ea9794d9e..2176171954609fd88f97f93408e14e01 } } diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 256a983c7345902600d52d7b7e3056162275f4c7..0ccfdceea8e211c595be2dad2392876109b4eeef 100644 +index 77985072928a1b892fb4f7dec1d0899324780082..f5e6610d271ef2c997fb3d1a5f65e0bf0740805a 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -82,13 +82,13 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -486,7 +486,7 @@ index 256a983c7345902600d52d7b7e3056162275f4c7..0ccfdceea8e211c595be2dad23928761 }); private static final ProtocolInfo<ServerHandshakePacketListener> INITIAL_PROTOCOL = HandshakeProtocols.SERVERBOUND; private final PacketFlow receiving; -@@ -189,7 +189,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { +@@ -197,7 +197,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { } } @@ -496,10 +496,10 @@ index 256a983c7345902600d52d7b7e3056162275f4c7..0ccfdceea8e211c595be2dad23928761 protected void channelRead0(ChannelHandlerContext channelhandlercontext, Packet<?> packet) { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 9249122da7282929f87613f41984b8085d7b53ec..21b8f1913ff54d2b1553826269355da8bdb7f702 100644 +index b41eb920b5665b7a1b7cd9f38955c31eeb350847..bb59986c211f7d6ea50b1ad4bd5565227bec8a6c 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -206,6 +206,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -210,6 +210,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface org.spigotmc.SpigotConfig.init((java.io.File) this.options.valueOf("spigot-settings")); org.spigotmc.SpigotConfig.registerCommands(); // Spigot end diff --git a/patches/unapplied/server/0016-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch b/patches/server/0016-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch index 0fdcde78a6..0fdcde78a6 100644 --- a/patches/unapplied/server/0016-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch +++ b/patches/server/0016-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch diff --git a/patches/unapplied/server/0017-Paper-command.patch b/patches/server/0017-Paper-command.patch index 32d75f1265..54d41bd762 100644 --- a/patches/unapplied/server/0017-Paper-command.patch +++ b/patches/server/0017-Paper-command.patch @@ -605,10 +605,10 @@ index 0000000000000000000000000000000000000000..ae60bd96b5284d54676d8e7e4dd5d170 + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 21b8f1913ff54d2b1553826269355da8bdb7f702..b9c22f725f5aeaee469fe5b7d8c3a57ddb1d5bdd 100644 +index bb59986c211f7d6ea50b1ad4bd5565227bec8a6c..9c950fc1de15b5039e34a9fdf893e97a8cc13237 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -211,6 +211,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -215,6 +215,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess()); this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Paper end - initialize global and world-defaults configuration @@ -617,10 +617,10 @@ index 21b8f1913ff54d2b1553826269355da8bdb7f702..b9c22f725f5aeaee469fe5b7d8c3a57d this.setPvpAllowed(dedicatedserverproperties.pvp); this.setFlightAllowed(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 749a4f1e8e46e0b072832056186d709a93df4b58..af1bca27eb2445218f7daeab3912e561085c9c00 100644 +index 7eb94216cc556ad4c6c76ffab0ca81861d2c1883..e7301f38be4fae26404fd8dd33798ef0764565ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -975,6 +975,7 @@ public final class CraftServer implements Server { +@@ -978,6 +978,7 @@ public final class CraftServer implements Server { this.commandMap.clearCommands(); this.reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot @@ -628,7 +628,7 @@ index 749a4f1e8e46e0b072832056186d709a93df4b58..af1bca27eb2445218f7daeab3912e561 this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2695,6 +2696,34 @@ public final class CraftServer implements Server { +@@ -2703,6 +2704,34 @@ public final class CraftServer implements Server { // Paper end // Paper start diff --git a/patches/unapplied/server/0018-Paper-Metrics.patch b/patches/server/0018-Paper-Metrics.patch index 927bc4dc2d..46c111b03f 100644 --- a/patches/unapplied/server/0018-Paper-Metrics.patch +++ b/patches/server/0018-Paper-Metrics.patch @@ -698,10 +698,10 @@ index 0000000000000000000000000000000000000000..6aaed8e8bf8c721fc834da5c76ac72a4 + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index b9c22f725f5aeaee469fe5b7d8c3a57ddb1d5bdd..0d6688e9da81453e64daacfb81e4a13cc37b3e66 100644 +index 9c950fc1de15b5039e34a9fdf893e97a8cc13237..6ba90739c20995362a5275e2259cac9e17fbcf59 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -212,6 +212,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -216,6 +216,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Paper end - initialize global and world-defaults configuration io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command @@ -710,7 +710,7 @@ index b9c22f725f5aeaee469fe5b7d8c3a57ddb1d5bdd..0d6688e9da81453e64daacfb81e4a13c this.setPvpAllowed(dedicatedserverproperties.pvp); this.setFlightAllowed(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 899e85ea70edfb6553dc27462690da8caa793f77..27b01f7ed930baab466a5e4f9608e9e1a4da0978 100644 +index b717c9d8b6edc2cafc9281140913b7bdb6108cf0..ba621fdc82896245f6ce448e084847edc4d3fe08 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -83,6 +83,7 @@ public class SpigotConfig diff --git a/patches/unapplied/server/0019-Paper-Plugins.patch b/patches/server/0019-Paper-Plugins.patch index 40cddbf7fe..84a4fe0f8f 100644 --- a/patches/unapplied/server/0019-Paper-Plugins.patch +++ b/patches/server/0019-Paper-Plugins.patch @@ -7194,10 +7194,10 @@ index f7114d5b8f2f93f62883e24da29afaf9f74ee1a6..8bf0630c0e06950cd99b7ae9898137f7 return foundFrame.orElse(null); diff --git a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java -index bc91370654f5da33cbfe7d42431568915c1159d6..b43af53960978ac04bccde08544a562841492791 100644 +index 34b3b3251da21bce616870d312fd42fd58ba7881..cbc1658e0df4070605a6b2fbe99167b3bc001223 100644 --- a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java +++ b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java -@@ -304,7 +304,13 @@ public class BuiltInRegistries { +@@ -322,7 +322,13 @@ public class BuiltInRegistries { } public static void bootStrap() { @@ -7212,10 +7212,10 @@ index bc91370654f5da33cbfe7d42431568915c1159d6..b43af53960978ac04bccde08544a5628 validate(REGISTRY); } diff --git a/src/main/java/net/minecraft/server/Bootstrap.java b/src/main/java/net/minecraft/server/Bootstrap.java -index 15ee2f2a83bfef2f6891d9bfb2d3a8c14b24ffb1..26892378d27dadce25c178333188ba093dc1617b 100644 +index 394792291e3b89e5fd757907eecd85ccc71183e2..8f1992188f7fd9e735569e099b36a7eafed47aae 100644 --- a/src/main/java/net/minecraft/server/Bootstrap.java +++ b/src/main/java/net/minecraft/server/Bootstrap.java -@@ -63,6 +63,7 @@ public class Bootstrap { +@@ -62,6 +62,7 @@ public class Bootstrap { Bootstrap.isBootstrapped = true; Instant instant = Instant.now(); @@ -7223,7 +7223,7 @@ index 15ee2f2a83bfef2f6891d9bfb2d3a8c14b24ffb1..26892378d27dadce25c178333188ba09 if (BuiltInRegistries.REGISTRY.keySet().isEmpty()) { throw new IllegalStateException("Unable to load registries"); } else { -@@ -74,7 +75,10 @@ public class Bootstrap { +@@ -73,7 +74,10 @@ public class Bootstrap { EntitySelectorOptions.bootStrap(); DispenseItemBehavior.bootStrap(); CauldronInteraction.bootStrap(); @@ -7248,10 +7248,10 @@ index 5b4ac7b4fd0077e900e9f788963f1613bbc9a5d0..6afede80c10503a261d0f735c351d943 Bootstrap.validate(); Util.startTimerHackThread(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index af1bca27eb2445218f7daeab3912e561085c9c00..709712a9e5cadca181ef74302ca9e90703d74ca8 100644 +index e7301f38be4fae26404fd8dd33798ef0764565ac..3f748a8f067d8ce8c39272cb3decaf4ec4879da5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -276,7 +276,8 @@ public final class CraftServer implements Server { +@@ -277,7 +277,8 @@ public final class CraftServer implements Server { private final CraftCommandMap commandMap = new CraftCommandMap(this); private final SimpleHelpMap helpMap = new SimpleHelpMap(this); private final StandardMessenger messenger = new StandardMessenger(); @@ -7261,7 +7261,7 @@ index af1bca27eb2445218f7daeab3912e561085c9c00..709712a9e5cadca181ef74302ca9e907 private final StructureManager structureManager; protected final DedicatedServer console; protected final DedicatedPlayerList playerList; -@@ -443,24 +444,7 @@ public final class CraftServer implements Server { +@@ -446,24 +447,7 @@ public final class CraftServer implements Server { } public void loadPlugins() { @@ -7287,7 +7287,7 @@ index af1bca27eb2445218f7daeab3912e561085c9c00..709712a9e5cadca181ef74302ca9e907 } public void enablePlugins(PluginLoadOrder type) { -@@ -549,15 +533,17 @@ public final class CraftServer implements Server { +@@ -552,15 +536,17 @@ public final class CraftServer implements Server { private void enablePlugin(Plugin plugin) { try { List<Permission> perms = plugin.getDescription().getPermissions(); @@ -7311,7 +7311,7 @@ index af1bca27eb2445218f7daeab3912e561085c9c00..709712a9e5cadca181ef74302ca9e907 this.pluginManager.enablePlugin(plugin); } catch (Throwable ex) { -@@ -999,6 +985,7 @@ public final class CraftServer implements Server { +@@ -1002,6 +988,7 @@ public final class CraftServer implements Server { "This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin" )); } @@ -7337,7 +7337,7 @@ index 909b2c98e7a9117d2f737245e4661792ffafb744..d96399e9bf1a58db5a4a22e58abb99e7 @Override public FileConfiguration getConfig() { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 8727d09566cba3b7223e4c72f960e568a9d8bb62..66c75a4baa35970254027d42e017fa62b791590b 100644 +index fb22e04a4a9f039f0e942ff837124b00ca1b12be..297767f64c1a7c01cffd6d78e71b60746622f22e 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -426,6 +426,16 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0020-Plugin-remapping.patch b/patches/server/0020-Plugin-remapping.patch index 676da40fff..8089ed1b6d 100644 --- a/patches/unapplied/server/0020-Plugin-remapping.patch +++ b/patches/server/0020-Plugin-remapping.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Plugin remapping Co-authored-by: Nassim Jahnke <[email protected]> diff --git a/build.gradle.kts b/build.gradle.kts -index 66cdd81e4b65ce00973f86763cea566e43053722..2868eb8f9e577ce839d7ecf5ce8fed5bad957dbe 100644 +index a2bb659ae3a502d4c181d1ccbd15eefc38e4823b..8350fc099b68918fb03a21b6a5047ceee72dcbb4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -46,6 +46,7 @@ dependencies { @@ -1553,10 +1553,10 @@ index 0000000000000000000000000000000000000000..badff5d6ae6dd8d209c82bc7e8afe370 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8dfa0fae4d5129688b7e2897da1fc51683aed6c3..5c0d2cb215e334b32332e322e931d72c46027190 100644 +index e82218de79759dfaa7fe2a5a78e150f135bf01a3..202a6510d9d093119ff88b910cef6e47fce2e6b8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -636,6 +636,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -643,6 +643,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD); @@ -1564,7 +1564,7 @@ index 8dfa0fae4d5129688b7e2897da1fc51683aed6c3..5c0d2cb215e334b32332e322e931d72c this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP)); this.connection.acceptConnections(); } -@@ -909,6 +910,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -916,6 +917,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.server.disablePlugins(); } // CraftBukkit end @@ -1573,10 +1573,10 @@ index 8dfa0fae4d5129688b7e2897da1fc51683aed6c3..5c0d2cb215e334b32332e322e931d72c this.isSaving = true; if (this.playerList != null) { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 0d6688e9da81453e64daacfb81e4a13cc37b3e66..98cba55466d6798e5de33d8dcbf03e205e5199d8 100644 +index 6ba90739c20995362a5275e2259cac9e17fbcf59..d38ecbc208c34509eaf77751ac45d9ef51a5dce8 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -315,6 +315,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -319,6 +319,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } } @@ -1904,10 +1904,10 @@ index 0000000000000000000000000000000000000000..73b20a92f330311e3fef8f03b51a0985 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 709712a9e5cadca181ef74302ca9e90703d74ca8..a348ddb7ca863da0b2d5eea1bb30bb356a6a751f 100644 +index 3f748a8f067d8ce8c39272cb3decaf4ec4879da5..d1699fcca66bcfbbe8fcc426802cb766cf1e580b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -989,6 +989,7 @@ public final class CraftServer implements Server { +@@ -992,6 +992,7 @@ public final class CraftServer implements Server { this.loadPlugins(); this.enablePlugins(PluginLoadOrder.STARTUP); this.enablePlugins(PluginLoadOrder.POSTWORLD); diff --git a/patches/unapplied/server/0021-Hook-into-CB-plugin-rewrites.patch b/patches/server/0021-Hook-into-CB-plugin-rewrites.patch index aaf1564e9f..2652791358 100644 --- a/patches/unapplied/server/0021-Hook-into-CB-plugin-rewrites.patch +++ b/patches/server/0021-Hook-into-CB-plugin-rewrites.patch @@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index beccd928d151164db8c29f5b7addefbe9a195311..dedcdac1c6b2ba056761d5bd02212c1fb76348c4 100644 +index 6500c1dad7a48256b8a58b0655f4972c0e7a5dd0..c8c40052d0bb7791297a215ba18fb093fbfda7b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -8,6 +8,7 @@ import java.util.ArrayList; @@ -27,9 +27,9 @@ index beccd928d151164db8c29f5b7addefbe9a195311..dedcdac1c6b2ba056761d5bd02212c1f import joptsimple.OptionParser; import joptsimple.OptionSet; import joptsimple.OptionSpec; -@@ -77,6 +79,40 @@ public class Commodore { - private static final Map<String, RerouteMethodData> FIELD_RENAME_METHOD_REROUTE = Commodore.createReroutes(FieldRename.class); +@@ -79,6 +81,40 @@ public class Commodore { private static final Map<String, RerouteMethodData> MATERIAL_METHOD_REROUTE = Commodore.createReroutes(MaterialRerouting.class); + private static final Map<String, RerouteMethodData> METHOD_REROUTE = Commodore.createReroutes(MethodRerouting.class); + // Paper start - Plugin rewrites + private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap(); @@ -68,7 +68,7 @@ index beccd928d151164db8c29f5b7addefbe9a195311..dedcdac1c6b2ba056761d5bd02212c1f public static void main(String[] args) { OptionParser parser = new OptionParser(); OptionSpec<File> inputFlag = parser.acceptsAll(Arrays.asList("i", "input")).withRequiredArg().ofType(File.class).required(); -@@ -203,9 +239,49 @@ public class Commodore { +@@ -205,9 +241,49 @@ public class Commodore { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { return new MethodVisitor(this.api, super.visitMethod(access, name, desc, signature, exceptions)) { @@ -118,7 +118,7 @@ index beccd928d151164db8c29f5b7addefbe9a195311..dedcdac1c6b2ba056761d5bd02212c1f name = FieldRename.rename(pluginVersion, owner, name); if (modern) { -@@ -301,6 +377,13 @@ public class Commodore { +@@ -306,6 +382,13 @@ public class Commodore { return; } @@ -132,7 +132,7 @@ index beccd928d151164db8c29f5b7addefbe9a195311..dedcdac1c6b2ba056761d5bd02212c1f if (modern) { if (owner.equals("org/bukkit/Material") || (instantiatedMethodType != null && instantiatedMethodType.getDescriptor().startsWith("(Lorg/bukkit/Material;)"))) { switch (name) { -@@ -397,6 +480,13 @@ public class Commodore { +@@ -402,6 +485,13 @@ public class Commodore { @Override public void visitLdcInsn(Object value) { @@ -146,7 +146,7 @@ index beccd928d151164db8c29f5b7addefbe9a195311..dedcdac1c6b2ba056761d5bd02212c1f if (value instanceof String && ((String) value).equals("com.mysql.jdbc.Driver")) { super.visitLdcInsn("com.mysql.cj.jdbc.Driver"); return; -@@ -407,6 +497,14 @@ public class Commodore { +@@ -412,6 +502,14 @@ public class Commodore { @Override public void visitInvokeDynamicInsn(String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) { @@ -161,7 +161,7 @@ index beccd928d151164db8c29f5b7addefbe9a195311..dedcdac1c6b2ba056761d5bd02212c1f if (bootstrapMethodHandle.getOwner().equals("java/lang/invoke/LambdaMetafactory") && bootstrapMethodHandle.getName().equals("metafactory") && bootstrapMethodArguments.length == 3) { Type samMethodType = (Type) bootstrapMethodArguments[0]; -@@ -423,7 +521,7 @@ public class Commodore { +@@ -428,7 +526,7 @@ public class Commodore { methodArgs.add(new Handle(newOpcode, newOwner, newName, newDescription, newItf)); methodArgs.add(newInstantiated); @@ -170,7 +170,7 @@ index beccd928d151164db8c29f5b7addefbe9a195311..dedcdac1c6b2ba056761d5bd02212c1f }, implMethod.getTag(), implMethod.getOwner(), implMethod.getName(), implMethod.getDesc(), implMethod.isInterface(), samMethodType, instantiatedMethodType); return; } -@@ -474,6 +572,12 @@ public class Commodore { +@@ -479,6 +577,12 @@ public class Commodore { @Override public FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) { diff --git a/patches/unapplied/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch b/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch index 5581e00de5..8211d56891 100644 --- a/patches/unapplied/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch +++ b/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Remap reflection calls in plugins using internals Co-authored-by: Jason Penilla <[email protected]> diff --git a/build.gradle.kts b/build.gradle.kts -index 2868eb8f9e577ce839d7ecf5ce8fed5bad957dbe..158779a3590f089c4224b2b128c2e653aef42a94 100644 +index 8350fc099b68918fb03a21b6a5047ceee72dcbb4..708448e071ddb5558658d3096b1d7ee2593ec8c5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -47,6 +47,12 @@ dependencies { @@ -645,11 +645,11 @@ index 242811578a786e3807a1a7019d472d5a68f87116..0b65fdf53124f3dd042b2363b1b8df8e return traceElements; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index dedcdac1c6b2ba056761d5bd02212c1fb76348c4..f45498bf9841c31338b83270c1badc6d7a792d25 100644 +index c8c40052d0bb7791297a215ba18fb093fbfda7b6..e8bdc9f97cc506ca8509480ea0c07facc778df8d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -80,36 +80,26 @@ public class Commodore { - private static final Map<String, RerouteMethodData> MATERIAL_METHOD_REROUTE = Commodore.createReroutes(MaterialRerouting.class); +@@ -82,36 +82,26 @@ public class Commodore { + private static final Map<String, RerouteMethodData> METHOD_REROUTE = Commodore.createReroutes(MethodRerouting.class); // Paper start - Plugin rewrites - private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap(); @@ -696,7 +696,7 @@ index dedcdac1c6b2ba056761d5bd02212c1fb76348c4..f45498bf9841c31338b83270c1badc6d } // Paper end - Plugin rewrites -@@ -180,7 +170,7 @@ public class Commodore { +@@ -182,7 +172,7 @@ public class Commodore { ClassReader cr = new ClassReader(b); ClassWriter cw = new ClassWriter(cr, 0); @@ -706,7 +706,7 @@ index dedcdac1c6b2ba056761d5bd02212c1fb76348c4..f45498bf9841c31338b83270c1badc6d String className; boolean isInterface; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 66c75a4baa35970254027d42e017fa62b791590b..2de7ee6afa7eb404d7aeaa5ef7c7190d8287de1d 100644 +index 297767f64c1a7c01cffd6d78e71b60746622f22e..d551c9d898d8b5128dfef84d206396c84072abe4 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -361,7 +361,7 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0023-Timings-v2.patch b/patches/server/0023-Timings-v2.patch index 7e40f11006..74a61a6b4a 100644 --- a/patches/unapplied/server/0023-Timings-v2.patch +++ b/patches/server/0023-Timings-v2.patch @@ -700,10 +700,10 @@ index 0000000000000000000000000000000000000000..2f0d9b953802dee821cfde82d22b0567 + } +} diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -index 73e7bb59596600df1b1953175f6da17bee54a65c..e161ad0f53a21a68e8c78575ba5d3cdbdb11fca0 100644 +index f7197f1347251a37dd0f6d9ffa2f09bc3a4e1233..d0d36a57ec4896bcb74970f8fb24d8f3e17db133 100644 --- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java +++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -@@ -30,7 +30,8 @@ public class PacketUtils { +@@ -31,7 +31,8 @@ public class PacketUtils { engine.executeIfPossible(() -> { if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players if (listener.shouldHandleMessage(packet)) { @@ -714,19 +714,19 @@ index 73e7bb59596600df1b1953175f6da17bee54a65c..e161ad0f53a21a68e8c78575ba5d3cdb } catch (Exception exception) { if (exception instanceof ReportedException) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5c0d2cb215e334b32332e322e931d72c46027190..e419ccaf2378d4736b8162092e537006aa3e1288 100644 +index 202a6510d9d093119ff88b910cef6e47fce2e6b8..4137cf4d716680ff1b1ab0b8a3e8f7cb4bae7dbe 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -190,7 +190,7 @@ import org.bukkit.craftbukkit.Main; +@@ -196,7 +196,7 @@ import org.bukkit.craftbukkit.Main; import org.bukkit.event.server.ServerLoadEvent; // CraftBukkit end -import org.bukkit.craftbukkit.SpigotTimings; // Spigot +import co.aikar.timings.MinecraftTimings; // Paper - public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable { + public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, ChunkIOErrorReporter, CommandSource, AutoCloseable { -@@ -905,6 +905,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -912,6 +912,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } MinecraftServer.LOGGER.info("Stopping server"); @@ -734,7 +734,7 @@ index 5c0d2cb215e334b32332e322e931d72c46027190..e419ccaf2378d4736b8162092e537006 // CraftBukkit start if (this.server != null) { this.server.disablePlugins(); -@@ -1182,9 +1183,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1189,9 +1190,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa private boolean haveTime() { // CraftBukkit start @@ -756,7 +756,7 @@ index 5c0d2cb215e334b32332e322e931d72c46027190..e419ccaf2378d4736b8162092e537006 private void executeModerately() { this.runAllTasks(); java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L); -@@ -1192,9 +1205,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1220,9 +1233,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } protected void waitUntilNextTick() { @@ -768,7 +768,7 @@ index 5c0d2cb215e334b32332e322e931d72c46027190..e419ccaf2378d4736b8162092e537006 }); } -@@ -1295,9 +1308,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1323,9 +1336,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } public void tickServer(BooleanSupplier shouldKeepTicking) { @@ -787,7 +787,7 @@ index 5c0d2cb215e334b32332e322e931d72c46027190..e419ccaf2378d4736b8162092e537006 ++this.tickCount; this.tickRateManager.tick(); this.tickChildren(shouldKeepTicking); -@@ -1311,15 +1332,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1339,15 +1360,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (this.autosavePeriod > 0 && this.ticksUntilAutosave <= 0) { this.ticksUntilAutosave = this.autosavePeriod; // CraftBukkit end @@ -808,7 +808,7 @@ index 5c0d2cb215e334b32332e322e931d72c46027190..e419ccaf2378d4736b8162092e537006 this.profiler.push("tallying"); long j = Util.getNanos() - i; int k = this.tickCount % 100; -@@ -1331,8 +1355,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1359,8 +1383,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.logTickMethodTime(i); this.profiler.pop(); org.spigotmc.WatchdogThread.tick(); // Spigot @@ -818,7 +818,7 @@ index 5c0d2cb215e334b32332e322e931d72c46027190..e419ccaf2378d4736b8162092e537006 } private void logTickMethodTime(long tickStartTime) { -@@ -1403,26 +1426,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1431,26 +1454,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.getPlayerList().getPlayers().forEach((entityplayer) -> { entityplayer.connection.suspendFlushing(); }); @@ -852,7 +852,7 @@ index 5c0d2cb215e334b32332e322e931d72c46027190..e419ccaf2378d4736b8162092e537006 // Send time updates to everyone, it will get the right time from the world the player is in. if (this.tickCount % 20 == 0) { for (int i = 0; i < this.getPlayerList().players.size(); ++i) { -@@ -1430,7 +1453,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1458,7 +1481,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level().getGameTime(), entityplayer.getPlayerTime(), entityplayer.level().getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time } } @@ -861,7 +861,7 @@ index 5c0d2cb215e334b32332e322e931d72c46027190..e419ccaf2378d4736b8162092e537006 while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); -@@ -1471,24 +1494,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1499,24 +1522,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } this.profiler.popPush("connection"); @@ -893,10 +893,10 @@ index 5c0d2cb215e334b32332e322e931d72c46027190..e419ccaf2378d4736b8162092e537006 this.profiler.popPush("send chunks"); iterator = this.playerList.getPlayers().iterator(); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 98cba55466d6798e5de33d8dcbf03e205e5199d8..8dcfcce4ccf0320b5d5b9eda2d1b5ebe04e26a13 100644 +index d38ecbc208c34509eaf77751ac45d9ef51a5dce8..b51c3f8c485496734ea58c15377a1215a334c765 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -63,10 +63,11 @@ import org.apache.logging.log4j.Level; +@@ -65,10 +65,11 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.io.IoBuilder; import org.bukkit.command.CommandSender; @@ -909,7 +909,7 @@ index 98cba55466d6798e5de33d8dcbf03e205e5199d8..8dcfcce4ccf0320b5d5b9eda2d1b5ebe import org.bukkit.event.server.RemoteServerCommandEvent; // CraftBukkit end -@@ -435,7 +436,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -439,7 +440,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } public void handleConsoleInputs() { @@ -918,7 +918,7 @@ index 98cba55466d6798e5de33d8dcbf03e205e5199d8..8dcfcce4ccf0320b5d5b9eda2d1b5ebe while (!this.consoleInput.isEmpty()) { ConsoleInput servercommand = (ConsoleInput) this.consoleInput.remove(0); -@@ -450,7 +451,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -454,7 +455,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface // CraftBukkit end } @@ -927,7 +927,7 @@ index 98cba55466d6798e5de33d8dcbf03e205e5199d8..8dcfcce4ccf0320b5d5b9eda2d1b5ebe } @Override -@@ -708,7 +709,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -712,7 +713,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } public String runCommand(RconConsoleSource rconConsoleSource, String s) { @@ -937,7 +937,7 @@ index 98cba55466d6798e5de33d8dcbf03e205e5199d8..8dcfcce4ccf0320b5d5b9eda2d1b5ebe this.executeBlocking(() -> { CommandSourceStack wrapper = rconConsoleSource.createCommandSourceStack(); RemoteServerCommandEvent event = new RemoteServerCommandEvent(rconConsoleSource.getBukkitSender(wrapper), s); -@@ -716,9 +719,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -720,9 +723,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface if (event.isCancelled()) { return; } @@ -978,7 +978,7 @@ index 98cba55466d6798e5de33d8dcbf03e205e5199d8..8dcfcce4ccf0320b5d5b9eda2d1b5ebe // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index e53b68f91183c8abcc9a0f7d97adfc212aec02c6..15c9f4822d1d11d05de6c2d6797ee3e845b3a1ab 100644 +index ce0d22452171857e3cf070bf01450a7653ec7142..6581566ca4e4fac0691e4f5851f8895d9ac7a38f 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1,8 +1,10 @@ @@ -992,7 +992,7 @@ index e53b68f91183c8abcc9a0f7d97adfc212aec02c6..15c9f4822d1d11d05de6c2d6797ee3e8 import com.google.common.collect.Lists; import com.google.common.collect.Queues; import com.google.common.collect.Sets; -@@ -1483,6 +1485,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1363,6 +1365,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider List<ServerPlayer> list = Lists.newArrayList(); List<ServerPlayer> list1 = this.level.players(); ObjectIterator objectiterator = this.entityMap.values().iterator(); @@ -1000,7 +1000,7 @@ index e53b68f91183c8abcc9a0f7d97adfc212aec02c6..15c9f4822d1d11d05de6c2d6797ee3e8 ChunkMap.TrackedEntity playerchunkmap_entitytracker; -@@ -1507,14 +1510,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1387,14 +1390,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider playerchunkmap_entitytracker.serverEntity.sendChanges(); } } @@ -1019,10 +1019,10 @@ index e53b68f91183c8abcc9a0f7d97adfc212aec02c6..15c9f4822d1d11d05de6c2d6797ee3e8 } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 712670230b6b881101b4128c1d275f2559fa705a..c4c85ba56c52a00e10e61fe0954d7fb8de471bdd 100644 +index ff68eff051c5f50b20b26d33001e12741dd3000e..946cf6e186c6b283e705aa9a8cc9726889ebb954 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -268,13 +268,15 @@ public class ServerChunkCache extends ChunkSource { +@@ -269,13 +269,15 @@ public class ServerChunkCache extends ChunkSource { } gameprofilerfiller.incrementCounter("getChunkCacheMiss"); @@ -1040,7 +1040,7 @@ index 712670230b6b881101b4128c1d275f2559fa705a..c4c85ba56c52a00e10e61fe0954d7fb8 ChunkResult<ChunkAccess> chunkresult = (ChunkResult) completablefuture.join(); ChunkAccess ichunkaccess1 = (ChunkAccess) chunkresult.orElse(null); // CraftBukkit - decompile error -@@ -463,7 +465,9 @@ public class ServerChunkCache extends ChunkSource { +@@ -440,7 +442,9 @@ public class ServerChunkCache extends ChunkSource { public void save(boolean flush) { this.runDistanceManagerUpdates(); @@ -1050,7 +1050,7 @@ index 712670230b6b881101b4128c1d275f2559fa705a..c4c85ba56c52a00e10e61fe0954d7fb8 } @Override -@@ -505,10 +509,10 @@ public class ServerChunkCache extends ChunkSource { +@@ -482,10 +486,10 @@ public class ServerChunkCache extends ChunkSource { this.level.timings.doChunkMap.stopTiming(); // Spigot this.level.getProfiler().popPush("chunks"); if (tickChunks) { @@ -1063,7 +1063,7 @@ index 712670230b6b881101b4128c1d275f2559fa705a..c4c85ba56c52a00e10e61fe0954d7fb8 } this.level.timings.doChunkUnload.startTiming(); // Spigot -@@ -531,6 +535,7 @@ public class ServerChunkCache extends ChunkSource { +@@ -508,6 +512,7 @@ public class ServerChunkCache extends ChunkSource { gameprofilerfiller.push("filteringLoadedChunks"); List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size()); Iterator iterator = this.chunkMap.getChunks().iterator(); @@ -1071,7 +1071,7 @@ index 712670230b6b881101b4128c1d275f2559fa705a..c4c85ba56c52a00e10e61fe0954d7fb8 while (iterator.hasNext()) { ChunkHolder playerchunk = (ChunkHolder) iterator.next(); -@@ -543,8 +548,10 @@ public class ServerChunkCache extends ChunkSource { +@@ -520,8 +525,10 @@ public class ServerChunkCache extends ChunkSource { if (this.level.tickRateManager().runsNormally()) { gameprofilerfiller.popPush("naturalSpawnCount"); @@ -1082,7 +1082,7 @@ index 712670230b6b881101b4128c1d275f2559fa705a..c4c85ba56c52a00e10e61fe0954d7fb8 this.lastSpawnState = spawnercreature_d; gameprofilerfiller.popPush("spawnAndTick"); -@@ -567,22 +574,25 @@ public class ServerChunkCache extends ChunkSource { +@@ -544,22 +551,25 @@ public class ServerChunkCache extends ChunkSource { } if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) { @@ -1111,7 +1111,7 @@ index 712670230b6b881101b4128c1d275f2559fa705a..c4c85ba56c52a00e10e61fe0954d7fb8 gameprofilerfiller.pop(); gameprofilerfiller.pop(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffccacb005cb6 100644 +index eea8bafd98e3a8d82b3216488537ab898cc4ae7a..9675d91e4e7ed46147c3f7a11dd65122fe998dc2 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 @@ @@ -1123,7 +1123,7 @@ index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffcca import com.google.common.collect.Lists; import com.mojang.datafixers.DataFixer; import com.mojang.datafixers.util.Pair; -@@ -172,7 +174,6 @@ import net.minecraft.world.ticks.LevelTicks; +@@ -173,7 +175,6 @@ import net.minecraft.world.ticks.LevelTicks; import org.slf4j.Logger; import org.bukkit.Bukkit; import org.bukkit.WeatherType; @@ -1131,7 +1131,7 @@ index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffcca import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.generator.CustomWorldChunkManager; import org.bukkit.craftbukkit.util.WorldUUID; -@@ -477,7 +478,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -478,7 +479,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } gameprofilerfiller.popPush("tickPending"); @@ -1140,7 +1140,7 @@ index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffcca if (!this.isDebug() && flag) { j = this.getGameTime(); gameprofilerfiller.push("blockTicks"); -@@ -486,15 +487,19 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -487,15 +488,19 @@ public class ServerLevel extends Level implements WorldGenLevel { this.fluidTicks.tick(j, 65536, this::tickFluid); gameprofilerfiller.pop(); } @@ -1161,7 +1161,7 @@ index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffcca gameprofilerfiller.popPush("blockEvents"); if (flag) { this.timings.doSounds.startTiming(); // Spigot -@@ -647,6 +652,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -648,6 +653,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } gameprofilerfiller.popPush("tickBlocks"); @@ -1169,7 +1169,7 @@ index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffcca if (randomTickSpeed > 0) { LevelChunkSection[] achunksection = chunk.getSections(); -@@ -679,6 +685,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -680,6 +686,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } @@ -1177,7 +1177,7 @@ index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffcca gameprofilerfiller.pop(); } -@@ -955,14 +962,22 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -956,14 +963,22 @@ public class ServerLevel extends Level implements WorldGenLevel { } public void tickNonPassenger(Entity entity) { @@ -1201,7 +1201,7 @@ index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffcca entity.setOldPosAndRot(); ProfilerFiller gameprofilerfiller = this.getProfiler(); -@@ -981,7 +996,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -982,7 +997,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickPassenger(entity, entity1); } @@ -1210,7 +1210,7 @@ index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffcca } -@@ -1023,6 +1038,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1024,6 +1039,7 @@ public class ServerLevel extends Level implements WorldGenLevel { if (!savingDisabled) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit @@ -1218,7 +1218,7 @@ index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffcca if (progressListener != null) { progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); } -@@ -1032,7 +1048,10 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1033,7 +1049,10 @@ public class ServerLevel extends Level implements WorldGenLevel { progressListener.progressStage(Component.translatable("menu.savingChunks")); } @@ -1230,7 +1230,7 @@ index 319cb644c0a42e9cc0d3ce9d1cbaa93b9c3dcd5b..a6e78b8a6ced8ec84273e2c5d18ffcca 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 7788f703c47480b009b26c23fa5e075b581c3aca..b700cd5ccf37f3592f7cb931101397fbc59dc60f 100644 +index 27cf5dceba5835f94f5397ec011f409e7b226ad5..4f50e2f5de529813c269b7670a47e06306575b60 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -330,7 +330,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1243,13 +1243,13 @@ index 7788f703c47480b009b26c23fa5e075b581c3aca..b700cd5ccf37f3592f7cb931101397fb this.ackBlockChangesUpTo = -1; @@ -397,7 +396,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 - this.disconnect(Component.translatable("multiplayer.disconnect.idling")); + this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling")); } - org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.stopTiming(); // Spigot } -@@ -2086,7 +2084,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2103,7 +2101,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } private void handleCommand(String s) { @@ -1258,7 +1258,7 @@ index 7788f703c47480b009b26c23fa5e075b581c3aca..b700cd5ccf37f3592f7cb931101397fb if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); -@@ -2096,7 +2094,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2113,7 +2111,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.cserver.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -1267,7 +1267,7 @@ index 7788f703c47480b009b26c23fa5e075b581c3aca..b700cd5ccf37f3592f7cb931101397fb return; } -@@ -2109,7 +2107,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2126,7 +2124,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; } finally { @@ -1277,7 +1277,7 @@ index 7788f703c47480b009b26c23fa5e075b581c3aca..b700cd5ccf37f3592f7cb931101397fb } // 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 50f4b77c83854932050cc543c7c2deeae641794f..26a0f1ae6fb2acb62648b0cd7996505d107db532 100644 +index 9807c5b2b248a62a476bfe3ae023d57d35811049..62174dae20bd9ff092238f1437f7e2b0114ef83b 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 @@ @@ -1287,7 +1287,7 @@ index 50f4b77c83854932050cc543c7c2deeae641794f..26a0f1ae6fb2acb62648b0cd7996505d import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1038,10 +1039,11 @@ public abstract class PlayerList { +@@ -1007,10 +1008,11 @@ public abstract class PlayerList { } public void saveAll() { @@ -1301,10 +1301,10 @@ index 50f4b77c83854932050cc543c7c2deeae641794f..26a0f1ae6fb2acb62648b0cd7996505d 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 cc3304e2ea7f58b4649da09b68ac3749bad08b00..074292615a13cf1f42ee74d629109ec1be390da5 100644 +index 6041033b3ea201bde1a73ce4e429e8b80e05e2eb..4f321f13352636999c3abc5332e50c747fb45cc9 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -138,7 +138,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; +@@ -140,7 +140,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Hanging; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Vehicle; @@ -1312,7 +1312,7 @@ index cc3304e2ea7f58b4649da09b68ac3749bad08b00..074292615a13cf1f42ee74d629109ec1 import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent; import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; -@@ -317,7 +316,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -323,7 +322,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess // Marks an entity, that it was removed by a plugin via Entity#remove // Main use case currently is for SPIGOT-7487, preventing dropping of leash when leash is removed public boolean pluginRemoved = false; @@ -1320,7 +1320,7 @@ index cc3304e2ea7f58b4649da09b68ac3749bad08b00..074292615a13cf1f42ee74d629109ec1 // Spigot start public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; -@@ -834,7 +832,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -840,7 +838,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public void move(MoverType movementType, Vec3 movement) { @@ -1328,7 +1328,7 @@ index cc3304e2ea7f58b4649da09b68ac3749bad08b00..074292615a13cf1f42ee74d629109ec1 if (this.noPhysics) { this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { -@@ -995,7 +992,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1001,7 +998,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.level().getProfiler().pop(); } } @@ -1337,7 +1337,7 @@ index cc3304e2ea7f58b4649da09b68ac3749bad08b00..074292615a13cf1f42ee74d629109ec1 private boolean isStateClimbable(BlockState state) { diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 1099a85ab7e98d8652cdd1c318f269ca31f4d783..606dbc398745b689f957e62ebd9eaa56a67a61f3 100644 +index e465aaa4fd29b4966ea8d88316c6d8f217da2e73..474f020371bb9e5fd2c5b22e44d7902977c4fc18 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -339,6 +339,15 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT @@ -1379,10 +1379,10 @@ index 1099a85ab7e98d8652cdd1c318f269ca31f4d783..606dbc398745b689f957e62ebd9eaa56 } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e..ddf4a7bc19ba358364ea4517ce941e63ec4d26a0 100644 +index 9deb6b90f3c4281280deb2f609a55923147a675a..fe52b8c57f652fcd49a2282f7a8f1041909b35cf 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -149,7 +149,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; +@@ -156,7 +156,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; import org.bukkit.event.player.PlayerItemConsumeEvent; // CraftBukkit end @@ -1391,7 +1391,7 @@ index a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e..ddf4a7bc19ba358364ea4517ce941e63 public abstract class LivingEntity extends Entity implements Attackable { -@@ -2945,7 +2945,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2949,7 +2949,6 @@ public abstract class LivingEntity extends Entity implements Attackable { @Override public void tick() { @@ -1399,7 +1399,7 @@ index a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e..ddf4a7bc19ba358364ea4517ce941e63 super.tick(); this.updatingUsingItem(); this.updateSwimAmount(); -@@ -2987,9 +2986,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2991,9 +2990,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } if (!this.isRemoved()) { @@ -1409,7 +1409,7 @@ index a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e..ddf4a7bc19ba358364ea4517ce941e63 } double d0 = this.getX() - this.xo; -@@ -3080,7 +3077,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3084,7 +3081,6 @@ public abstract class LivingEntity extends Entity implements Attackable { this.refreshDimensions(); } @@ -1417,7 +1417,7 @@ index a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e..ddf4a7bc19ba358364ea4517ce941e63 } public void detectEquipmentUpdatesPublic() { // CraftBukkit -@@ -3279,7 +3275,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3300,7 +3296,6 @@ public abstract class LivingEntity extends Entity implements Attackable { this.setDeltaMovement(d0, d1, d2); this.level().getProfiler().push("ai"); @@ -1425,7 +1425,7 @@ index a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e..ddf4a7bc19ba358364ea4517ce941e63 if (this.isImmobile()) { this.jumping = false; this.xxa = 0.0F; -@@ -3289,7 +3284,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3310,7 +3305,6 @@ public abstract class LivingEntity extends Entity implements Attackable { this.serverAiStep(); this.level().getProfiler().pop(); } @@ -1433,7 +1433,7 @@ index a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e..ddf4a7bc19ba358364ea4517ce941e63 this.level().getProfiler().pop(); this.level().getProfiler().push("jump"); -@@ -3329,7 +3323,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3350,7 +3344,6 @@ public abstract class LivingEntity extends Entity implements Attackable { this.resetFallDistance(); } @@ -1441,7 +1441,7 @@ index a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e..ddf4a7bc19ba358364ea4517ce941e63 label104: { LivingEntity entityliving = this.getControllingPassenger(); -@@ -3343,7 +3336,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3364,7 +3357,6 @@ public abstract class LivingEntity extends Entity implements Attackable { this.travel(vec3d1); } @@ -1449,7 +1449,7 @@ index a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e..ddf4a7bc19ba358364ea4517ce941e63 this.level().getProfiler().pop(); this.level().getProfiler().push("freezing"); -@@ -3370,9 +3362,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3391,9 +3383,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); } @@ -1460,10 +1460,10 @@ index a3ebdbb231fb7bc6ed24747105ef02bb0ea9770e..ddf4a7bc19ba358364ea4517ce941e63 if (!this.level().isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { this.hurt(this.damageSources().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 68715d9fd69addad07384efa10eeb09bc78c1e28..5f881af95bd5ee94daadfd9e5d64ee6d411255c4 100644 +index 55b30e1df4a05802977b0c3f3b518ef0676eae2d..1702cd6aa8b4fc29b8f2539604f6e203bf95d020 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -92,7 +92,6 @@ import net.minecraft.network.protocol.game.ClientboundSetBorderWarningDistancePa +@@ -93,7 +93,6 @@ import net.minecraft.network.protocol.game.ClientboundSetBorderWarningDistancePa import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; @@ -1471,7 +1471,7 @@ index 68715d9fd69addad07384efa10eeb09bc78c1e28..5f881af95bd5ee94daadfd9e5d64ee6d import org.bukkit.craftbukkit.block.CapturedBlockState; import org.bukkit.craftbukkit.block.CraftBlockState; import org.bukkit.craftbukkit.block.data.CraftBlockData; -@@ -163,7 +162,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -164,7 +163,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } // Paper end - add paper world config @@ -1480,7 +1480,7 @@ index 68715d9fd69addad07384efa10eeb09bc78c1e28..5f881af95bd5ee94daadfd9e5d64ee6d public static BlockPos lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter tileLimiter; -@@ -258,7 +257,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -259,7 +258,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {} }); // CraftBukkit end @@ -1489,7 +1489,7 @@ index 68715d9fd69addad07384efa10eeb09bc78c1e28..5f881af95bd5ee94daadfd9e5d64ee6d this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); } -@@ -718,15 +717,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -723,15 +722,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { this.timings.tileEntityTick.stopTiming(); // Spigot this.tickingBlockEntities = false; @@ -1507,10 +1507,10 @@ index 68715d9fd69addad07384efa10eeb09bc78c1e28..5f881af95bd5ee94daadfd9e5d64ee6d 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 991ebf07bc0608df0a12f1f26e581cc93255ae01..946001c57c326f2d2f0677bca954e8558f1c851b 100644 +index d1cfcc8a36964f006f1af6764c52b5ca458b478d..def3e28edc206e0ba41111e26332db468223fb2e 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -89,6 +89,15 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -88,6 +88,15 @@ public class Block extends BlockBehaviour implements ItemLike { public static final int UPDATE_LIMIT = 512; protected final StateDefinition<Block, BlockState> stateDefinition; private BlockState defaultBlockState; @@ -1545,10 +1545,10 @@ index e6c586eb85c6c477a3c130e1e1a37b41f17c30c8..6e35709f2a7c32050908e7e5af5529c9 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 bb0f16aef406bdc627e1263859dd4637bec90c63..55b24bf21dce3ab00c19a73b3af797ac1fd2ccc7 100644 +index 7898e1aaf82f096fa74bd3f5859f0f4303ea677f..05d959ccc424aaaa465ec256213f2ec4d44ef8b5 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -698,6 +698,7 @@ public class LevelChunk extends ChunkAccess { +@@ -710,6 +710,7 @@ public class LevelChunk extends ChunkAccess { server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(bukkitChunk, this.needsDecoration)); if (this.needsDecoration) { @@ -1556,7 +1556,7 @@ index bb0f16aef406bdc627e1263859dd4637bec90c63..55b24bf21dce3ab00c19a73b3af797ac this.needsDecoration = false; java.util.Random random = new java.util.Random(); random.setSeed(this.level.getSeed()); -@@ -717,6 +718,7 @@ public class LevelChunk extends ChunkAccess { +@@ -729,6 +730,7 @@ public class LevelChunk extends ChunkAccess { } } server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk)); @@ -1565,10 +1565,10 @@ index bb0f16aef406bdc627e1263859dd4637bec90c63..55b24bf21dce3ab00c19a73b3af797ac } } 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 8199fd0a50e0f7d2e1f2a14ac525bc6bd9feeac4..b0518725a2e145d29bd5bc0aa7e6998a47dcb511 100644 +index 46a090123e205394791cdbde2af84c58ce55f7e1..47f5f3d58bb3bf85cf35f9baae77df7fab5c844f 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 -@@ -471,13 +471,10 @@ public class ChunkSerializer { +@@ -472,13 +472,10 @@ public class ChunkSerializer { ListTag nbttaglist1 = ChunkSerializer.getListOfCompoundsOrNull(nbt, "block_entities"); return nbttaglist == null && nbttaglist1 == null ? null : (chunk) -> { @@ -1582,7 +1582,7 @@ index 8199fd0a50e0f7d2e1f2a14ac525bc6bd9feeac4..b0518725a2e145d29bd5bc0aa7e6998a if (nbttaglist1 != null) { for (int i = 0; i < nbttaglist1.size(); ++i) { CompoundTag nbttagcompound1 = nbttaglist1.getCompound(i); -@@ -495,7 +492,6 @@ public class ChunkSerializer { +@@ -496,7 +493,6 @@ public class ChunkSerializer { } } } @@ -1591,10 +1591,10 @@ index 8199fd0a50e0f7d2e1f2a14ac525bc6bd9feeac4..b0518725a2e145d29bd5bc0aa7e6998a }; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a348ddb7ca863da0b2d5eea1bb30bb356a6a751f..f42af8073569b4153858c2762d1553e89fe85a16 100644 +index d1699fcca66bcfbbe8fcc426802cb766cf1e580b..de55611daeb6d55f69c4cb72137eb7b050e727f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -373,7 +373,7 @@ public final class CraftServer implements Server { +@@ -376,7 +376,7 @@ public final class CraftServer implements Server { this.saveCommandsConfig(); this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); @@ -1603,7 +1603,7 @@ index a348ddb7ca863da0b2d5eea1bb30bb356a6a751f..f42af8073569b4153858c2762d1553e8 this.overrideSpawnLimits(); console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose")); -@@ -2604,12 +2604,31 @@ public final class CraftServer implements Server { +@@ -2612,12 +2612,31 @@ public final class CraftServer implements Server { private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot() { @@ -1805,10 +1805,10 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e59f2ae85126061ee35812eaa02a35ddb4a9eb66..b64cabaee5adc3fc9e2b704c2959a7a4b3051ed2 100644 +index 64aed98084aeb3f29db301adf3c8c49ee9236a0b..0bea424418984e17193ff107d2b4cf13278a3d3e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2768,6 +2768,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2781,6 +2781,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR)); } @@ -2005,7 +2005,7 @@ index f97eccb6a17c7876e1e002d798eb67bbe80571a0..76effc345d362047e64d064eb64a5222 + } // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 2de7ee6afa7eb404d7aeaa5ef7c7190d8287de1d..233abe27ff9b11eb88c073d8d6bc7211a10ba5df 100644 +index d551c9d898d8b5128dfef84d206396c84072abe4..99f134d03b76e867a3e5084c5c89e53c74d8e7af 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -217,6 +217,12 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0024-Add-TickThread.patch b/patches/server/0024-Add-TickThread.patch index bf8c922243..bf8c922243 100644 --- a/patches/unapplied/server/0024-Add-TickThread.patch +++ b/patches/server/0024-Add-TickThread.patch diff --git a/patches/unapplied/server/0025-Further-improve-server-tick-loop.patch b/patches/server/0025-Further-improve-server-tick-loop.patch index 584e18294d..0a1f62fc08 100644 --- a/patches/unapplied/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 e419ccaf2378d4736b8162092e537006aa3e1288..93c7648106b18ef2982f476c3200839bb5e2ea0c 100644 +index 4137cf4d716680ff1b1ab0b8a3e8f7cb4bae7dbe..8fbc764fd2802f735b9d5fac2dabca6a7cebe58e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -289,7 +289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -296,7 +296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public org.bukkit.craftbukkit.CraftServer server; public OptionSet options; public org.bukkit.command.ConsoleCommandSender console; @@ -24,7 +24,7 @@ index e419ccaf2378d4736b8162092e537006aa3e1288..93c7648106b18ef2982f476c3200839b public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -298,7 +298,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -305,7 +305,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // Spigot start public static final int TPS = 20; public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS; @@ -34,7 +34,7 @@ index e419ccaf2378d4736b8162092e537006aa3e1288..93c7648106b18ef2982f476c3200839b public final double[] recentTps = new double[ 3 ]; // Spigot end public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files -@@ -1013,6 +1014,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1020,6 +1021,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa { return ( avg * exp ) + ( tps * ( 1 - exp ) ); } @@ -92,7 +92,7 @@ index e419ccaf2378d4736b8162092e537006aa3e1288..93c7648106b18ef2982f476c3200839b // Spigot End protected void runServer() { -@@ -1027,7 +1079,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1034,7 +1086,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // Spigot start Arrays.fill( this.recentTps, 20 ); @@ -104,7 +104,7 @@ index e419ccaf2378d4736b8162092e537006aa3e1288..93c7648106b18ef2982f476c3200839b while (this.running) { long i; -@@ -1050,15 +1105,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1057,15 +1112,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } // Spigot start ++MinecraftServer.currentTickLong; // Paper - track current tick as a long @@ -135,7 +135,7 @@ index e419ccaf2378d4736b8162092e537006aa3e1288..93c7648106b18ef2982f476c3200839b // Spigot end boolean flag = i == 0L; -@@ -1068,7 +1130,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1075,7 +1137,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount); } @@ -146,10 +146,10 @@ index e419ccaf2378d4736b8162092e537006aa3e1288..93c7648106b18ef2982f476c3200839b this.startMetricsRecordingTick(); this.profiler.push("tick"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f42af8073569b4153858c2762d1553e89fe85a16..c9767da51134fc5576f4d9f994f8b9fc05c57b9e 100644 +index de55611daeb6d55f69c4cb72137eb7b050e727f7..1cb6c21741408ff4628864b52341965dfbfa5711 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2657,7 +2657,11 @@ public final class CraftServer implements Server { +@@ -2665,7 +2665,11 @@ public final class CraftServer implements Server { @Override public double[] getTPS() { diff --git a/patches/unapplied/server/0026-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0026-Add-command-line-option-to-load-extra-plugin-jars-no.patch index dda6c86274..0f009842b0 100644 --- a/patches/unapplied/server/0026-Add-command-line-option-to-load-extra-plugin-jars-no.patch +++ b/patches/server/0026-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 c9767da51134fc5576f4d9f994f8b9fc05c57b9e..0030794a3e125f2493a84ddac86430db625c626e 100644 +index 1cb6c21741408ff4628864b52341965dfbfa5711..a2f784b28c0d974ee45d61d6a3a0096dd7161d3e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -447,6 +447,35 @@ public final class CraftServer implements Server { +@@ -450,6 +450,35 @@ public final class CraftServer implements Server { io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.INSTANCE.enter(io.papermc.paper.plugin.entrypoint.Entrypoint.PLUGIN); // Paper - replace implementation } @@ -47,7 +47,7 @@ index c9767da51134fc5576f4d9f994f8b9fc05c57b9e..0030794a3e125f2493a84ddac86430db 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 2ef6386ea4b95211e26c8759cae849cbe68e3f40..efedc5c8474c548781c943ddfdf2de121c7c09b7 100644 +index 9de87edb75947382fda114df883fb4b31c1a7141..bc664b090e16ed27ba795c204dc5639679e6eee8 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -160,6 +160,12 @@ public class Main { diff --git a/patches/unapplied/server/0027-Support-components-in-ItemMeta.patch b/patches/server/0027-Support-components-in-ItemMeta.patch index 1497a2f29d..1086398de1 100644 --- a/patches/unapplied/server/0027-Support-components-in-ItemMeta.patch +++ b/patches/server/0027-Support-components-in-ItemMeta.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Support components in ItemMeta diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 41ba64593bd548131d1cdbecc79b2f38406aa78b..c7eed6b642c69fb08bc6e50d4890ea61666cde01 100644 +index fd147ea7fb5d143c11e7e2bf09f31bcb6e513f76..7381f0dac6dd0ec716e3b3475bbf8f5aae049e28 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -900,11 +900,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -923,11 +923,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return CraftChatMessage.fromComponent(this.displayName); } @@ -32,7 +32,7 @@ index 41ba64593bd548131d1cdbecc79b2f38406aa78b..c7eed6b642c69fb08bc6e50d4890ea61 @Override public boolean hasDisplayName() { return this.displayName != null; -@@ -1078,6 +1090,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1101,6 +1113,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return this.lore == null ? null : new ArrayList<String>(Lists.transform(this.lore, CraftChatMessage::fromComponent)); } @@ -47,7 +47,7 @@ index 41ba64593bd548131d1cdbecc79b2f38406aa78b..c7eed6b642c69fb08bc6e50d4890ea61 @Override public void setLore(List<String> lore) { if (lore == null || lore.isEmpty()) { -@@ -1092,6 +1112,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1115,6 +1135,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -69,7 +69,7 @@ index 41ba64593bd548131d1cdbecc79b2f38406aa78b..c7eed6b642c69fb08bc6e50d4890ea61 @Override public boolean hasCustomModelData() { return this.customModelData != null; -@@ -1763,6 +1798,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1810,6 +1845,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } for (Object object : addFrom) { diff --git a/patches/unapplied/server/0028-Configurable-cactus-bamboo-and-reed-growth-height.patch b/patches/server/0028-Configurable-cactus-bamboo-and-reed-growth-height.patch index d25f48a93d..d25f48a93d 100644 --- a/patches/unapplied/server/0028-Configurable-cactus-bamboo-and-reed-growth-height.patch +++ b/patches/server/0028-Configurable-cactus-bamboo-and-reed-growth-height.patch diff --git a/patches/server/0029-Configurable-baby-zombie-movement-speed.patch b/patches/server/0029-Configurable-baby-zombie-movement-speed.patch new file mode 100644 index 0000000000..a55a0a3944 --- /dev/null +++ b/patches/server/0029-Configurable-baby-zombie-movement-speed.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown <[email protected]> +Date: Tue, 1 Mar 2016 13:09:16 -0600 +Subject: [PATCH] Configurable baby zombie movement speed + + +diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java +index 60a9db4131bcf69a33003b83db6117c9a7a83276..393a9c704f4637a0e8031328d2a0facef4723dd8 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java +@@ -75,7 +75,7 @@ import org.bukkit.event.entity.EntityTransformEvent; + public class Zombie extends Monster { + + private static final ResourceLocation SPEED_MODIFIER_BABY_ID = ResourceLocation.withDefaultNamespace("baby"); +- private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_ID, 0.5D, AttributeModifier.Operation.ADD_MULTIPLIED_BASE); ++ private final AttributeModifier babyModifier = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_ID, this.level().paperConfig().entities.behavior.babyZombieMovementModifier, AttributeModifier.Operation.ADD_MULTIPLIED_BASE); // Paper - Make baby speed configurable + private static final ResourceLocation REINFORCEMENT_CALLER_CHARGE_ID = ResourceLocation.withDefaultNamespace("reinforcement_caller_charge"); + private static final AttributeModifier ZOMBIE_REINFORCEMENT_CALLEE_CHARGE = new AttributeModifier(ResourceLocation.withDefaultNamespace("reinforcement_callee_charge"), -0.05000000074505806D, AttributeModifier.Operation.ADD_VALUE); + private static final ResourceLocation LEADER_ZOMBIE_BONUS_ID = ResourceLocation.withDefaultNamespace("leader_zombie_bonus"); +@@ -188,9 +188,9 @@ public class Zombie extends Monster { + if (this.level() != null && !this.level().isClientSide) { + AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); + +- attributemodifiable.removeModifier(Zombie.SPEED_MODIFIER_BABY_ID); ++ attributemodifiable.removeModifier(this.babyModifier.id()); // Paper - Make baby speed configurable + if (baby) { +- attributemodifiable.addTransientModifier(Zombie.SPEED_MODIFIER_BABY); ++ attributemodifiable.addTransientModifier(this.babyModifier); // Paper - Make baby speed configurable + } + } + diff --git a/patches/unapplied/server/0030-Configurable-fishing-time-ranges.patch b/patches/server/0030-Configurable-fishing-time-ranges.patch index 41c5f833ec..90d886761f 100644 --- a/patches/unapplied/server/0030-Configurable-fishing-time-ranges.patch +++ b/patches/server/0030-Configurable-fishing-time-ranges.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Configurable fishing time ranges 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 347d91344e2b02f33f6993e24247282eb390c4db..1eeb61688cae52bb25ef6d9ac4f0a0df3d34f846 100644 +index 0acb45014039d4392988c7d853595f96e856af4a..ed43ad94ca007a54e3c32d5e17c141048eeb5835 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -@@ -93,6 +93,10 @@ public class FishingHook extends Projectile { +@@ -94,6 +94,10 @@ public class FishingHook extends Projectile { this.noCulling = true; - this.luck = Math.max(0, luckOfTheSeaLevel); - this.lureSpeed = Math.max(0, lureLevel); + this.luck = Math.max(0, luckBonus); + this.lureSpeed = Math.max(0, waitTimeReductionTicks); + // Paper start - Configurable fishing time ranges + minWaitTime = world.paperConfig().fishingTimeRange.minimum; + maxWaitTime = world.paperConfig().fishingTimeRange.maximum; @@ -19,12 +19,12 @@ index 347d91344e2b02f33f6993e24247282eb390c4db..1eeb61688cae52bb25ef6d9ac4f0a0df } public FishingHook(EntityType<? extends FishingHook> type, Level world) { -@@ -410,7 +414,7 @@ public class FishingHook extends Projectile { +@@ -411,7 +415,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); -- this.timeUntilLured -= (this.applyLure) ? this.lureSpeed * 20 * 5 : 0; -+ this.timeUntilLured -= (this.applyLure) ? (this.lureSpeed * 20 * 5 >= this.maxWaitTime ? this.timeUntilLured - 1 : this.lureSpeed * 20 * 5) : 0; // Paper - Fix Lure infinite loop +- this.timeUntilLured -= (this.applyLure) ? this.lureSpeed : 0; ++ this.timeUntilLured -= (this.applyLure) ? (this.lureSpeed >= this.maxWaitTime ? this.timeUntilLured - 1 : this.lureSpeed ) : 0; // Paper - Fix Lure infinite loop // CraftBukkit end } } diff --git a/patches/unapplied/server/0031-Allow-nerfed-mobs-to-jump.patch b/patches/server/0031-Allow-nerfed-mobs-to-jump.patch index 793fa23ab5..1c95173e39 100644 --- a/patches/unapplied/server/0031-Allow-nerfed-mobs-to-jump.patch +++ b/patches/server/0031-Allow-nerfed-mobs-to-jump.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow nerfed mobs to jump diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index d615649c67b54cfd1cb083e3ddb9719255e90bc7..a9d7fd0234c88cd5d1589a05daa10ec9424e92aa 100644 +index fcc8b66702f761c443fb647a8ab6e1ab49e5acfe..bf905bc1c4918412e3c324a62d2915b57c40d2cc 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -126,6 +126,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -124,6 +124,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab private final BodyRotationControl bodyRotationControl; protected PathNavigation navigation; public GoalSelector goalSelector; @@ -16,7 +16,7 @@ index d615649c67b54cfd1cb083e3ddb9719255e90bc7..a9d7fd0234c88cd5d1589a05daa10ec9 public GoalSelector targetSelector; @Nullable private LivingEntity target; -@@ -935,7 +936,15 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -890,7 +891,15 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @Override protected final void serverAiStep() { ++this.noActionTime; diff --git a/patches/unapplied/server/0032-Add-configurable-entity-despawn-distances.patch b/patches/server/0032-Add-configurable-entity-despawn-distances.patch index 19e5918416..348a1c4e40 100644 --- a/patches/unapplied/server/0032-Add-configurable-entity-despawn-distances.patch +++ b/patches/server/0032-Add-configurable-entity-despawn-distances.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add configurable entity despawn distances diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index a9d7fd0234c88cd5d1589a05daa10ec9424e92aa..577e7504064b97fa1115210f209bb40a3d94a60f 100644 +index bf905bc1c4918412e3c324a62d2915b57c40d2cc..51b33ea29af0f4010dfb8a1a7503cb7ca463209e 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -911,14 +911,14 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -866,14 +866,14 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/patches/unapplied/server/0033-Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/0033-Drop-falling-block-and-tnt-entities-at-the-specified.patch index 70612c5eb7..ce9c290891 100644 --- a/patches/unapplied/server/0033-Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/patches/server/0033-Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Drop falling block and tnt entities at the specified height Co-authored-by: Jake Potrebic <[email protected]> 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 4ac7f43b834a2c761ad538f9d00afb2263ed7e4f..37dfd08621d402a339f36bb70f1b39de010e8669 100644 +index a4e8fa5267b8853603e4683bf9d002db7465e4b6..c3a16691e8a843c02e0aea6469822cd8869ad593 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -@@ -145,6 +145,16 @@ public class FallingBlockEntity extends Entity { +@@ -149,6 +149,16 @@ public class FallingBlockEntity extends Entity { ++this.time; this.applyGravity(); this.move(MoverType.SELF, this.getDeltaMovement()); @@ -23,15 +23,15 @@ index 4ac7f43b834a2c761ad538f9d00afb2263ed7e4f..37dfd08621d402a339f36bb70f1b39de + return; + } + // Paper end - Configurable falling blocks height nerf - if (!this.level().isClientSide) { + this.handlePortal(); + if (!this.level().isClientSide && (this.isAlive() || this.forceTickAfterTeleportToDuplicate)) { 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 e4a7d4cda22106716897df964cd74d0bbccd6092..f127cac376cf4d0e585d12cd5976a3aee567403a 100644 +index 8f693bb45099124bca62849528c81d717131a48c..15432b512fc0d0d38bf28499e2afa5e48fec7aaa 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -@@ -78,6 +78,12 @@ public class PrimedTnt extends Entity implements TraceableEntity { - if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot +@@ -99,6 +99,12 @@ public class PrimedTnt extends Entity implements TraceableEntity { + this.handlePortal(); this.applyGravity(); this.move(MoverType.SELF, this.getDeltaMovement()); + // Paper start - Configurable TNT height nerf diff --git a/patches/unapplied/server/0034-Expose-server-build-information.patch b/patches/server/0034-Expose-server-build-information.patch index cd2936aebf..7b10d6d232 100644 --- a/patches/unapplied/server/0034-Expose-server-build-information.patch +++ b/patches/server/0034-Expose-server-build-information.patch @@ -11,7 +11,7 @@ Co-authored-by: Jake Potrebic <[email protected]> Co-authored-by: masmc05 <[email protected]> diff --git a/build.gradle.kts b/build.gradle.kts -index 158779a3590f089c4224b2b128c2e653aef42a94..2caa4c8e250a7925e7d6f9ba00a95956b5328568 100644 +index 708448e071ddb5558658d3096b1d7ee2593ec8c5..7b002d28932e21878dbab248abf85066a8a80a9c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ @@ -472,7 +472,7 @@ index 0000000000000000000000000000000000000000..790bad0494454ca12ee152e3de6da3da + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 93c7648106b18ef2982f476c3200839bb5e2ea0c..8b5a630a67b058f014478b033e6b1299f99afccc 100644 +index 8fbc764fd2802f735b9d5fac2dabca6a7cebe58e..3d9c7105bfdb1b0c63a036ba3213d51b2fb6425f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -43,7 +43,6 @@ import java.util.Set; @@ -483,7 +483,7 @@ index 93c7648106b18ef2982f476c3200839bb5e2ea0c..8b5a630a67b058f014478b033e6b1299 import java.util.concurrent.atomic.AtomicReference; import java.util.function.BooleanSupplier; import java.util.function.Consumer; -@@ -185,8 +184,6 @@ import net.minecraft.world.phys.Vec2; +@@ -191,8 +190,6 @@ import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec3; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftRegistry; @@ -492,7 +492,7 @@ index 93c7648106b18ef2982f476c3200839bb5e2ea0c..8b5a630a67b058f014478b033e6b1299 import org.bukkit.event.server.ServerLoadEvent; // CraftBukkit end -@@ -1680,7 +1677,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1708,7 +1705,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @DontObfuscate public String getServerModName() { @@ -502,10 +502,10 @@ index 93c7648106b18ef2982f476c3200839bb5e2ea0c..8b5a630a67b058f014478b033e6b1299 public SystemReport fillSystemReport(SystemReport details) { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 8dcfcce4ccf0320b5d5b9eda2d1b5ebe04e26a13..1b38916d8e9241bd45523e692c04bf69430b64f9 100644 +index b51c3f8c485496734ea58c15377a1215a334c765..48107f8eb50483430053b990496862d71c9f8a3e 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -214,6 +214,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -218,6 +218,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface // Paper end - initialize global and world-defaults configuration io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics @@ -529,7 +529,7 @@ index f077b8ff0bf0d96628db3569132696b68fd79921..5f11f5b16766f9d1d5640ae037e259be value.append("\n Plugins: {"); for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0030794a3e125f2493a84ddac86430db625c626e..c052ec6b028613fb27c0cfead8da5a1793ecadd3 100644 +index a2f784b28c0d974ee45d61d6a3a0096dd7161d3e..7c97ec4aa57562a8383a40e493eaa8a3697208bb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -11,8 +11,6 @@ import com.google.common.collect.MapMaker; @@ -549,7 +549,7 @@ index 0030794a3e125f2493a84ddac86430db625c626e..c052ec6b028613fb27c0cfead8da5a17 import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; -@@ -154,7 +151,6 @@ import org.bukkit.craftbukkit.ban.CraftProfileBanList; +@@ -155,7 +152,6 @@ import org.bukkit.craftbukkit.ban.CraftProfileBanList; import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.boss.CraftBossBar; import org.bukkit.craftbukkit.boss.CraftKeyedBossbar; @@ -557,7 +557,7 @@ index 0030794a3e125f2493a84ddac86430db625c626e..c052ec6b028613fb27c0cfead8da5a17 import org.bukkit.craftbukkit.command.CraftCommandMap; import org.bukkit.craftbukkit.command.VanillaCommandWrapper; import org.bukkit.craftbukkit.entity.CraftEntityFactory; -@@ -250,7 +246,6 @@ import org.bukkit.plugin.PluginManager; +@@ -251,7 +247,6 @@ import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.ServicesManager; import org.bukkit.plugin.SimplePluginManager; import org.bukkit.plugin.SimpleServicesManager; @@ -565,7 +565,7 @@ index 0030794a3e125f2493a84ddac86430db625c626e..c052ec6b028613fb27c0cfead8da5a17 import org.bukkit.plugin.messaging.Messenger; import org.bukkit.plugin.messaging.StandardMessenger; import org.bukkit.profile.PlayerProfile; -@@ -267,7 +262,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; +@@ -268,7 +263,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; import net.md_5.bungee.api.chat.BaseComponent; // Spigot public final class CraftServer implements Server { @@ -574,7 +574,7 @@ index 0030794a3e125f2493a84ddac86430db625c626e..c052ec6b028613fb27c0cfead8da5a17 private final String serverVersion; private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); -@@ -322,7 +317,7 @@ public final class CraftServer implements Server { +@@ -324,7 +319,7 @@ public final class CraftServer implements Server { return player.getBukkitEntity(); } })); @@ -583,7 +583,7 @@ index 0030794a3e125f2493a84ddac86430db625c626e..c052ec6b028613fb27c0cfead8da5a17 this.structureManager = new CraftStructureManager(console.getStructureManager(), console.registryAccess()); this.dataPackManager = new CraftDataPackManager(this.getServer().getPackRepository()); this.serverTickManager = new CraftServerTickManager(console.tickRateManager()); -@@ -595,6 +590,13 @@ public final class CraftServer implements Server { +@@ -598,6 +593,13 @@ public final class CraftServer implements Server { return this.bukkitVersion; } @@ -598,7 +598,7 @@ index 0030794a3e125f2493a84ddac86430db625c626e..c052ec6b028613fb27c0cfead8da5a17 public List<CraftPlayer> getOnlinePlayers() { return this.playerView; diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index efedc5c8474c548781c943ddfdf2de121c7c09b7..ce4671b24c7471efb3f6a1ae87d96c67881642f6 100644 +index bc664b090e16ed27ba795c204dc5639679e6eee8..9dc72b01092783c436bc1fa8ce29ff7cdaa39b19 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -15,6 +15,7 @@ import joptsimple.OptionSet; @@ -610,7 +610,7 @@ index efedc5c8474c548781c943ddfdf2de121c7c09b7..ce4671b24c7471efb3f6a1ae87d96c67 public static boolean useConsole = true; @@ -252,13 +253,26 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -21); + deadline.add(Calendar.DAY_OF_YEAR, -3); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***"); @@ -638,7 +638,7 @@ index efedc5c8474c548781c943ddfdf2de121c7c09b7..ce4671b24c7471efb3f6a1ae87d96c67 net.minecraft.server.Main.main(options); } catch (Throwable t) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 233abe27ff9b11eb88c073d8d6bc7211a10ba5df..9730a3fe6b1e2734d897936dc8bff7c06edb3687 100644 +index 99f134d03b76e867a3e5084c5c89e53c74d8e7af..7800e0a5aa381181d6a19d55f90490154de05c04 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -478,6 +478,11 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/unapplied/server/0035-Player-affects-spawning-API.patch b/patches/server/0035-Player-affects-spawning-API.patch index e040772a02..6b8ea7ffca 100644 --- a/patches/unapplied/server/0035-Player-affects-spawning-API.patch +++ b/patches/server/0035-Player-affects-spawning-API.patch @@ -21,10 +21,10 @@ index 3126e8cab3c40e3af47f4c8925e1c6a9523309ba..3207166061bf9c4d7bf3f38e5a9f7aff public static Predicate<Entity> 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 577e7504064b97fa1115210f209bb40a3d94a60f..d4559aea807e3ee76f9dd1ecde72f77644636923 100644 +index 51b33ea29af0f4010dfb8a1a7503cb7ca463209e..e81a25462239dbb3993f31ff927bd809aef0a124 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -907,7 +907,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -862,7 +862,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab if (this.level().getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { @@ -34,7 +34,7 @@ index 577e7504064b97fa1115210f209bb40a3d94a60f..d4559aea807e3ee76f9dd1ecde72f776 if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java -index c01d9751828d03f37f36b52d84336bd0ee008e8b..f3a02925833733ae50d706ffc681dd05344a7687 100644 +index 3b7fc11b7832a72fb9b0806fe9847f4e30759e7b..3cb84856c10347162a8736ae1ef65165183ec8fe 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java @@ -27,7 +27,7 @@ public class SkeletonTrapGoal extends Goal { @@ -60,10 +60,10 @@ index 95e9d38dbccbd1c43ababd707e18dfe6779256c1..9ff42b0ae2b82dc3092e38e1439d89b4 return false; } diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 8256af275e468a5aa506f0af22428f4082204956..c71d4f91df7ec1cf26888b00fac444bccbbe472e 100644 +index 393a9c704f4637a0e8031328d2a0facef4723dd8..d97c3c139f10a45febc0cfb1057ff6e33266228e 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -322,7 +322,7 @@ public class Zombie extends Monster { +@@ -328,7 +328,7 @@ public class Zombie extends Monster { if (SpawnPlacements.isSpawnPositionOk(entitytypes, this.level(), blockposition) && SpawnPlacements.checkSpawnRules(entitytypes, worldserver, MobSpawnType.REINFORCEMENT, blockposition, this.level().random)) { entityzombie.setPos((double) i1, (double) j1, (double) k1); @@ -73,13 +73,13 @@ index 8256af275e468a5aa506f0af22428f4082204956..c71d4f91df7ec1cf26888b00fac444bc entityzombie.finalizeSpawn(worldserver, this.level().getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.REINFORCEMENT, (SpawnGroupData) null); worldserver.addFreshEntityWithPassengers(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit 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 7a95aff16a973b7b7d00e8409a252d4a2f6c41bf..a1c5e5913430404838205bc4a04b2afcff9d9046 100644 +index f652859457171759f72800df7a8d5475a0486759..0d1d8ad353ff2f2bd478cfdc2f6bebad5203e190 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -193,6 +193,7 @@ public abstract class Player extends LivingEntity { - @Nullable +@@ -194,6 +194,7 @@ public abstract class Player extends LivingEntity { public Entity currentExplosionCause; - public boolean ignoreFallDamageFromCurrentImpulse; + private boolean ignoreFallDamageFromCurrentImpulse; + private int currentImpulseContextResetGraceTime; + public boolean affectsSpawning = true; // Paper - Affects Spawning API // CraftBukkit start @@ -135,10 +135,10 @@ index f38f62e777d88a783e1e3b7e1a48da921cc67cf4..77ae7882a08441d9a80b50492be5e484 for (Player player : this.players()) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b64cabaee5adc3fc9e2b704c2959a7a4b3051ed2..7cdd44a936c0a2ada4f0c5013ee2b05c5758c751 100644 +index 0bea424418984e17193ff107d2b4cf13278a3d3e..276b12f8451fd3e7922175980b24fb26a56572ef 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2411,6 +2411,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2424,6 +2424,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().language; } diff --git a/patches/unapplied/server/0036-Only-refresh-abilities-if-needed.patch b/patches/server/0036-Only-refresh-abilities-if-needed.patch index c2ff6b3bcf..4843159987 100644 --- a/patches/unapplied/server/0036-Only-refresh-abilities-if-needed.patch +++ b/patches/server/0036-Only-refresh-abilities-if-needed.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Only refresh abilities if needed diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7cdd44a936c0a2ada4f0c5013ee2b05c5758c751..de712c7b3711d2d36d5702b323946541f105e674 100644 +index 276b12f8451fd3e7922175980b24fb26a56572ef..153bc2407de2acc4452aa7959b39669ddb66b4da 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2079,12 +2079,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2092,12 +2092,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setFlying(boolean value) { diff --git a/patches/unapplied/server/0037-Entity-Origin-API.patch b/patches/server/0037-Entity-Origin-API.patch index b021245302..eeca12666e 100644 --- a/patches/unapplied/server/0037-Entity-Origin-API.patch +++ b/patches/server/0037-Entity-Origin-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index a6e78b8a6ced8ec84273e2c5d18ffccacb005cb6..c476a49f69261868f74ad528a2ad746aed3094a3 100644 +index 9675d91e4e7ed46147c3f7a11dd65122fe998dc2..711318ddc706e72dbd8cea1c541058c881086f21 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2173,6 +2173,15 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2141,6 +2141,15 @@ public class ServerLevel extends Level implements WorldGenLevel { entity.updateDynamicGameEventListener(DynamicGameEventListener::add); entity.inWorld = true; // CraftBukkit - Mark entity as in world entity.valid = true; // CraftBukkit @@ -25,10 +25,10 @@ index a6e78b8a6ced8ec84273e2c5d18ffccacb005cb6..c476a49f69261868f74ad528a2ad746a public void onTrackingEnd(Entity entity) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 074292615a13cf1f42ee74d629109ec1be390da5..35ec3d6557a02a29df15c7302c1007f335c3db65 100644 +index 4f321f13352636999c3abc5332e50c747fb45cc9..c355e8d71b4941b2ad43740763209927a3279336 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -322,7 +322,27 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -328,7 +328,27 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public long activatedTick = Integer.MIN_VALUE; public void inactiveTick() { } // Spigot end @@ -56,7 +56,7 @@ index 074292615a13cf1f42ee74d629109ec1be390da5..35ec3d6557a02a29df15c7302c1007f3 public float getBukkitYaw() { return this.yRot; } -@@ -2083,6 +2103,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2153,6 +2173,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.bukkitEntity.storeBukkitValues(nbttagcompound); } // CraftBukkit end @@ -72,7 +72,7 @@ index 074292615a13cf1f42ee74d629109ec1be390da5..35ec3d6557a02a29df15c7302c1007f3 return nbttagcompound; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT"); -@@ -2210,6 +2239,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2280,6 +2309,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } // CraftBukkit end @@ -94,10 +94,10 @@ index 074292615a13cf1f42ee74d629109ec1be390da5..35ec3d6557a02a29df15c7302c1007f3 CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT"); CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being loaded"); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 0996bfe664e0085dcacdd2b6c08a2737d3b2fa6a..f117d32f3606917ad3526c9140ef5e40990ede8c 100644 +index 269326e7689eba91bcfd3475006e8cbf8f5694ef..7b45a1216ff824f1b528bb5759d10b70858832a1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -946,4 +946,21 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -963,4 +963,21 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return this.spigot; } // Spigot end diff --git a/patches/unapplied/server/0038-Prevent-block-entity-and-entity-crashes.patch b/patches/server/0038-Prevent-block-entity-and-entity-crashes.patch index 0402535680..c4f8050de2 100644 --- a/patches/unapplied/server/0038-Prevent-block-entity-and-entity-crashes.patch +++ b/patches/server/0038-Prevent-block-entity-and-entity-crashes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent block entity and entity crashes diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 5f881af95bd5ee94daadfd9e5d64ee6d411255c4..472df81e4aef21e0cf2684a9e04d6ce18d6d6922 100644 +index 1702cd6aa8b4fc29b8f2539604f6e203bf95d020..e19ee11905417918c7ec142fd2016ab3f000e4e2 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -726,11 +726,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -731,11 +731,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { try { tickConsumer.accept(entity); } catch (Throwable throwable) { @@ -44,10 +44,10 @@ index 6e35709f2a7c32050908e7e5af5529c9f342b787..d20f71a2098b327423cbdbbc096aa9e3 } } 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 55b24bf21dce3ab00c19a73b3af797ac1fd2ccc7..c4ff77ed93e17ed816e0325eb5bdfcdb444be4a4 100644 +index 05d959ccc424aaaa465ec256213f2ec4d44ef8b5..329f2210b73a75fc91a5ba06a1ed7f66c5aa2680 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -1061,11 +1061,11 @@ public class LevelChunk extends ChunkAccess { +@@ -1073,11 +1073,11 @@ public class LevelChunk extends ChunkAccess { gameprofilerfiller.pop(); } catch (Throwable throwable) { diff --git a/patches/unapplied/server/0039-Configurable-top-of-nether-void-damage.patch b/patches/server/0039-Configurable-top-of-nether-void-damage.patch index 78fb2dce6b..e3e87945ee 100644 --- a/patches/unapplied/server/0039-Configurable-top-of-nether-void-damage.patch +++ b/patches/server/0039-Configurable-top-of-nether-void-damage.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable top of nether void damage Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 35ec3d6557a02a29df15c7302c1007f335c3db65..795ac5f58469f10ce35fff55bbc4fa5f395eea2a 100644 +index c355e8d71b4941b2ad43740763209927a3279336..fafccc1c98cbc630dc71db623184a62f08618b03 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -696,7 +696,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -706,7 +706,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public void checkBelowWorld() { @@ -23,19 +23,19 @@ index 35ec3d6557a02a29df15c7302c1007f335c3db65..795ac5f58469f10ce35fff55bbc4fa5f } diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -index 6987e3e7590a6ddf93622ba5d280db6f4e98310d..f4c8eee7bc574d402a7897a202734047e37c7a67 100644 +index 46448259cd60ea5e2e08fb58cd2b2b7f8a4ec3cc..aef1dd28da7e0c0a13a0a7a5b52daa27635c48ea 100644 --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -@@ -55,7 +55,7 @@ public class PortalForcer { - Optional<PoiRecord> optional = villageplace.getInSquare((holder) -> { - return holder.is(PoiTypes.NETHER_PORTAL); - }, blockposition, i, PoiManager.Occupancy.ANY).filter((villageplacerecord) -> { -- return worldborder.isWithinBounds(villageplacerecord.getPos()); -+ return worldborder.isWithinBounds(villageplacerecord.getPos()) && !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v)); // Paper - Configurable nether ceiling damage - }).sorted(Comparator.comparingDouble((PoiRecord villageplacerecord) -> { // CraftBukkit - decompile error - return villageplacerecord.getPos().distSqr(blockposition); - }).thenComparingInt((villageplacerecord) -> { -@@ -90,6 +90,11 @@ public class PortalForcer { +@@ -58,7 +58,7 @@ public class PortalForcer { + }, blockposition, i, PoiManager.Occupancy.ANY).map(PoiRecord::getPos); + + Objects.requireNonNull(worldborder); +- return stream.filter(worldborder::isWithinBounds).filter((blockposition1) -> { ++ return stream.filter(worldborder::isWithinBounds).filter(pos -> !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> pos.getY() >= v))).filter((blockposition1) -> { // Paper - Configurable nether ceiling damage + return this.level.getBlockState(blockposition1).hasProperty(BlockStateProperties.HORIZONTAL_AXIS); + }).min(Comparator.comparingDouble((BlockPos blockposition1) -> { // CraftBukkit - decompile error + return blockposition1.distSqr(blockposition); +@@ -79,6 +79,11 @@ public class PortalForcer { BlockPos blockposition2 = null; WorldBorder worldborder = this.level.getWorldBorder(); int i = Math.min(this.level.getMaxBuildHeight(), this.level.getMinBuildHeight() + this.level.getLogicalHeight()) - 1; @@ -44,6 +44,6 @@ index 6987e3e7590a6ddf93622ba5d280db6f4e98310d..f4c8eee7bc574d402a7897a202734047 + i = Math.min(i, this.level.paperConfig().environment.netherCeilingVoidDamageHeight.intValue() - 1); + } + // Paper end - Configurable nether ceiling damage + boolean flag = true; BlockPos.MutableBlockPos blockposition_mutableblockposition = blockposition.mutable(); Iterator iterator = BlockPos.spiralAround(blockposition, createRadius, Direction.EAST, Direction.SOUTH).iterator(); // CraftBukkit - diff --git a/patches/unapplied/server/0040-Check-online-mode-before-converting-and-renaming-pla.patch b/patches/server/0040-Check-online-mode-before-converting-and-renaming-pla.patch index f89cf885a5..f89cf885a5 100644 --- a/patches/unapplied/server/0040-Check-online-mode-before-converting-and-renaming-pla.patch +++ b/patches/server/0040-Check-online-mode-before-converting-and-renaming-pla.patch diff --git a/patches/unapplied/server/0041-Add-more-entities-to-activation-range-ignore-list.patch b/patches/server/0041-Add-more-entities-to-activation-range-ignore-list.patch index c402bdafa2..c402bdafa2 100644 --- a/patches/unapplied/server/0041-Add-more-entities-to-activation-range-ignore-list.patch +++ b/patches/server/0041-Add-more-entities-to-activation-range-ignore-list.patch diff --git a/patches/server/0042-Configurable-end-credits.patch b/patches/server/0042-Configurable-end-credits.patch new file mode 100644 index 0000000000..7d2becba09 --- /dev/null +++ b/patches/server/0042-Configurable-end-credits.patch @@ -0,0 +1,18 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: DoctorDark <[email protected]> +Date: Wed, 16 Mar 2016 02:21:39 -0500 +Subject: [PATCH] Configurable end credits + + +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java +index a8a7f1fcf235508d9437ec7c550c3a3853321b78..2022667e631d0ae1c7e7ffcfeca81091aa7c57c7 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -1164,6 +1164,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { + this.unRide(); + this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); + if (!this.wonGame) { ++ if (this.level().paperConfig().misc.disableEndCredits) this.seenCredits = true; // Paper - Option to disable end credits + this.wonGame = true; + this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, 0.0F)); + this.seenCredits = true; diff --git a/patches/unapplied/server/0043-Fix-lag-from-explosions-processing-dead-entities.patch b/patches/server/0043-Fix-lag-from-explosions-processing-dead-entities.patch index 549e7e93fb..ae3fb7c15b 100644 --- a/patches/unapplied/server/0043-Fix-lag-from-explosions-processing-dead-entities.patch +++ b/patches/server/0043-Fix-lag-from-explosions-processing-dead-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix lag from explosions processing dead entities diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 93c6d28df13077a2759fecf31d7dba5db10e11f9..598050c77c5a875d3fa27271debd916ab8b5259f 100644 +index 4a30928cd11f528f8ac06950b8052ebb7f2dd33c..458020575050284544761ec61c52abac7bfd15be 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -226,7 +226,7 @@ public class Explosion { +@@ -227,7 +227,7 @@ public class Explosion { int i1 = Mth.floor(this.y + (double) f2 + 1.0D); int j1 = Mth.floor(this.z - (double) f2 - 1.0D); int k1 = Mth.floor(this.z + (double) f2 + 1.0D); diff --git a/patches/unapplied/server/0044-Optimize-explosions.patch b/patches/server/0044-Optimize-explosions.patch index a1a008a5bd..e3fc8cb992 100644 --- a/patches/unapplied/server/0044-Optimize-explosions.patch +++ b/patches/server/0044-Optimize-explosions.patch @@ -10,10 +10,10 @@ This patch adds a per-tick cache that is used for storing and retrieving an entity's exposure during an explosion. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8b5a630a67b058f014478b033e6b1299f99afccc..0b2588dc70b295026fc2050797a1d7ef9e5b8dca 100644 +index 3d9c7105bfdb1b0c63a036ba3213d51b2fb6425f..5c82bf57575bbe8bea8d39bead51c6860ac86e37 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1551,6 +1551,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1579,6 +1579,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.profiler.pop(); this.profiler.pop(); @@ -22,10 +22,10 @@ index 8b5a630a67b058f014478b033e6b1299f99afccc..0b2588dc70b295026fc2050797a1d7ef this.profiler.popPush("connection"); diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 598050c77c5a875d3fa27271debd916ab8b5259f..8faa868787d63663cf844a9a6782a13405b30372 100644 +index 458020575050284544761ec61c52abac7bfd15be..55d66aa8264d5b444a23e2132206bcc9835cfe00 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -278,7 +278,7 @@ public class Explosion { +@@ -279,7 +279,7 @@ public class Explosion { // CraftBukkit end } @@ -34,7 +34,7 @@ index 598050c77c5a875d3fa27271debd916ab8b5259f..8faa868787d63663cf844a9a6782a134 double d13; if (entity instanceof LivingEntity) { -@@ -534,4 +534,84 @@ public class Explosion { +@@ -539,4 +539,84 @@ public class Explosion { private BlockInteraction() {} } @@ -120,10 +120,10 @@ index 598050c77c5a875d3fa27271debd916ab8b5259f..8faa868787d63663cf844a9a6782a134 + // 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 472df81e4aef21e0cf2684a9e04d6ce18d6d6922..395744b57e0dcff2de5f2675c03c2e696123d386 100644 +index e19ee11905417918c7ec142fd2016ab3f000e4e2..da7b1b705da9f17de858f72a20d3a932cd8f7fad 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -167,6 +167,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -168,6 +168,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter tileLimiter; private int tileTickPosition; diff --git a/patches/unapplied/server/0045-Disable-explosion-knockback.patch b/patches/server/0045-Disable-explosion-knockback.patch index 01f044f93e..233aa30581 100644 --- a/patches/unapplied/server/0045-Disable-explosion-knockback.patch +++ b/patches/server/0045-Disable-explosion-knockback.patch @@ -5,19 +5,19 @@ Subject: [PATCH] Disable explosion knockback diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 8faa868787d63663cf844a9a6782a13405b30372..da9a9b235d1c8bcab3762134d69dcb112470e55d 100644 +index 55d66aa8264d5b444a23e2132206bcc9835cfe00..d93ed33d5ae72e9dd3e6cf044ef79e4b9689dc1c 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -284,7 +284,7 @@ public class Explosion { +@@ -285,7 +285,7 @@ public class Explosion { if (entity instanceof LivingEntity) { LivingEntity entityliving = (LivingEntity) entity; -- d13 = ProtectionEnchantment.getExplosionKnockbackAfterDampener(entityliving, d12); -+ d13 = entity instanceof Player && level.paperConfig().environment.disableExplosionKnockback ? 0 : ProtectionEnchantment.getExplosionKnockbackAfterDampener(entityliving, d12); // Paper - Option to disable explosion knockback +- d13 = d12 * (1.0D - entityliving.getAttributeValue(Attributes.EXPLOSION_KNOCKBACK_RESISTANCE)); ++ d13 = entity instanceof Player && this.level.paperConfig().environment.disableExplosionKnockback ? 0 : d12 * (1.0D - entityliving.getAttributeValue(Attributes.EXPLOSION_KNOCKBACK_RESISTANCE)); } else { d13 = d12; } -@@ -309,7 +309,7 @@ public class Explosion { +@@ -310,7 +310,7 @@ public class Explosion { if (entity instanceof Player) { Player entityhuman = (Player) entity; diff --git a/patches/unapplied/server/0046-Disable-thunder.patch b/patches/server/0046-Disable-thunder.patch index 55d3e6add9..3dea5304a7 100644 --- a/patches/unapplied/server/0046-Disable-thunder.patch +++ b/patches/server/0046-Disable-thunder.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable thunder diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c476a49f69261868f74ad528a2ad746aed3094a3..b66b2cc4111073f080620a52883e1b8d6946e768 100644 +index 711318ddc706e72dbd8cea1c541058c881086f21..ff80e95bf91b8f0e60dfc1183dd9fba2dba2719d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -615,7 +615,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -616,7 +616,7 @@ public class ServerLevel extends Level implements WorldGenLevel { ProfilerFiller gameprofilerfiller = this.getProfiler(); gameprofilerfiller.push("thunder"); diff --git a/patches/unapplied/server/0047-Disable-ice-and-snow.patch b/patches/server/0047-Disable-ice-and-snow.patch index d17551d9f5..f693d7666f 100644 --- a/patches/unapplied/server/0047-Disable-ice-and-snow.patch +++ b/patches/server/0047-Disable-ice-and-snow.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable ice and snow diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index b66b2cc4111073f080620a52883e1b8d6946e768..53e69115a2186c0124d3d8c83f6ca0aecc68c324 100644 +index ff80e95bf91b8f0e60dfc1183dd9fba2dba2719d..d0788c4223891117c042aa4243e6804b4ed33aea 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -645,11 +645,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -646,11 +646,13 @@ public class ServerLevel extends Level implements WorldGenLevel { gameprofilerfiller.popPush("iceandsnow"); diff --git a/patches/unapplied/server/0048-Configurable-mob-spawner-tick-rate.patch b/patches/server/0048-Configurable-mob-spawner-tick-rate.patch index deb1ddde3f..deb1ddde3f 100644 --- a/patches/unapplied/server/0048-Configurable-mob-spawner-tick-rate.patch +++ b/patches/server/0048-Configurable-mob-spawner-tick-rate.patch diff --git a/patches/unapplied/server/0049-Implement-PlayerLocaleChangeEvent.patch b/patches/server/0049-Implement-PlayerLocaleChangeEvent.patch index 6abcc7a156..4c300bff09 100644 --- a/patches/unapplied/server/0049-Implement-PlayerLocaleChangeEvent.patch +++ b/patches/server/0049-Implement-PlayerLocaleChangeEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerLocaleChangeEvent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 5b33cc5c54ab38b32f232dae00684d8b1e276acf..29020296e4f3bbddc0faabb1eeaa07a921b5b68f 100644 +index 2022667e631d0ae1c7e7ffcfeca81091aa7c57c7..de55fbbc92d180ca49427b134e6fc8e20f52607c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -233,7 +233,7 @@ public class ServerPlayer extends Player { +@@ -236,7 +236,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { private int levitationStartTime; private boolean disconnected; private int requestedViewDistance; @@ -17,7 +17,7 @@ index 5b33cc5c54ab38b32f232dae00684d8b1e276acf..29020296e4f3bbddc0faabb1eeaa07a9 public java.util.Locale adventure$locale = java.util.Locale.US; // Paper @Nullable private Vec3 startingToFallPosition; -@@ -289,7 +289,7 @@ public class ServerPlayer extends Player { +@@ -293,7 +293,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { this.lastActionTime = Util.getMillis(); this.recipeBook = new ServerRecipeBook(); this.requestedViewDistance = 2; @@ -26,7 +26,7 @@ index 5b33cc5c54ab38b32f232dae00684d8b1e276acf..29020296e4f3bbddc0faabb1eeaa07a9 this.lastSectionPos = SectionPos.of(0, 0, 0); this.chunkTrackingView = ChunkTrackingView.EMPTY; this.respawnDimension = Level.OVERWORLD; -@@ -2012,9 +2012,10 @@ public class ServerPlayer extends Player { +@@ -2054,9 +2054,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), this.getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); this.server.server.getPluginManager().callEvent(event); } @@ -39,10 +39,10 @@ index 5b33cc5c54ab38b32f232dae00684d8b1e276acf..29020296e4f3bbddc0faabb1eeaa07a9 // CraftBukkit end this.language = clientOptions.language(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index de712c7b3711d2d36d5702b323946541f105e674..6d3171e90f3ab83df3a0888eff3a1abadd4bde8a 100644 +index 153bc2407de2acc4452aa7959b39669ddb66b4da..e42b928d7019b636d4fd092d4a222208a7787bcb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2409,7 +2409,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2422,7 +2422,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { diff --git a/patches/unapplied/server/0050-Add-BeaconEffectEvent.patch b/patches/server/0050-Add-BeaconEffectEvent.patch index 52b61d4284..f26dbf1ae4 100644 --- a/patches/unapplied/server/0050-Add-BeaconEffectEvent.patch +++ b/patches/server/0050-Add-BeaconEffectEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add BeaconEffectEvent 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 2508e06ef33a4c219b330aec7d5311c5702b8e1b..cf48d4531821c2b1b031a63c8f007aa7d3fbef1d 100644 +index 9fc5f72ac2d23a03584d3c0357bc1a55ea40bab3..fc915797d2a085447747d9ce23a5a354fb3eb6b6 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 @@ -1,5 +1,6 @@ @@ -14,7 +14,7 @@ index 2508e06ef33a4c219b330aec7d5311c5702b8e1b..cf48d4531821c2b1b031a63c8f007aa7 +import com.destroystokyo.paper.event.block.BeaconEffectEvent; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; - import java.util.Arrays; + import java.util.Collection; @@ -46,6 +47,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.phys.AABB; diff --git a/patches/unapplied/server/0051-Configurable-container-update-tick-rate.patch b/patches/server/0051-Configurable-container-update-tick-rate.patch index eea4b9d182..9a0819ff78 100644 --- a/patches/unapplied/server/0051-Configurable-container-update-tick-rate.patch +++ b/patches/server/0051-Configurable-container-update-tick-rate.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable container update tick rate diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 29020296e4f3bbddc0faabb1eeaa07a921b5b68f..eb04f9ae48d1122cd08ccdd2798131dd124221df 100644 +index de55fbbc92d180ca49427b134e6fc8e20f52607c..916ba7c09b077bc3c9ed9fad579e607e4c065e06 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -263,6 +263,7 @@ public class ServerPlayer extends Player { +@@ -267,6 +267,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { public final Object object; private int containerCounter; public boolean wonGame; @@ -16,7 +16,7 @@ index 29020296e4f3bbddc0faabb1eeaa07a921b5b68f..eb04f9ae48d1122cd08ccdd2798131dd // CraftBukkit start public CraftPlayer.TransferCookieConnection transferCookieConnection; -@@ -689,7 +690,12 @@ public class ServerPlayer extends Player { +@@ -698,7 +699,12 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { --this.invulnerableTime; } diff --git a/patches/unapplied/server/0052-Use-UserCache-for-player-heads.patch b/patches/server/0052-Use-UserCache-for-player-heads.patch index f13d9d9f3e..f13d9d9f3e 100644 --- a/patches/unapplied/server/0052-Use-UserCache-for-player-heads.patch +++ b/patches/server/0052-Use-UserCache-for-player-heads.patch diff --git a/patches/unapplied/server/0053-Disable-spigot-tick-limiters.patch b/patches/server/0053-Disable-spigot-tick-limiters.patch index 0884563fa8..2e19fda1e1 100644 --- a/patches/unapplied/server/0053-Disable-spigot-tick-limiters.patch +++ b/patches/server/0053-Disable-spigot-tick-limiters.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 395744b57e0dcff2de5f2675c03c2e696123d386..03fec2504579acb0a8ba835939e0067f3649ab6a 100644 +index da7b1b705da9f17de858f72a20d3a932cd8f7fad..68436413645e0e33f22cdee0ea101ca01b343d75 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -699,9 +699,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -704,9 +704,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { boolean flag = this.tickRateManager().runsNormally(); int tilesThisCycle = 0; diff --git a/patches/unapplied/server/0054-Add-PlayerInitialSpawnEvent.patch b/patches/server/0054-Add-PlayerInitialSpawnEvent.patch index 6afbd430d3..cc08d58fcb 100644 --- a/patches/unapplied/server/0054-Add-PlayerInitialSpawnEvent.patch +++ b/patches/server/0054-Add-PlayerInitialSpawnEvent.patch @@ -12,7 +12,7 @@ improve setPosition to use raw public net.minecraft.world.entity.Entity setRot(FF)V diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 26a0f1ae6fb2acb62648b0cd7996505d107db532..abb769cbbed17a82ee86a6c99e61a375045d9937 100644 +index 62174dae20bd9ff092238f1437f7e2b0114ef83b..a3e695c321b9164822506e787bb5c54813aad7c2 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -226,7 +226,7 @@ public abstract class PlayerList { diff --git a/patches/unapplied/server/0055-Configurable-Disabling-Cat-Chest-Detection.patch b/patches/server/0055-Configurable-Disabling-Cat-Chest-Detection.patch index 232eb8f5f4..232eb8f5f4 100644 --- a/patches/unapplied/server/0055-Configurable-Disabling-Cat-Chest-Detection.patch +++ b/patches/server/0055-Configurable-Disabling-Cat-Chest-Detection.patch diff --git a/patches/unapplied/server/0056-Improve-Player-chat-API-handling.patch b/patches/server/0056-Improve-Player-chat-API-handling.patch index ff0359adb8..ddf0a3129b 100644 --- a/patches/unapplied/server/0056-Improve-Player-chat-API-handling.patch +++ b/patches/server/0056-Improve-Player-chat-API-handling.patch @@ -17,10 +17,10 @@ Co-authored-by: Jake Potrebic <[email protected]> Co-authored-by: SoSeDiK <[email protected]> diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b700cd5ccf37f3592f7cb931101397fbc59dc60f..ad598e57feb2d9db1b71cb3a432df22212aab9b3 100644 +index 4f50e2f5de529813c269b7670a47e06306575b60..f9050a1d255780d5131200e8b31bd91154907af6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1996,7 +1996,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2013,7 +2013,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } OutgoingChatMessage outgoing = OutgoingChatMessage.create(original); @@ -29,7 +29,7 @@ index b700cd5ccf37f3592f7cb931101397fbc59dc60f..ad598e57feb2d9db1b71cb3a432df222 this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin -@@ -2083,7 +2083,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2100,7 +2100,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } @@ -40,10 +40,10 @@ index b700cd5ccf37f3592f7cb931101397fbc59dc60f..ad598e57feb2d9db1b71cb3a432df222 if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c052ec6b028613fb27c0cfead8da5a1793ecadd3..255848f770427d59d466cb382dd20d4dd213c08b 100644 +index 7c97ec4aa57562a8383a40e493eaa8a3697208bb..78193f0d66c2755ed238824bcd24ced9f9052188 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -922,7 +922,7 @@ public final class CraftServer implements Server { +@@ -925,7 +925,7 @@ public final class CraftServer implements Server { public boolean dispatchCommand(CommandSender sender, String commandLine) { Preconditions.checkArgument(sender != null, "sender cannot be null"); Preconditions.checkArgument(commandLine != null, "commandLine cannot be null"); @@ -53,10 +53,10 @@ index c052ec6b028613fb27c0cfead8da5a1793ecadd3..255848f770427d59d466cb382dd20d4d if (this.commandMap.dispatch(sender, commandLine)) { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6d3171e90f3ab83df3a0888eff3a1abadd4bde8a..facd720eaf61f408d6867f416ea793f63605565e 100644 +index e42b928d7019b636d4fd092d4a222208a7787bcb..783db0dc65725c49ffc4af0f2ca7357ab051d12c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -544,7 +544,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -546,7 +546,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (this.getHandle().connection == null) return; diff --git a/patches/unapplied/server/0057-All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/0057-All-chunks-are-slime-spawn-chunks-toggle.patch index 3e5b7edaff..3cded231dd 100644 --- a/patches/unapplied/server/0057-All-chunks-are-slime-spawn-chunks-toggle.patch +++ b/patches/server/0057-All-chunks-are-slime-spawn-chunks-toggle.patch @@ -5,10 +5,10 @@ Subject: [PATCH] All chunks are slime spawn chunks toggle 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 172be1f03f77dcc6d57dd9a9316b303c6f9c7175..136ec2413b6fe4680d7f2e903d04c9984b37f4c0 100644 +index b7e6f6e195d8b947c06e2bf58f4c644bda8eba99..b1f7ea02e533660322675e1bddb070f0a41084f2 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java -@@ -342,7 +342,7 @@ public class Slime extends Mob implements Enemy { +@@ -350,7 +350,7 @@ public class Slime extends Mob implements Enemy { } ChunkPos chunkcoordintpair = new ChunkPos(pos); @@ -18,7 +18,7 @@ index 172be1f03f77dcc6d57dd9a9316b303c6f9c7175..136ec2413b6fe4680d7f2e903d04c998 if (random.nextInt(10) == 0 && flag && pos.getY() < 40) { return checkMobSpawnRules(type, world, spawnReason, pos, random); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 1401ba66c98a3e0732ff449a7491a090e46887d5..110bdba382c361228c52c1c1f807fef25f127ab5 100644 +index 5db1be69f0c4ef6976789587866c7a9bb6d19b0d..e37dae711e7059834612ead5f4fcea9f28ad436f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -218,7 +218,7 @@ public class CraftChunk implements Chunk { diff --git a/patches/unapplied/server/0058-Expose-server-CommandMap.patch b/patches/server/0058-Expose-server-CommandMap.patch index 0f34902971..7ef3e6c199 100644 --- a/patches/unapplied/server/0058-Expose-server-CommandMap.patch +++ b/patches/server/0058-Expose-server-CommandMap.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 255848f770427d59d466cb382dd20d4dd213c08b..0cff3f1864f8bc0e731a7275842908c056332212 100644 +index 78193f0d66c2755ed238824bcd24ced9f9052188..4bfb836513d5194be271f4a82990ace98de69640 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2166,6 +2166,7 @@ public final class CraftServer implements Server { +@@ -2169,6 +2169,7 @@ public final class CraftServer implements Server { return this.helpMap; } diff --git a/patches/unapplied/server/0059-Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/0059-Be-a-bit-more-informative-in-maxHealth-exception.patch index 5c996dd4f7..489c881a1a 100644 --- a/patches/unapplied/server/0059-Be-a-bit-more-informative-in-maxHealth-exception.patch +++ b/patches/server/0059-Be-a-bit-more-informative-in-maxHealth-exception.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Be a bit more informative in maxHealth exception diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 5ba556a9b6b59420abd65b17bea72c8f85a3c70a..c6b41aea86dd6c18b25754fa1ffe4d8ab1dd0f75 100644 +index adeb3b9a3d65d2ef71ea4fd6f0f4679a88d0ba87..e6c68fd9a5fcd374cd7feca081189c9ba9225743 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -101,7 +101,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -102,7 +102,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @Override public void setHealth(double health) { health = (float) health; diff --git a/patches/unapplied/server/0060-Player-Tab-List-and-Title-APIs.patch b/patches/server/0060-Player-Tab-List-and-Title-APIs.patch index a8faff148c..dc13ad83d8 100644 --- a/patches/unapplied/server/0060-Player-Tab-List-and-Title-APIs.patch +++ b/patches/server/0060-Player-Tab-List-and-Title-APIs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player Tab List and Title APIs diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index facd720eaf61f408d6867f416ea793f63605565e..cb0990c5479773c7448984b79d9b4d8fe45bef7a 100644 +index 783db0dc65725c49ffc4af0f2ca7357ab051d12c..ecb17cffbec7d2630602b265660f7b9b3f317906 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -384,6 +384,98 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -386,6 +386,98 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } diff --git a/patches/server/0061-Add-configurable-portal-search-radius.patch b/patches/server/0061-Add-configurable-portal-search-radius.patch new file mode 100644 index 0000000000..4a5099223d --- /dev/null +++ b/patches/server/0061-Add-configurable-portal-search-radius.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Joseph Hirschfeld <[email protected]> +Date: Thu, 3 Mar 2016 02:46:17 -0600 +Subject: [PATCH] Add configurable portal search radius + + +diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java +index 462afb22cce2376789e44283032e63a6264cf851..19c813ab9e71eed150ae569f903287e9283d9292 100644 +--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java +@@ -139,8 +139,14 @@ public class NetherPortalBlock extends Block implements Portal { + WorldBorder worldborder = worldserver1.getWorldBorder(); + double d0 = DimensionType.getTeleportationScale(world.dimensionType(), worldserver1.dimensionType()); + BlockPos blockposition1 = worldborder.clampToBounds(entity.getX() * d0, entity.getY(), entity.getZ() * d0); ++ // Paper start - Configurable portal search radius ++ int portalSearchRadius = worldserver1.paperConfig().environment.portalSearchRadius; ++ if (entity.level().paperConfig().environment.portalSearchVanillaDimensionScaling && flag) { // flag = is going to nether ++ portalSearchRadius = (int) (portalSearchRadius / worldserver1.dimensionType().coordinateScale()); ++ } ++ // Paper end - Configurable portal search radius + // CraftBukkit start +- CraftPortalEvent event = entity.callPortalEvent(entity, CraftLocation.toBukkit(blockposition1, worldserver1.getWorld()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag ? 16 : 128, 16); ++ CraftPortalEvent event = entity.callPortalEvent(entity, CraftLocation.toBukkit(blockposition1, worldserver1.getWorld()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, 16); // Paper - use custom portal search radius + if (event == null) { + return null; + } +diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +index aef1dd28da7e0c0a13a0a7a5b52daa27635c48ea..5c4b2a33d4007c36aef68604bca40a4eba510b4e 100644 +--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java ++++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +@@ -42,6 +42,7 @@ public class PortalForcer { + this.level = world; + } + ++ @io.papermc.paper.annotation.DoNotUse // Paper + public Optional<BlockPos> findClosestPortalPosition(BlockPos pos, boolean destIsNether, WorldBorder worldBorder) { + // CraftBukkit start + return this.findClosestPortalPosition(pos, worldBorder, destIsNether ? 16 : 128); // Search Radius diff --git a/patches/unapplied/server/0062-Add-velocity-warnings.patch b/patches/server/0062-Add-velocity-warnings.patch index 40cc47e141..996e71c322 100644 --- a/patches/unapplied/server/0062-Add-velocity-warnings.patch +++ b/patches/server/0062-Add-velocity-warnings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0cff3f1864f8bc0e731a7275842908c056332212..65502d719c5e87dc6e24662fcc8ba1d0bde0b78d 100644 +index 4bfb836513d5194be271f4a82990ace98de69640..fd31d0e76d1a953b128e777b1bc27e24b1e03ed7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -300,6 +300,7 @@ public final class CraftServer implements Server { +@@ -302,6 +302,7 @@ public final class CraftServer implements Server { private final List<CraftPlayer> playerView; public int reloadCount; public Set<String> activeCompatibilities = Collections.emptySet(); @@ -17,10 +17,10 @@ index 0cff3f1864f8bc0e731a7275842908c056332212..65502d719c5e87dc6e24662fcc8ba1d0 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 f117d32f3606917ad3526c9140ef5e40990ede8c..3390033bbfc8fd0715458e5faa6a65477272a80b 100644 +index 7b45a1216ff824f1b528bb5759d10b70858832a1..df6da730134da754d0ff23bd1b57c82486b9ab73 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -129,10 +129,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -131,10 +131,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public void setVelocity(Vector velocity) { Preconditions.checkArgument(velocity != null, "velocity"); velocity.checkFinite(); diff --git a/patches/unapplied/server/0029-Configurable-baby-zombie-movement-speed.patch b/patches/unapplied/server/0029-Configurable-baby-zombie-movement-speed.patch deleted file mode 100644 index 214f8a89f8..0000000000 --- a/patches/unapplied/server/0029-Configurable-baby-zombie-movement-speed.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown <[email protected]> -Date: Tue, 1 Mar 2016 13:09:16 -0600 -Subject: [PATCH] Configurable baby zombie movement speed - - -diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index bf573c3ca0b34e58525b547ae0228f8af7a4d333..8256af275e468a5aa506f0af22428f4082204956 100644 ---- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java -+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -75,6 +75,7 @@ public class Zombie extends Monster { - - private static final UUID SPEED_MODIFIER_BABY_UUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); - private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.ADD_MULTIPLIED_BASE); -+ private final AttributeModifier babyModifier = new net.minecraft.world.entity.ai.attributes.AttributeModifier(SPEED_MODIFIER_BABY.id(), SPEED_MODIFIER_BABY.name(), this.level().paperConfig().entities.behavior.babyZombieMovementModifier, SPEED_MODIFIER_BABY.operation()); // Paper - Make baby speed configurable - private static final EntityDataAccessor<Boolean> DATA_BABY_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); - private static final EntityDataAccessor<Integer> DATA_SPECIAL_TYPE_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT); - public static final EntityDataAccessor<Boolean> DATA_DROWNED_CONVERSION_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); -@@ -183,9 +184,9 @@ public class Zombie extends Monster { - if (this.level() != null && !this.level().isClientSide) { - AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); - -- attributemodifiable.removeModifier(Zombie.SPEED_MODIFIER_BABY.id()); -+ attributemodifiable.removeModifier(this.babyModifier.id()); // Paper - Make baby speed configurable - if (baby) { -- attributemodifiable.addTransientModifier(Zombie.SPEED_MODIFIER_BABY); -+ attributemodifiable.addTransientModifier(this.babyModifier); // Paper - Make baby speed configurable - } - } - diff --git a/patches/unapplied/server/0042-Configurable-end-credits.patch b/patches/unapplied/server/0042-Configurable-end-credits.patch deleted file mode 100644 index f53785fc6c..0000000000 --- a/patches/unapplied/server/0042-Configurable-end-credits.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: DoctorDark <[email protected]> -Date: Wed, 16 Mar 2016 02:21:39 -0500 -Subject: [PATCH] Configurable end credits - - -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 08b2d5c6fb6d236b805ca6556270ad1891b411f5..5b33cc5c54ab38b32f232dae00684d8b1e276acf 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayer.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1107,6 +1107,7 @@ public class ServerPlayer extends Player { - this.unRide(); - this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); - if (!this.wonGame) { -+ if (this.level().paperConfig().misc.disableEndCredits) this.seenCredits = true; // Paper - Option to disable end credits - this.wonGame = true; - this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, this.seenCredits ? 0.0F : 1.0F)); - this.seenCredits = true; diff --git a/patches/unapplied/server/0061-Add-configurable-portal-search-radius.patch b/patches/unapplied/server/0061-Add-configurable-portal-search-radius.patch deleted file mode 100644 index f65dd2ef82..0000000000 --- a/patches/unapplied/server/0061-Add-configurable-portal-search-radius.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Joseph Hirschfeld <[email protected]> -Date: Thu, 3 Mar 2016 02:46:17 -0600 -Subject: [PATCH] Add configurable portal search radius - - -diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 795ac5f58469f10ce35fff55bbc4fa5f395eea2a..fb3f9082b16f5ec420ddc1f5a0e81b8130a71e4f 100644 ---- a/src/main/java/net/minecraft/world/entity/Entity.java -+++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3208,7 +3208,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - double d0 = DimensionType.getTeleportationScale(this.level().dimensionType(), destination.dimensionType()); - BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0); - // CraftBukkit start -- CraftPortalEvent event = this.callPortalEvent(this, destination, new Vec3(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); -+ // Paper start - Configurable portal search radius -+ int portalSearchRadius = destination.paperConfig().environment.portalSearchRadius; -+ if (level.paperConfig().environment.portalSearchVanillaDimensionScaling && flag2) { // == THE_NETHER -+ portalSearchRadius = (int) (portalSearchRadius / destination.dimensionType().coordinateScale()); -+ } -+ // Paper end - Configurable portal search radius -+ CraftPortalEvent event = this.callPortalEvent(this, destination, new Vec3(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, destination.paperConfig().environment.portalCreateRadius); // Paper start - configurable portal radius - if (event == null) { - return null; - } -diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -index f4c8eee7bc574d402a7897a202734047e37c7a67..03dd833d61d5152af3032f23dd1fc4c75da9bc4f 100644 ---- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -@@ -43,7 +43,7 @@ public class PortalForcer { - - public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos pos, boolean destIsNether, WorldBorder worldBorder) { - // CraftBukkit start -- return this.findPortalAround(pos, worldBorder, destIsNether ? 16 : 128); // Search Radius -+ return this.findPortalAround(pos, worldBorder, destIsNether ? level.paperConfig().environment.portalCreateRadius : level.paperConfig().environment.portalSearchRadius); // Search Radius // Paper - Configurable portal search radius - } - - public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos blockposition, WorldBorder worldborder, int i) { |