From 0e7b7a9b93252de067d92415624c840f8e6056aa Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Sat, 14 Dec 2024 23:42:02 +0900 Subject: [PATCH] work --- build.gradle.kts | 9 +- gradle.properties | 14 +- gradle/libs.versions.toml | 2 +- libs/api.versions.toml | 2 +- libs/common.versions.toml | 2 +- libs/server.versions.toml | 7 +- patches/api/0001-Purpur-API-Changes.patch | 16 +- .../0002-Use-Gradle-Version-Catalogs.patch | 24 +- patches/api/0005-Various-API-Tweaks.patch | 4 +- patches/api/0007-Reduce-allocations.patch | 6 +- .../server/0001-Purpur-Server-Changes.patch | 1111 +++++++++-------- .../0003-Minor-code-optimizations.patch | 4 +- .../server/0004-Build-System-Changes.patch | 15 +- .../0005-Fork-friendly-Rebranding.patch | 27 +- .../server/0007-Plazma-Configurations.patch | 22 +- patches/server/0009-Warn-on-startup.patch | 4 +- ...lways-agree-EULA-on-development-mode.patch | 6 +- patches/server/0011-Add-more-metrics.patch | 4 +- ...0012-Optimize-default-configurations.patch | 20 +- ...-apply-the-configuration-to-the-vani.patch | 6 +- ...missing-Purpur-configuration-options.patch | 22 +- .../0018-Apply-various-optimizations.patch | 6 +- ...sable-moved-to-quickly-check-for-spe.patch | 4 +- .../0027-Improve-SwingTime-ticking.patch | 4 +- ...instead-if-server-favicon-doesn-t-ex.patch | 4 +- ...urable-RandomSource-factory-provider.patch | 4 +- ...042-Remove-persist-isClientSide-flag.patch | 698 ++++------- ...3-Process-pathfinding-asynchronously.patch | 0 ...nt-alternative-noise-chunk-generator.patch | 0 .../0045-Reduce-allocations.patch | 0 .../0046-Hashed-rcon-password.patch | 0 ...7-Add-option-to-allow-shoot-fireball.patch | 0 .../0048-Remove-Mojang-Profiler-codes.patch | 0 ...49-Completely-remove-Mojang-profiler.patch | 0 ...0050-Port-minor-SparklyPaper-patches.patch | 0 ...-Optimize-framed-map-tracker-ticking.patch | 0 ...p-executeTick-check-if-there-s-no-ta.patch | 0 .../0053-SparklyPaper-MSPT-by-World.patch | 0 ...054-SparklyPaper-Optimize-farm-check.patch | 0 ...5-SparklyPaper-Optimize-season-check.patch | 0 ...klyPaper-Optimize-tickingBlockEntity.patch | 0 .../0057-Implement-CarpetFixes.patch | 0 .../0058-Ticking-Controller.patch | 0 ...ion-to-disable-beacon-effect-ambient.patch | 0 .../0060-Tick-toggle-subcommand.patch | 0 45 files changed, 925 insertions(+), 1122 deletions(-) rename patches/{server => work}/0042-Remove-persist-isClientSide-flag.patch (94%) rename patches/{server => work}/0043-Process-pathfinding-asynchronously.patch (100%) rename patches/{server => work}/0044-Implement-alternative-noise-chunk-generator.patch (100%) rename patches/{server => work}/0045-Reduce-allocations.patch (100%) rename patches/{server => work}/0046-Hashed-rcon-password.patch (100%) rename patches/{server => work}/0047-Add-option-to-allow-shoot-fireball.patch (100%) rename patches/{server => work}/0048-Remove-Mojang-Profiler-codes.patch (100%) rename patches/{server => work}/0049-Completely-remove-Mojang-profiler.patch (100%) rename patches/{server => work}/0050-Port-minor-SparklyPaper-patches.patch (100%) rename patches/{server => work}/0051-SparklyPaper-Optimize-framed-map-tracker-ticking.patch (100%) rename patches/{server => work}/0052-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch (100%) rename patches/{server => work}/0053-SparklyPaper-MSPT-by-World.patch (100%) rename patches/{server => work}/0054-SparklyPaper-Optimize-farm-check.patch (100%) rename patches/{server => work}/0055-SparklyPaper-Optimize-season-check.patch (100%) rename patches/{server => work}/0056-SparklyPaper-Optimize-tickingBlockEntity.patch (100%) rename patches/{server => work}/0057-Implement-CarpetFixes.patch (100%) rename patches/{server => work}/0058-Ticking-Controller.patch (100%) rename patches/{server => work}/0059-Add-option-to-disable-beacon-effect-ambient.patch (100%) rename patches/{server => work}/0060-Tick-toggle-subcommand.patch (100%) diff --git a/build.gradle.kts b/build.gradle.kts index 55dce0bd9..20f9390ea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -36,13 +36,8 @@ paperweight { remapRepo = "https://repo.papermc.io/repository/maven-public/" decompileRepo = "https://repo.papermc.io/repository/maven-public/" - useStandardUpstream("paper") { - url = github("PaperMC", "Paper-archive") - ref = providers.gradleProperty("paperCommit") - - withStandardPatcher { - baseName("Paper") - + usePaperUpstream(providers.gradleProperty("paperCommit")) { + withPaperPatcher { apiPatchDir.set(projectDir.resolve("patches/api")) apiOutputDir.set(projectDir.resolve("$brandName-API")) diff --git a/gradle.properties b/gradle.properties index 07b35e492..49f259081 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,17 +13,17 @@ brandName = Plazma providerName = PlazmaMC providerRepo = PlazmaMC/PlazmaBukkit -version = 1.21.3-R0.1-SNAPSHOT -mcVersion = 1.21.3 +version = 1.21.4-R0.1-SNAPSHOT +mcVersion = 1.21.4 jdkVersion = 21 -paperRepo = https://github.com/PaperMC/Paper-archive -paperBranch = ver/1.21.3 +paperRepo = https://github.com/PaperMC/Paper +paperBranch = master purpurRepo = https://github.com/PurpurMC/Purpur -purpurBranch = ver/1.21.3 +purpurBranch = ver/1.21.4 pufferfishRepo = https://github.com/pufferfish-gg/Pufferfish pufferfishBranch = ver/1.21 usePufferfish = false -paperCommit = da7138233f6392e791d790d1c3407414c855f9c2 -purpurCommit = 16ce24aa7eb08232030e4570e027f7baefa5f3f9 +paperCommit = b746d9df0b6b7765478b2a72c2d963b6e668fa35 +purpurCommit = 4a204f1bd7cde4bd1a99673bf46f2373d3bcb7e5 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c9064c912..c68bdc987 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ shadow = "8.3.5" remapper = "0.10.3" paperclip = "3.0.3" -paperweight = "1.7.4" +paperweight = "1.7.7" decompiler = "1.10.1" [libraries] diff --git a/libs/api.versions.toml b/libs/api.versions.toml index 6ce5cb209..32136e4f6 100644 --- a/libs/api.versions.toml +++ b/libs/api.versions.toml @@ -9,7 +9,7 @@ bungeechat = "1.20-R0.2-deprecated+build.19" joml = "1.10.8" json-simple = "1.1.1" -fastutil = "8.5.6" +fastutil = "8.5.15" # adventure # log4j slf4j-api = "2.0.9" diff --git a/libs/common.versions.toml b/libs/common.versions.toml index ed9f9e105..ae0524d5a 100644 --- a/libs/common.versions.toml +++ b/libs/common.versions.toml @@ -1,6 +1,6 @@ [versions] adventure = "4.17.0" -log4j = "2.19.0" +log4j = "2.24.1" asm = "9.7.1" mvn = "3.9.6" diff --git a/libs/server.versions.toml b/libs/server.versions.toml index 8be06bc43..4cdb08b67 100644 --- a/libs/server.versions.toml +++ b/libs/server.versions.toml @@ -1,4 +1,6 @@ [versions] +concurrentutil = "0.0.2" + jline = "3.27.1" tca = "1.3.0" # adventure @@ -7,7 +9,7 @@ netty = "4.1.97.Final" # asm configurate = "4.2.0-SNAPSHOT" # commons2 -sqlite = "3.46.1.3" +sqlite = "3.47.0.0" mysql = "9.1.0" disruptor = "3.4.4" velocity = "3.3.0-SNAPSHOT" @@ -31,6 +33,8 @@ spark = "1.10.119-SNAPSHOT" [libraries] +concurrentutil = { group = "ca.spottedleaf", name = "concurrentutil", version.ref = "concurrentutil" } + jline-ffm = { group = "org.jline", name = "jline-terminal-ffm", version.ref = "jline" } jline-jni = { group = "org.jline", name = "jline-terminal-jni", version.ref = "jline" } tca = { group = "net.minecrell", name = "terminalconsoleappender", version.ref="tca" } @@ -70,6 +74,7 @@ runtime = [ "sqlite", "mysql", "disruptor" ] test = [ "classgraph" ] implementation = [ + "concurrentutil", "jline-ffm", "jline-jni", "tca", diff --git a/patches/api/0001-Purpur-API-Changes.patch b/patches/api/0001-Purpur-API-Changes.patch index b915ed1c6..4887dd10e 100644 --- a/patches/api/0001-Purpur-API-Changes.patch +++ b/patches/api/0001-Purpur-API-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: granny -Date: Fri, 13 Dec 2024 07:03:22 +0900 +Date: Sat, 14 Dec 2024 20:26:32 +0900 Subject: [PATCH] Purpur API Changes PurpurMC @@ -25,10 +25,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/build.gradle.kts b/build.gradle.kts -index e29e5024fa693baae469d47fe77b57118f14627c..b0fd6c1804844f09428051952e3ac4e58f8c859c 100644 +index 571534b42cd9c33d6a7bb6fe3bf3a28e33f8e5de..49546dfbb4dd006b5a2419908890ba4c2a0e207a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -64,6 +64,7 @@ dependencies { +@@ -66,6 +66,7 @@ dependencies { apiAndDocs("net.kyori:adventure-text-logger-slf4j") api("org.apache.logging.log4j:log4j-api:$log4jVersion") api("org.slf4j:slf4j-api:$slf4jVersion") @@ -36,7 +36,7 @@ index e29e5024fa693baae469d47fe77b57118f14627c..b0fd6c1804844f09428051952e3ac4e5 implementation("org.ow2.asm:asm:9.7.1") implementation("org.ow2.asm:asm-commons:9.7.1") -@@ -148,6 +149,13 @@ val generateApiVersioningFile by tasks.registering { +@@ -150,6 +151,13 @@ val generateApiVersioningFile by tasks.registering { } } @@ -50,7 +50,7 @@ index e29e5024fa693baae469d47fe77b57118f14627c..b0fd6c1804844f09428051952e3ac4e5 tasks.jar { from(generateApiVersioningFile.map { it.outputs.files.singleFile }) { into("META-INF/maven/${project.group}/${project.name}") -@@ -160,6 +168,8 @@ tasks.jar { +@@ -162,6 +170,8 @@ tasks.jar { } tasks.withType { @@ -781,10 +781,10 @@ index 918a045165cdcde264bc24082b7afebb407271de..e98d6321c5f2cdde91b54f8a74cbcc04 + // Purpur end } diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 028ac35df6c4d044d07b3869751736d418c1eb0e..95c1f331f364c5fafa100860f3c9674f18888714 100644 +index e89edabd36a6755912694d8a8700da4ebe5c5829..ba2eff0f2ecffbea4b42d5c6e4485ee0087dc981 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -5840,4 +5840,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla +@@ -5811,4 +5811,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla return this.asItemType().getDefaultDataTypes(); } // Paper end - data component API @@ -4305,7 +4305,7 @@ index 12946bd55fcf7c40d39081779a7fa30049ee6165..9c2d605c50cbf9aefa56ec209df9f6ce } diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java -index f9e4b16a21d6cc6c9cbbe06d20c8af25e72e3ddb..4028b230e7fe1c78520f227a377a2a61e8381ecc 100644 +index 5b0d26c68f6c30fd3a9125e96012a7d162afb402..c92dc62e16aec026f32c5a4739ac041e5c88ed03 100644 --- a/src/test/java/org/bukkit/AnnotationTest.java +++ b/src/test/java/org/bukkit/AnnotationTest.java @@ -47,6 +47,10 @@ public class AnnotationTest { diff --git a/patches/api/0002-Use-Gradle-Version-Catalogs.patch b/patches/api/0002-Use-Gradle-Version-Catalogs.patch index 14aeeb1fc..98f18d222 100644 --- a/patches/api/0002-Use-Gradle-Version-Catalogs.patch +++ b/patches/api/0002-Use-Gradle-Version-Catalogs.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use Gradle Version Catalogs diff --git a/build.gradle.kts b/build.gradle.kts -index b0fd6c1804844f09428051952e3ac4e58f8c859c..2b668f8a5c245d024e03c94b7d8872448f1929cf 100644 +index 49546dfbb4dd006b5a2419908890ba4c2a0e207a..6963a76b9040c01dc60d0f24c9eef4738e93f753 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,11 +9,13 @@ java { @@ -22,26 +22,28 @@ index b0fd6c1804844f09428051952e3ac4e58f8c859c..2b668f8a5c245d024e03c94b7d887244 val apiAndDocs: Configuration by configurations.creating { attributes { attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION)) -@@ -39,58 +41,30 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { +@@ -39,60 +41,30 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { // Paper end - configure mockito agent that is needed in newer java versions dependencies { - api("com.mojang:brigadier:1.2.9") // Paper - Brigadier command api - // api dependencies are listed transitively to API consumers -- api("com.google.guava:guava:32.1.2-jre") -- api("com.google.code.gson:gson:2.10.1") +- api("com.google.guava:guava:33.3.1-jre") +- api("com.google.code.gson:gson:2.11.0") - // Paper start - adventure -- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.18") { +- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.19") { - exclude("com.google.guava", "guava") - } - // Paper - adventure - api("org.yaml:snakeyaml:2.2") -- api("org.joml:joml:1.10.5") +- api("org.joml:joml:1.10.8") { +- isTransitive = false // https://github.com/JOML-CI/JOML/issues/352 +- } - // Paper start - api("com.googlecode.json-simple:json-simple:1.1.1") { - isTransitive = false // includes junit - } -- api("it.unimi.dsi:fastutil:8.5.6") +- api("it.unimi.dsi:fastutil:8.5.15") - apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion")) - apiAndDocs("net.kyori:adventure-api") - apiAndDocs("net.kyori:adventure-text-minimessage") @@ -105,17 +107,17 @@ index b0fd6c1804844f09428051952e3ac4e58f8c859c..2b668f8a5c245d024e03c94b7d887244 } // Paper start -@@ -175,27 +149,25 @@ tasks.withType { +@@ -177,27 +149,25 @@ tasks.withType { options.use() options.isDocFilesSubDirs = true options.links( -- "https://guava.dev/releases/32.1.2-jre/api/docs/", +- "https://guava.dev/releases/33.3.1-jre/api/docs/", - "https://javadoc.io/doc/org.yaml/snakeyaml/2.2/", - "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations - // "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat - // Paper start - add missing javadoc links -- "https://javadoc.io/doc/org.joml/joml/1.10.5/index.html", -- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1", +- "https://javadoc.io/doc/org.joml/joml/1.10.8/index.html", +- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.11.0", - "https://jspecify.dev/docs/api/", - // Paper end - // Paper start diff --git a/patches/api/0005-Various-API-Tweaks.patch b/patches/api/0005-Various-API-Tweaks.patch index 4b20293af..9825504ca 100644 --- a/patches/api/0005-Various-API-Tweaks.patch +++ b/patches/api/0005-Various-API-Tweaks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Various API Tweaks diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java -index 41eaa8159f8c028faa118300e95f6a0fb9cfe989..76a5381a959ae4e153dba291a362f3d58aeceac9 100644 +index 679f78e07a3a2de745fa237165d0a8db5e086f29..ac24a288fda957546e2832f375bd1c958db8852b 100644 --- a/src/main/java/com/destroystokyo/paper/MaterialTags.java +++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java -@@ -584,6 +584,15 @@ public class MaterialTags { +@@ -591,6 +591,15 @@ public class MaterialTags { .add(material -> material.name().startsWith("DEEPSLATE_") && material.name().endsWith("_ORE")) .ensureSize("DEEPSLATE_ORES", 8).lock(); diff --git a/patches/api/0007-Reduce-allocations.patch b/patches/api/0007-Reduce-allocations.patch index bfe71e60c..a7455d3c4 100644 --- a/patches/api/0007-Reduce-allocations.patch +++ b/patches/api/0007-Reduce-allocations.patch @@ -67,10 +67,10 @@ index 521f035409ee61a9ad73d39bec938f2938892570..6e53135579426cb677bf34a0813db826 } } diff --git a/src/main/java/org/bukkit/block/Biome.java b/src/main/java/org/bukkit/block/Biome.java -index 464f8f81ba907a61588e4ab869e4f8269830195a..6d50664e76e6e7ed98ca7b311fdb368886ab65a8 100644 +index 20fc2b30fdcdedb012dfe129e746d0b9e162fc36..ca97debfd1a204d15bf5f6c176612cccc2596537 100644 --- a/src/main/java/org/bukkit/block/Biome.java +++ b/src/main/java/org/bukkit/block/Biome.java -@@ -23,6 +23,7 @@ import org.jetbrains.annotations.NotNull; +@@ -21,6 +21,7 @@ import org.jetbrains.annotations.NotNull; * which can be accessed via {@link Registry#BIOME}. */ public interface Biome extends OldEnum, Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations @@ -78,7 +78,7 @@ index 464f8f81ba907a61588e4ab869e4f8269830195a..6d50664e76e6e7ed98ca7b311fdb3688 Biome OCEAN = getBiome("ocean"); Biome PLAINS = getBiome("plains"); -@@ -129,7 +130,7 @@ public interface Biome extends OldEnum, Keyed, net.kyori.adventure.transl +@@ -125,7 +126,7 @@ public interface Biome extends OldEnum, Keyed, net.kyori.adventure.transl @NotNull @Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils static Biome[] values() { diff --git a/patches/server/0001-Purpur-Server-Changes.patch b/patches/server/0001-Purpur-Server-Changes.patch index 3f972ca95..ad02f90e5 100644 --- a/patches/server/0001-Purpur-Server-Changes.patch +++ b/patches/server/0001-Purpur-Server-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: granny -Date: Fri, 13 Dec 2024 07:03:31 +0900 +Date: Sat, 14 Dec 2024 20:26:40 +0900 Subject: [PATCH] Purpur Server Changes PurpurMC @@ -25,7 +25,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/build.gradle.kts b/build.gradle.kts -index faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..77602e4445b1b45a17e5552ac6a769e0ed46ebc7 100644 +index 2da91ed6363c0851e4c459188f5e8ef5475e0c97..74d7aaae57e0e9ea9e31c4b2189ba50a0ac83bea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,7 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { @@ -34,10 +34,10 @@ index faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..77602e4445b1b45a17e5552ac6a769e0 dependencies { - implementation(project(":paper-api")) + implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur + implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency // Paper start implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ - implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21 -@@ -60,6 +60,17 @@ dependencies { +@@ -61,6 +61,17 @@ dependencies { runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") @@ -55,8 +55,8 @@ index faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..77602e4445b1b45a17e5552ac6a769e0 testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0") -@@ -86,6 +97,14 @@ paperweight { - craftBukkitPackageVersion.set("v1_21_R2") // also needs to be updated in MappingEnvironment +@@ -87,6 +98,14 @@ paperweight { + craftBukkitPackageVersion.set("v1_21_R3") // also needs to be updated in MappingEnvironment } + @@ -70,7 +70,7 @@ index faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..77602e4445b1b45a17e5552ac6a769e0 tasks.jar { archiveClassifier.set("dev") -@@ -99,14 +118,14 @@ tasks.jar { +@@ -100,14 +119,14 @@ tasks.jar { val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", @@ -90,7 +90,7 @@ index faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..77602e4445b1b45a17e5552ac6a769e0 "Build-Number" to (build ?: ""), "Build-Time" to Instant.now().toString(), "Git-Branch" to gitBranch, // Paper -@@ -172,7 +191,7 @@ fun TaskContainer.registerRunTask( +@@ -173,7 +192,7 @@ fun TaskContainer.registerRunTask( name: String, block: JavaExec.() -> Unit ): TaskProvider = register(name) { @@ -240,10 +240,10 @@ index c21e00812f1aaa1279834a0562d360d6b89e146c..877d2095a066854939f260ca4b0b8c7b } diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 4b002e8b75d117b726b0de274a76d3596fce015b..8cde30544e14f8fc2dac32966ae3c21f8cf3a551 100644 +index 8f62879582195d8ae4f64bd23f752fa133b1c973..4a8f95670e25c81952cccbaf4c6e49514cacd529 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java -@@ -593,7 +593,7 @@ public class Metrics { +@@ -592,7 +592,7 @@ public class Metrics { boolean logFailedRequests = config.getBoolean("logFailedRequests", false); // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { @@ -252,7 +252,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..8cde30544e14f8fc2dac32966ae3c21f metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { String minecraftVersion = Bukkit.getVersion(); -@@ -602,16 +602,8 @@ public class Metrics { +@@ -601,16 +601,8 @@ public class Metrics { })); metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size())); @@ -365,7 +365,7 @@ index 6ee39b534b8d992655bc0cef3c299d12cbae0034..90b3526479320064378f2cde6c2f2b8e .completer(new ConsoleCommandCompleter(this.server)) .option(LineReader.Option.COMPLETE_IN_WORD, true); diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -index 3470720466fc81f977c18e3a97bb918926025a22..c8651af322927c46d075f88890fcd0476bd85440 100644 +index 6bdc683b5ade408ee27f1d6636b4d60c8c89cb7c..11d91f58208c1e816620f5b97c5fdfc6ce37f6c3 100644 --- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java @@ -136,6 +136,10 @@ public class MobGoalHelper { @@ -1558,7 +1558,7 @@ index 13bd145b1e8006a53c22f5dc0c78f29b540c7663..0d133cd7993eb40b19e2aabe8e2bfcdc boolean flag1 = this.source.acceptsSuccess() && !this.silent; boolean flag2 = broadcastToOps && this.source.shouldInformAdmins() && !this.silent; diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 64bf4444ffba25cb40743a32267aa790ad1738f9..8d82425ccbc30b3f4a59767ca72bf37311ddeda0 100644 +index 517cb238ec280aadd1fc54bcb675ed386e798eaf..a5e8f2d8e5963c730a9509eddfadb9ca322c7183 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java @@ -226,8 +226,8 @@ public class Commands { @@ -1704,10 +1704,10 @@ index 7b118a92a6eb779f800ae8f5d8f6e3c861fc4f6a..057a038e8dcacd7496a0b2373de2c202 register(registry, "template_rotation", TemplateRotationArgument.class, SingletonArgumentInfo.contextFree(TemplateRotationArgument::templateRotation)); register(registry, "heightmap", HeightmapTypeArgument.class, SingletonArgumentInfo.contextFree(HeightmapTypeArgument::heightmap)); diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index f58a94efafbc01d402cd03a108bb90f60930a316..21ea63da99c5b3e2e1ab9cc1049c903bba6cf288 100644 +index faffd87c357511ef00646971a16acf1009362c59..c98e0d9d8bc9e6ef12a9b9d6082e98bc5bb7a5f6 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java -@@ -62,6 +62,12 @@ public class BlockPos extends Vec3i { +@@ -63,6 +63,12 @@ public class BlockPos extends Vec3i { public static final int MAX_HORIZONTAL_COORDINATE = 33554431; // Paper end - Optimize Bit Operations by inlining @@ -1721,7 +1721,7 @@ index f58a94efafbc01d402cd03a108bb90f60930a316..21ea63da99c5b3e2e1ab9cc1049c903b super(x, y, z); } diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 0d12605dc84dad49faa18bf1fd058c3c168623ee..c6490554a3025f4de3f3218178fad76cd1848a19 100644 +index c9d7ac819ce26f5301df7df56edce59b7ef377e0..cdd73bb358e309844bef576175a9026cb8563e7e 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java @@ -930,5 +930,22 @@ public interface DispenseItemBehavior { @@ -1761,7 +1761,7 @@ index bf8c511739265c6a9cd277752e844481598f8966..ffe2399ab6b1f311536475d8216238b5 // CraftBukkit start diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index e693a003ea8f022eef8b49e4332025b769333b30..44a31f6f44885598ee06e88b940b84b1e89e5430 100644 +index 3c866432c8a938c677a315612f3e159bda67a2a2..8661c1b1cfe2b3db000e1f08814fd4409c4b7fab 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -617,11 +617,20 @@ public class Connection extends SimpleChannelInboundHandler> { @@ -1799,10 +1799,10 @@ index 300929a406905f5ff1ede664d5b99fb0938d4d2e..a4e9ac0e07f08e0b6aa682e8c1587d9c throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.OUT_OF_ORDER_CHAT, org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes } else { diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 90ca25c4aaf92a5639839a7cdaee2ffcdb75efa7..ecaec3c7b5768771b00c4c33d48a76ba22653a79 100644 +index 300a044bb0f0e377133f24469cea1a9669de6e58..a880f4e5cf712654649ad043e58e073e9a87c0fe 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -120,6 +120,12 @@ public class Main { +@@ -122,6 +122,12 @@ public class Main { JvmProfiler.INSTANCE.start(Environment.SERVER); } @@ -1816,7 +1816,7 @@ index 90ca25c4aaf92a5639839a7cdaee2ffcdb75efa7..ecaec3c7b5768771b00c4c33d48a76ba Bootstrap.bootStrap(); Bootstrap.validate(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4158473fd553a16fec23bcbcf9a278d413120600..23505b0f80d643d9ef569b49192f44e0373dfb5f 100644 +index ae4ebf509837e8d44255781c61d02873f8b74be8..95f1e0ae174400f2cf7bfed2897259d5aa2cfcb5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -314,6 +314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping + public boolean lagging = false; // Purpur + protected boolean upnp = false; // Purpur public volatile Thread shutdownThread; // Paper public volatile boolean abnormalExit = false; // Paper public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation - private final Set pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping + public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("MobSpawning"); // Pufferfish - optimize mob spawning public static S spin(Function serverFactory) { - AtomicReference atomicreference = new AtomicReference(); -@@ -1054,6 +1058,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - Add EntityMoveEvent net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers worldserver.updateLagCompensationTick(); // Paper - lag compensation @@ -1959,7 +1959,7 @@ index 4158473fd553a16fec23bcbcf9a278d413120600..23505b0f80d643d9ef569b49192f44e0 gameprofilerfiller.push(() -> { String s = String.valueOf(worldserver); -@@ -2011,7 +2058,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop persistentStateManagerFactory) { this.level = world; this.mainThreadProcessor = new ServerChunkCache.MainThreadExecutor(world); -@@ -504,6 +507,43 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -511,6 +514,43 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon this.broadcastChangedChunks(gameprofilerfiller); gameprofilerfiller.pop(); } @@ -2352,7 +2352,7 @@ index d021cd5b6136f0125076513977f430c6d4dd4f9f..1cb8c9d21eef27492efc4995525c198c } private void broadcastChangedChunks(ProfilerFiller profiler) { -@@ -553,6 +593,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -560,6 +600,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon final int naturalSpawnChunkCount = j; NaturalSpawner.SpawnState spawnercreature_d; // moved down if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled @@ -2360,7 +2360,7 @@ index d021cd5b6136f0125076513977f430c6d4dd4f9f..1cb8c9d21eef27492efc4995525c198c // re-set mob counts for (ServerPlayer player : this.level.players) { // Paper start - per player mob spawning backoff -@@ -567,13 +608,17 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -574,13 +615,17 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } // Paper end - per player mob spawning backoff } @@ -2381,7 +2381,7 @@ index d021cd5b6136f0125076513977f430c6d4dd4f9f..1cb8c9d21eef27492efc4995525c198c profiler.popPush("spawnAndTick"); boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING); -@@ -590,7 +635,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -597,7 +642,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon // Paper end - PlayerNaturallySpawnCreaturesEvent boolean flag1 = this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && this.level.getLevelData().getGameTime() % this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit @@ -2390,7 +2390,7 @@ index d021cd5b6136f0125076513977f430c6d4dd4f9f..1cb8c9d21eef27492efc4995525c198c } else { list1 = List.of(); } -@@ -602,8 +647,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -609,8 +654,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon ChunkPos chunkcoordintpair = chunk.getPos(); chunk.incrementInhabitedTime(timeDelta); @@ -2402,7 +2402,7 @@ index d021cd5b6136f0125076513977f430c6d4dd4f9f..1cb8c9d21eef27492efc4995525c198c if (true) { // Paper - rewrite chunk system diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 90eb4927fa51ce3df86aa7b6c71f49150a03e337..c14ce846afb7364e541bfe01b73a06a94e48f55b 100644 +index 103e2c414780be66324bcb9cd4ea539bbdfe12ad..b0675953a75ff01f714cf5f35ad3907281648724 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java @@ -81,7 +81,7 @@ public class ServerEntity { @@ -2431,10 +2431,10 @@ index 90eb4927fa51ce3df86aa7b6c71f49150a03e337..c14ce846afb7364e541bfe01b73a06a9 this.wasOnGround = this.entity.onGround(); this.teleportDelay = 0; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea03eaec03 100644 +index 1f898500d0e9b18a880645ceb0a8ff0fe75f4e48..d0653880e8f8852a27e16c5c964fb7b86c40d542 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -223,6 +223,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -224,6 +224,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe private final StructureManager structureManager; private final StructureCheck structureCheck; private final boolean tickTime; @@ -2443,7 +2443,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea private final RandomSequences randomSequences; // CraftBukkit start -@@ -231,6 +233,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -232,6 +234,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current) @@ -2451,7 +2451,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea public LevelChunk getChunkIfLoaded(int x, int z) { return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately -@@ -604,7 +607,24 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -605,7 +608,24 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe // CraftBukkit end this.tickTime = flag1; this.server = minecraftserver; @@ -2477,7 +2477,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea this.serverLevelData = iworlddataserver; ChunkGenerator chunkgenerator = worlddimension.generator(); // CraftBukkit start -@@ -676,6 +696,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -677,6 +697,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler); // Paper end - rewrite chunk system this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit @@ -2485,7 +2485,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea } // Paper start -@@ -727,7 +748,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -728,7 +749,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); long j; @@ -2494,7 +2494,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea // CraftBukkit start j = this.levelData.getDayTime() + 24000L; TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (j - j % 24000L) - this.getDayTime()); -@@ -792,6 +813,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -793,6 +814,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe org.spigotmc.ActivationRange.activateEntities(this); // Spigot this.entityTickList.forEach((entity) -> { @@ -2502,7 +2502,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea if (!entity.isRemoved()) { if (!tickratemanager.isEntityFrozen(entity)) { gameprofilerfiller.push("checkDespawn"); -@@ -809,7 +831,20 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -810,7 +832,20 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } gameprofilerfiller.push("tick"); @@ -2524,7 +2524,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea gameprofilerfiller.pop(); } } -@@ -841,6 +876,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -842,6 +877,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe this.serverLevelData.getScheduledEvents().tick(this.server, i); Profiler.get().pop(); if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) { @@ -2538,7 +2538,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea this.setDayTime(this.levelData.getDayTime() + 1L); } -@@ -849,8 +891,22 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -850,8 +892,22 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe public void setDayTime(long timeOfDay) { this.serverLevelData.setDayTime(timeOfDay); @@ -2561,7 +2561,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea public void tickCustomSpawners(boolean spawnMonsters, boolean spawnAnimals) { Iterator iterator = this.customSpawners.iterator(); -@@ -930,7 +986,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -931,7 +987,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe ProfilerFiller gameprofilerfiller = Profiler.get(); gameprofilerfiller.push("thunder"); @@ -2570,7 +2570,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15)); if (this.isRainingAt(blockposition)) { -@@ -938,10 +994,18 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -939,10 +995,18 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper - Configurable spawn chances for skeleton horses if (flag1) { @@ -2591,7 +2591,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea entityhorseskeleton.setAge(0); entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); this.addFreshEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit -@@ -1022,7 +1086,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1023,7 +1087,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe return holder.is(PoiTypes.LIGHTNING_ROD); }, (blockposition1) -> { return blockposition1.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockposition1.getX(), blockposition1.getZ()) - 1; @@ -2600,7 +2600,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea return optional.map((blockposition1) -> { return blockposition1.above(1); -@@ -1071,11 +1135,27 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1072,11 +1136,27 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe if (this.canSleepThroughNights()) { if (!this.getServer().isSingleplayer() || this.getServer().isPublished()) { int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); @@ -2629,7 +2629,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea ichatmutablecomponent = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(i)); } -@@ -1215,6 +1295,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1216,6 +1296,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @VisibleForTesting public void resetWeatherCycle() { // CraftBukkit start @@ -2637,7 +2637,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents // If we stop due to everyone sleeping we should reset the weather duration to some other random value. // Not that everyone ever manages to get the whole server to sleep at the same time.... -@@ -1222,6 +1303,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1223,6 +1304,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe this.serverLevelData.setRainTime(0); } // CraftBukkit end @@ -2645,7 +2645,7 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents // CraftBukkit start // If we stop due to everyone sleeping we should reset the weather duration to some other random value. -@@ -2762,7 +2844,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -2772,7 +2854,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message // Paper start - Fix merchant inventory not closing on entity removal @@ -2655,10 +2655,10 @@ index 585e2b43a0326f0b81597fa1234d3c67c76af550..6a359f1ed07aa7b9c78e470fb00661ea } // Paper end - Fix merchant inventory not closing on entity removal diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1db5cf44bd 100644 +index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d561478a27ece9 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -329,6 +329,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -327,6 +327,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent public @Nullable String clientBrandName = null; // Paper - Brand support public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event @@ -2669,7 +2669,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d // Paper start - rewrite chunk system private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader; -@@ -691,6 +695,9 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -689,6 +693,9 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple }); } @@ -2679,7 +2679,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d } @Override -@@ -743,6 +750,9 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -741,6 +748,9 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple } this.saveEnderPearls(nbt); @@ -2689,7 +2689,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d } private void saveParentVehicle(CompoundTag nbt) { -@@ -1032,6 +1042,15 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -1029,6 +1039,15 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple this.trackEnteredOrExitedLavaOnVehicle(); this.updatePlayerAttributes(); this.advancements.flushDirty(this); @@ -2705,7 +2705,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d } private void updatePlayerAttributes() { -@@ -1329,6 +1348,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -1326,6 +1345,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple })); PlayerTeam scoreboardteam = this.getTeam(); @@ -2713,12 +2713,12 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d if (scoreboardteam != null && scoreboardteam.getDeathMessageVisibility() != Team.Visibility.ALWAYS) { if (scoreboardteam.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) { this.server.getPlayerList().broadcastSystemToTeam(this, ichatbasecomponent); -@@ -1432,6 +1452,16 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -1429,6 +1449,16 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple if (this.isInvulnerableTo(world, source)) { return false; } else { + // Purpur start -+ if (source.is(DamageTypeTags.IS_FALL)) { // Purpur ++ if (source.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) { // Purpur + if (getRootVehicle() instanceof net.minecraft.world.entity.vehicle.AbstractMinecart && level().purpurConfig.minecartControllable && !level().purpurConfig.minecartControllableFallDamage) { + return false; + } @@ -2727,10 +2727,10 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d + } + } + // Purpur end - boolean flag = this.server.isDedicatedServer() && this.isPvpAllowed() && source.is(DamageTypeTags.IS_FALL); + Entity entity = source.getEntity(); - if (!flag && this.spawnInvulnerableTime > 0 && !source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { -@@ -1664,6 +1694,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple + if (entity instanceof net.minecraft.world.entity.player.Player) { +@@ -1655,6 +1685,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); this.unsetRemoved(); // CraftBukkit end @@ -2738,7 +2738,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d this.setServerLevel(worldserver); this.connection.internalTeleport(PositionMoveRotation.of(teleportTarget), teleportTarget.relatives()); // CraftBukkit - use internal teleport without event this.connection.resetPosition(); -@@ -1774,7 +1805,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -1765,7 +1796,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple return entitymonster.isPreventingPlayerRest(this.serverLevel(), this); }); @@ -2747,7 +2747,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d return Either.left(net.minecraft.world.entity.player.Player.BedSleepingProblem.NOT_SAFE); } } -@@ -1814,7 +1845,19 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -1805,7 +1836,19 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple }); if (!this.serverLevel().canSleepThroughNights()) { @@ -2768,7 +2768,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d } ((ServerLevel) this.level()).updateSleepingPlayerList(); -@@ -1936,6 +1979,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -1919,6 +1962,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple @Override public void openTextEdit(SignBlockEntity sign, boolean front) { @@ -2776,7 +2776,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d this.connection.send(new ClientboundBlockUpdatePacket(this.level(), sign.getBlockPos())); this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos(), front)); } -@@ -2252,6 +2296,26 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -2235,6 +2279,26 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple this.lastSentExp = -1; // CraftBukkit - Added to reset } @@ -2803,7 +2803,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d @Override public void displayClientMessage(Component message, boolean overlay) { this.sendSystemMessage(message, overlay); -@@ -2476,6 +2540,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -2456,6 +2520,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple return new CommandSourceStack(this.commandSource(), this.position(), this.getRotationVector(), this.serverLevel(), this.getPermissionLevel(), this.getName().getString(), this.getDisplayName(), this.server, this); } @@ -2824,7 +2824,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d public void sendSystemMessage(Component message) { this.sendSystemMessage(message, false); } -@@ -2597,8 +2675,68 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -2577,8 +2655,68 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple public void resetLastActionTime() { this.lastActionTime = Util.getMillis(); @@ -2893,7 +2893,7 @@ index 5a8f396d47577f087abb415c972fd4f51e50faba..e6001fadc04b63b82e20652bbb16cb1d public ServerStatsCounter getStats() { return this.stats; } -@@ -3305,4 +3443,50 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -3285,4 +3423,50 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple return (CraftPlayer) super.getBukkitEntity(); } // CraftBukkit end @@ -3076,10 +3076,10 @@ index b0bc66dc7248aae691dcab68b925b52a1695e63f..7d276c191b391bca24948ddb36b8b7d0 if (this.keepAlivePending && !this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd188404890f 100644 +index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6411babfc 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -342,6 +342,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -344,6 +344,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private boolean justTeleported = false; // CraftBukkit end @@ -3100,7 +3100,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 @Override public void tick() { if (this.ackBlockChangesUpTo > -1) { -@@ -398,6 +412,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -400,6 +414,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.recipeSpamPackets.tick(); // Paper - auto recipe limit this.dropSpamThrottler.tick(); if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits @@ -3113,7 +3113,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause } -@@ -663,6 +683,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -656,6 +676,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); @@ -3122,7 +3122,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 Location oldTo = to.clone(); PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); this.cserver.getPluginManager().callEvent(event); -@@ -739,6 +761,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -734,6 +756,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (packet.getId() == this.awaitingTeleport) { if (this.awaitingPositionFromClient == null) { @@ -3130,7 +3130,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause return; } -@@ -1172,6 +1195,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1226,6 +1249,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleEditBook(ServerboundEditBookPacket packet) { @@ -3138,7 +3138,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 // Paper start - Book size limits final io.papermc.paper.configuration.type.number.IntOr.Disabled pageMax = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax; if (!this.cserver.isPrimaryThread() && pageMax.enabled()) { -@@ -1180,6 +1204,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1234,6 +1258,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl final int maxBookPageSize = pageMax.intValue(); final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D); long byteAllowed = maxBookPageSize; @@ -3149,7 +3149,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 for (final String page : pageList) { final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; byteTotal += byteLength; -@@ -1204,7 +1232,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1258,7 +1286,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } if (byteTotal > byteAllowed) { @@ -3159,7 +3159,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect return; } -@@ -1226,10 +1255,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1280,10 +1309,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl Objects.requireNonNull(list); optional.ifPresent(list::add); list.addAll(packet.pages()); @@ -3176,7 +3176,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 }; this.filterTextPacket((List) list).thenAcceptAsync(consumer, this.server); -@@ -1237,13 +1270,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1291,13 +1324,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } private void updateBookContents(List pages, int slotId) { @@ -3196,7 +3196,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1)); this.player.getInventory().setItem(slotId, CraftEventFactory.handleEditBookEvent(this.player, slotId, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent) -@@ -1251,6 +1289,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1305,6 +1343,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } private void signBook(FilteredText title, List pages, int slotId) { @@ -3208,7 +3208,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 ItemStack itemstack = this.player.getInventory().getItem(slotId); if (itemstack.has(DataComponents.WRITABLE_BOOK_CONTENT)) { -@@ -1258,10 +1301,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1312,10 +1355,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl itemstack1.remove(DataComponents.WRITABLE_BOOK_CONTENT); List> list1 = (List>) (List) pages.stream().map((filteredtext1) -> { // CraftBukkit - decompile error @@ -3221,7 +3221,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 CraftEventFactory.handleEditBookEvent(this.player, slotId, itemstack, itemstack1); // CraftBukkit this.player.getInventory().setItem(slotId, itemstack); // CraftBukkit - event factory updates the hand book } -@@ -1271,6 +1314,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1325,6 +1368,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return this.player.isTextFilteringEnabled() ? Filterable.passThrough(message.filteredOrEmpty()) : Filterable.from(message); } @@ -3238,7 +3238,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 @Override public void handleEntityTagQuery(ServerboundEntityTagQueryPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); -@@ -1320,7 +1373,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1374,7 +1427,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleMovePlayer(ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); @@ -3255,7 +3255,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 this.disconnect((Component) Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause } else { ServerLevel worldserver = this.player.serverLevel(); -@@ -1500,7 +1561,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1554,7 +1615,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl movedWrongly = true; if (event.getLogWarning()) // Paper end @@ -3264,7 +3264,7 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 } // Paper } -@@ -1568,6 +1629,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1622,6 +1683,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); @@ -3273,13 +3273,13 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 Location oldTo = to.clone(); PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); this.cserver.getPluginManager().callEvent(event); -@@ -1613,6 +1676,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1667,6 +1730,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.tryResetCurrentImpulseContext(); } + // Purpur Start -+ if (this.player.level().purpurConfig.dontRunWithScissors && this.player.isSprinting() && !(this.player.level().purpurConfig.ignoreScissorsInWater && this.player.isInWater()) && !(this.player.level().purpurConfig.ignoreScissorsInLava && this.player.isInLava()) && (isScissor(this.player.getItemInHand(InteractionHand.MAIN_HAND)) || isScissor(this.player.getItemInHand(InteractionHand.OFF_HAND))) && (int) (Math.random() * 10) == 0) { -+ this.player.hurt(this.player.damageSources().scissors(), (float) this.player.level().purpurConfig.scissorsRunningDamage); ++ if (this.player.serverLevel().purpurConfig.dontRunWithScissors && this.player.isSprinting() && !(this.player.serverLevel().purpurConfig.ignoreScissorsInWater && this.player.isInWater()) && !(this.player.serverLevel().purpurConfig.ignoreScissorsInLava && this.player.isInLava()) && (isScissors(this.player.getItemInHand(InteractionHand.MAIN_HAND)) || isScissors(this.player.getItemInHand(InteractionHand.OFF_HAND))) && (int) (Math.random() * 10) == 0) { ++ this.player.hurtServer(this.player.serverLevel(), this.player.damageSources().scissors(), (float) this.player.serverLevel().purpurConfig.scissorsRunningDamage); + if (!org.purpurmc.purpur.PurpurConfig.dontRunWithScissors.isBlank()) this.player.sendActionBarMessage(org.purpurmc.purpur.PurpurConfig.dontRunWithScissors); + } + // Purpur End @@ -3287,45 +3287,48 @@ index cd1b6b539a62fa5237d6dab2d1c09a2e631d9941..9ae16e24013ea5664d4ea6d52ed7dd18 this.player.checkMovementStatistics(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5); this.lastGoodX = this.player.getX(); this.lastGoodY = this.player.getY(); -@@ -1652,6 +1722,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1706,6 +1776,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } + // Purpur start -+ public boolean isScissor(ItemStack stack) { ++ public boolean isScissors(ItemStack stack) { + if (!stack.is(Items.SHEARS)) return false; -+ net.minecraft.world.item.component.CustomModelData customModelData = stack.get(net.minecraft.core.component.DataComponents.CUSTOM_MODEL_DATA); -+ return customModelData == null || customModelData.value() == 0; ++ ++ ResourceLocation itemModelReference = stack.get(net.minecraft.core.component.DataComponents.ITEM_MODEL); ++ if (itemModelReference != null && itemModelReference.equals(this.player.serverLevel().purpurConfig.dontRunWithScissorsItemModelReference)) return true; ++ ++ return stack.getOrDefault(DataComponents.CUSTOM_MODEL_DATA, net.minecraft.world.item.component.CustomModelData.EMPTY).equals(net.minecraft.world.item.component.CustomModelData.EMPTY); + } + // Purpur end + // Paper start - optimise out extra getCubes private boolean hasNewCollision(final ServerLevel world, final Entity entity, final AABB oldBox, final AABB newBox) { final List collisionsBB = new java.util.ArrayList<>(); -@@ -2025,6 +2103,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2084,6 +2165,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - boolean cancelled; - if (movingobjectposition == null || movingobjectposition.getType() != HitResult.Type.BLOCK) { + boolean cancelled; + if (movingobjectposition == null || movingobjectposition.getType() != HitResult.Type.BLOCK) { + if (this.player.gameMode.shiftClickMended(itemstack)) return; // Purpur - org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack, enumhand); - cancelled = event.useItemInHand() == Event.Result.DENY; - } else { -@@ -2808,6 +2887,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - AABB axisalignedbb = entity.getBoundingBox(); + org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack, enumhand); + cancelled = event.useItemInHand() == Event.Result.DENY; + } else { +@@ -2874,6 +2956,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + AABB axisalignedbb = entity.getBoundingBox(); if (this.player.canInteractWithEntity(axisalignedbb, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0D))) { // Paper - configurable lenience value for interact range + if (entity instanceof Mob mob) mob.ticksSinceLastInteraction = 0; // Purpur - packet.dispatch(new ServerboundInteractPacket.Handler() { - private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit - ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand); -@@ -2821,6 +2901,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + packet.dispatch(new ServerboundInteractPacket.Handler() { + private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit + ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand); +@@ -2887,6 +2970,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event); + ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event); -+ player.processClick(enumhand); // Purpur ++ player.processClick(enumhand); // Purpur + - // Entity in bucket - SPIGOT-4048 and SPIGOT-6859a - if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) { + // Entity in bucket - SPIGOT-4048 and SPIGOT-6859a + if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) { entity.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java index 033755682c61c889723c3669b5cff4de147f637e..16069b9cbf6c7679c28a2e9a54e77d23cd10e541 100644 @@ -3353,7 +3356,7 @@ index 532f09089b8d6798999cf3f83e852df7479e450e..43c63d203859eaa0999937e2f9254c22 // Paper end } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 1a956249828156fdc273888de59128c3d1a0b898..16999fa20c3621e016d1b0fadfb76f2fe03a2a69 100644 +index 9b71655a425356132afb786eff623f558e1e3498..e1d195ab8b005edd7fcded810ddf903b47c000a1 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -419,6 +419,7 @@ public abstract class PlayerList { @@ -3653,10 +3656,10 @@ index 11d1ee8fae7670f02cb3f5d57f4774dbde77f48c..88cf1353892a7ead4e0f16822216b151 return true; diff --git a/src/main/java/net/minecraft/world/effect/PoisonMobEffect.java b/src/main/java/net/minecraft/world/effect/PoisonMobEffect.java -index 83c6d17f75c3f0b531bdfd5b5f9bc2a5b3eb7a2c..df43c007e7b9fee58b2cd0892b966ce88cb1f890 100644 +index 3f1e59229d6a71117700a56c87914bc9401f1da2..32c8474ffa88e997bb484caecb21e3dc98991e70 100644 --- a/src/main/java/net/minecraft/world/effect/PoisonMobEffect.java +++ b/src/main/java/net/minecraft/world/effect/PoisonMobEffect.java -@@ -11,8 +11,8 @@ class PoisonMobEffect extends MobEffect { +@@ -13,8 +13,8 @@ public class PoisonMobEffect extends MobEffect { @Override public boolean applyEffectTick(ServerLevel world, LivingEntity entity, int amplifier) { @@ -3695,10 +3698,10 @@ index 98b74649a667fb9b10afef0ba5383a73022d8c71..0c7c0524e487ff32e16dd9939d92bc64 ((CraftPlayer) entityhuman.getBukkitEntity()).sendHealthUpdate(); diff --git a/src/main/java/net/minecraft/world/effect/WitherMobEffect.java b/src/main/java/net/minecraft/world/effect/WitherMobEffect.java -index 303cefba51e19ac43b1f6188ad64ef480715ebaf..98ec88751b3e71c2e7aad633096b7f41608c0b33 100644 +index 55132e6e064ddd15b26286eca335305ed57b2f9e..1e04947995009689315352b79989e7ce4e20073c 100644 --- a/src/main/java/net/minecraft/world/effect/WitherMobEffect.java +++ b/src/main/java/net/minecraft/world/effect/WitherMobEffect.java -@@ -10,7 +10,7 @@ class WitherMobEffect extends MobEffect { +@@ -12,7 +12,7 @@ public class WitherMobEffect extends MobEffect { @Override public boolean applyEffectTick(ServerLevel world, LivingEntity entity, int amplifier) { @@ -3708,7 +3711,7 @@ index 303cefba51e19ac43b1f6188ad64ef480715ebaf..98ec88751b3e71c2e7aad633096b7f41 } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44177752f7 100644 +index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e8b701dd2 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -177,7 +177,7 @@ import org.bukkit.plugin.PluginManager; @@ -3785,7 +3788,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 this.remainingFireTicks = -this.getFireImmuneTicks(); this.fluidHeight = new Object2DoubleArrayMap(2); this.fluidOnEyes = new HashSet(); -@@ -974,6 +1000,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -978,6 +1004,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v) && (!(this instanceof Player player) || !player.getAbilities().invulnerable))) { // Paper end - Configurable nether ceiling damage @@ -3793,7 +3796,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 this.onBelowWorld(); } -@@ -1935,7 +1962,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1958,7 +1985,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public boolean fireImmune() { @@ -3802,7 +3805,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 } public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { -@@ -2008,7 +2035,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2031,7 +2058,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return this.isInWater() || flag; } @@ -3811,7 +3814,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 Entity entity = this.getVehicle(); if (entity instanceof AbstractBoat abstractboat) { -@@ -2690,6 +2717,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2713,6 +2740,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess nbttagcompound.putBoolean("Paper.FreezeLock", true); } // Paper end @@ -3823,7 +3826,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 return nbttagcompound; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT"); -@@ -2838,6 +2870,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2863,6 +2895,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess freezeLocked = nbt.getBoolean("Paper.FreezeLock"); } // Paper end @@ -3835,7 +3838,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT"); -@@ -3089,6 +3126,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3114,6 +3151,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess if (this.isAlive() && this instanceof Leashable leashable) { if (leashable.getLeashHolder() == player) { if (!this.level().isClientSide()) { @@ -3843,7 +3846,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 // CraftBukkit start - fire PlayerUnleashEntityEvent // Paper start - Expand EntityUnleashEvent org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.hasInfiniteMaterials()); -@@ -3294,6 +3332,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3324,6 +3362,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.passengers = ImmutableList.copyOf(list); } @@ -3857,7 +3860,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 this.gameEvent(GameEvent.ENTITY_MOUNT, passenger); } } -@@ -3333,6 +3378,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3363,6 +3408,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return false; } // CraftBukkit end @@ -3872,7 +3875,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 if (this.passengers.size() == 1 && this.passengers.get(0) == entity) { this.passengers = ImmutableList.of(); } else { -@@ -3413,14 +3466,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3443,14 +3496,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return Vec3.directionFromRotation(this.getRotationVector()); } @@ -3891,7 +3894,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 } } else { this.portalProcess = new PortalProcessor(portal, pos.immutable()); -@@ -3637,7 +3693,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3667,7 +3723,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public int getMaxAirSupply() { @@ -3900,7 +3903,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 } public int getAirSupply() { -@@ -4135,7 +4191,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4169,7 +4225,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess // CraftBukkit end public boolean canUsePortal(boolean allowVehicles) { @@ -3909,7 +3912,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 } public boolean canTeleport(Level from, Level to) { -@@ -4723,6 +4779,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4753,6 +4809,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return Mth.lerp(delta, this.yRotO, this.yRot); } @@ -3922,7 +3925,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 // Paper start - optimise collisions public boolean updateFluidHeightAndDoFluidPushing(final TagKey fluid, final double flowScale) { if (this.touchingUnloadedChunk()) { -@@ -5124,7 +5186,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -5154,7 +5216,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public float maxUpStep() { @@ -3931,7 +3934,7 @@ index a15546e433ebba6c0de01bdaaef201a3d99a87b5..aa171a1afb9800e6ec84f6b4f1b28e44 } public void onExplosionHit(@Nullable Entity entity) {} -@@ -5325,4 +5387,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -5355,4 +5417,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return ((net.minecraft.server.level.ServerLevel) this.level).isPositionEntityTicking(this.blockPosition()); } // Paper end - Expose entity id counter @@ -3989,7 +3992,7 @@ index 6bf691fcc6486bde73bae30eff09142802c29eda..59c4d3753c7084e92402608b7fb3c4ad private EntitySelector() {} // Paper start - Affects Spawning API diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index c8c2394558952d7ca57d29874485251b8f2b3400..1d50b03246d114c6583815205eeacb7ac8549aec 100644 +index d23914a3ab3723d532ae867db6b954c843030f75..a3ae5e663a0334eaa8ca6ce89c3088620a849bb9 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -385,10 +385,12 @@ public class EntityType implements FeatureElement, EntityTypeT @@ -4023,7 +4026,7 @@ index c8c2394558952d7ca57d29874485251b8f2b3400..1d50b03246d114c6583815205eeacb7a public static ResourceLocation getKey(EntityType type) { return BuiltInRegistries.ENTITY_TYPE.getKey(type); } -@@ -604,6 +616,16 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -614,6 +626,16 @@ public class EntityType implements FeatureElement, EntityTypeT return this.category; } @@ -4040,7 +4043,7 @@ index c8c2394558952d7ca57d29874485251b8f2b3400..1d50b03246d114c6583815205eeacb7a public String getDescriptionId() { return this.descriptionId; } -@@ -661,6 +683,12 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -671,6 +693,12 @@ public class EntityType implements FeatureElement, EntityTypeT entity.load(nbt); }, () -> { EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id")); @@ -4054,10 +4057,10 @@ index c8c2394558952d7ca57d29874485251b8f2b3400..1d50b03246d114c6583815205eeacb7a } diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index bf0838f574fa3fb9654e087d602b8d380bd7fb28..32a0db7e8f974712bd8a05f16f3bd48ac66142d5 100644 +index 23b47d90fd35659d9eaa661e808a7f89b29614cf..ba4fe614e2a3378f17b544c78c92a271523e8d37 100644 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -@@ -333,7 +333,7 @@ public class ExperienceOrb extends Entity { +@@ -335,7 +335,7 @@ public class ExperienceOrb extends Entity { public void playerTouch(Player player) { if (player instanceof ServerPlayer entityplayer) { if (player.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(entityplayer.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent @@ -4066,7 +4069,7 @@ index bf0838f574fa3fb9654e087d602b8d380bd7fb28..32a0db7e8f974712bd8a05f16f3bd48a player.take(this, 1); int i = this.repairPlayerItems(entityplayer, this.value); -@@ -351,7 +351,7 @@ public class ExperienceOrb extends Entity { +@@ -353,7 +353,7 @@ public class ExperienceOrb extends Entity { } private int repairPlayerItems(ServerPlayer player, int amount) { @@ -4076,7 +4079,7 @@ index bf0838f574fa3fb9654e087d602b8d380bd7fb28..32a0db7e8f974712bd8a05f16f3bd48a if (optional.isPresent()) { ItemStack itemstack = ((EnchantedItemInUse) optional.get()).itemStack(); diff --git a/src/main/java/net/minecraft/world/entity/GlowSquid.java b/src/main/java/net/minecraft/world/entity/GlowSquid.java -index b851c3ee1426bc0a259bf6c4a662af0c9883dd71..3283228d7ebf98ce98780725a0a412bea4200da5 100644 +index 397765b1547ae47b64963b3807b206c50a6650e1..7f75b5485ca047829415cc1ffb0ec28614633707 100644 --- a/src/main/java/net/minecraft/world/entity/GlowSquid.java +++ b/src/main/java/net/minecraft/world/entity/GlowSquid.java @@ -25,6 +25,39 @@ public class GlowSquid extends Squid { @@ -4120,11 +4123,11 @@ index b851c3ee1426bc0a259bf6c4a662af0c9883dd71..3283228d7ebf98ce98780725a0a412be protected ParticleOptions getInkParticle() { return ParticleTypes.GLOW_SQUID_INK; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e755aa12bfa 100644 +index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..33fbe0f7a356dd847e546feffb468b2803c6744b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -248,9 +248,9 @@ public abstract class LivingEntity extends Entity implements Attackable { - protected int deathScore; +@@ -246,9 +246,9 @@ public abstract class LivingEntity extends Entity implements Attackable { + protected float rotOffs; public float lastHurt; public boolean jumping; - public float xxa; @@ -4136,7 +4139,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 protected int lerpSteps; protected double lerpX; protected double lerpY; -@@ -297,6 +297,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -295,6 +295,7 @@ public abstract class LivingEntity extends Entity implements Attackable { public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API @@ -4144,7 +4147,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 @Override public float getBukkitYaw() { -@@ -325,7 +326,8 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -323,7 +324,8 @@ public abstract class LivingEntity extends Entity implements Attackable { this.lastClimbablePos = Optional.empty(); this.activeLocationDependentEnchantments = new EnumMap(EquipmentSlot.class); this.appliedScale = 1.0F; @@ -4154,7 +4157,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 this.craftAttributes = new CraftAttributeMap(this.attributes); // CraftBukkit // CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor this.entityData.set(LivingEntity.DATA_HEALTH_ID, (float) this.getAttribute(Attributes.MAX_HEALTH).getValue()); -@@ -340,6 +342,8 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -338,6 +340,8 @@ public abstract class LivingEntity extends Entity implements Attackable { this.brain = this.makeBrain(new Dynamic(dynamicopsnbt, (Tag) dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), (Tag) dynamicopsnbt.emptyMap())))); } @@ -4163,7 +4166,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 public Brain getBrain() { return this.brain; } -@@ -375,6 +379,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -373,6 +377,7 @@ public abstract class LivingEntity extends Entity implements Attackable { public static AttributeSupplier.Builder createLivingAttributes() { return AttributeSupplier.builder().add(Attributes.MAX_HEALTH).add(Attributes.KNOCKBACK_RESISTANCE).add(Attributes.MOVEMENT_SPEED).add(Attributes.ARMOR).add(Attributes.ARMOR_TOUGHNESS).add(Attributes.MAX_ABSORPTION).add(Attributes.STEP_HEIGHT).add(Attributes.SCALE).add(Attributes.GRAVITY).add(Attributes.SAFE_FALL_DISTANCE).add(Attributes.FALL_DAMAGE_MULTIPLIER).add(Attributes.JUMP_STRENGTH).add(Attributes.OXYGEN_BONUS).add(Attributes.BURNING_TIME).add(Attributes.EXPLOSION_KNOCKBACK_RESISTANCE).add(Attributes.WATER_MOVEMENT_EFFICIENCY).add(Attributes.MOVEMENT_EFFICIENCY).add(Attributes.ATTACK_KNOCKBACK); } @@ -4171,7 +4174,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 @Override protected void checkFallDamage(double heightDifference, boolean onGround, BlockState state, BlockPos landedPosition) { -@@ -467,7 +472,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -465,7 +470,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (world1 instanceof ServerLevel) { worldserver1 = (ServerLevel) world1; @@ -4180,7 +4183,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 this.hurtServer(worldserver1, this.damageSources().inWall(), 1.0F); } else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) { double d1 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone(); -@@ -475,6 +480,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -473,6 +478,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (d1 < 0.0D) { d0 = this.level().getWorldBorder().getDamagePerBlock(); if (d0 > 0.0D) { @@ -4188,7 +4191,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 this.hurtServer(worldserver1, this.damageSources().outOfBorder(), (float) Math.max(1, Mth.floor(-d1 * d0))); } } -@@ -486,7 +492,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -484,7 +490,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (flag1) { this.setAirSupply(this.decreaseAirSupply(this.getAirSupply())); @@ -4197,15 +4200,15 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 this.setAirSupply(0); Vec3 vec3d = this.getDeltaMovement(); -@@ -498,7 +504,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -496,7 +502,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.level().addParticle(ParticleTypes.BUBBLE, this.getX() + d0, this.getY() + d2, this.getZ() + d3, vec3d.x, vec3d.y, vec3d.z); } - this.hurt(this.damageSources().drown(), 2.0F); + this.hurt(this.damageSources().drown(), (float) this.level().purpurConfig.damageFromDrowning); // Purpur } - } - + } else if (this.getAirSupply() < this.getMaxAirSupply()) { + this.setAirSupply(this.increaseAirSupply(this.getAirSupply())); @@ -564,6 +570,19 @@ public abstract class LivingEntity extends Entity implements Attackable { gameprofilerfiller.pop(); } @@ -4313,23 +4316,23 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 this.noActionTime = 0; if (amount < 0.0F) { amount = 0.0F; -@@ -1549,13 +1615,13 @@ public abstract class LivingEntity extends Entity implements Attackable { - if (entity1 instanceof net.minecraft.world.entity.player.Player) { - net.minecraft.world.entity.player.Player entityhuman = (net.minecraft.world.entity.player.Player) entity1; - +@@ -1643,13 +1709,13 @@ public abstract class LivingEntity extends Entity implements Attackable { + Entity entity = damageSource.getEntity(); + + if (entity instanceof net.minecraft.world.entity.player.Player entityhuman) { +- this.lastHurtByPlayerTime = 100; ++ this.lastHurtByPlayerTime = this.level().purpurConfig.mobLastHurtByPlayerTime; // Purpur + this.lastHurtByPlayer = entityhuman; + return entityhuman; + } else { + if (entity instanceof Wolf entitywolf) { + if (entitywolf.isTame()) { - this.lastHurtByPlayerTime = 100; + this.lastHurtByPlayerTime = this.level().purpurConfig.mobLastHurtByPlayerTime; // Purpur - this.lastHurtByPlayer = entityhuman; - } else if (entity1 instanceof Wolf) { - Wolf entitywolf = (Wolf) entity1; - - if (entitywolf.isTame()) { -- this.lastHurtByPlayerTime = 100; -+ this.lastHurtByPlayerTime = this.level().purpurConfig.mobLastHurtByPlayerTime; // Purpur - LivingEntity entityliving2 = entitywolf.getOwner(); + LivingEntity entityliving = entitywolf.getOwner(); - if (entityliving2 instanceof net.minecraft.world.entity.player.Player) { -@@ -1702,6 +1768,18 @@ public abstract class LivingEntity extends Entity implements Attackable { + if (entityliving instanceof net.minecraft.world.entity.player.Player) { +@@ -1713,6 +1779,18 @@ public abstract class LivingEntity extends Entity implements Attackable { } } @@ -4348,7 +4351,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null; EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot); event.setCancelled(itemstack == null); -@@ -1873,7 +1951,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1884,7 +1962,7 @@ public abstract class LivingEntity extends Entity implements Attackable { boolean flag = false; if (this.dead && adversary instanceof WitherBoss) { // Paper @@ -4357,7 +4360,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 BlockPos blockposition = this.blockPosition(); BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState(); -@@ -1910,6 +1988,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1921,6 +1999,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.dropEquipment(world); // CraftBukkit - from below if (this.shouldDropLoot() && world.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { @@ -4365,7 +4368,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 this.dropFromLootTable(world, damageSource, flag); // Paper start final boolean prev = this.clearEquipmentSlots; -@@ -1918,6 +1997,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1929,6 +2008,7 @@ public abstract class LivingEntity extends Entity implements Attackable { // Paper end this.dropCustomDeathLoot(world, damageSource, flag); this.clearEquipmentSlots = prev; // Paper @@ -4373,7 +4376,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 } // CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, damageSource, this.drops, () -> { -@@ -2120,6 +2200,20 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2135,6 +2215,20 @@ public abstract class LivingEntity extends Entity implements Attackable { return this.lastClimbablePos; } @@ -4394,7 +4397,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 public boolean onClimbable() { if (this.isSpectator()) { return false; -@@ -3146,6 +3240,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3157,6 +3251,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (f > 0.0F) { this.playSound(this.getFallDamageSound((int) f), 1.0F, 1.0F); @@ -4402,7 +4405,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 this.hurt(this.damageSources().flyIntoWall(), f); } } -@@ -3692,8 +3787,10 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3703,8 +3798,10 @@ public abstract class LivingEntity extends Entity implements Attackable { this.pushEntities(); gameprofilerfiller.pop(); // Paper start - Add EntityMoveEvent @@ -4415,7 +4418,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 Location from = new Location(this.level().getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO); Location to = new Location(this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot()); io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone()); -@@ -3703,6 +3800,21 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3714,6 +3811,21 @@ public abstract class LivingEntity extends Entity implements Attackable { this.absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch()); } } @@ -4437,7 +4440,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 } // Paper end - Add EntityMoveEvent world = this.level(); -@@ -3712,6 +3824,34 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3723,6 +3835,34 @@ public abstract class LivingEntity extends Entity implements Attackable { } } @@ -4472,7 +4475,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 } public boolean isSensitiveToWater() { -@@ -3738,7 +3878,17 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3749,7 +3889,17 @@ public abstract class LivingEntity extends Entity implements Attackable { }).toList(); EquipmentSlot enumitemslot = (EquipmentSlot) Util.getRandom(list, this.random); @@ -4491,7 +4494,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 } this.gameEvent(GameEvent.ELYTRA_GLIDE); -@@ -3747,7 +3897,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3758,7 +3908,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } @@ -4500,7 +4503,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 if (!this.onGround() && !this.isPassenger() && !this.hasEffect(MobEffects.LEVITATION)) { Iterator iterator = EquipmentSlot.VALUES.iterator(); -@@ -4669,7 +4819,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4676,7 +4826,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (equippable != null && equippable.dispensable()) { EquipmentSlot enumitemslot = equippable.slot(); @@ -4509,7 +4512,7 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 } else { return false; } -@@ -4694,6 +4844,12 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4701,6 +4851,12 @@ public abstract class LivingEntity extends Entity implements Attackable { return equippable == null ? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND) : slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.getType()); } @@ -4523,10 +4526,10 @@ index f36a075dbee2b96d01899e02460b1d8443e91749..f4604e543a980d6aeb485252da5a4e75 return slot != EquipmentSlot.HEAD && slot != EquipmentSlot.MAINHAND && slot != EquipmentSlot.OFFHAND ? SlotAccess.forEquipmentSlot(entity, slot, (itemstack) -> { return itemstack.isEmpty() || entity.getEquipmentSlotForItem(itemstack) == slot; diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2df55a21c 100644 +index 5a0b51342f4a646101f4588697bcae7d1ca8a010..0d68cd513cfed80fcbe011648cc8779beb782aaa 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -148,6 +148,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -144,6 +144,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab private BlockPos restrictCenter; private float restrictRadius; @@ -4534,7 +4537,7 @@ index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2 public boolean aware = true; // CraftBukkit protected Mob(EntityType type, Level world) { -@@ -163,8 +164,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -159,8 +160,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab this.restrictRadius = -1.0F; this.goalSelector = new GoalSelector(); this.targetSelector = new GoalSelector(); @@ -4545,7 +4548,7 @@ index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2 this.jumpControl = new JumpControl(this); this.bodyRotationControl = this.createBodyControl(); this.navigation = this.createNavigation(world); -@@ -235,14 +236,16 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -231,14 +232,16 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab return this.lookControl; } @@ -4564,7 +4567,7 @@ index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2 this.targetSelector.tick(); } } -@@ -334,6 +337,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -330,6 +333,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab entityliving = null; } } @@ -4572,7 +4575,7 @@ index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2 this.target = entityliving; return true; // CraftBukkit end -@@ -378,8 +382,28 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -374,8 +378,28 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab } gameprofilerfiller.pop(); @@ -4601,7 +4604,7 @@ index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2 @Override protected void playHurtSound(DamageSource damageSource) { this.resetAmbientSoundTime(); -@@ -547,6 +571,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -544,6 +568,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab } nbt.putBoolean("Bukkit.Aware", this.aware); // CraftBukkit @@ -4609,7 +4612,7 @@ index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2 } @Override -@@ -624,6 +649,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -634,6 +659,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab this.aware = nbt.getBoolean("Bukkit.Aware"); } // CraftBukkit end @@ -4621,7 +4624,7 @@ index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2 } @Override -@@ -676,7 +706,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -686,7 +716,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab Level world = this.level(); if (world instanceof ServerLevel worldserver) { @@ -4669,7 +4672,7 @@ index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2 } public boolean isWithinRestriction() { -@@ -1735,23 +1769,15 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -1738,23 +1772,15 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab this.playAttackSound(); } @@ -4696,7 +4699,7 @@ index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2 } @Override -@@ -1813,4 +1839,58 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -1816,4 +1842,58 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab public float[] getArmorDropChances() { return this.armorDropChances; } @@ -4756,7 +4759,7 @@ index dbd321f3dc3cc80737830db63aed47a6935e8e89..7ca12a1128661ea36e2e33cda204c7d2 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java -index 94d04a20f97405e02d7cccaabadc7a7e86e336f7..861591694785a6ff16f839fa91781791c275de14 100644 +index fb967ac7b3e7828301f08a7fe9b039441cf7da30..236485c0c9706d5561f8bc950b20411ae628ca96 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java @@ -23,14 +23,23 @@ public class AttributeMap { @@ -4801,10 +4804,10 @@ index 94d04a20f97405e02d7cccaabadc7a7e86e336f7..861591694785a6ff16f839fa91781791 public boolean hasAttribute(Holder attribute) { diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java b/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java -index 386f9bca728055f7b75fb690b307ff4510068105..0bb08af954d224a2b4404615bee720ac4bdbac55 100644 +index c76438d5ce2330eca16dc0b381f97e9506f84aef..074d2d4e85d3e3ad546fcb15dfd00b757bf549a8 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java -@@ -130,7 +130,7 @@ public class DefaultAttributes { +@@ -131,7 +131,7 @@ public class DefaultAttributes { .put(EntityType.OCELOT, Ocelot.createAttributes().build()) .put(EntityType.PANDA, Panda.createAttributes().build()) .put(EntityType.PARROT, Parrot.createAttributes().build()) @@ -4813,7 +4816,7 @@ index 386f9bca728055f7b75fb690b307ff4510068105..0bb08af954d224a2b4404615bee720ac .put(EntityType.PIG, Pig.createAttributes().build()) .put(EntityType.PIGLIN, Piglin.createAttributes().build()) .put(EntityType.PIGLIN_BRUTE, PiglinBrute.createAttributes().build()) -@@ -161,7 +161,7 @@ public class DefaultAttributes { +@@ -162,7 +162,7 @@ public class DefaultAttributes { .put(EntityType.VILLAGER, Villager.createAttributes().build()) .put(EntityType.VINDICATOR, Vindicator.createAttributes().build()) .put(EntityType.WARDEN, Warden.createAttributes().build()) @@ -4835,18 +4838,18 @@ index f0703302e7dbbda88de8c648d20d87c55ed9b1e0..a913ebabaa5f443afa987b972355a8f8 } } diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java -index e1b6fe9ecda25f86431baf414f1bfd3a26a8b2bd..3d7578605812021bc84b99d4db1672a682d897ad 100644 +index 0d177e828c2b338ce93c58aaef04df326e1eb0b2..273ba657926ce72a7c82861e880a82bf7f322a0b 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java -@@ -73,7 +73,7 @@ public class AcquirePoi { +@@ -86,7 +86,7 @@ public class AcquirePoi { }; // Paper start - optimise POI access - java.util.List, BlockPos>> poiposes = new java.util.ArrayList<>(); + final java.util.List, BlockPos>> poiposes = new java.util.ArrayList<>(); - io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, poiPredicate, predicate2, entity.blockPosition(), 48, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes); + io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, poiPredicate, predicate2, entity.blockPosition(), world.purpurConfig.villagerAcquirePoiSearchRadius, world.purpurConfig.villagerAcquirePoiSearchRadius*world.purpurConfig.villagerAcquirePoiSearchRadius, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes); - Set, BlockPos>> set = new java.util.HashSet<>(poiposes); - // Paper end - optimise POI access - Path path = findPathToPois(entity, set); + final Set, BlockPos>> set = new java.util.HashSet<>(poiposes.size()); + for (final Pair, BlockPos> poiPose : poiposes) { + if (worldPosBiPredicate.test(world, poiPose.getSecond())) { diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java b/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java index 2ade08d1466660ee1787fa97908002ef56389712..018cc6ff39641157668fca09e64bcddf7d4d3a5c 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java @@ -4975,10 +4978,10 @@ index 8508ac7de8cda3127b73e11ff4aee62502e65ead..b1544e028d5a9b84b944e1fb5a12bb16 throwHalfStack(entity, this.trades, villager); } diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java -index bb65d46967cb04f611b3c9c97d5732cfb21ede9b..7f4156e4690bbd57f9e9141f008851062cae733d 100644 +index 41f4107101bcd5d753b72cdbabe7946a1975c653..4475b406dde30e5be8ce9d2ff45f8d22d242690c 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java -@@ -52,8 +52,13 @@ public class VillagerGoalPackages { +@@ -74,8 +74,13 @@ public class VillagerGoalPackages { } public static ImmutableList>> getWorkPackage(VillagerProfession profession, float speed) { @@ -5555,10 +5558,10 @@ index 5677dc97ed83652f261100cf391883cfac7d16fe..9987d28ea145f6d0126cb4ea22001e09 entityanimal.resetLove(); worldserver.broadcastEntityEvent(this, (byte) 18); diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f60f81b659 100644 +index 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b0386a44a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -150,6 +150,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -154,6 +154,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { public Bee(EntityType type, Level world) { super(type, world); this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(this.random, 20, 60); @@ -5566,7 +5569,7 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 // Paper start - Fix MC-167279 class BeeFlyingMoveControl extends FlyingMoveControl { public BeeFlyingMoveControl(final Mob entity, final int maxPitchChange, final boolean noGravity) { -@@ -158,22 +159,69 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -162,22 +163,69 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @Override public void tick() { @@ -5637,7 +5640,7 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { super.defineSynchedData(builder); -@@ -188,6 +236,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -192,6 +240,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @Override protected void registerGoals() { @@ -5645,7 +5648,7 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 this.goalSelector.addGoal(0, new Bee.BeeAttackGoal(this, 1.399999976158142D, true)); this.goalSelector.addGoal(1, new Bee.BeeEnterHiveGoal()); this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D)); -@@ -207,6 +256,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -211,6 +260,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.goalSelector.addGoal(7, new Bee.BeeGrowCropGoal()); this.goalSelector.addGoal(8, new Bee.BeeWanderGoal()); this.goalSelector.addGoal(9, new FloatGoal(this)); @@ -5653,7 +5656,7 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 this.targetSelector.addGoal(1, (new Bee.BeeHurtByOtherGoal(this)).setAlertOthers(new Class[0])); this.targetSelector.addGoal(2, new Bee.BeeBecomeAngryTargetGoal(this)); this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true)); -@@ -376,7 +426,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -380,7 +430,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { } public static boolean isNightOrRaining(Level world) { @@ -5662,7 +5665,7 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 } public void setStayOutOfHiveCountdown(int cannotEnterHiveTicks) { -@@ -411,6 +461,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -415,6 +465,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.hurtServer(world, this.damageSources().drown(), 1.0F); } @@ -5670,7 +5673,7 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 if (flag) { ++this.timeSinceSting; if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) { -@@ -435,6 +486,27 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -439,6 +490,27 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { return tileentitybeehive != null && tileentitybeehive.isFireNearby(); } @@ -5698,8 +5701,8 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 @Override public int getRemainingPersistentAngerTime() { return (Integer) this.entityData.get(Bee.DATA_REMAINING_ANGER_TIME); -@@ -701,16 +773,16 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { - this.hivePos = pos; +@@ -738,16 +810,16 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { + return state.is(BlockTags.BEE_ATTRACTIVE) ? ((Boolean) state.getValueOrElse(BlockStateProperties.WATERLOGGED, false) ? false : (state.is(Blocks.SUNFLOWER) ? state.getValue(DoublePlantBlock.HALF) == DoubleBlockHalf.UPPER : true)) : false; } - private class BeeLookControl extends LookControl { @@ -5718,7 +5721,7 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 } } -@@ -882,6 +954,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -916,6 +988,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { if (optional.isPresent()) { Bee.this.savedFlowerPos = (BlockPos) optional.get(); Bee.this.navigation.moveTo((double) Bee.this.savedFlowerPos.getX() + 0.5D, (double) Bee.this.savedFlowerPos.getY() + 0.5D, (double) Bee.this.savedFlowerPos.getZ() + 0.5D, 1.2000000476837158D); @@ -5726,7 +5729,7 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 return true; } else { Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60); -@@ -925,6 +998,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -959,6 +1032,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.pollinating = false; Bee.this.navigation.stop(); Bee.this.remainingCooldownBeforeLocatingNewFlower = 200; @@ -5734,7 +5737,7 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 } @Override -@@ -974,6 +1048,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -1008,6 +1082,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.setWantedPos(); } @@ -5743,7 +5746,7 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..dc8df0912c1d18176e18a8f4dc43c4f6 if (Bee.this.random.nextFloat() < 0.05F && this.successfulPollinatingTicks > this.lastSoundPlayedTick + 60) { this.lastSoundPlayedTick = this.successfulPollinatingTicks; diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java -index 471d5727b964922d8e898be9e1d5c30f9d3bac97..4aad4fdc80070f4000e929fff126714fc67050b0 100644 +index 989b7be74eaeba7f40eac87c7ee7f252cb0c05c9..a418ded306908ee9cb9e375104354a6e031305c9 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java @@ -100,12 +100,59 @@ public class Cat extends TamableAnimal implements VariantHolder { @@ -6624,10 +6628,10 @@ index e07b79ef172095c1800c88342b3ac8dc7703aea2..9a6471d2f1eb1c8af006b70b6bba0b66 } } diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java -index eea02ea0d99425a60575f5fa729782494d579080..6cbe80e13a590817d3ecf27d89202f10e2cd83dc 100644 +index b04532aa04aec6ebbff74d64abb73189c2e12016..4d05c34dcebc7582fd400066809b4997b2e8a86a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java +++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java -@@ -65,6 +65,43 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder optional = this.getEffectsFromItemStack(itemstack); - - if (optional.isEmpty()) { -- return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur - } - - itemstack.consume(1, player); -@@ -195,6 +232,13 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder { world.sendParticles(ParticleTypes.EXPLOSION, this.getX(), this.getY(0.5D), this.getZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D); @@ -6909,10 +6904,10 @@ index be753557d7ebd6f1e82b1bdb6d60ecc450f72eec..83372c86bd54eedd9b136ddfcbfc67d3 } } diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -index 8883894da73c7d5975a8826d23ee7f542db98b0b..28a9d267099f6c24f71dc5a11179d59c27265a88 100644 +index a2f0b79599799ad2aa85aff821d8ac76a8e650bd..f14fe1c299e6ef5cf55bde617ff9fe6aca08702f 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -@@ -126,12 +126,89 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder type, Level world) { super(type, world); @@ -7003,7 +6998,7 @@ index 8883894da73c7d5975a8826d23ee7f542db98b0b..28a9d267099f6c24f71dc5a11179d59c @Nullable @Override public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData entityData) { -@@ -150,8 +227,11 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder type, LevelAccessor world, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random) { -@@ -294,13 +375,13 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder { @@ -7408,7 +7403,7 @@ index 8cc6022507c97af62fb2b4455198bc35744137c9..b3a0146ccfcda9fa33b91d33458086b5 + // Purpur end float f = 0.3F; - if (this.horizontalCollision || this.moveControl.hasWanted() && this.moveControl.getWantedY() > this.getY() + 0.5D) { + if (this.moveControl.getSpeedModifier() <= 0.6D) { @@ -188,6 +264,12 @@ public class Rabbit extends Animal implements VariantHolder { @Override @@ -7463,7 +7458,7 @@ index 8cc6022507c97af62fb2b4455198bc35744137c9..b3a0146ccfcda9fa33b91d33458086b5 + public void vanillaTick() { // Purpur if (this.rabbit.onGround() && !this.rabbit.jumping && !((Rabbit.RabbitJumpControl) this.rabbit.jumpControl).wantJump()) { this.rabbit.setSpeedModifier(0.0D); - } else if (this.hasWanted()) { + } else if (this.hasWanted() || this.operation == MoveControl.Operation.JUMPING) { this.rabbit.setSpeedModifier(this.nextJumpSpeed); } @@ -7482,10 +7477,10 @@ index 8cc6022507c97af62fb2b4455198bc35744137c9..b3a0146ccfcda9fa33b91d33458086b5 } diff --git a/src/main/java/net/minecraft/world/entity/animal/Salmon.java b/src/main/java/net/minecraft/world/entity/animal/Salmon.java -index 661997c39df777b6e332f0a5710e7f63a116a499..1a0c71ed6f3bd3d961f9b30ab29a62d683195355 100644 +index 500259e6f297276fb3d6943c2bf88c844d4ec7e4..3716201b0889dfb0bacd0e223a29e80ee1f84e8e 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Salmon.java +++ b/src/main/java/net/minecraft/world/entity/animal/Salmon.java -@@ -32,6 +32,33 @@ public class Salmon extends AbstractSchoolingFish implements VariantHolder brainProvider() { return Brain.provider(Allay.MEMORY_TYPES, Allay.SENSOR_TYPES); -@@ -219,11 +260,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS +@@ -223,11 +264,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS return 0.4F; } @@ -8444,7 +8440,7 @@ index f3c884ab9c09f04dd01cabf2ee9de3b5b620563d..dbce71f45c008da883b6d244a06343d8 protected SoundEvent getAmbientSound() { return SoundEvents.CAMEL_AMBIENT; diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index 36846ba6b6c7494c745ebd8b221479a9d02ff318..02581f47d1ca58c2b8abffc478adf48343585c8b 100644 +index ca04e5d829331551a2c2f44e223ff05c6ce04e76..267f49bf00f5bbd5541e25c938f727a5bafd8eb2 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java @@ -106,6 +106,8 @@ public class Frog extends Animal implements VariantHolder> { @@ -9094,7 +9090,7 @@ index 7d0197447990bb79b85a4f1529c3ac3eefb03c84..9307c07b8f75caacbde6839893f54700 @Override protected SoundEvent getAmbientSound() { diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java b/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java -index 7b43fcf86984cc200f34c189e7a547996416f379..1d765ad53a9d8dd388106bc0cb02f4919a1f8173 100644 +index 53a8d59681809da931d11ff76c202f950993a142..cb881211f948b21ea03364373376e894cd6ed5cc 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java @@ -33,6 +33,58 @@ public class TraderLlama extends Llama { @@ -9389,7 +9385,7 @@ index 7cb3d69a69e0e3ef4b7f9f9c8b1eb67edb5d116d..b1db1e92de3a88a0f0e0fdb42b0bf973 this.remove(Entity.RemovalReason.KILLED, EntityRemoveEvent.Cause.DEATH); // CraftBukkit - add Bukkit remove cause } diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 2df8bf818345246cc1f88b93e4a3b62e61772efb..c9e3bb91ff506a35551a58f469ad2849e6058668 100644 +index d5fc74dbc2c5f6b65fee46e7797b151144c8fd41..eff4424fa9cbea4358c8d8cd4d20c53182f5179e 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java @@ -108,6 +108,7 @@ public class EnderDragon extends Mob implements Enemy { @@ -9570,7 +9566,7 @@ index 2df8bf818345246cc1f88b93e4a3b62e61772efb..c9e3bb91ff506a35551a58f469ad2849 short0 = 12000; } -@@ -1069,6 +1155,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1083,6 +1169,7 @@ public class EnderDragon extends Mob implements Enemy { @Override protected boolean canRide(Entity entity) { @@ -9578,7 +9574,7 @@ index 2df8bf818345246cc1f88b93e4a3b62e61772efb..c9e3bb91ff506a35551a58f469ad2849 return false; } -@@ -1095,6 +1182,6 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1109,6 +1196,6 @@ public class EnderDragon extends Mob implements Enemy { @Override protected float sanitizeScale(float scale) { @@ -9587,7 +9583,7 @@ index 2df8bf818345246cc1f88b93e4a3b62e61772efb..c9e3bb91ff506a35551a58f469ad2849 } } diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c060797883613812ad73c31 100644 +index bd9e10f79eaf0d23908229b3ebc2227946a14843..a671d18a354421f197e5248a16bfe9a12c5befe4 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java @@ -86,20 +86,60 @@ public class WitherBoss extends Monster implements RangedAttackMob { @@ -9652,7 +9648,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 @Override protected PathNavigation createNavigation(Level world) { FlyingPathNavigation navigationflying = new FlyingPathNavigation(this, world); -@@ -110,13 +150,114 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -109,13 +149,114 @@ public class WitherBoss extends Monster implements RangedAttackMob { return navigationflying; } @@ -9767,7 +9763,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0])); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 0, false, false, WitherBoss.LIVING_ENTITY_SELECTOR)); } -@@ -134,6 +275,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -133,6 +274,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); nbt.putInt("Invul", this.getInvulnerableTicks()); @@ -9775,7 +9771,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 } @Override -@@ -143,6 +285,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -142,6 +284,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { if (this.hasCustomName()) { this.bossEvent.setName(this.getDisplayName()); } @@ -9783,7 +9779,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 } -@@ -152,6 +295,13 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -151,6 +294,13 @@ public class WitherBoss extends Monster implements RangedAttackMob { this.bossEvent.setName(this.getDisplayName()); } @@ -9797,7 +9793,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 @Override protected SoundEvent getAmbientSound() { return SoundEvents.WITHER_AMBIENT; -@@ -261,6 +411,15 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -260,6 +410,15 @@ public class WitherBoss extends Monster implements RangedAttackMob { @Override protected void customServerAiStep(ServerLevel world) { @@ -9813,7 +9809,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 int i; if (this.getInvulnerableTicks() > 0) { -@@ -277,7 +436,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -276,7 +435,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { } // CraftBukkit end @@ -9822,7 +9818,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 // CraftBukkit start - Use relative location for far away sounds // worldserver.globalLevelEvent(1023, new BlockPosition(this), 0); int viewDistance = world.getCraftServer().getViewDistance() * 16; -@@ -302,7 +461,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -301,7 +460,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { this.setInvulnerableTicks(i); if (this.tickCount % 10 == 0) { @@ -9831,7 +9827,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 } } else { -@@ -362,7 +521,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -361,7 +520,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { if (this.destroyBlocksTick > 0) { --this.destroyBlocksTick; @@ -9840,7 +9836,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 boolean flag = false; j = Mth.floor(this.getBbWidth() / 2.0F + 1.0F); -@@ -389,8 +548,10 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -388,8 +547,10 @@ public class WitherBoss extends Monster implements RangedAttackMob { } } @@ -9853,7 +9849,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 } this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth()); -@@ -579,11 +740,11 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -578,11 +739,11 @@ public class WitherBoss extends Monster implements RangedAttackMob { } public int getAlternativeTarget(int headIndex) { @@ -9867,7 +9863,7 @@ index 244e38db508efa3eebebb6392c4ebb0805367baf..5e134b3cf939fe396c06079788361381 } public boolean isPowered() { -@@ -592,6 +753,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -591,6 +752,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { @Override protected boolean canRide(Entity entity) { @@ -9936,7 +9932,7 @@ index 70b8023c3badc745f342d5b0ab54699e3923826a..037586c0fdb42a02660aba89dd741a64 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -index bbdaaa1cc0b4aed28bc39385508d221055b99d4d..bd5e034ce58ebe53d2121209d76ae60134ce72fe 100644 +index 7d83ad8a61f6aafbc063506c1858554f9b700b70..fd1bd4fb88d1bd4a0734db463dc1be640c736d34 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java @@ -240,7 +240,13 @@ public class ItemFrame extends HangingEntity { @@ -10022,7 +10018,7 @@ index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..c63cf322e0d00b5ec9929db8c22d4a39 @Override 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 de87483600e55d88176fe25db621bbd3e464729f..287ba483614e79e78022e703ef891f59f41ac455 100644 +index 809f5e847e2f5bb594c130cebd2cb897ea768d82..6f1e21d6c104d71fe4fc3376ed2f2273a5f3d3cc 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java @@ -249,4 +249,31 @@ public class PrimedTnt extends Entity implements TraceableEntity { @@ -10058,10 +10054,10 @@ index de87483600e55d88176fe25db621bbd3e464729f..287ba483614e79e78022e703ef891f59 + // Purpur end - Shears can defuse TNT } diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -index 32670a3cb4b54b66d655197e3fde834d2b2b6d34..39d02cf0e31832e30c4f034b0b5385e3e0057e60 100644 +index 90b6ed81dcfd4021c7e9509da5e8725034fa07e5..0235488faee8078186fbb78038789da0846aca29 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -@@ -68,16 +68,19 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -70,16 +70,19 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo protected AbstractSkeleton(EntityType type, Level world) { super(type, world); this.reassessWeaponGoal(); @@ -10081,7 +10077,7 @@ index 32670a3cb4b54b66d655197e3fde834d2b2b6d34..39d02cf0e31832e30c4f034b0b5385e3 this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0])); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true)); -@@ -96,37 +99,14 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -98,37 +101,14 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo abstract SoundEvent getStepSound(); // Paper start - shouldBurnInDay API @@ -10121,7 +10117,7 @@ index 32670a3cb4b54b66d655197e3fde834d2b2b6d34..39d02cf0e31832e30c4f034b0b5385e3 super.aiStep(); } -@@ -158,11 +138,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -160,11 +140,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo this.reassessWeaponGoal(); this.setCanPickUpLoot(this.level().paperConfig().entities.behavior.mobsCanAlwaysPickUpLoot.skeletons || randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper - Add world settings for mobs picking up loot if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) { @@ -10134,7 +10130,7 @@ index 32670a3cb4b54b66d655197e3fde834d2b2b6d34..39d02cf0e31832e30c4f034b0b5385e3 this.setItemSlot(EquipmentSlot.HEAD, new ItemStack(randomsource.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN)); this.armorDropChances[EquipmentSlot.HEAD.getIndex()] = 0.0F; } -@@ -221,7 +197,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -223,7 +199,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo } if (event.getProjectile() == entityarrow.getBukkitEntity()) { @@ -10143,7 +10139,7 @@ index 32670a3cb4b54b66d655197e3fde834d2b2b6d34..39d02cf0e31832e30c4f034b0b5385e3 } // CraftBukkit end } -@@ -243,7 +219,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -250,7 +226,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo super.readAdditionalSaveData(nbt); this.reassessWeaponGoal(); // Paper start - shouldBurnInDay API @@ -10152,7 +10148,7 @@ index 32670a3cb4b54b66d655197e3fde834d2b2b6d34..39d02cf0e31832e30c4f034b0b5385e3 this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); } // Paper end - shouldBurnInDay API -@@ -253,7 +229,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -260,7 +236,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @Override public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); @@ -10523,10 +10519,10 @@ index 1906dfc22af208d6e801ad4a8f2f9e9702432691..38cbe2fce9c36195aa9bea2af26d1436 } // Paper end - CreeperIgniteEvent diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java -index 2e73917ce9270de7483bb1d4e9bf312a31ec9b1e..949207eda199c874f2f14074b5a4fff5462b86b9 100644 +index c6c86913c0a48501a9109a3838a3e56685d16d79..a28a4cd9544ffa58bd03ac901a761c797044629a 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java +++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java -@@ -72,6 +72,59 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -75,6 +75,59 @@ public class Drowned extends Zombie implements RangedAttackMob { return Zombie.createAttributes().add(Attributes.STEP_HEIGHT, 1.0); } @@ -10586,7 +10582,7 @@ index 2e73917ce9270de7483bb1d4e9bf312a31ec9b1e..949207eda199c874f2f14074b5a4fff5 @Override protected void addBehaviourGoals() { this.goalSelector.addGoal(1, new Drowned.DrownedGoToWaterGoal(this, 1.0)); -@@ -79,10 +132,23 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -82,10 +135,23 @@ public class Drowned extends Zombie implements RangedAttackMob { this.goalSelector.addGoal(2, new Drowned.DrownedAttackGoal(this, 1.0, false)); this.goalSelector.addGoal(5, new Drowned.DrownedGoToBeachGoal(this, 1.0)); this.goalSelector.addGoal(6, new Drowned.DrownedSwimUpGoal(this, 1.0, this.level().getSeaLevel())); @@ -10611,7 +10607,7 @@ index 2e73917ce9270de7483bb1d4e9bf312a31ec9b1e..949207eda199c874f2f14074b5a4fff5 this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Axolotl.class, true, false)); this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR)); -@@ -396,7 +462,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -398,7 +464,7 @@ public class Drowned extends Zombie implements RangedAttackMob { } } @@ -10620,7 +10616,7 @@ index 2e73917ce9270de7483bb1d4e9bf312a31ec9b1e..949207eda199c874f2f14074b5a4fff5 private final Drowned drowned; public DrownedMoveControl(Drowned drowned) { -@@ -405,7 +471,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -407,7 +473,7 @@ public class Drowned extends Zombie implements RangedAttackMob { } @Override @@ -10629,7 +10625,7 @@ index 2e73917ce9270de7483bb1d4e9bf312a31ec9b1e..949207eda199c874f2f14074b5a4fff5 LivingEntity livingEntity = this.drowned.getTarget(); if (this.drowned.wantsToSwim() && this.drowned.isInWater()) { if (livingEntity != null && livingEntity.getY() > this.drowned.getY() || this.drowned.searchingForLand) { -@@ -425,7 +491,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -427,7 +493,7 @@ public class Drowned extends Zombie implements RangedAttackMob { float h = (float)(Mth.atan2(f, d) * 180.0F / (float)Math.PI) - 90.0F; this.drowned.setYRot(this.rotlerp(this.drowned.getYRot(), h, 90.0F)); this.drowned.yBodyRot = this.drowned.getYRot(); @@ -10638,7 +10634,7 @@ index 2e73917ce9270de7483bb1d4e9bf312a31ec9b1e..949207eda199c874f2f14074b5a4fff5 float j = Mth.lerp(0.125F, this.drowned.getSpeed(), i); this.drowned.setSpeed(j); this.drowned.setDeltaMovement(this.drowned.getDeltaMovement().add((double)j * d * 0.005, (double)j * e * 0.1, (double)j * f * 0.005)); -@@ -434,7 +500,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -436,7 +502,7 @@ public class Drowned extends Zombie implements RangedAttackMob { this.drowned.setDeltaMovement(this.drowned.getDeltaMovement().add(0.0, -0.008, 0.0)); } @@ -10687,10 +10683,10 @@ index 378694a38115c012978e1fea59d049d1ebd04110..a000304e3ac4c34b020f7457aa2589c8 return Guardian.createAttributes().add(Attributes.MOVEMENT_SPEED, 0.30000001192092896D).add(Attributes.ATTACK_DAMAGE, 8.0D).add(Attributes.MAX_HEALTH, 80.0D); } diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..476aaa0d9899eb56ea29b1fcf15565b58f78479d 100644 +index 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822be5c2a517 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -@@ -92,12 +92,41 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -91,12 +91,41 @@ public class EnderMan extends Monster implements NeutralMob { public EnderMan(EntityType type, Level world) { super(type, world); @@ -10733,7 +10729,7 @@ index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..476aaa0d9899eb56ea29b1fcf15565b5 this.goalSelector.addGoal(1, new EnderMan.EndermanFreezeWhenLookedAt(this)); this.goalSelector.addGoal(2, new MeleeAttackGoal(this, 1.0D, false)); this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D, 0.0F)); -@@ -105,9 +134,10 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -104,9 +133,10 @@ public class EnderMan extends Monster implements NeutralMob { this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); this.goalSelector.addGoal(10, new EnderMan.EndermanLeaveBlockGoal(this)); this.goalSelector.addGoal(11, new EnderMan.EndermanTakeBlockGoal(this)); @@ -10745,16 +10741,16 @@ index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..476aaa0d9899eb56ea29b1fcf15565b5 this.targetSelector.addGoal(4, new ResetUniversalAngerTargetGoal<>(this, false)); } -@@ -235,7 +265,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -234,7 +264,7 @@ public class EnderMan extends Monster implements NeutralMob { boolean isBeingStaredBy(Player player) { - // Paper start - EndermanAttackPlayerEvent -- boolean shouldAttack = isBeingStaredBy0(player); -+ boolean shouldAttack = !this.level().purpurConfig.endermanDisableStareAggro && isBeingStaredBy0(player); // Purpur - com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent event = new com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent((org.bukkit.entity.Enderman) getBukkitEntity(), (org.bukkit.entity.Player) player.getBukkitEntity()); + // Paper start - EndermanAttackPlayerEvent +- final boolean shouldAttack = isBeingStaredBy0(player); ++ final boolean shouldAttack = !this.level().purpurConfig.endermanDisableStareAggro && isBeingStaredBy0(player); // Purpur + final com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent event = new com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent((org.bukkit.entity.Enderman) getBukkitEntity(), (org.bukkit.entity.Player) player.getBukkitEntity()); event.setCancelled(!shouldAttack); return event.callEvent(); -@@ -263,12 +293,12 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -262,12 +292,12 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean isSensitiveToWater() { @@ -10769,7 +10765,7 @@ index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..476aaa0d9899eb56ea29b1fcf15565b5 float f = this.getLightLevelDependentMagicValue(); if (f > 0.5F && world.canSeeSky(this.blockPosition()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper - EndermanEscapeEvent -@@ -307,11 +337,17 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -306,11 +336,17 @@ public class EnderMan extends Monster implements NeutralMob { private boolean teleport(double x, double y, double z) { BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(x, y, z); @@ -10789,7 +10785,7 @@ index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..476aaa0d9899eb56ea29b1fcf15565b5 boolean flag = iblockdata.blocksMotion(); boolean flag1 = iblockdata.getFluidState().is(FluidTags.WATER); -@@ -383,6 +419,8 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -382,6 +418,8 @@ public class EnderMan extends Monster implements NeutralMob { public boolean hurtServer(ServerLevel world, DamageSource source, float amount) { if (this.isInvulnerableTo(world, source)) { return false; @@ -10798,7 +10794,7 @@ index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..476aaa0d9899eb56ea29b1fcf15565b5 } else { boolean flag = source.getDirectEntity() instanceof ThrownPotion; boolean flag1; -@@ -397,6 +435,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -396,6 +434,7 @@ public class EnderMan extends Monster implements NeutralMob { } else { flag1 = flag && this.hurtWithCleanWater(world, source, (ThrownPotion) source.getDirectEntity(), amount); @@ -10806,7 +10802,7 @@ index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..476aaa0d9899eb56ea29b1fcf15565b5 if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - EndermanEscapeEvent for (int i = 0; i < 64; ++i) { if (this.teleport()) { -@@ -441,7 +480,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -440,7 +479,7 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean requiresCustomPersistence() { @@ -10815,7 +10811,7 @@ index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..476aaa0d9899eb56ea29b1fcf15565b5 } private static class EndermanFreezeWhenLookedAt extends Goal { -@@ -488,7 +527,16 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -487,7 +526,16 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean canUse() { @@ -10833,7 +10829,7 @@ index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..476aaa0d9899eb56ea29b1fcf15565b5 } @Override -@@ -533,7 +581,16 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -532,7 +580,16 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean canUse() { @@ -10936,7 +10932,7 @@ index 534e98dd7291e09dee1d0f77cbf221b15708590f..f8373fc9839fccb31e3dd090de70e2cd @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/Evoker.java b/src/main/java/net/minecraft/world/entity/monster/Evoker.java -index 6592baa53ecb4e364d1c1b6f64178fc86c59a982..e231bb33b7e6a00d7c1a6c3540b4b48cfd4c15e3 100644 +index 14f23c9a248760a57b3d6fe4f2824a4a456a6d37..9454a2eccc1f405f2013a18d56e65a1e6a4bb8f7 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Evoker.java +++ b/src/main/java/net/minecraft/world/entity/monster/Evoker.java @@ -53,10 +53,44 @@ public class Evoker extends SpellcasterIllager { @@ -10983,7 +10979,7 @@ index 6592baa53ecb4e364d1c1b6f64178fc86c59a982..e231bb33b7e6a00d7c1a6c3540b4b48c + this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur this.goalSelector.addGoal(1, new Evoker.EvokerCastingSpellGoal()); this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, Player.class, 8.0F, 0.6D, 1.0D)); - this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0D, 1.2D)); + this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 0.6D, 1.0D)); @@ -66,6 +100,7 @@ public class Evoker extends SpellcasterIllager { this.goalSelector.addGoal(8, new RandomStrollGoal(this, 0.6D)); this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 3.0F, 1.0F)); @@ -11538,7 +11534,7 @@ index e2de074bbe7bab0e5a7aecc1fae4c5914a203dd4..c2061f575c731ecc6071384b007517c0 return false; } else { diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java -index 150fd890ac65097b5434fd88e8d2b24a89dca79a..cda6cb5b10b895bab48d2212f259ba4ca40e1ed6 100644 +index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117da23c2290 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java @@ -49,6 +49,8 @@ public class Phantom extends FlyingMob implements Enemy { @@ -11553,7 +11549,7 @@ index 150fd890ac65097b5434fd88e8d2b24a89dca79a..cda6cb5b10b895bab48d2212f259ba4c @@ -58,6 +60,92 @@ public class Phantom extends FlyingMob implements Enemy { this.xpReward = 5; this.moveControl = new Phantom.PhantomMoveControl(this); - this.lookControl = new Phantom.PhantomLookControl(this, this); + this.lookControl = new Phantom.PhantomLookControl(this); + this.setShouldBurnInDay(true); // Purpur - API for any mob to burn daylight + } + @@ -11914,11 +11910,11 @@ index 150fd890ac65097b5434fd88e8d2b24a89dca79a..cda6cb5b10b895bab48d2212f259ba4c } } -- private class PhantomLookControl extends LookControl { -+ private class PhantomLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur +- private static class PhantomLookControl extends LookControl { ++ private static class PhantomLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - public PhantomLookControl(final Phantom entity, final Mob phantom) { - super(phantom); + public PhantomLookControl(Mob entity) { + super(entity); } + // Purpur start @@ -11955,10 +11951,10 @@ index 150fd890ac65097b5434fd88e8d2b24a89dca79a..cda6cb5b10b895bab48d2212f259ba4c list.sort(Comparator.comparing((Entity e) -> { return e.getY(); }).reversed()); // CraftBukkit - decompile error Iterator iterator = list.iterator(); 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 3e8631c7bd1e7591051ca21c6ae7acd87d3c7529..85d5c84a8861905e4546901aa6707078571eb402 100644 +index 91edf8767541982b8cd1be83c33a7b287ffb62fe..588da64f4137a9f13f41875b3f5c47b485398782 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Pillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Pillager.java -@@ -64,16 +64,51 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve +@@ -67,16 +67,51 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve super(type, world); } @@ -12001,7 +11997,7 @@ index 3e8631c7bd1e7591051ca21c6ae7acd87d3c7529..85d5c84a8861905e4546901aa6707078 this.goalSelector.addGoal(0, new FloatGoal(this)); + this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur this.goalSelector.addGoal(1, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0D, 1.2D)); - this.goalSelector.addGoal(2, new Raider.HoldGroundAttackGoal(this, 10.0F)); // Paper - decomp fix + this.goalSelector.addGoal(2, new Raider.HoldGroundAttackGoal(this, 10.0F)); this.goalSelector.addGoal(3, new RangedCrossbowAttackGoal<>(this, 1.0D, 8.0F)); this.goalSelector.addGoal(8, new RandomStrollGoal(this, 0.6D)); this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 15.0F, 1.0F)); @@ -12011,10 +12007,10 @@ index 3e8631c7bd1e7591051ca21c6ae7acd87d3c7529..85d5c84a8861905e4546901aa6707078 this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false)); diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -index c96fbfe448b3e7b722a8db0e1688276776abd94e..98c1934b4895a86cd8748edf906aaa721a87a123 100644 +index cfc28828a5b81563a826ae6045553e7350f67986..17aaa3f376ce6183911739536206f9f701e452b5 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -@@ -77,15 +77,57 @@ public class Ravager extends Raider { +@@ -75,14 +75,56 @@ public class Ravager extends Raider { this.setPathfindingMalus(PathType.LEAVES, 0.0F); } @@ -12062,7 +12058,6 @@ index c96fbfe448b3e7b722a8db0e1688276776abd94e..98c1934b4895a86cd8748edf906aaa72 super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); + this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0D, 1.2D)); + if (level().purpurConfig.ravagerAvoidRabbits) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.AvoidEntityGoal<>(this, net.minecraft.world.entity.animal.Rabbit.class, 6.0F, 1.0D, 1.2D)); // Purpur this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0D, true)); this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.4D)); @@ -12072,7 +12067,7 @@ index c96fbfe448b3e7b722a8db0e1688276776abd94e..98c1934b4895a86cd8748edf906aaa72 this.targetSelector.addGoal(2, (new HurtByTargetGoal(this, new Class[]{Raider.class})).setAlertOthers()); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, true)); this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, true, (entityliving, worldserver) -> { -@@ -138,7 +180,7 @@ public class Ravager extends Raider { +@@ -135,7 +177,7 @@ public class Ravager extends Raider { @Override public void aiStep() { super.aiStep(); @@ -12081,7 +12076,7 @@ index c96fbfe448b3e7b722a8db0e1688276776abd94e..98c1934b4895a86cd8748edf906aaa72 if (this.isImmobile()) { this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.0D); } else { -@@ -153,7 +195,7 @@ public class Ravager extends Raider { +@@ -150,7 +192,7 @@ public class Ravager extends Raider { if (world instanceof ServerLevel) { ServerLevel worldserver = (ServerLevel) world; @@ -12090,7 +12085,7 @@ index c96fbfe448b3e7b722a8db0e1688276776abd94e..98c1934b4895a86cd8748edf906aaa72 boolean flag = false; AABB axisalignedbb = this.getBoundingBox().inflate(0.2D); Iterator iterator = BlockPos.betweenClosed(Mth.floor(axisalignedbb.minX), Mth.floor(axisalignedbb.minY), Mth.floor(axisalignedbb.minZ), Mth.floor(axisalignedbb.maxX), Mth.floor(axisalignedbb.maxY), Mth.floor(axisalignedbb.maxZ)).iterator(); -@@ -163,7 +205,7 @@ public class Ravager extends Raider { +@@ -160,7 +202,7 @@ public class Ravager extends Raider { BlockState iblockdata = worldserver.getBlockState(blockposition); Block block = iblockdata.getBlock(); @@ -12100,7 +12095,7 @@ index c96fbfe448b3e7b722a8db0e1688276776abd94e..98c1934b4895a86cd8748edf906aaa72 if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state continue; diff --git a/src/main/java/net/minecraft/world/entity/monster/Shulker.java b/src/main/java/net/minecraft/world/entity/monster/Shulker.java -index 6e0f2f6573ed6be9b91de960d55c269417ad8907..e3fefd52c83079fe3eab1a96dd81a183f718192b 100644 +index 64d99b8b576212f754bd316343562b1ba7f604fa..b940cb26de3852e2127ccdd1f6c067123a909c25 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Shulker.java +++ b/src/main/java/net/minecraft/world/entity/monster/Shulker.java @@ -84,7 +84,7 @@ public class Shulker extends AbstractGolem implements VariantHolder type, ServerLevelAccessor world, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random ) { diff --git a/src/main/java/net/minecraft/world/entity/monster/Strider.java b/src/main/java/net/minecraft/world/entity/monster/Strider.java -index 711b7eb8e9fdedbc87965828e573fe8d5c357d53..c3b5b34a54de945071692293645b8a8865aed961 100644 +index 0a9246241985d2d97beb865b7163f1d2198f03b8..779ae2e63202c1f189b1f5647218a07c21a84ccd 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Strider.java +++ b/src/main/java/net/minecraft/world/entity/monster/Strider.java @@ -91,12 +91,45 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { @@ -13058,10 +13054,10 @@ index a03fa8a3e648532a7ffaaf523ca87c13e8af4c0a..313228811d1eff478887511f99b49706 this.targetSelector.addGoal(2, this.healRaidersGoal); this.targetSelector.addGoal(3, this.attackPlayersGoal); diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java -index 37d3acda84a984bf4f1c44b3d27e2102839d3e8e..23fc36780a3e15260f8cb1001c8d676464a9df3a 100644 +index 557b4e225688416132281e9b1759d46a9b775ff9..80968050fa7680a8d9b379ef7a8db5e91a4b3a8f 100644 --- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java -@@ -33,6 +33,39 @@ public class WitherSkeleton extends AbstractSkeleton { +@@ -36,6 +36,39 @@ public class WitherSkeleton extends AbstractSkeleton { this.setPathfindingMalus(PathType.LAVA, 8.0F); } @@ -13368,7 +13364,7 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java -index 18c19e4b675000aacb74344909fc104964231008..6f6b32bf7f68d05e4173c31f2e631a409b858a05 100644 +index 30bce56a70f923b0ec77c8e3f29e435a71c71510..cd66ef1d99f3ce4533c2423fd12b2fcadf481a66 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java @@ -85,6 +85,58 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @@ -13530,11 +13526,11 @@ index 03e3cbe73119ca76417d4dd192e1560bdfc373ec..8c3271dcc8c9aa58e2e007eba282c11e @Nullable diff --git a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java -index 7b5f9284972b3a6bd8125891b23f73438e875c08..ea1655d2cbc631d80dd66f7e3e24998530df66a2 100644 +index 6a7e725edece3043c8523d387e2929d5ba8932cb..57f07799e74ecd48b8e4af68569b46be42c721ea 100644 --- a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java +++ b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java -@@ -63,6 +63,29 @@ public class Creaking extends Monster { - this.xpReward = 0; +@@ -106,6 +106,29 @@ public class Creaking extends Monster { + return this.getHomePos() != null; } + // Purpur start @@ -13563,7 +13559,7 @@ index 7b5f9284972b3a6bd8125891b23f73438e875c08..ea1655d2cbc631d80dd66f7e3e249985 @Override protected BodyRotationControl createBodyControl() { return new Creaking.CreakingBodyRotationControl(this); -@@ -185,6 +208,14 @@ public class Creaking extends Monster { +@@ -474,6 +497,14 @@ public class Creaking extends Monster { return this.isActive() ? null : SoundEvents.CREAKING_AMBIENT; } @@ -13578,12 +13574,13 @@ index 7b5f9284972b3a6bd8125891b23f73438e875c08..ea1655d2cbc631d80dd66f7e3e249985 @Override protected SoundEvent getHurtSound(DamageSource source) { return SoundEvents.CREAKING_SWAY; -@@ -296,28 +327,28 @@ public class Creaking extends Monster { - } +@@ -575,31 +606,31 @@ public class Creaking extends Monster { + return 0.0F; } -- class CreakingLookControl extends LookControl { -+ class CreakingLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur +- private class CreakingLookControl extends LookControl { ++ private class CreakingLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur + public CreakingLookControl(final Creaking creaking) { super(creaking); } @@ -13595,11 +13592,13 @@ index 7b5f9284972b3a6bd8125891b23f73438e875c08..ea1655d2cbc631d80dd66f7e3e249985 - super.tick(); + super.vanillaTick(); // Purpur } + } } -- class CreakingMoveControl extends MoveControl { -+ class CreakingMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur +- private class CreakingMoveControl extends MoveControl { ++ private class CreakingMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur + public CreakingMoveControl(final Creaking creaking) { super(creaking); } @@ -13611,8 +13610,8 @@ index 7b5f9284972b3a6bd8125891b23f73438e875c08..ea1655d2cbc631d80dd66f7e3e249985 - super.tick(); + super.vanillaTick(); // Purpur } + } - } diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java index 92270912ef26924f611a1df7cb3d5b485b0a262d..6144613e834236ec0ebb12872ef9e47255b76b5b 100644 --- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java @@ -13682,10 +13681,10 @@ index 92270912ef26924f611a1df7cb3d5b485b0a262d..6144613e834236ec0ebb12872ef9e472 gameprofilerfiller.pop(); HoglinAi.updateActivity(this); diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -index e04d2c5e75dc774fe893a552474fdb8045c32693..20608fb46a0af85739e3c0caa843c1a9d45c9659 100644 +index 2121d2a2e1aa1d0f0390cc515317096431f6dcb0..a2d29cf854be6f0bc5b5bb99e7002e07ccc4cae9 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -@@ -96,6 +96,39 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -99,6 +99,39 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento this.xpReward = 5; } @@ -13725,7 +13724,7 @@ index e04d2c5e75dc774fe893a552474fdb8045c32693..20608fb46a0af85739e3c0caa843c1a9 @Override public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); -@@ -304,11 +337,13 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -307,11 +340,13 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento return !this.cannotHunt; } @@ -13739,7 +13738,7 @@ index e04d2c5e75dc774fe893a552474fdb8045c32693..20608fb46a0af85739e3c0caa843c1a9 this.getBrain().tick(world, this); gameprofilerfiller.pop(); PiglinAi.updateActivity(this); -@@ -405,7 +440,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -413,7 +448,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @Override public boolean wantsToPickUp(ServerLevel world, ItemStack stack) { @@ -13825,7 +13824,7 @@ index 24eaeb93284fe1a573026b85818a93a34fd9e1ec..bc3b0eb21200eae7e419b2571871b36f profilerFiller.pop(); PiglinBruteAi.updateActivity(this); diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java -index 6180019da58b19d2595da508aed3196af922d587..5a62fe9c4f0cee9e8b4a48564f76afec609335b1 100644 +index c47ed605f0822effd58df4f875297ed015e1e57e..cf231928bae5493b0684109c769d7da4dc36f872 100644 --- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java @@ -127,8 +127,32 @@ public class Warden extends Monster implements VibrationSystem { @@ -13897,7 +13896,7 @@ index 6180019da58b19d2595da508aed3196af922d587..5a62fe9c4f0cee9e8b4a48564f76afec public static void applyDarknessAround(ServerLevel world, Vec3 pos, @Nullable Entity entity, int range) { diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -index 5f656fc726a1dc5f42657095a2f2b7cf85b92d7c..6c74cf1dea99b3b967b8c3d76f405f823c881fb9 100644 +index 3c037cabd8331eb96a6523b37abab4e73ab79a02..e2b00681e427bc99c3b3660d8f4830379b98c7a0 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java @@ -48,6 +48,7 @@ import org.bukkit.event.entity.VillagerAcquireTradeEvent; @@ -13950,7 +13949,7 @@ index b0236c7bf9441aa84d3795ffed05dd6099f29636..796dcc0dcf9022b455b8847e045266b8 } diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index b7a34f1c4d7b5ef3f7a843d152e33c839dcdedd5..0ee456972923e90905732ffc5d77bb027cf6c0fc 100644 +index 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..15ddc44bb266b4cdb1036c92dd60f1379832b501 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -141,6 +141,10 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -14309,10 +14308,10 @@ index a728dcbf956f108f01c966c7531449a506a14a87..4c1378132201c1e5d1bc01f8c0cbba91 if (spawnplacementtype.isSpawnPositionOk(world, blockposition2, EntityType.WANDERING_TRADER)) { blockposition1 = blockposition2; diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java -index 0990bcf65f484b9a019c91fcdae1783bac6388da..99feda30fb85a7615560b6e9a3701d5dfeb3e524 100644 +index 110456deaa662bc1c0f6ba7878bb3074869a4350..58c8e8f06f5cf028b158350327bf42984fcb4d38 100644 --- a/src/main/java/net/minecraft/world/entity/player/Inventory.java +++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java -@@ -649,6 +649,8 @@ public class Inventory implements Container, Nameable { +@@ -636,6 +636,8 @@ public class Inventory implements Container, Nameable { } public boolean contains(ItemStack stack) { @@ -14321,7 +14320,7 @@ index 0990bcf65f484b9a019c91fcdae1783bac6388da..99feda30fb85a7615560b6e9a3701d5d Iterator iterator = this.compartments.iterator(); while (iterator.hasNext()) { -@@ -663,6 +665,18 @@ public class Inventory implements Container, Nameable { +@@ -650,6 +652,18 @@ public class Inventory implements Container, Nameable { } } } @@ -14341,10 +14340,10 @@ index 0990bcf65f484b9a019c91fcdae1783bac6388da..99feda30fb85a7615560b6e9a3701d5d return false; } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..c1d068fa99ec0fd5685bbb627a775e4d1587feab 100644 +index 5b8b85a295a08ae495f729c595b3a78778965342..d19b1e127a1018a798eed181d8060a781b589f90 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -197,17 +197,40 @@ public abstract class Player extends LivingEntity { +@@ -200,17 +200,40 @@ public abstract class Player extends LivingEntity { private int currentImpulseContextResetGraceTime; public boolean affectsSpawning = true; // Paper - Affects Spawning API public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage @@ -14385,7 +14384,7 @@ index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..c1d068fa99ec0fd5685bbb627a775e4d public Player(Level world, BlockPos pos, float yaw, GameProfile gameProfile) { super(EntityType.PLAYER, world); this.lastItemInMainHand = ItemStack.EMPTY; -@@ -252,6 +275,12 @@ public abstract class Player extends LivingEntity { +@@ -255,6 +278,12 @@ public abstract class Player extends LivingEntity { @Override public void tick() { @@ -14396,9 +14395,9 @@ index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..c1d068fa99ec0fd5685bbb627a775e4d + // Purpur end + this.noPhysics = this.isSpectator(); - if (this.isSpectator()) { + if (this.isSpectator() || this.isPassenger()) { this.setOnGround(false); -@@ -332,6 +361,17 @@ public abstract class Player extends LivingEntity { +@@ -335,6 +364,17 @@ public abstract class Player extends LivingEntity { this.turtleHelmetTick(); } @@ -14416,7 +14415,7 @@ index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..c1d068fa99ec0fd5685bbb627a775e4d this.cooldowns.tick(); this.updatePlayerPose(); if (this.currentImpulseContextResetGraceTime > 0) { -@@ -622,7 +662,7 @@ public abstract class Player extends LivingEntity { +@@ -625,7 +665,7 @@ public abstract class Player extends LivingEntity { while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -14425,7 +14424,7 @@ index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..c1d068fa99ec0fd5685bbb627a775e4d list1.add(entity); } else if (!entity.isRemoved()) { this.touch(entity); -@@ -1274,7 +1314,7 @@ public abstract class Player extends LivingEntity { +@@ -1277,7 +1317,7 @@ public abstract class Player extends LivingEntity { flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits if (flag2) { damagesource = damagesource.critical(true); // Paper start - critical damage API @@ -14434,7 +14433,7 @@ index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..c1d068fa99ec0fd5685bbb627a775e4d } float f3 = f + f1; -@@ -1640,7 +1680,7 @@ public abstract class Player extends LivingEntity { +@@ -1643,7 +1683,7 @@ public abstract class Player extends LivingEntity { } @Override @@ -14443,7 +14442,7 @@ index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..c1d068fa99ec0fd5685bbb627a775e4d return !this.abilities.flying && super.canGlide(); } -@@ -1900,7 +1940,23 @@ public abstract class Player extends LivingEntity { +@@ -1903,7 +1943,23 @@ public abstract class Player extends LivingEntity { @Override protected int getBaseExperienceReward(ServerLevel world) { @@ -14468,7 +14467,7 @@ index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..c1d068fa99ec0fd5685bbb627a775e4d } @Override -@@ -1978,6 +2034,13 @@ public abstract class Player extends LivingEntity { +@@ -1981,6 +2037,13 @@ public abstract class Player extends LivingEntity { return slot != EquipmentSlot.BODY; } @@ -14483,10 +14482,10 @@ index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..c1d068fa99ec0fd5685bbb627a775e4d if (!this.isPassenger() && this.onGround() && !this.isInWater() && !this.isInPowderSnow) { if (this.getShoulderEntityLeft().isEmpty()) { diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 8ce573042ea87631eb6539f2a0d5036655c2b809..5006a59734c5fc7525fba86f7d74e74f8f1b54b0 100644 +index f4513b1887f823b088dabe425be042b8fb2bde66..e136738ed53a488ad0aa67a04237ac6243fe712c 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -@@ -80,6 +80,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -82,6 +82,7 @@ public abstract class AbstractArrow extends Projectile { public ItemStack pickupItemStack; @Nullable public ItemStack firedFromWeapon; @@ -14494,7 +14493,7 @@ index 8ce573042ea87631eb6539f2a0d5036655c2b809..5006a59734c5fc7525fba86f7d74e74f // Spigot Start @Override -@@ -371,7 +372,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -372,7 +373,7 @@ public abstract class AbstractArrow extends Projectile { Vec3 vec3d = this.getDeltaMovement(); this.setDeltaMovement(vec3d.multiply((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F))); @@ -14503,7 +14502,7 @@ index 8ce573042ea87631eb6539f2a0d5036655c2b809..5006a59734c5fc7525fba86f7d74e74f } public boolean isInGround() { -@@ -623,6 +624,12 @@ public abstract class AbstractArrow extends Projectile { +@@ -638,6 +639,12 @@ public abstract class AbstractArrow extends Projectile { return this.firedFromWeapon; } @@ -14563,7 +14562,7 @@ index 958ea103cc80da7366cc33dc385b76d4f5c809f2..0b7f27a6cc6be58fa5b60002059c9fbb protected double getDefaultGravity() { return 0.06D; diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index 6c2d4d6f3a36ab452dfd3c33f66e54f152906639..a7df9c2a3f210bc944cf76cdcc8d2a9484704bd1 100644 +index 9a7b56b653848974e1194eb4f6d40cb99a96ff57..40a1514637a6a26666ba877e6dcf5bc42bd54a51 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java @@ -58,6 +58,36 @@ public abstract class Projectile extends Entity implements TraceableEntity { @@ -14603,7 +14602,7 @@ index 6c2d4d6f3a36ab452dfd3c33f66e54f152906639..a7df9c2a3f210bc944cf76cdcc8d2a94 public void setOwner(@Nullable Entity entity) { if (entity != null) { this.ownerUUID = entity.getUUID(); -@@ -480,7 +510,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -468,7 +498,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { public boolean mayInteract(ServerLevel world, BlockPos pos) { Entity entity = this.getOwner(); @@ -14626,7 +14625,7 @@ index bb159ea4baf208aab6d6fcfbbddacd5b089b55c8..588b07ec4501924a49264183b414a7fd // CraftBukkit end } diff --git a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java -index 70961e151666a0ecf5b791853f4581eaebbdcc8b..0db58e7d63a5c1b43a2224c247979f23a1d3f899 100644 +index 048ca5232d71f07d8ba7d3eaf0236660494c6b35..6fdacf2f6934521a0dd4b25aea35a6a14123da0a 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java @@ -58,11 +58,41 @@ public class Snowball extends ThrowableItemProjectile { @@ -14699,10 +14698,10 @@ index bd2684528157f928460f2143dd71a48e11983123..0720df603b4f89dd6aa346091b13033a this.playSound(worldserver, vec3d); diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java -index 322733266fdca8ce43434a8ffea304c51794bcbb..489c26423a7f5bc9da45d247de57ec989cc74119 100644 +index 1e045397763e8233c2e8f9955468788374b80068..3573a6cf0632dfb6859f5a5e7ceffb947e9d3692 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java -@@ -69,7 +69,7 @@ public class ThrownTrident extends AbstractArrow { +@@ -70,7 +70,7 @@ public class ThrownTrident extends AbstractArrow { Entity entity = this.getOwner(); byte b0 = (Byte) this.entityData.get(ThrownTrident.ID_LOYALTY); @@ -14745,7 +14744,7 @@ index 4c47b30867e30d84908abf93dbefc252bc8c3453..e63b408594b5d2673148e39c1deafc85 protected void defineSynchedData(SynchedEntityData.Builder builder) { builder.define(WitherSkull.DATA_DANGEROUS, false); diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java -index ab132041982df2a701e4baea8195873f31b4a5fb..722c1660cf6b93d0f9c05cafe587b1834c5c3a22 100644 +index cee1e4db2312efb4843c4b6dc18f4af10b91d304..68525419f18c18931d771d66fb15c9301d611416 100644 --- a/src/main/java/net/minecraft/world/entity/raid/Raider.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java @@ -345,7 +345,7 @@ public abstract class Raider extends PatrollingMonster { @@ -14802,7 +14801,7 @@ index 439d61d8689fabe940006b9b317a6810175dccfb..6b30941a84054efb5fcccb5d9e6c80d7 if (!raid.isStarted() && !this.raidMap.containsKey(raid.getId())) { this.raidMap.put(raid.getId(), raid); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java -index 1fdbef16cd29c8fc74578ac3328f985eca61088d..56c265940208bc94f531a5af94f564b59f35ebf3 100644 +index b87fd952020d88a6612429df73121422bf9ae422..1a4fb057025689a22b3dd05f531f0d8639d7e47b 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java @@ -499,6 +499,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { @@ -15228,10 +15227,10 @@ index 286ae002e1711ad9e800b7f2091988d66cd572a7..5959e1df9374bcb889be1726abb83b8c public boolean setItemName(String newItemName) { diff --git a/src/main/java/net/minecraft/world/inventory/ArmorSlot.java b/src/main/java/net/minecraft/world/inventory/ArmorSlot.java -index 6c0b6abb1698fac9bb902f695b725d4ab783ee90..091e3c3514fcb378b68098114106d09f04d8fb0d 100644 +index db7caaa2e77b9b98adac8add3040131c673c036b..262d9b2507d37edf0ed9c0821059e518d1baa9e9 100644 --- a/src/main/java/net/minecraft/world/inventory/ArmorSlot.java +++ b/src/main/java/net/minecraft/world/inventory/ArmorSlot.java -@@ -45,7 +45,7 @@ class ArmorSlot extends Slot { +@@ -44,7 +44,7 @@ class ArmorSlot extends Slot { @Override public boolean mayPickup(Player playerEntity) { ItemStack itemStack = this.getItem(); @@ -15276,10 +15275,10 @@ index 48a6b6136ac3414ca735f93a14b1a8d76210603c..27321b07cd04814bc1ff720c65770d77 return new ChestMenu(MenuType.GENERIC_9x6, syncId, playerInventory, inventory, 6); } diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java -index 50a735dd97daab4fb9579f922a4c63de60204f29..5b8ad051347f73553acb65c5ddc690d2b7eaa754 100644 +index bb9b17a058273ee1519b2abbefba97cad7feb51b..29996864b35711b29629e9071d28493ac27fbde6 100644 --- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java +++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java -@@ -42,6 +42,12 @@ import org.bukkit.event.enchantment.PrepareItemEnchantEvent; +@@ -41,6 +41,12 @@ import org.bukkit.event.enchantment.PrepareItemEnchantEvent; import org.bukkit.entity.Player; // CraftBukkit end @@ -15291,8 +15290,8 @@ index 50a735dd97daab4fb9579f922a4c63de60204f29..5b8ad051347f73553acb65c5ddc690d2 + public class EnchantmentMenu extends AbstractContainerMenu { - static final ResourceLocation EMPTY_SLOT_LAPIS_LAZULI = ResourceLocation.withDefaultNamespace("item/empty_slot_lapis_lazuli"); -@@ -76,6 +82,22 @@ public class EnchantmentMenu extends AbstractContainerMenu { + static final ResourceLocation EMPTY_SLOT_LAPIS_LAZULI = ResourceLocation.withDefaultNamespace("container/slot/lapis_lazuli"); +@@ -75,6 +81,22 @@ public class EnchantmentMenu extends AbstractContainerMenu { return context.getLocation(); } // CraftBukkit end @@ -15315,8 +15314,8 @@ index 50a735dd97daab4fb9579f922a4c63de60204f29..5b8ad051347f73553acb65c5ddc690d2 }; this.random = RandomSource.create(); this.enchantmentSeed = DataSlot.standalone(); -@@ -100,6 +122,16 @@ public class EnchantmentMenu extends AbstractContainerMenu { - return Pair.of(InventoryMenu.BLOCK_ATLAS, EnchantmentMenu.EMPTY_SLOT_LAPIS_LAZULI); +@@ -99,6 +121,16 @@ public class EnchantmentMenu extends AbstractContainerMenu { + return EnchantmentMenu.EMPTY_SLOT_LAPIS_LAZULI; } }); + // Purpur start @@ -15332,7 +15331,7 @@ index 50a735dd97daab4fb9579f922a4c63de60204f29..5b8ad051347f73553acb65c5ddc690d2 this.addStandardInventorySlots(playerInventory, 8, 84); this.addDataSlot(DataSlot.shared(this.costs, 0)); this.addDataSlot(DataSlot.shared(this.costs, 1)); -@@ -329,6 +361,7 @@ public class EnchantmentMenu extends AbstractContainerMenu { +@@ -328,6 +360,7 @@ public class EnchantmentMenu extends AbstractContainerMenu { public void removed(net.minecraft.world.entity.player.Player player) { super.removed(player); this.access.execute((world, blockposition) -> { @@ -15615,7 +15614,7 @@ index abff08f2d61014944235ffe2f5494a718a28cc10..dc2c415ab227e1357533079ada4903e9 return optional3; } else { diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java -index c816c935ecc74a811ffdffbe6ded73c06e92324a..d58619d1d63a03598b8740dd789d4b6f2c93f8d0 100644 +index 4377fa2400c4320e0023ece230090a2a3b4b2ab6..3d7a09c81b10f7a34d55670b7f2cc50b80550380 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java +++ b/src/main/java/net/minecraft/world/item/BlockItem.java @@ -151,7 +151,16 @@ public class BlockItem extends Item { @@ -15636,15 +15635,15 @@ index c816c935ecc74a811ffdffbe6ded73c06e92324a..d58619d1d63a03598b8740dd789d4b6f } @Nullable -@@ -213,6 +222,7 @@ public class BlockItem extends Item { +@@ -223,6 +232,7 @@ public class BlockItem extends Item { + } - if (tileentity != null) { - if (!world.isClientSide && tileentity.onlyOpCanSetNbt() && (player == null || !(player.canUseGameMasterBlocks() || (player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.nbt.place"))))) { // Spigot - add permission -+ if (!(!world.isClientSide && world.purpurConfig.silkTouchEnabled && tileentity instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity && player.getBukkitEntity().hasPermission("purpur.drop.spawners"))) + if (tileentitytypes1.onlyOpCanSetNbt() && (player == null || !(player.canUseGameMasterBlocks() || (player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.nbt.place"))))) { // Spigot - add permission ++ if (!(world.purpurConfig.silkTouchEnabled && tileentity instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity && player.getBukkitEntity().hasPermission("purpur.drop.spawners"))) return false; } -@@ -248,6 +258,7 @@ public class BlockItem extends Item { +@@ -273,6 +283,7 @@ public class BlockItem extends Item { ItemContainerContents itemcontainercontents = (ItemContainerContents) entity.getItem().set(DataComponents.CONTAINER, ItemContainerContents.EMPTY); if (itemcontainercontents != null) { @@ -15703,7 +15702,7 @@ index bb593209c95c9cf1f9c5d52d52fab4a33ddbabcf..58fa528e4b2589d362eb976afd6221cd } else { user.startUsingItem(hand); diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java -index 3bddfb6f7412ab86e0c090d0cbc6cf254b3f891c..6aa8ee091d3a7d2826d08ab9a03f970ef71a81ea 100644 +index 3bddfb6f7412ab86e0c090d0cbc6cf254b3f891c..38f287d97544b8a5b080837e38710dc4e94ae9bf 100644 --- a/src/main/java/net/minecraft/world/item/BucketItem.java +++ b/src/main/java/net/minecraft/world/item/BucketItem.java @@ -196,7 +196,7 @@ public class BucketItem extends Item implements DispensibleContainerItem { @@ -15720,15 +15719,15 @@ index 3bddfb6f7412ab86e0c090d0cbc6cf254b3f891c..6aa8ee091d3a7d2826d08ab9a03f970e for (int l = 0; l < 8; ++l) { - world.addParticle(ParticleTypes.LARGE_SMOKE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D); -+ ((ServerLevel) world).sendParticles(null, ParticleTypes.LARGE_SMOKE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 1, 0.0D, 0.0D, 0.0D, 0.0D, true); // Purpur ++ ((ServerLevel) world).sendParticlesSource(null, ParticleTypes.LARGE_SMOKE, false, true, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 1, 0.0D, 0.0D, 0.0D, 0.0D); // Purpur } return true; diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java -index 52c40eafc77e50a6fd21b9a7a250cea501f11690..86204c2ab5bbd5d45ddb1d626f844d91ccae6b4f 100644 +index be1902a307a54434644b242b429ad47c271d2a0c..cac4de9877b91bd805a5a8f4b84d27449fc5001f 100644 --- a/src/main/java/net/minecraft/world/item/CrossbowItem.java +++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java -@@ -69,7 +69,7 @@ public class CrossbowItem extends ProjectileWeaponItem { +@@ -70,7 +70,7 @@ public class CrossbowItem extends ProjectileWeaponItem { ItemStack itemStack = user.getItemInHand(hand); ChargedProjectiles chargedProjectiles = itemStack.get(DataComponents.CHARGED_PROJECTILES); if (chargedProjectiles != null && !chargedProjectiles.isEmpty()) { @@ -15738,12 +15737,12 @@ index 52c40eafc77e50a6fd21b9a7a250cea501f11690..86204c2ab5bbd5d45ddb1d626f844d91 } else if (!user.getProjectile(itemStack).isEmpty()) { this.startSoundPlayed = false; diff --git a/src/main/java/net/minecraft/world/item/DyeColor.java b/src/main/java/net/minecraft/world/item/DyeColor.java -index 79dc7cf5bfe92b4df21d164f39726dfe618331e4..6721432f9cdd11c9658c34f0ac407be217f9d276 100644 +index 648e6979aa72b9d1e1ea3b40d5a876e3c690b934..d9cd4f47e9990bdd85e30f68ca3b755a953332a1 100644 --- a/src/main/java/net/minecraft/world/item/DyeColor.java +++ b/src/main/java/net/minecraft/world/item/DyeColor.java -@@ -103,4 +103,10 @@ public enum DyeColor implements StringRepresentable { - public String getSerializedName() { - return this.name; +@@ -123,4 +123,10 @@ public enum DyeColor implements StringRepresentable { + private static CraftingInput makeCraftColorInput(DyeColor first, DyeColor second) { + return CraftingInput.of(2, 1, List.of(new ItemStack(DyeItem.byColor(first)), new ItemStack(DyeItem.byColor(second)))); } + + // Purpur start @@ -15753,15 +15752,15 @@ index 79dc7cf5bfe92b4df21d164f39726dfe618331e4..6721432f9cdd11c9658c34f0ac407be2 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/item/EggItem.java b/src/main/java/net/minecraft/world/item/EggItem.java -index 3ddd34e5d05fa1355a2affd329d72dea216cd0e4..770bdb3fb2426083ff6785f1c38ffe9d11f898e5 100644 +index 6d559fef484036194e4d899b82aaa7b5d518311e..9fb04b4e5b61ea497238e042fefa9a06f7489618 100644 --- a/src/main/java/net/minecraft/world/item/EggItem.java +++ b/src/main/java/net/minecraft/world/item/EggItem.java -@@ -27,7 +27,7 @@ public class EggItem extends Item implements ProjectileItem { +@@ -29,7 +29,7 @@ public class EggItem extends Item implements ProjectileItem { if (world instanceof ServerLevel worldserver) { // CraftBukkit start // Paper start - PlayerLaunchProjectileEvent -- final Projectile.Delayed thrownEgg = Projectile.spawnProjectileFromRotationDelayed(ThrownEgg::new, worldserver, itemstack, user, 0.0F, 1.5F, 1.0F); -+ final Projectile.Delayed thrownEgg = Projectile.spawnProjectileFromRotationDelayed(ThrownEgg::new, worldserver, itemstack, user, 0.0F, 1.5F, (float) worldserver.purpurConfig.eggProjectileOffset); // Purpur +- final Projectile.Delayed thrownEgg = Projectile.spawnProjectileFromRotationDelayed(ThrownEgg::new, worldserver, itemstack, user, 0.0F, EggItem.PROJECTILE_SHOOT_POWER, 1.0F); ++ final Projectile.Delayed thrownEgg = Projectile.spawnProjectileFromRotationDelayed(ThrownEgg::new, worldserver, itemstack, user, 0.0F, EggItem.PROJECTILE_SHOOT_POWER, (float) worldserver.purpurConfig.eggProjectileOffset); // Purpur com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) user.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), (org.bukkit.entity.Projectile) thrownEgg.projectile().getBukkitEntity()); if (event.callEvent() && thrownEgg.attemptSpawn()) { if (event.shouldConsume()) { @@ -15788,19 +15787,19 @@ index b62db8c7c8c57e43869ee239ebf4b02f112355d9..e75930f26604b772a141a93c6f4b7782 } } diff --git a/src/main/java/net/minecraft/world/item/EnderpearlItem.java b/src/main/java/net/minecraft/world/item/EnderpearlItem.java -index b232390d8ee8e449e61c0ea7f3af60df507abb97..4039d300debadf29e6c544e8b4c950b7121a02d1 100644 +index eaee34054233c8f0296b65a09f1287ba515496f2..392f2600e4fb1ff937c3ec5635156b358eb36888 100644 --- a/src/main/java/net/minecraft/world/item/EnderpearlItem.java +++ b/src/main/java/net/minecraft/world/item/EnderpearlItem.java -@@ -24,7 +24,7 @@ public class EnderpearlItem extends Item { +@@ -26,7 +26,7 @@ public class EnderpearlItem extends Item { if (world instanceof ServerLevel worldserver) { // CraftBukkit start // Paper start - PlayerLaunchProjectileEvent -- final Projectile.Delayed thrownEnderpearl = Projectile.spawnProjectileFromRotationDelayed(ThrownEnderpearl::new, worldserver, itemstack, user, 0.0F, 1.5F, 1.0F); -+ final Projectile.Delayed thrownEnderpearl = Projectile.spawnProjectileFromRotationDelayed(ThrownEnderpearl::new, worldserver, itemstack, user, 0.0F, 1.5F, (float) worldserver.purpurConfig.enderPearlProjectileOffset); // Purpur +- final Projectile.Delayed thrownEnderpearl = Projectile.spawnProjectileFromRotationDelayed(ThrownEnderpearl::new, worldserver, itemstack, user, 0.0F, EnderpearlItem.PROJECTILE_SHOOT_POWER, 1.0F); ++ final Projectile.Delayed thrownEnderpearl = Projectile.spawnProjectileFromRotationDelayed(ThrownEnderpearl::new, worldserver, itemstack, user, 0.0F, EnderpearlItem.PROJECTILE_SHOOT_POWER, (float) worldserver.purpurConfig.enderPearlProjectileOffset); // Purpur com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) user.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), (org.bukkit.entity.Projectile) thrownEnderpearl.projectile().getBukkitEntity()); if (event.callEvent() && thrownEnderpearl.attemptSpawn()) { if (event.shouldConsume()) { -@@ -35,6 +35,7 @@ public class EnderpearlItem extends Item { +@@ -37,6 +37,7 @@ public class EnderpearlItem extends Item { world.playSound((Player) null, user.getX(), user.getY(), user.getZ(), SoundEvents.ENDER_PEARL_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)); user.awardStat(Stats.ITEM_USED.get(this)); @@ -15883,10 +15882,10 @@ index d2871bb4fd670ae4133d13f290b3256c9177d8e6..0936bdc945f73c7750c20a34276aead2 consumer.accept(context); if (player != null) { diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 33e7d2884195677c4d6340d8b84c1dd85c636ec1..42b259c3878bd34b8e7cb768887fd1456be8db35 100644 +index f29415b8dff7d17328e159b56ae4ad46452f018e..5964c2e77e9f21c72d9e0655e5f48d2798317779 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -503,6 +503,7 @@ public final class ItemStack implements DataComponentHolder { +@@ -508,6 +508,7 @@ public final class ItemStack implements DataComponentHolder { world.isBlockPlaceCancelled = true; // Paper - prevent calling cleanup logic when undoing a block place upon a cancelled BlockPlaceEvent for (BlockState blockstate : blocks) { blockstate.update(true, false); @@ -15894,7 +15893,7 @@ index 33e7d2884195677c4d6340d8b84c1dd85c636ec1..42b259c3878bd34b8e7cb768887fd145 } world.isBlockPlaceCancelled = false; // Paper - prevent calling cleanup logic when undoing a block place upon a cancelled BlockPlaceEvent world.preventPoiUpdated = false; -@@ -535,6 +536,7 @@ public final class ItemStack implements DataComponentHolder { +@@ -540,6 +541,7 @@ public final class ItemStack implements DataComponentHolder { if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically block.onPlace(world, newblockposition, oldBlock, true, context); } @@ -15902,7 +15901,7 @@ index 33e7d2884195677c4d6340d8b84c1dd85c636ec1..42b259c3878bd34b8e7cb768887fd145 world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point } -@@ -681,6 +683,26 @@ public final class ItemStack implements DataComponentHolder { +@@ -686,6 +688,26 @@ public final class ItemStack implements DataComponentHolder { return this.isDamageableItem() && this.getDamageValue() > 0; } @@ -15929,7 +15928,7 @@ index 33e7d2884195677c4d6340d8b84c1dd85c636ec1..42b259c3878bd34b8e7cb768887fd145 public int getDamageValue() { return Mth.clamp((Integer) this.getOrDefault(DataComponents.DAMAGE, 0), 0, this.getMaxDamage()); } -@@ -761,6 +783,12 @@ public final class ItemStack implements DataComponentHolder { +@@ -766,6 +788,12 @@ public final class ItemStack implements DataComponentHolder { org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(serverPlayer, this); // Paper - Add EntityDamageItemEvent } // CraftBukkit end @@ -15942,7 +15941,7 @@ index 33e7d2884195677c4d6340d8b84c1dd85c636ec1..42b259c3878bd34b8e7cb768887fd145 this.shrink(1); breakCallback.accept(item); -@@ -1325,6 +1353,12 @@ public final class ItemStack implements DataComponentHolder { +@@ -1343,6 +1371,12 @@ public final class ItemStack implements DataComponentHolder { return !((ItemEnchantments) this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY)).isEmpty(); } @@ -15956,10 +15955,10 @@ index 33e7d2884195677c4d6340d8b84c1dd85c636ec1..42b259c3878bd34b8e7cb768887fd145 return (ItemEnchantments) this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); } diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java -index 5a70111cd39af50981cfd440c021340da1de5eab..580bd63fdbf9555f867362d3c1f39f41fd750089 100644 +index 6d16b4433e79eca0ff8008941f0b9b807b1db9db..317e69eb4e3a4c312d5e856a0bff31a9e3eb5326 100644 --- a/src/main/java/net/minecraft/world/item/Items.java +++ b/src/main/java/net/minecraft/world/item/Items.java -@@ -363,7 +363,7 @@ public class Items { +@@ -367,7 +367,7 @@ public class Items { public static final Item PURPUR_BLOCK = registerBlock(Blocks.PURPUR_BLOCK); public static final Item PURPUR_PILLAR = registerBlock(Blocks.PURPUR_PILLAR); public static final Item PURPUR_STAIRS = registerBlock(Blocks.PURPUR_STAIRS); @@ -15968,7 +15967,7 @@ index 5a70111cd39af50981cfd440c021340da1de5eab..580bd63fdbf9555f867362d3c1f39f41 public static final Item CREAKING_HEART = registerBlock(Blocks.CREAKING_HEART); public static final Item CHEST = registerBlock(Blocks.CHEST, settings -> settings.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY)); public static final Item CRAFTING_TABLE = registerBlock(Blocks.CRAFTING_TABLE); -@@ -2104,7 +2104,7 @@ public class Items { +@@ -1987,7 +1987,7 @@ public class Items { "sweet_berries", createBlockItemWithCustomItemName(Blocks.SWEET_BERRY_BUSH), new Item.Properties().food(Foods.SWEET_BERRIES) ); public static final Item GLOW_BERRIES = registerItem( @@ -15978,7 +15977,7 @@ index 5a70111cd39af50981cfd440c021340da1de5eab..580bd63fdbf9555f867362d3c1f39f41 public static final Item CAMPFIRE = registerBlock(Blocks.CAMPFIRE, settings -> settings.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY)); public static final Item SOUL_CAMPFIRE = registerBlock( diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java -index 571f2540a1e9422025efe651167e26b44b437daa..c2f3c8b3d8eeb609b6d6067c4fb404aefbf94ec5 100644 +index 8ff50a4c7461bbd9f469d503f6b5ee482d2463d7..5c0a46c11003b6e154195a8ef299416cc73eae33 100644 --- a/src/main/java/net/minecraft/world/item/MapItem.java +++ b/src/main/java/net/minecraft/world/item/MapItem.java @@ -194,6 +194,7 @@ public class MapItem extends Item { @@ -16014,7 +16013,7 @@ index 7153d9ed12276a0f2d8b8a17c79734aa25ed1fa5..dc49ea6454e04ae8ec68af12c4bf2ff0 } } diff --git a/src/main/java/net/minecraft/world/item/NameTagItem.java b/src/main/java/net/minecraft/world/item/NameTagItem.java -index 000d1863bfba98b5132dfc6743362d687b2f54f3..20fece9908382f40b4082f7b1fb7d41914ae31be 100644 +index df9cdcb9544a171a5a07c65ba0150933fb70d5fc..793bd6392ca3c3792306a20538233e4d7fb69b86 100644 --- a/src/main/java/net/minecraft/world/item/NameTagItem.java +++ b/src/main/java/net/minecraft/world/item/NameTagItem.java @@ -23,6 +23,7 @@ public class NameTagItem extends Item { @@ -16059,27 +16058,26 @@ index 55c18f182166f4905d623d6f5e909eefd5ed2483..d10c4705cc9e7faabd4a5619e1da1072 afterAction = () -> { // Paper if (!level.isClientSide()) { diff --git a/src/main/java/net/minecraft/world/item/SnowballItem.java b/src/main/java/net/minecraft/world/item/SnowballItem.java -index 57872ebef6beb8cdc03c9f8f19de94652ee19062..60a064c26de0566aaf9f8be886402e291c03ca3b 100644 +index d3bba4665ae14cc279c0f937831f909f8831b12b..27499f01ef0bc89c4c3f60eb696ca07cc5984809 100644 --- a/src/main/java/net/minecraft/world/item/SnowballItem.java +++ b/src/main/java/net/minecraft/world/item/SnowballItem.java -@@ -27,7 +27,7 @@ public class SnowballItem extends Item implements ProjectileItem { +@@ -29,7 +29,7 @@ public class SnowballItem extends Item implements ProjectileItem { // world.playSound((EntityHuman) null, entityhuman.getX(), entityhuman.getY(), entityhuman.getZ(), SoundEffects.SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F)); if (world instanceof ServerLevel worldserver) { // Paper start - PlayerLaunchProjectileEvent -- final Projectile.Delayed snowball = Projectile.spawnProjectileFromRotationDelayed(Snowball::new, worldserver, itemstack, user, 0.0F, 1.5F, 1.0F); -+ final Projectile.Delayed snowball = Projectile.spawnProjectileFromRotationDelayed(Snowball::new, worldserver, itemstack, user, 0.0F, 1.5F, (float) worldserver.purpurConfig.snowballProjectileOffset); // Purpur +- final Projectile.Delayed snowball = Projectile.spawnProjectileFromRotationDelayed(Snowball::new, worldserver, itemstack, user, 0.0F, SnowballItem.PROJECTILE_SHOOT_POWER, 1.0F); ++ final Projectile.Delayed snowball = Projectile.spawnProjectileFromRotationDelayed(Snowball::new, worldserver, itemstack, user, 0.0F, SnowballItem.PROJECTILE_SHOOT_POWER, (float) worldserver.purpurConfig.snowballProjectileOffset); // Purpur com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) user.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), (org.bukkit.entity.Projectile) snowball.projectile().getBukkitEntity()); if (event.callEvent() && snowball.attemptSpawn()) { user.awardStat(Stats.ITEM_USED.get(this)); diff --git a/src/main/java/net/minecraft/world/item/SpawnEggItem.java b/src/main/java/net/minecraft/world/item/SpawnEggItem.java -index 9956ed42df55daa6d97fd6e3ab5368dad91cfaf0..e0e746d6c78421b40777125ba49f0a04809f5415 100644 +index cc7e9b87e919b4ef8cf77cd780c890fd9a9cfa50..a185d098175e504b7bb93d2cff03ca99eabc11eb 100644 --- a/src/main/java/net/minecraft/world/item/SpawnEggItem.java +++ b/src/main/java/net/minecraft/world/item/SpawnEggItem.java -@@ -73,6 +73,24 @@ public class SpawnEggItem extends Item { +@@ -68,6 +68,23 @@ public class SpawnEggItem extends Item { Spawner spawner = (Spawner) tileentity; - entitytypes = this.getType(itemstack); -+ + entitytypes = this.getType(world.registryAccess(), itemstack); + // Purpur start + if (spawner instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity) { + org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); @@ -16101,23 +16099,23 @@ index 9956ed42df55daa6d97fd6e3ab5368dad91cfaf0..e0e746d6c78421b40777125ba49f0a04 world.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3); world.gameEvent((Entity) context.getPlayer(), (Holder) GameEvent.BLOCK_CHANGE, blockposition); diff --git a/src/main/java/net/minecraft/world/item/ThrowablePotionItem.java b/src/main/java/net/minecraft/world/item/ThrowablePotionItem.java -index fa9d2ae44fcdd06f8f33cd14ffca422b20a01451..ffbc71ca2a27800d7758e3db339bf06a39ef1f11 100644 +index e422881d1ab0f1a5bb2cb741d23089a2e35de2d4..bbd65d35d91d4f3ffabeb355b82f22ddde0f868b 100644 --- a/src/main/java/net/minecraft/world/item/ThrowablePotionItem.java +++ b/src/main/java/net/minecraft/world/item/ThrowablePotionItem.java -@@ -21,7 +21,7 @@ public class ThrowablePotionItem extends PotionItem implements ProjectileItem { +@@ -23,7 +23,7 @@ public class ThrowablePotionItem extends PotionItem implements ProjectileItem { ItemStack itemStack = user.getItemInHand(hand); if (world instanceof ServerLevel serverLevel) { // Paper start - PlayerLaunchProjectileEvent -- final Projectile.Delayed thrownPotion = Projectile.spawnProjectileFromRotationDelayed(ThrownPotion::new, serverLevel, itemStack, user, -20.0F, 0.5F, 1.0F); -+ final Projectile.Delayed thrownPotion = Projectile.spawnProjectileFromRotationDelayed(ThrownPotion::new, serverLevel, itemStack, user, -20.0F, 0.5F, (float) serverLevel.purpurConfig.throwablePotionProjectileOffset); // Purpur +- final Projectile.Delayed thrownPotion = Projectile.spawnProjectileFromRotationDelayed(ThrownPotion::new, serverLevel, itemStack, user, -20.0F, PROJECTILE_SHOOT_POWER, 1.0F); ++ final Projectile.Delayed thrownPotion = Projectile.spawnProjectileFromRotationDelayed(ThrownPotion::new, serverLevel, itemStack, user, -20.0F, PROJECTILE_SHOOT_POWER, (float) serverLevel.purpurConfig.throwablePotionProjectileOffset); // Purpur // Paper start - PlayerLaunchProjectileEvent com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) user.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), (org.bukkit.entity.Projectile) thrownPotion.projectile().getBukkitEntity()); if (event.callEvent() && thrownPotion.attemptSpawn()) { diff --git a/src/main/java/net/minecraft/world/item/TridentItem.java b/src/main/java/net/minecraft/world/item/TridentItem.java -index 8b9a93ef71164cce8a616735b71d96d37e83b1a8..23e04d0d68ffa0e07ab295e7121f8a4963f4914a 100644 +index 2b2af4b7cc2c8be8c3aed30885be26816c021bdc..be32255c9bd90f7de3f8f5a62d84c7dcf59fa722 100644 --- a/src/main/java/net/minecraft/world/item/TridentItem.java +++ b/src/main/java/net/minecraft/world/item/TridentItem.java -@@ -88,7 +88,7 @@ public class TridentItem extends Item implements ProjectileItem { +@@ -89,7 +89,7 @@ public class TridentItem extends Item implements ProjectileItem { // itemstack.hurtWithoutBreaking(1, entityhuman); // CraftBukkit - moved down if (f == 0.0F) { // Paper start - PlayerLaunchProjectileEvent @@ -16126,7 +16124,7 @@ index 8b9a93ef71164cce8a616735b71d96d37e83b1a8..23e04d0d68ffa0e07ab295e7121f8a49 // Paper start - PlayerLaunchProjectileEvent com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(stack), (org.bukkit.entity.Projectile) tridentDelayed.projectile().getBukkitEntity()); if (!event.callEvent() || !tridentDelayed.attemptSpawn()) { -@@ -100,6 +100,9 @@ public class TridentItem extends Item implements ProjectileItem { +@@ -101,6 +101,9 @@ public class TridentItem extends Item implements ProjectileItem { return false; } ThrownTrident entitythrowntrident = tridentDelayed.projectile(); // Paper - PlayerLaunchProjectileEvent @@ -16173,20 +16171,20 @@ index 0651c2af040e3f248860cfb3c5effce91589380e..d884df481b4bbb978113a4ac7a1feac3 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/world/item/crafting/Ingredient.java b/src/main/java/net/minecraft/world/item/crafting/Ingredient.java -index 812f919a7a7e309c8513f44104f092496037608f..10730b307971915f52b3e41068a864b8ee1352b4 100644 +index 0b0054b3d5d56ba24e1aee0e3ab56ea5b01a82a8..2e3a834643d56543418e9b9beb9d3448bf059d22 100644 --- a/src/main/java/net/minecraft/world/item/crafting/Ingredient.java +++ b/src/main/java/net/minecraft/world/item/crafting/Ingredient.java -@@ -45,6 +45,7 @@ public final class Ingredient implements Predicate { +@@ -45,6 +45,7 @@ public final class Ingredient implements StackedContents.IngredientInfo itemStacks; + private java.util.Set itemStacks; // Paper - Improve exact choice recipe ingredients + public Predicate predicate; // Purpur public boolean isExact() { return this.itemStacks != null; -@@ -100,6 +101,11 @@ public final class Ingredient implements Predicate { - - return false; +@@ -100,6 +101,11 @@ public final class Ingredient implements StackedContents.IngredientInfo> list = this.items(); - + return itemstack.is(this.values); + } diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java -index 12f95bee2a69fd5df7c4a165537e01299e60c5f6..d7ce86752e4138cdd3844b3374609753aa20f9ea 100644 +index 12f95bee2a69fd5df7c4a165537e01299e60c5f6..4b3769020a92124bd5677cf75e268b8bc5ba2031 100644 --- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java +++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java @@ -31,8 +31,13 @@ public class ShapelessRecipe implements CraftingRecipe { @@ -16214,7 +16212,7 @@ index 12f95bee2a69fd5df7c4a165537e01299e60c5f6..d7ce86752e4138cdd3844b3374609753 this.group = group; this.category = category; this.result = result; -@@ -80,6 +85,28 @@ public class ShapelessRecipe implements CraftingRecipe { +@@ -80,6 +85,27 @@ public class ShapelessRecipe implements CraftingRecipe { } public boolean matches(CraftingInput input, Level world) { @@ -16239,12 +16237,11 @@ index 12f95bee2a69fd5df7c4a165537e01299e60c5f6..d7ce86752e4138cdd3844b3374609753 + return ingredients.isEmpty(); + } + // Pufferfish end -+ // Paper start - Improve exact choice recipe ingredients & unwrap ternary if (input.ingredientCount() != this.ingredients.size()) { return false; diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java -index f99b87cf70df7eaac13d46f4e0234b1e6483d342..73241113e50dc8be89ef8850d49d95ec31fb194f 100644 +index 4dd074d04c9a535f6cf24420058fd68594c59edc..2c1799e8c9009a6ab24c24e7363d5a87e41f0c35 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java +++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java @@ -6,6 +6,7 @@ import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry; @@ -16396,10 +16393,10 @@ index 5d7a6e4b73f032db356e7ec369b150013e940ee6..6b2cda6d578a0983b2401ea206292754 if (range < 0.0 || d < range * range) { return true; diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 0de2b79481352b52438dde284262019b29949ad8..34e8eb828be517d9ee3973597c74c5cac3d75c99 100644 +index 27f9d167b5ae9ce5117798ea44324107df59425f..1a808fc381c0c3ea1fc49bbffebddf2c550e817a 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -174,6 +174,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -175,6 +175,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl // Paper end - add paper world config public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray @@ -16407,7 +16404,7 @@ index 0de2b79481352b52438dde284262019b29949ad8..34e8eb828be517d9ee3973597c74c5ca public static BlockPos lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter tileLimiter; -@@ -181,6 +182,49 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -182,6 +183,49 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public final Map explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here @@ -16457,7 +16454,7 @@ index 0de2b79481352b52438dde284262019b29949ad8..34e8eb828be517d9ee3973597c74c5ca public CraftWorld getWorld() { return this.world; } -@@ -842,6 +886,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -843,6 +887,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl // Paper end - getblock optimisations - cache world height/sections this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config @@ -16466,7 +16463,7 @@ index 0de2b79481352b52438dde284262019b29949ad8..34e8eb828be517d9ee3973597c74c5ca this.generator = gen; this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env); -@@ -1487,16 +1533,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1488,16 +1534,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public void guardEntityTick(Consumer tickConsumer, T entity) { try { tickConsumer.accept(entity); @@ -16486,7 +16483,7 @@ index 0de2b79481352b52438dde284262019b29949ad8..34e8eb828be517d9ee3973597c74c5ca } // Paper start - Option to prevent armor stands from doing entity lookups @Override -@@ -2042,4 +2088,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -2045,4 +2091,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl return this.id; } } @@ -16515,7 +16512,7 @@ index c1b76a1ebc1eea7ab70cf61d8175a31794dd122a..dc15c15951e4ca30b8341d24f813259a if (entityhuman != null) { double d2 = entityhuman.distanceToSqr(d0, (double) i, d1); diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java -index bbbd451ff184be8fa13bd93d53c89a9502f9951a..3c3d219c9339f64c23ec0b31783bf68a4423636c 100644 +index 685ccfb73bf7125585ef90b6a0f51b2f81daa428..e2763ee67530074d8ec78fbff694eb84f5373de0 100644 --- a/src/main/java/net/minecraft/world/level/ServerExplosion.java +++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java @@ -311,7 +311,7 @@ public class ServerExplosion implements Explosion { @@ -16652,7 +16649,7 @@ index d7ca7a43d2d5f8cad416156fd40588cdd6634f52..231338adda19f57bf1a95379cc2e1434 return true; } else { diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java -index c02c4834ace843633b77fb43eeadd3ddc7b1f743..c130d316e87f1f896d33ab43831063a89e3bef2b 100644 +index be700995c3e7f63e0471712c3cd6fd83db583491..54836f2a1e4cc9046ba29fb71ea237b358c9cb7d 100644 --- a/src/main/java/net/minecraft/world/level/block/BedBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java @@ -106,7 +106,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock @@ -16696,7 +16693,7 @@ index 9e3f1441d62128535112621bf259c24f1a90595b..2535e6d71b690f8dfde41a7d9cb76b6f if (i != -1) { world.scheduleTick(blockposition, (Block) this, i); 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 b6d6c2cb9b227a17fb4ce42bc75f92206fbea043..1748aea6613e0c8081f70092c9431e7e04907383 100644 +index c0b1f903962b25d8ff6c2b4fcd2be0e45de09b35..91e68335d7007e3c1fe13eec0060db01c5f659ac 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -88,6 +88,10 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -16791,10 +16788,10 @@ index b6d6c2cb9b227a17fb4ce42bc75f92206fbea043..1748aea6613e0c8081f70092c9431e7e public void updateEntityMovementAfterFallOn(BlockGetter world, Entity entity) { diff --git a/src/main/java/net/minecraft/world/level/block/Blocks.java b/src/main/java/net/minecraft/world/level/block/Blocks.java -index 66a07f7cbf1c1d6ecbe055cbf4f63eb07d93e90c..63d67d46d30ed8ed57cdc0e59b6cb6b75ab22c1f 100644 +index 9bafac9b2c7b487f745fb64354f4bbc6a7ded468..1c34691da51d7f7ba3d54e095a3b58b74a5f2263 100644 --- a/src/main/java/net/minecraft/world/level/block/Blocks.java +++ b/src/main/java/net/minecraft/world/level/block/Blocks.java -@@ -6465,6 +6465,7 @@ public class Blocks { +@@ -6454,6 +6454,7 @@ public class Blocks { BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) .forceSolidOff() @@ -16802,7 +16799,7 @@ index 66a07f7cbf1c1d6ecbe055cbf4f63eb07d93e90c..63d67d46d30ed8ed57cdc0e59b6cb6b7 .instabreak() .sound(SoundType.AZALEA) .noOcclusion() -@@ -6476,6 +6477,7 @@ public class Blocks { +@@ -6465,6 +6466,7 @@ public class Blocks { BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) .forceSolidOff() @@ -16926,7 +16923,7 @@ index 648c2510beb162e73aed236a3169d0bbb8fc5050..3563a241c0b697dc0167cf7b1aa73fef } diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java -index 18d4020017d76303d3179fad8974574777ea6305..2ee2b1485f848ac5270bc3f7e1e5b1bc3029b0bb 100644 +index 1b94f26e78db062f80d806b82f714a815b4710ff..299d782c4e84d8548f2faddfb03712bab388de09 100644 --- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java @@ -140,7 +140,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB @@ -16991,7 +16988,7 @@ index c9968934f4ecaa8d81e545f279b3001c7b1ce545..03e4fce6f8226451365fc2831b5bf1e5 @Override diff --git a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java -index c4473c2a778116d48bc3e4796afd901f455070e6..e62217c0bfa6cc426c7d41154f3ccc34d8f242ca 100644 +index 81e572783157926383dd9baa58d30f5419c1616f..84d6ae4acf80f6ff4f418739a0228e740993f950 100644 --- a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java @@ -94,4 +94,11 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements CaveVines { @@ -17020,10 +17017,10 @@ index daae7fd6e0148cfba8e359d990748a0c83a3376e..0e06b1bcd906e92c083dc74d56d6d0a2 return random.nextFloat() < f1 ? this.getNext(state) : Optional.empty(); } diff --git a/src/main/java/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java -index edef8fc62f8dba1b57214d8d7d805ff0d83f4114..663eb96b8227f000448957b5d8ea13ca78cee329 100644 +index ca69a9fbd4942f9079aeaab7cead2d7a2c3b8659..54f351f1cbb50a5b1aa3167e3a0b10bb0456c1cf 100644 --- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java -@@ -341,6 +341,7 @@ public class ChestBlock extends AbstractChestBlock implements +@@ -336,6 +336,7 @@ public class ChestBlock extends AbstractChestBlock implements } public static boolean isBlockedChestByBlock(BlockGetter world, BlockPos pos) { @@ -17032,10 +17029,10 @@ index edef8fc62f8dba1b57214d8d7d805ff0d83f4114..663eb96b8227f000448957b5d8ea13ca return world.getBlockState(blockposition1).isRedstoneConductor(world, blockposition1); diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -index db837b250fc35af5b528bf973b3b07f63e79bc46..ed3a310d56a0cca8c4c11c3768ac2056cd11edea 100644 +index 9264ba58188a7a682eeb8eb449b89ff8e60f91d6..809a820dd8eec3e48dd3263335c62fbea4cd4f2c 100644 --- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -@@ -241,18 +241,27 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -243,18 +243,27 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { int i = (Integer) state.getValue(ComposterBlock.LEVEL); if (i < 8 && ComposterBlock.COMPOSTABLES.containsKey(stack.getItem())) { @@ -17074,7 +17071,7 @@ index db837b250fc35af5b528bf973b3b07f63e79bc46..ed3a310d56a0cca8c4c11c3768ac2056 return InteractionResult.SUCCESS; } else { -@@ -260,6 +269,25 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -262,6 +271,25 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { } } @@ -17113,7 +17110,7 @@ index a59b23f4062fa896836dec72cbd5097411774ad1..c526ea13a726624adaa654f09ff84c89 int i = aenumdirection.length; diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java -index 1ada5ed825501666addacf527a513ab7bd4a3a58..33c27909290ff3ab483226cf65b1a1bc2e983cbc 100644 +index 1967ff3fcb94988be85985c4754904f0077de066..7f6f7a114e9930e7655c9695a5737739503999de 100644 --- a/src/main/java/net/minecraft/world/level/block/CropBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java @@ -180,7 +180,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock { @@ -17187,10 +17184,10 @@ index 30d15686b1a81de7ac28feb0c6188eb007c6f2fd..b6799db00e157892dd4339a01d2ca360 BlockPos blockposition1 = pos.offset(world.random.nextInt(16) - world.random.nextInt(16), world.random.nextInt(8) - world.random.nextInt(8), world.random.nextInt(16) - world.random.nextInt(16)); diff --git a/src/main/java/net/minecraft/world/level/block/EnchantingTableBlock.java b/src/main/java/net/minecraft/world/level/block/EnchantingTableBlock.java -index a7fb500d950687743d1fc0b3ad3e6d10dcc6e31a..ce6a9e15ae0114623e79b5d8c244c2c490a3f74e 100644 +index 4c4e6290035710480cd5c1d7399f2443df01a5a6..248039ac7eab85b29ae3c525a986d91aa8d177fe 100644 --- a/src/main/java/net/minecraft/world/level/block/EnchantingTableBlock.java +++ b/src/main/java/net/minecraft/world/level/block/EnchantingTableBlock.java -@@ -123,4 +123,18 @@ public class EnchantingTableBlock extends BaseEntityBlock { +@@ -118,4 +118,18 @@ public class EnchantingTableBlock extends BaseEntityBlock { protected boolean isPathfindable(BlockState state, PathComputationType type) { return false; } @@ -17210,7 +17207,7 @@ index a7fb500d950687743d1fc0b3ad3e6d10dcc6e31a..ce6a9e15ae0114623e79b5d8c244c2c4 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java -index a7a21f071161fb7e73a046717d2462f871ab653c..abb75f9389167a1f51a2c50831664d50181749de 100644 +index af46f2885ead1e3ec1734504d8ba134c886e04fb..47ee0538c8ea94136b2416c324c8a264e54d2c09 100644 --- a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java +++ b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java @@ -104,6 +104,13 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal { @@ -17228,7 +17225,7 @@ index a7a21f071161fb7e73a046717d2462f871ab653c..abb75f9389167a1f51a2c50831664d50 TheEndGatewayBlockEntity.triggerCooldown(world, pos, state, tileentityendgateway); } diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java -index 4aa14f975e1ceedf3d4a427e0daefb58b12fcafe..2dffc3990d9ae3d595d923239885e3a7d8ec04f3 100644 +index 8cb4142562db0be1f1a7d961ec5a10d4abf31692..84ecb012cb0a47e47799dc73c7fadc75f462f47a 100644 --- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java +++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java @@ -70,6 +70,13 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal { @@ -17246,10 +17243,10 @@ index 4aa14f975e1ceedf3d4a427e0daefb58b12fcafe..2dffc3990d9ae3d595d923239885e3a7 EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()), org.bukkit.PortalType.ENDER); // Paper - add portal type world.getCraftServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java -index 2a207fb2e1c26b562de42240e11c856bd2a23458..6ad4aa371607ab92616626285a7e71757c76a3db 100644 +index 9b6ab617ab7f503cf0b2d4e29333c706ffe95f46..bfe79431dc5707677671df5c0787817c6e14a676 100644 --- a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java +++ b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java -@@ -89,7 +89,7 @@ public class EnderChestBlock extends AbstractChestBlock i +@@ -84,7 +84,7 @@ public class EnderChestBlock extends AbstractChestBlock i // Paper start - Fix InventoryOpenEvent cancellation - moved up; playerEnderChestContainer.setActiveChest(enderChestBlockEntity); // Needs to happen before ChestMenu.threeRows as it is required for opening animations if (world instanceof ServerLevel serverLevel && player.openMenu( @@ -17258,7 +17255,7 @@ index 2a207fb2e1c26b562de42240e11c856bd2a23458..6ad4aa371607ab92616626285a7e7175 ).isPresent()) { // Paper end - Fix InventoryOpenEvent cancellation - moved up; // Paper - Fix InventoryOpenEvent cancellation - moved up; -@@ -104,6 +104,35 @@ public class EnderChestBlock extends AbstractChestBlock i +@@ -99,6 +99,35 @@ public class EnderChestBlock extends AbstractChestBlock i } } @@ -17499,7 +17496,7 @@ index 7ffdcf18bf4bd8b5325c76945b2d80ca3fe52958..dfa931316fde0b2e80068a0edd1427ff } 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 2b31bf586c1c0bd393d2aa8d0b6635dd9f22f21c..02bcba52e28f757b59e2f384d5744834962870f0 100644 +index 3e9642e5236d9a1cc8e8f3b375d76810f4bc7c6c..6c10860aee8b8fac4089fb7f1506c890fb3f5308 100644 --- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java +++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java @@ -78,7 +78,7 @@ public class NetherPortalBlock extends Block implements Portal { @@ -17535,7 +17532,7 @@ index 2b31bf586c1c0bd393d2aa8d0b6635dd9f22f21c..02bcba52e28f757b59e2f384d5744834 return 0; } diff --git a/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java b/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java -index acbd60a2f162fe0e254e36d0e8e7face3fc8a7b3..b8355ea1de26c4b6905f477fb4e110f1762447b4 100644 +index 7bb4994d6474c8ea59c102009253552020691b8f..264692baa4a20b66910d8ff379fa72acb99e27f8 100644 --- a/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java +++ b/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java @@ -16,7 +16,7 @@ import net.minecraft.world.level.block.state.properties.IntegerProperty; @@ -17674,10 +17671,10 @@ index 9117c035d5a6ff114b028fad3380ceb1fc2b9691..2c5e394156dbf76107adb4913a094dfd public static boolean canSetSpawn(Level world) { diff --git a/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java b/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java -index 0e05bfef55dcacb50766bba8328ffeb8a5394c31..e00fcea07e74de647c26ff9eb32bc682738c15b7 100644 +index 7990a6c225c27845ccada0df91cf5ed7e4315a88..db2b21d5842fafa48dbde25a461505d03aa9b955 100644 --- a/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java -@@ -135,7 +135,7 @@ public class SculkShriekerBlock extends BaseEntityBlock implements SimpleWaterlo +@@ -130,7 +130,7 @@ public class SculkShriekerBlock extends BaseEntityBlock implements SimpleWaterlo @Nullable @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { @@ -17734,7 +17731,7 @@ index 9908a0b5b1fec5f9de518a733f7abbbff7e1a9f9..0ad444cf7f798f63e9140a42c5d5d8ca } diff --git a/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java b/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java -index 4f190a40b8474aa06a92c8afcc06d0044120ff7b..80ee7a6f010cc838625674007a3ea908f2f9dadd 100644 +index d751b280a8bf2066d458f8eb548d7aa123fa69c9..fb88b5c1d9e764bf1211d601527133ea8e8268b3 100644 --- a/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java @@ -42,6 +42,57 @@ public class SpawnerBlock extends BaseEntityBlock { @@ -17804,7 +17801,7 @@ index 4f190a40b8474aa06a92c8afcc06d0044120ff7b..80ee7a6f010cc838625674007a3ea908 int i = 15 + worldserver.random.nextInt(15) + worldserver.random.nextInt(15); diff --git a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java -index 59cf905b1b5686f6f4f2bad94730ffa69d3a2834..4c5bc71fef307d13b640e534ace0b4411f6e97e2 100644 +index e9a77c1ae09af42d2d444ad6b5f6c8ac395044e1..4540d3a31ed89ea3684feeffb85a391655e9cbbc 100644 --- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java @@ -61,7 +61,7 @@ public class SpongeBlock extends Block { @@ -17822,7 +17819,7 @@ index 59cf905b1b5686f6f4f2bad94730ffa69d3a2834..4c5bc71fef307d13b640e534ace0b441 - if (!fluid.is(FluidTags.WATER)) { + if (!fluid.is(FluidTags.WATER) && (!world.purpurConfig.spongeAbsorbsLava || !fluid.is(FluidTags.LAVA)) && (!world.purpurConfig.spongeAbsorbsWaterFromMud || !iblockdata.is(Blocks.MUD))) { // Purpur - return false; + return BlockPos.TraversalNodeStatus.SKIP; } else { Block block = iblockdata.getBlock(); @@ -95,6 +95,10 @@ public class SpongeBlock extends Block { @@ -17835,12 +17832,12 @@ index 59cf905b1b5686f6f4f2bad94730ffa69d3a2834..4c5bc71fef307d13b640e534ace0b441 + // Purpur end } else { if (!iblockdata.is(Blocks.KELP) && !iblockdata.is(Blocks.KELP_PLANT) && !iblockdata.is(Blocks.SEAGRASS) && !iblockdata.is(Blocks.TALL_SEAGRASS)) { - return false; + return BlockPos.TraversalNodeStatus.SKIP; diff --git a/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java b/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java -index e61644241f24b42bb4f702d3eef5b590b4d107c8..0bf6503819b02e5ba2c346d9d563a93f2946d89b 100644 +index f1366aea49206afcd64bf058ee673d6a562315c5..ff655401c7aecba5acd8d241e844d77364f09f35 100644 --- a/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java -@@ -98,4 +98,14 @@ public class StonecutterBlock extends Block { +@@ -93,4 +93,14 @@ public class StonecutterBlock extends Block { protected boolean isPathfindable(BlockState state, PathComputationType type) { return false; } @@ -17994,10 +17991,10 @@ index 0fbe66cc02bd3d95c0a5dcd55380a1b4a2f17ca6..3a7126883f11ac5a647947eaf060df15 if (!world.addFreshEntity(entitywither, SpawnReason.BUILD_WITHER)) { return; diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 15e0861486a2bda3e2f4049b1b5a299c870acd31..91a158ed90b7ce3eac7277fd962682a0226c08ed 100644 +index a9809c18233d82f910735e59363a49de488defcd..affa084b6bd4a6792d1c55719f88f3fb16627761 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -219,6 +219,21 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -218,6 +218,21 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit } ItemStack itemstack = (ItemStack) blockEntity.items.get(1); @@ -18019,7 +18016,7 @@ index 15e0861486a2bda3e2f4049b1b5a299c870acd31..91a158ed90b7ce3eac7277fd962682a0 ItemStack itemstack1 = (ItemStack) blockEntity.items.get(0); boolean flag2 = !itemstack1.isEmpty(); boolean flag3 = !itemstack.isEmpty(); -@@ -308,6 +323,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -303,6 +318,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit setChanged(world, pos, state); } @@ -18134,7 +18131,7 @@ index 0e0d178f2793ab014358f534c8dc53218b89f083..2d190b3a6378b8cbadfa65510df1ccfb BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT); } diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -index 83ad45aed0894e90825d22e078632352c3a06816..def408384cbd571b7bee23f5cecf430a5d690c4b 100644 +index 65a85b4a4e159cfe55e435ed342a87bcc07b21d5..6fa25cac9d88808a590281bf90f619fa2f167d4a 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java @@ -60,7 +60,7 @@ public class BeehiveBlockEntity extends BlockEntity { @@ -18180,7 +18177,7 @@ index 83ad45aed0894e90825d22e078632352c3a06816..def408384cbd571b7bee23f5cecf430a // Paper start - Add EntityBlockStorage clearEntities public void clearBees() { this.stored.clear(); -@@ -472,9 +494,9 @@ public class BeehiveBlockEntity extends BlockEntity { +@@ -467,9 +489,9 @@ public class BeehiveBlockEntity extends BlockEntity { } } @@ -18193,10 +18190,10 @@ index 83ad45aed0894e90825d22e078632352c3a06816..def408384cbd571b7bee23f5cecf430a private int ticksInHive; diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index 1f929b467a0ece3143af58a657cf5983c07a8d51..eaa6ece956f90632831f0558924eaf18680a252b 100644 +index 1f664c10138a6e19bdc0051fa80575516d5602e7..5c5cc77ff2e050e80dc9f6f62ede68d177a0015f 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -@@ -95,6 +95,12 @@ public abstract class BlockEntity { +@@ -94,6 +94,12 @@ public abstract class BlockEntity { if (persistentDataTag instanceof CompoundTag) { this.persistentDataContainer.putAll((CompoundTag) persistentDataTag); } @@ -18209,7 +18206,7 @@ index 1f929b467a0ece3143af58a657cf5983c07a8d51..eaa6ece956f90632831f0558924eaf18 } // CraftBukkit end -@@ -111,6 +117,15 @@ public abstract class BlockEntity { +@@ -110,6 +116,15 @@ public abstract class BlockEntity { this.loadAdditional(nbt, registries); } @@ -18225,7 +18222,7 @@ index 1f929b467a0ece3143af58a657cf5983c07a8d51..eaa6ece956f90632831f0558924eaf18 protected void saveAdditional(CompoundTag nbt, HolderLookup.Provider registries) {} public final CompoundTag saveWithFullMetadata(HolderLookup.Provider registries) { -@@ -419,4 +434,16 @@ public abstract class BlockEntity { +@@ -406,4 +421,16 @@ public abstract class BlockEntity { T getOrDefault(DataComponentType type, T fallback); } @@ -18378,7 +18375,7 @@ index 61ef08ac941b1e8988d001241780d3a1582f7a2d..2eab5b43ab654966d26424597c1f3baa FuelValues(Object2IntSortedMap fuelValues) { this.values = fuelValues; diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -index 8ac19e1e052e73ff3fd09089bb8e3fd687390ee4..6da1eec98c08e4909ecbd48fe90b3fd62011e284 100644 +index 7a1d9a718dc57b5f630ca8e5358120cebaeefb9c..b51b0b0f48b1da6187387d6ec025681e10ed584d 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java @@ -201,16 +201,31 @@ public class SignBlockEntity extends BlockEntity { @@ -18476,7 +18473,7 @@ index 205e223c356634bd6bc6bd58c6f0b7fda61a6f5f..bea05cb928d540a2f19b51bb7352d032 } 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 5b6fbfd1a7a2d87fb2b87d5d1e674206cdf9b280..dcf2dcece3e995ce4646b931329246be19a4e1c2 100644 +index 8c0f332a1a0918f60226d969918ae7fe4fe74166..c8ae6e4cd74549f753ec04def5d882de1ab72308 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 @@ -91,7 +91,7 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -18498,10 +18495,10 @@ index 5b6fbfd1a7a2d87fb2b87d5d1e674206cdf9b280..dcf2dcece3e995ce4646b931329246be protected final String descriptionId; 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 4640baec5bed6c2d53cc0f8ca1d273cc115abe9b..5c4843f6cfd13790a44fc0f928f1fbcef8a648ce 100644 +index 97937e3bd211997f0a0a3e9e671a1c59712d0003..090e196cf391dced8adcb8106026d67b2aeac6b0 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -88,6 +88,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -89,6 +89,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p private final LevelChunkTicks fluidTicks; private LevelChunk.UnsavedListener unsavedListener; @@ -18520,7 +18517,7 @@ index 4640baec5bed6c2d53cc0f8ca1d273cc115abe9b..5c4843f6cfd13790a44fc0f928f1fbce public LevelChunk(Level world, ChunkPos pos) { this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null); } -@@ -121,6 +133,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p +@@ -122,6 +134,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p this.debug = !empty && this.level.isDebug(); this.defaultBlockState = empty ? VOID_AIR_BLOCKSTATE : AIR_BLOCKSTATE; // Paper end - get block chunk optimisation @@ -18990,7 +18987,7 @@ index 94ca0407303c4493ab4928b12ec6ecc75aaca549..a138e1b6b66d99f2035de054137a607a + // Purpur end - OfflinePlayer API } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ac8af406180bc680d46e8edc3da0fc2e5211345a..81922bf93f8a96e6cf05944ca98a82cc5945a6c6 100644 +index 97b5d6ba2b19a7c730730c74175a29157aed1840..d74591cd30b19f0d5cbfdb81e0607ccd4bdd91d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -426,6 +426,20 @@ public final class CraftServer implements Server { @@ -19142,10 +19139,10 @@ index ac8af406180bc680d46e8edc3da0fc2e5211345a..81922bf93f8a96e6cf05944ca98a82cc + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 57da11c0da7322e74810e7108e9c8000b0c36520..907fe00ab752ad124020755f211567af771b9d70 100644 +index 92d9f0ea8f7810ae20d3996f49aefa539b4bcb69..eb9bb689a52a7e9c95d6f2e07bb16799286e9057 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2384,6 +2384,48 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2374,6 +2374,48 @@ public class CraftWorld extends CraftRegionAccessor implements World { return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight()); } @@ -19195,7 +19192,7 @@ index 57da11c0da7322e74810e7108e9c8000b0c36520..907fe00ab752ad124020755f211567af public Collection getStructures(int x, int z) { return this.getStructures(x, z, struct -> true); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index be0d38544395a9b3befb898bb961f34e32fe9509..430407b0cf06ba337c59cd576c7e40a8e5fe8229 100644 +index 1c2439ffc1e407ff69286817d22f127470ce07ba..c471a8c81ba067abcb22956ad1a30b5a9b64fc87 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -176,6 +176,20 @@ public class Main { @@ -19373,7 +19370,7 @@ index d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8..985e9ec21c60a1f47973bd5fc53b96a6 // Paper start @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index ddabaed899c755925ad8618b78c33dacaf2126ac..51aee9a468f4ebfa9672fd9ce84883cf080859e3 100644 +index b25b10c24a379097233e61bcc10add841b6a7115..1290c1587fe9e39d9350c1079ab27f3be0c6084f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -87,6 +87,23 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -19527,7 +19524,7 @@ index 30d62ee4d5cd2ddacb8783b5bbbf475d592b3e02..5c1cda88080850314dac196dbe71ff12 + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index d0c409f4efad289e3e325f44b500fc72589d89d4..051ffc663317fe5a4fafe0750c89fafdece4d316 100644 +index 4f98d138a275a6c34528b7a5148ef265bc38d6b5..72498e233ece886941cca268e729336d66042402 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -523,7 +523,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -19578,10 +19575,10 @@ index 351f42842b780d053cd2e5bad9ae299449141b10..4860574e7fad7a9527dda599703c573c + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d4e497961578bb693275cdf95915b60b2cc76eb7..63065a22ff359c142bab23fccacfd5ebd86f81a5 100644 +index 6a647cab8b2e476987931486e290703b8726f2c7..029d6daa003f90999afa4e5070eabf6e0ada473a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -583,10 +583,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -584,10 +584,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setPlayerListName(String name) { @@ -19598,7 +19595,7 @@ index d4e497961578bb693275cdf95915b60b2cc76eb7..63065a22ff359c142bab23fccacfd5eb if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined for (ServerPlayer player : (List) this.server.getHandle().players) { if (player.getBukkitEntity().canSee(this)) { -@@ -1435,6 +1440,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1444,6 +1449,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper start - Teleport passenger API // Don't allow teleporting between worlds while keeping passengers if (ignorePassengers && entity.isVehicle() && location.getWorld() != this.getWorld()) { @@ -19606,7 +19603,7 @@ index d4e497961578bb693275cdf95915b60b2cc76eb7..63065a22ff359c142bab23fccacfd5eb return false; } -@@ -1456,6 +1462,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1465,6 +1471,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } if (entity.isVehicle() && !ignorePassengers) { // Paper - Teleport API @@ -19614,7 +19611,7 @@ index d4e497961578bb693275cdf95915b60b2cc76eb7..63065a22ff359c142bab23fccacfd5eb return false; } -@@ -2769,6 +2776,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2763,6 +2770,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().getAbilities().walkingSpeed * 2f; } @@ -19643,7 +19640,7 @@ index d4e497961578bb693275cdf95915b60b2cc76eb7..63065a22ff359c142bab23fccacfd5eb private void validateSpeed(float value) { Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value); } -@@ -3580,4 +3609,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3565,4 +3594,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundEntityEventPacket(((CraftEntity) target).getHandle(), effect.getData())); } // Paper end - entity effect API @@ -20218,10 +20215,10 @@ index 78975412da0f0c2b802bfce6d30d56b26d8023e2..4ec6a07796023aab2f8f84f131f48108 + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java -index 3592091c6d1371224e82e1f95b003951ad2f8779..4fdc78a9c74b42a8894030221e0452493d68020e 100644 +index 4864e2016cb1d377425297fd1c52b383632cb59e..fc0e93a936dadb0dca758207297f92a22f3955d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java -@@ -38,6 +38,7 @@ public interface CraftRecipe extends Recipe { +@@ -36,6 +36,7 @@ public interface CraftRecipe extends Recipe { stack = Ingredient.of(((RecipeChoice.MaterialChoice) bukkit).getChoices().stream().map((mat) -> CraftItemType.bukkitToMinecraft(mat))); } else if (bukkit instanceof RecipeChoice.ExactChoice) { stack = Ingredient.ofStacks(((RecipeChoice.ExactChoice) bukkit).getChoices().stream().map((mat) -> CraftItemStack.asNMSCopy(mat)).toList()); @@ -20350,7 +20347,7 @@ index 1354ccfbf525e5e64483ac5f443cc2325ba63850..5e7b833fc9f37bc370c76e5c43e6c991 // (async tasks must live with race-conditions if they attempt to cancel between these few lines of code) } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 507f908916cbeb592496f963b46e4c2121a7b5e3..86ba02ba848ee20a2e2b52baab8986dd5a013f98 100644 +index 15892c7769caa15f3d52a1ee2147cf9615aa0e25..8979956334ad5802d221e45eba91248e7f048d13 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -505,7 +505,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -20398,7 +20395,7 @@ index b3169c551b8410f5861f9db0543c785439ecba7c..916ca3f1f39e10158fc7c10141785fff DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "seed", "Allows the user to view the seed of the world", PermissionDefault.OP, commands); diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..95cd1156766895546ef5574b33a60806bff08fa2 +index 0000000000000000000000000000000000000000..7690441b5059ae6c7ca8519875ea8a515c5c5e93 --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -0,0 +1,606 @@ @@ -20482,8 +20479,8 @@ index 0000000000000000000000000000000000000000..95cd1156766895546ef5574b33a60806 + commands = new HashMap<>(); + commands.put("purpur", new PurpurCommand("purpur")); + -+ version = getInt("config-version", 37); -+ set("config-version", 37); ++ version = getInt("config-version", 38); ++ set("config-version", 38); + + readConfig(PurpurConfig.class, null); + @@ -21010,10 +21007,10 @@ index 0000000000000000000000000000000000000000..95cd1156766895546ef5574b33a60806 +} diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..57ddb4e6a464567cc67e09ce06218cc25af4ddf9 +index 0000000000000000000000000000000000000000..0d5a0e14cbaacc63eeced78a6c28cc64ad918522 --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -0,0 +1,3438 @@ +@@ -0,0 +1,3447 @@ +package org.purpurmc.purpur; + +import net.minecraft.core.registries.BuiltInRegistries; @@ -21253,6 +21250,7 @@ index 0000000000000000000000000000000000000000..57ddb4e6a464567cc67e09ce06218cc2 + public List itemImmuneToFire = new ArrayList<>(); + public List itemImmuneToLightning = new ArrayList<>(); + public boolean dontRunWithScissors = false; ++ public ResourceLocation dontRunWithScissorsItemModelReference = ResourceLocation.parse("purpurmc:scissors"); + public boolean ignoreScissorsInWater = false; + public boolean ignoreScissorsInLava = false; + public double scissorsRunningDamage = 1D; @@ -21304,6 +21302,7 @@ index 0000000000000000000000000000000000000000..57ddb4e6a464567cc67e09ce06218cc2 + if (item != Items.AIR) itemImmuneToLightning.add(item); + }); + dontRunWithScissors = getBoolean("gameplay-mechanics.item.shears.damage-if-sprinting", dontRunWithScissors); ++ dontRunWithScissorsItemModelReference = ResourceLocation.parse(getString("gameplay-mechanics.item.shears.damage-if-sprinting-item-model", "purpurmc:scissors")); + ignoreScissorsInWater = getBoolean("gameplay-mechanics.item.shears.ignore-in-water", ignoreScissorsInWater); + ignoreScissorsInLava = getBoolean("gameplay-mechanics.item.shears.ignore-in-lava", ignoreScissorsInLava); + scissorsRunningDamage = getDouble("gameplay-mechanics.item.shears.sprinting-damage", scissorsRunningDamage); @@ -21625,28 +21624,35 @@ index 0000000000000000000000000000000000000000..57ddb4e6a464567cc67e09ce06218cc2 + PurpurConfig.config.set("world-settings.default.tools.axe.weatherables.minecraft:weathered_copper_bulb", Map.of("into", "minecraft:exposed_copper_bulb", "drops", new HashMap())); + PurpurConfig.config.set("world-settings.default.tools.axe.weatherables.minecraft:oxidized_copper_bulb", Map.of("into", "minecraft:weathered_copper_bulb", "drops", new HashMap())); + } ++ if (PurpurConfig.version < 38) { ++ PurpurConfig.config.set("world-settings.default.tools.axe.strippables.minecraft:pale_oak_wood", Map.of("into", "minecraft:stripped_pale_oak_wood", "drops", new HashMap())); ++ PurpurConfig.config.set("world-settings.default.tools.axe.strippables.minecraft:pale_oak_log", Map.of("into", "minecraft:stripped_pale_oak_log", "drops", new HashMap())); ++ } + getMap("tools.axe.strippables", Map.ofEntries( + Map.entry("minecraft:oak_wood", Map.of("into", "minecraft:stripped_oak_wood", "drops", new HashMap())), + Map.entry("minecraft:oak_log", Map.of("into", "minecraft:stripped_oak_log", "drops", new HashMap())), + Map.entry("minecraft:dark_oak_wood", Map.of("into", "minecraft:stripped_dark_oak_wood", "drops", new HashMap())), + Map.entry("minecraft:dark_oak_log", Map.of("into", "minecraft:stripped_dark_oak_log", "drops", new HashMap())), ++ Map.entry("minecraft:pale_oak_wood", Map.of("into", "minecraft:stripped_pale_oak_wood", "drops", new HashMap())), ++ Map.entry("minecraft:pale_oak_log", Map.of("into", "minecraft:stripped_pale_oak_log", "drops", new HashMap())), + Map.entry("minecraft:acacia_wood", Map.of("into", "minecraft:stripped_acacia_wood", "drops", new HashMap())), + Map.entry("minecraft:acacia_log", Map.of("into", "minecraft:stripped_acacia_log", "drops", new HashMap())), ++ Map.entry("minecraft:cherry_wood", Map.of("into", "minecraft:stripped_cherry_wood", "drops", new HashMap())), ++ Map.entry("minecraft:cherry_log", Map.of("into", "minecraft:stripped_cherry_log", "drops", new HashMap())), + Map.entry("minecraft:birch_wood", Map.of("into", "minecraft:stripped_birch_wood", "drops", new HashMap())), + Map.entry("minecraft:birch_log", Map.of("into", "minecraft:stripped_birch_log", "drops", new HashMap())), + Map.entry("minecraft:jungle_wood", Map.of("into", "minecraft:stripped_jungle_wood", "drops", new HashMap())), + Map.entry("minecraft:jungle_log", Map.of("into", "minecraft:stripped_jungle_log", "drops", new HashMap())), + Map.entry("minecraft:spruce_wood", Map.of("into", "minecraft:stripped_spruce_wood", "drops", new HashMap())), + Map.entry("minecraft:spruce_log", Map.of("into", "minecraft:stripped_spruce_log", "drops", new HashMap())), -+ Map.entry("minecraft:mangrove_wood", Map.of("into", "minecraft:stripped_mangrove_wood", "drops", new HashMap())), -+ Map.entry("minecraft:mangrove_log", Map.of("into", "minecraft:stripped_mangrove_log", "drops", new HashMap())), -+ Map.entry("minecraft:cherry_log", Map.of("into", "minecraft:stripped_cherry_log", "drops", new HashMap())), -+ Map.entry("minecraft:cherry_wood", Map.of("into", "minecraft:stripped_cherry_wood", "drops", new HashMap())), -+ Map.entry("minecraft:bamboo_block", Map.of("into", "minecraft:stripped_bamboo_block", "drops", new HashMap())), + Map.entry("minecraft:warped_stem", Map.of("into", "minecraft:stripped_warped_stem", "drops", new HashMap())), + Map.entry("minecraft:warped_hyphae", Map.of("into", "minecraft:stripped_warped_hyphae", "drops", new HashMap())), + Map.entry("minecraft:crimson_stem", Map.of("into", "minecraft:stripped_crimson_stem", "drops", new HashMap())), -+ Map.entry("minecraft:crimson_hyphae", Map.of("into", "minecraft:stripped_crimson_hyphae", "drops", new HashMap()))) ++ Map.entry("minecraft:crimson_hyphae", Map.of("into", "minecraft:stripped_crimson_hyphae", "drops", new HashMap())), ++ Map.entry("minecraft:mangrove_wood", Map.of("into", "minecraft:stripped_mangrove_wood", "drops", new HashMap())), ++ Map.entry("minecraft:mangrove_log", Map.of("into", "minecraft:stripped_mangrove_log", "drops", new HashMap())), ++ Map.entry("minecraft:bamboo_block", Map.of("into", "minecraft:stripped_bamboo_block", "drops", new HashMap())) ++ ) + ).forEach((blockId, obj) -> { + Block block = BuiltInRegistries.BLOCK.getValue(ResourceLocation.parse(blockId)); + if (block == Blocks.AIR) { PurpurConfig.log(Level.SEVERE, "Invalid block for `tools.axe.strippables`: " + blockId); return; } @@ -24950,14 +24956,16 @@ index 0000000000000000000000000000000000000000..a04d23bd98075cd65a24d4de8d18281d +} diff --git a/src/main/java/org/purpurmc/purpur/controller/FlyingMoveControllerWASD.java b/src/main/java/org/purpurmc/purpur/controller/FlyingMoveControllerWASD.java new file mode 100644 -index 0000000000000000000000000000000000000000..ed494e0ad278813a0eb261101447b84cca3ad7aa +index 0000000000000000000000000000000000000000..940bcc6f79b59cb3cce578912eb789efd394f456 --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/controller/FlyingMoveControllerWASD.java -@@ -0,0 +1,71 @@ +@@ -0,0 +1,74 @@ +package org.purpurmc.purpur.controller; + ++import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.Mob; +import net.minecraft.world.entity.ai.attributes.Attributes; ++import net.minecraft.world.entity.player.Input; +import net.minecraft.world.entity.player.Player; + +public class FlyingMoveControllerWASD extends MoveControllerWASD { @@ -24987,11 +24995,12 @@ index 0000000000000000000000000000000000000000..ed494e0ad278813a0eb261101447b84c + + @Override + public void purpurTick(Player rider) { -+ float forward = Math.max(0.0F, rider.getForwardMot()); ++ Input lastClientInput = ((ServerPlayer) rider).getLastClientInput(); ++ float forward = lastClientInput.forward() == lastClientInput.backward() ? 0.0F : lastClientInput.forward() ? 1.0F : 0.0F; + float vertical = forward == 0.0F ? 0.0F : -(rider.xRotO / 45.0F); -+ float strafe = rider.getStrafeMot(); ++ float strafe = (lastClientInput.left() == lastClientInput.right() ? 0.0F : lastClientInput.left() ? 1.0F : -1.0F); + -+ if (rider.jumping && spacebarEvent(entity)) { ++ if (lastClientInput.jump() && spacebarEvent(entity)) { + entity.onSpacebar(); + } + @@ -25027,14 +25036,16 @@ index 0000000000000000000000000000000000000000..ed494e0ad278813a0eb261101447b84c +} diff --git a/src/main/java/org/purpurmc/purpur/controller/FlyingWithSpacebarMoveControllerWASD.java b/src/main/java/org/purpurmc/purpur/controller/FlyingWithSpacebarMoveControllerWASD.java new file mode 100644 -index 0000000000000000000000000000000000000000..9383c07fa53141127106a1f289366a040960d52e +index 0000000000000000000000000000000000000000..e0bbaec05afa0ae67ed486b14ea1fbadbbe90d9b --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/controller/FlyingWithSpacebarMoveControllerWASD.java -@@ -0,0 +1,63 @@ +@@ -0,0 +1,66 @@ +package org.purpurmc.purpur.controller; + ++import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.Mob; +import net.minecraft.world.entity.ai.attributes.Attributes; ++import net.minecraft.world.entity.player.Input; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.phys.Vec3; + @@ -25049,8 +25060,9 @@ index 0000000000000000000000000000000000000000..9383c07fa53141127106a1f289366a04 + + @Override + public void purpurTick(Player rider) { -+ float forward = rider.getForwardMot(); -+ float strafe = rider.getStrafeMot() * 0.5F; ++ Input lastClientInput = ((ServerPlayer) rider).getLastClientInput(); ++ float forward = (lastClientInput.forward() == lastClientInput.backward() ? 0.0F : lastClientInput.forward() ? 1.0F : -1.0F); ++ float strafe = (lastClientInput.left() == lastClientInput.right() ? 0.0F : lastClientInput.left() ? 1.0F : -1.0F) * 0.5F; + float vertical = 0; + + if (forward < 0.0F) { @@ -25064,7 +25076,7 @@ index 0000000000000000000000000000000000000000..9383c07fa53141127106a1f289366a04 + speed *= groundSpeedModifier; + } + -+ if (rider.jumping && spacebarEvent(entity) && !entity.onSpacebar()) { ++ if (lastClientInput.jump() && spacebarEvent(entity) && !entity.onSpacebar()) { + entity.setNoGravity(true); + vertical = 1.0F; + } else { @@ -25181,7 +25193,7 @@ index 0000000000000000000000000000000000000000..dd219518150ca90f89ad238904fd4095 +} diff --git a/src/main/java/org/purpurmc/purpur/controller/MoveControllerWASD.java b/src/main/java/org/purpurmc/purpur/controller/MoveControllerWASD.java new file mode 100644 -index 0000000000000000000000000000000000000000..ad85c1ff6cd5d5ce2262bdb367ce9c8a5b707170 +index 0000000000000000000000000000000000000000..34f3c43fa16e950326ac5e3d93faee0466ffedc6 --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/controller/MoveControllerWASD.java @@ -0,0 +1,92 @@ @@ -25256,7 +25268,7 @@ index 0000000000000000000000000000000000000000..ad85c1ff6cd5d5ce2262bdb367ce9c8a + + ((LookControllerWASD) entity.getLookControl()).setOffsets(yawOffset, 0); + -+ if (rider.jumping && spacebarEvent(entity) && !entity.onSpacebar() && entity.onGround) { ++ if (lastClientInput.jump() && spacebarEvent(entity) && !entity.onSpacebar() && entity.onGround) { + entity.jumpFromGround(); + } + @@ -25279,14 +25291,16 @@ index 0000000000000000000000000000000000000000..ad85c1ff6cd5d5ce2262bdb367ce9c8a +} diff --git a/src/main/java/org/purpurmc/purpur/controller/WaterMoveControllerWASD.java b/src/main/java/org/purpurmc/purpur/controller/WaterMoveControllerWASD.java new file mode 100644 -index 0000000000000000000000000000000000000000..ba2a37dad43e238e54632975abea8ee6fafaa9e0 +index 0000000000000000000000000000000000000000..922e48799c43ca322a8f550c98a26e1e2959439c --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/controller/WaterMoveControllerWASD.java -@@ -0,0 +1,50 @@ +@@ -0,0 +1,53 @@ +package org.purpurmc.purpur.controller; + ++import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.Mob; +import net.minecraft.world.entity.ai.attributes.Attributes; ++import net.minecraft.world.entity.player.Input; +import net.minecraft.world.entity.player.Player; + +public class WaterMoveControllerWASD extends MoveControllerWASD { @@ -25303,8 +25317,9 @@ index 0000000000000000000000000000000000000000..ba2a37dad43e238e54632975abea8ee6 + + @Override + public void purpurTick(Player rider) { -+ float forward = rider.getForwardMot(); -+ float strafe = rider.getStrafeMot() * 0.5F; // strafe slower by default ++ Input lastClientInput = ((ServerPlayer) rider).getLastClientInput(); ++ float forward = (lastClientInput.forward() == lastClientInput.backward() ? 0.0F : lastClientInput.forward() ? 1.0F : -1.0F); ++ float strafe = (lastClientInput.left() == lastClientInput.right() ? 0.0F : lastClientInput.left() ? 1.0F : -1.0F) * 0.5F; // strafe slower by default + float vertical = -(rider.xRotO / 90); + + if (forward == 0.0F) { @@ -25335,10 +25350,10 @@ index 0000000000000000000000000000000000000000..ba2a37dad43e238e54632975abea8ee6 +} diff --git a/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java b/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java new file mode 100644 -index 0000000000000000000000000000000000000000..f25abee6dbf99c8d08f8e09db02b41df86115faa +index 0000000000000000000000000000000000000000..1c7e38067b79869669a674dc949e9547b93bd49f --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java -@@ -0,0 +1,107 @@ +@@ -0,0 +1,108 @@ +package org.purpurmc.purpur.entity; + +import net.minecraft.core.particles.ParticleTypes; @@ -25400,11 +25415,12 @@ index 0000000000000000000000000000000000000000..f25abee6dbf99c8d08f8e09db02b41df + + Vec3 motDouble = mot.scale(2.0); + for (int i = 0; i < 5; i++) { -+ ((ServerLevel) level()).sendParticles(null, ParticleTypes.BUBBLE, ++ ((ServerLevel) level()).sendParticlesSource(null, ParticleTypes.BUBBLE, ++ false, true, + getX() + random.nextFloat() / 2 - 0.25F, + getY() + random.nextFloat() / 2 - 0.25F, + getZ() + random.nextFloat() / 2 - 0.25F, -+ 0, motDouble.x(), motDouble.y(), motDouble.z(), 0.1D, true); ++ 0, motDouble.x(), motDouble.y(), motDouble.z(), 0.1D); + } + + if (++ticksLived > 20) { @@ -25448,10 +25464,10 @@ index 0000000000000000000000000000000000000000..f25abee6dbf99c8d08f8e09db02b41df +} diff --git a/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java b/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java new file mode 100644 -index 0000000000000000000000000000000000000000..58957b0bd3cd2c37fd4a6766a02e2506d9f51010 +index 0000000000000000000000000000000000000000..19c2d5240eb47d8b4e819c75dc378f2fa2697b0d --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java -@@ -0,0 +1,129 @@ +@@ -0,0 +1,130 @@ +package org.purpurmc.purpur.entity; + +import net.minecraft.core.particles.ParticleTypes; @@ -25515,11 +25531,12 @@ index 0000000000000000000000000000000000000000..58957b0bd3cd2c37fd4a6766a02e2506 + + Vec3 motDouble = mot.scale(2.0); + for (int i = 0; i < 5; i++) { -+ ((ServerLevel) level()).sendParticles(null, ParticleTypes.FLAME, ++ ((ServerLevel) level()).sendParticlesSource(null, ParticleTypes.FLAME, ++ false, true, + getX() + random.nextFloat() / 2 - 0.25F, + getY() + random.nextFloat() / 2 - 0.25F, + getZ() + random.nextFloat() / 2 - 0.25F, -+ 0, motDouble.x(), motDouble.y(), motDouble.z(), 0.1D, true); ++ 0, motDouble.x(), motDouble.y(), motDouble.z(), 0.1D); + } + + if (++ticksLived > 20) { diff --git a/patches/server/0003-Minor-code-optimizations.patch b/patches/server/0003-Minor-code-optimizations.patch index 9ab49dd19..7323d5d67 100644 --- a/patches/server/0003-Minor-code-optimizations.patch +++ b/patches/server/0003-Minor-code-optimizations.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Minor code optimizations diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 34e8eb828be517d9ee3973597c74c5cac3d75c99..f8575f94a389d87d8043ae838720dbe2247235c4 100644 +index 1a808fc381c0c3ea1fc49bbffebddf2c550e817a..55f15f26b56b97a561054b0660ba4965bb008b36 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1697,7 +1697,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1698,7 +1698,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @Override public List getEntities(@Nullable Entity except, AABB box, Predicate predicate) { Profiler.get().incrementCounter("getEntities"); diff --git a/patches/server/0004-Build-System-Changes.patch b/patches/server/0004-Build-System-Changes.patch index 0522c48b8..f30ddcbb0 100644 --- a/patches/server/0004-Build-System-Changes.patch +++ b/patches/server/0004-Build-System-Changes.patch @@ -5,13 +5,15 @@ Subject: [PATCH] Build System Changes diff --git a/build.gradle.kts b/build.gradle.kts -index 77602e4445b1b45a17e5552ac6a769e0ed46ebc7..f021047331c7eb3dac7f0d56af73a9056ffe826b 100644 +index 74d7aaae57e0e9ea9e31c4b2189ba50a0ac83bea..20abf704decfad4dc1744b6515f540d0f871fcb7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -26,71 +26,34 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { +@@ -25,73 +25,35 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { + // Paper end - configure mockito agent that is needed in newer java versions dependencies { - implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur +- implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur +- implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency - // Paper start - implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ - implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21 @@ -29,11 +31,11 @@ index 77602e4445b1b45a17e5552ac6a769e0ed46ebc7..f021047331c7eb3dac7f0d56af73a905 - alsoShade(log4jPlugins.output) - implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol - // Paper end -- implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion +- implementation("org.apache.logging.log4j:log4j-iostreams:2.24.1") // Paper - remove exclusion - implementation("org.ow2.asm:asm-commons:9.7.1") - 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.46.1.3") +- runtimeOnly("org.xerial:sqlite-jdbc:3.47.0.0") - runtimeOnly("com.mysql:mysql-connector-j:9.1.0") - runtimeOnly("com.lmax:disruptor:3.4.4") // Paper - // Paper start - Use Velocity cipher @@ -77,6 +79,7 @@ index 77602e4445b1b45a17e5552ac6a769e0ed46ebc7..f021047331c7eb3dac7f0d56af73a905 - implementation("me.lucko:spark-api:0.1-20240720.200737-2") - implementation("me.lucko:spark-paper:1.10.119-SNAPSHOT") - // Paper end - spark ++ implementation(project(":${rootProject.providers.gradleProperty("brandName").get().lowercase()}-api")) // Pufferfish // Paper // Purpur // Plazma - Fork-friendly Rebranding + // Plazma start - Use Gradle Version Catalogs + implementation(server.bundles.implementation) + implementation(common.adventure.serializer.ansi) @@ -108,7 +111,7 @@ index 77602e4445b1b45a17e5552ac6a769e0ed46ebc7..f021047331c7eb3dac7f0d56af73a905 } paperweight { -@@ -118,14 +81,14 @@ tasks.jar { +@@ -119,14 +81,14 @@ tasks.jar { val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", diff --git a/patches/server/0005-Fork-friendly-Rebranding.patch b/patches/server/0005-Fork-friendly-Rebranding.patch index 5494caf8c..5c33d65ab 100644 --- a/patches/server/0005-Fork-friendly-Rebranding.patch +++ b/patches/server/0005-Fork-friendly-Rebranding.patch @@ -4,24 +4,11 @@ Date: Wed, 21 Dec 2022 19:31:24 +0900 Subject: [PATCH] Fork-friendly Rebranding -diff --git a/build.gradle.kts b/build.gradle.kts -index f021047331c7eb3dac7f0d56af73a9056ffe826b..41005f58fdd526907972185e728bbe1fa97171e9 100644 ---- a/build.gradle.kts -+++ b/build.gradle.kts -@@ -25,7 +25,7 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { - // Paper end - configure mockito agent that is needed in newer java versions - - dependencies { -- implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur -+ implementation(project(":plazma-api")) // Pufferfish // Paper // Purpur // Plazma - // Plazma start - Use Gradle Version Catalogs - implementation(server.bundles.implementation) - implementation(common.adventure.serializer.ansi) diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..8d5a52c5762c3d9b44dcdf00ae312e0bdc01fa1f 100644 +index 4a8f95670e25c81952cccbaf4c6e49514cacd529..63c9f3b6ea3e3deae1e7a5d6b317b3aa179e1dc5 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java -@@ -593,7 +593,7 @@ public class Metrics { +@@ -592,7 +592,7 @@ public class Metrics { boolean logFailedRequests = config.getBoolean("logFailedRequests", false); // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { @@ -209,10 +196,10 @@ index 710477ae27ebc5afdf0012ef0867d05efd293c24..3a5e7546c5cc1fcec880cece3f0d0b04 public String getTitle() { diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index ecaec3c7b5768771b00c4c33d48a76ba22653a79..8f77566bef4b992013e3b65068cabe7ee1921951 100644 +index a880f4e5cf712654649ad043e58e073e9a87c0fe..c3bce9206aee05b18ddd8b2788f892a972146737 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -108,6 +108,11 @@ public class Main { +@@ -110,6 +110,11 @@ public class Main { */ // CraftBukkit end try { @@ -225,10 +212,10 @@ index ecaec3c7b5768771b00c4c33d48a76ba22653a79..8f77566bef4b992013e3b65068cabe7e Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 23505b0f80d643d9ef569b49192f44e0373dfb5f..20f79bcd7613e426b6b1020f586773819f1ac9d0 100644 +index 95f1e0ae174400f2cf7bfed2897259d5aa2cfcb5..b0bc896f004e915b291091937a2a566477df1e43 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1280,7 +1280,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping public boolean lagging = false; // Purpur - protected boolean upnp = false; // Purpur -@@ -515,6 +516,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop WorldDataServer public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { @@ -656,10 +656,10 @@ index 6a359f1ed07aa7b9c78e470fb00661ea03eaec03..a4421517b8136bb974e197eaa6dd0d83 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 f8575f94a389d87d8043ae838720dbe2247235c4..0da2014933fe441c4d3dc27c5fe10afa92ca1ec7 100644 +index 55f15f26b56b97a561054b0660ba4965bb008b36..abdd3fcf266752d3bcad56cc5cd35ba8d3356a85 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -172,7 +172,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -173,7 +173,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl return this.paperConfig; } // Paper end - add paper world config @@ -673,7 +673,7 @@ index f8575f94a389d87d8043ae838720dbe2247235c4..0da2014933fe441c4d3dc27c5fe10afa public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur public static BlockPos lastPhysicsProblem; // Spigot -@@ -874,7 +879,24 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -875,7 +880,24 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl } // Paper end - optimise random ticking @@ -699,7 +699,7 @@ index f8575f94a389d87d8043ae838720dbe2247235c4..0da2014933fe441c4d3dc27c5fe10afa // Paper start - getblock optimisations - cache world height/sections final DimensionType dimType = holder.value(); this.minY = dimType.minY(); -@@ -886,6 +908,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -887,6 +909,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl // Paper end - getblock optimisations - cache world height/sections this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config @@ -708,7 +708,7 @@ index f8575f94a389d87d8043ae838720dbe2247235c4..0da2014933fe441c4d3dc27c5fe10afa this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur this.generator = gen; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 81922bf93f8a96e6cf05944ca98a82cc5945a6c6..655463a7d588ed88778d137b6fe5ac18951ff172 100644 +index d74591cd30b19f0d5cbfdb81e0607ccd4bdd91d4..9f9ad30fc3b80b5865669d44057cc658172c574a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1100,6 +1100,7 @@ public final class CraftServer implements Server { @@ -734,7 +734,7 @@ index 81922bf93f8a96e6cf05944ca98a82cc5945a6c6..655463a7d588ed88778d137b6fe5ac18 public void restart() { org.spigotmc.RestartCommand.restart(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 75a062e1105c2f7cc631a6b8b201b0e08621e3c5..b75e2a9273e9562a3d07f68af927ad085c428589 100644 +index 74c0859f6dc3d885f16c6dcc32c9c3fc5d3defcb..ba002bf801ec34f88671031fe916e0dddf86a437 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -197,6 +197,14 @@ public class Main { diff --git a/patches/server/0009-Warn-on-startup.patch b/patches/server/0009-Warn-on-startup.patch index 1a70dab4d..557e8bc94 100644 --- a/patches/server/0009-Warn-on-startup.patch +++ b/patches/server/0009-Warn-on-startup.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Warn on startup diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 8f77566bef4b992013e3b65068cabe7ee1921951..65fd553887ed9eb9c26e036c8009179a7baf5380 100644 +index c3bce9206aee05b18ddd8b2788f892a972146737..fc378b08c10c7f670be93d52937c7642b986ed0d 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -113,6 +113,18 @@ public class Main { +@@ -115,6 +115,18 @@ public class Main { if (io.papermc.paper.ServerBrandConstants.ASCII_LOGO != null) System.out.println(io.papermc.paper.ServerBrandConstants.ASCII_LOGO); // Plazma end - Fork-friendly Rebranding diff --git a/patches/server/0010-Always-agree-EULA-on-development-mode.patch b/patches/server/0010-Always-agree-EULA-on-development-mode.patch index e6368f509..17ff79e17 100644 --- a/patches/server/0010-Always-agree-EULA-on-development-mode.patch +++ b/patches/server/0010-Always-agree-EULA-on-development-mode.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Always agree EULA on development mode diff --git a/build.gradle.kts b/build.gradle.kts -index 41005f58fdd526907972185e728bbe1fa97171e9..746ad8087192931400256c8a1ef71e966eaf6b1a 100644 +index 20abf704decfad4dc1744b6515f540d0f871fcb7..5040a01c391b0276e28bd8b27280d5d61099e8f1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -164,7 +164,7 @@ fun TaskContainer.registerRunTask( @@ -18,10 +18,10 @@ index 41005f58fdd526907972185e728bbe1fa97171e9..746ad8087192931400256c8a1ef71e96 if (rootProject.childProjects["test-plugin"] != null) { val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile } diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 65fd553887ed9eb9c26e036c8009179a7baf5380..694b126df2c3d1d6fa40ee9731c28886caf1a4fc 100644 +index fc378b08c10c7f670be93d52937c7642b986ed0d..05e760162ebbf3475129001b4e9de951e0e142d4 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -179,6 +179,7 @@ public class Main { +@@ -181,6 +181,7 @@ public class Main { // Spigot Start boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" ); diff --git a/patches/server/0011-Add-more-metrics.patch b/patches/server/0011-Add-more-metrics.patch index 9c52df6b8..c6a909deb 100644 --- a/patches/server/0011-Add-more-metrics.patch +++ b/patches/server/0011-Add-more-metrics.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add more metrics diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 8d5a52c5762c3d9b44dcdf00ae312e0bdc01fa1f..48d33d4131af90eee35c9553898a2ac7ec5e2b7e 100644 +index 63c9f3b6ea3e3deae1e7a5d6b317b3aa179e1dc5..1693d010148b99cbafa22433d5fb396324c1bf2f 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java -@@ -636,38 +636,59 @@ public class Metrics { +@@ -635,38 +635,59 @@ public class Metrics { return map; })); diff --git a/patches/server/0012-Optimize-default-configurations.patch b/patches/server/0012-Optimize-default-configurations.patch index 431da41f0..791433ad1 100644 --- a/patches/server/0012-Optimize-default-configurations.patch +++ b/patches/server/0012-Optimize-default-configurations.patch @@ -46,10 +46,10 @@ index 411c81a88b8a008b2aaf0ca62fb7ffa1dd9e32a4..53dc2e3c22c5cb038b9a283112f265d3 "will get their pathfinders and behaviors ticked. 20 = 1s"); activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8, diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -index 17e23ca4dd2bbfba49ea00aa2b719a95feb931be..a8e75eaadfcc6c8b2503776d7de197f756712819 100644 +index 088b8fe5d144807f4da1e85b2fa34dfd21286f8c..8c3c7987a269733a0f530e8f22c3f1a005de21ac 100644 --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -@@ -147,7 +147,7 @@ public class GlobalConfiguration extends ConfigurationPart { +@@ -148,7 +148,7 @@ public class GlobalConfiguration extends ConfigurationPart { public class Watchdog extends ConfigurationPart { public int earlyWarningEvery = 5000; @@ -58,7 +58,7 @@ index 17e23ca4dd2bbfba49ea00aa2b719a95feb931be..a8e75eaadfcc6c8b2503776d7de197f7 } public SpamLimiter spamLimiter; -@@ -187,7 +187,7 @@ public class GlobalConfiguration extends ConfigurationPart { +@@ -188,7 +188,7 @@ public class GlobalConfiguration extends ConfigurationPart { public Commands commands; public class Commands extends ConfigurationPart { @@ -307,10 +307,10 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357 } diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 694b126df2c3d1d6fa40ee9731c28886caf1a4fc..822ecda5f4dc6cc8cd0cc4da577f27cdcc5c4967 100644 +index 05e760162ebbf3475129001b4e9de951e0e142d4..363ef48b096281132cea61aff405a50d7b51c4d4 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -164,7 +164,7 @@ public class Main { +@@ -166,7 +166,7 @@ public class Main { File configFile = (File) optionset.valueOf("bukkit-settings"); YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile); configuration.options().copyDefaults(true); @@ -352,7 +352,7 @@ index 8f7e922ceca286b1a590181c301fbe9bff55c024..3dd5c7441bb300ca17d717af37edbefb this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false); this.enableStatus = this.get("enable-status", true); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 655463a7d588ed88778d137b6fe5ac18951ff172..cc4762c13e21600b4c5e287a6fae9e6e472080b3 100644 +index 9f9ad30fc3b80b5865669d44057cc658172c574a..889d66fc4af69a1ecbf1ddd218f45e23e762d956 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -449,7 +449,7 @@ public final class CraftServer implements Server { @@ -396,7 +396,7 @@ index 09053b4ccf268fd204c81dbb8d4f10fa9edcad5f..93f67f125b3674e645cfdae27e579e12 #### ENGLISH #### This is the %s configuration file for Plazma. diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index 95cd1156766895546ef5574b33a60806bff08fa2..097f3c34d244b89e7dd9f8b6f2a3d8fdc67b36dc 100644 +index 7690441b5059ae6c7ca8519875ea8a515c5c5e93..f29059798c9dc642187b4939dd917ee15cbe120d 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -244,7 +244,7 @@ public class PurpurConfig { @@ -418,10 +418,10 @@ index 95cd1156766895546ef5574b33a60806bff08fa2..097f3c34d244b89e7dd9f8b6f2a3d8fd private static void networkSettings() { useUPnP = getBoolean("settings.network.upnp-port-forwarding", useUPnP); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 57ddb4e6a464567cc67e09ce06218cc25af4ddf9..e55993e318b7f7292e22c4539bc2fd1447f67fa8 100644 +index 0d5a0e14cbaacc63eeced78a6c28cc64ad918522..43ad38dadfe14b3dd0565c536b276eb3f9dbd813 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -424,7 +424,7 @@ public class PurpurWorldConfig { +@@ -426,7 +426,7 @@ public class PurpurWorldConfig { public boolean idleTimeoutTargetPlayer = true; public String playerDeathExpDropEquation = "expLevel * 7"; public int playerDeathExpDropMax = 100; @@ -430,7 +430,7 @@ index 57ddb4e6a464567cc67e09ce06218cc25af4ddf9..e55993e318b7f7292e22c4539bc2fd14 public boolean teleportOnNetherCeilingDamage = false; public boolean totemOfUndyingWorksInInventory = false; public boolean playerFixStuckPortal = false; -@@ -3262,7 +3262,7 @@ public class PurpurWorldConfig { +@@ -3271,7 +3271,7 @@ public class PurpurWorldConfig { public boolean zombieJockeyOnlyBaby = true; public double zombieJockeyChance = 0.05D; public boolean zombieJockeyTryExistingChickens = true; diff --git a/patches/server/0013-Add-an-option-to-apply-the-configuration-to-the-vani.patch b/patches/server/0013-Add-an-option-to-apply-the-configuration-to-the-vani.patch index 8c6daee12..3e75c88ea 100644 --- a/patches/server/0013-Add-an-option-to-apply-the-configuration-to-the-vani.patch +++ b/patches/server/0013-Add-an-option-to-apply-the-configuration-to-the-vani.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add an option to apply the configuration to the vanilla diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -index a8e75eaadfcc6c8b2503776d7de197f756712819..99cf08bc17eec05463b300c0c9fd108cbfba1b8f 100644 +index 8c3c7987a269733a0f530e8f22c3f1a005de21ac..20def77109eb9cd98a7677e73b4316544be86283 100644 --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -@@ -87,7 +87,7 @@ public class GlobalConfiguration extends ConfigurationPart { +@@ -88,7 +88,7 @@ public class GlobalConfiguration extends ConfigurationPart { public Component flyingVehicle = Component.translatable("multiplayer.disconnect.flying"); } @@ -19,7 +19,7 @@ index a8e75eaadfcc6c8b2503776d7de197f756712819..99cf08bc17eec05463b300c0c9fd108c } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index cc4762c13e21600b4c5e287a6fae9e6e472080b3..76f255d12189ffe83426cc7aa85771d5c7cfb111 100644 +index 889d66fc4af69a1ecbf1ddd218f45e23e762d956..88208ecf64ab298b859226494436cc84c944e610 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -449,7 +449,19 @@ public final class CraftServer implements Server { diff --git a/patches/server/0016-Add-missing-Purpur-configuration-options.patch b/patches/server/0016-Add-missing-Purpur-configuration-options.patch index 83c8547fa..e5d2d0e39 100644 --- a/patches/server/0016-Add-missing-Purpur-configuration-options.patch +++ b/patches/server/0016-Add-missing-Purpur-configuration-options.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add missing Purpur configuration options diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java -index 0a173040c56fea6d8f83998b7c66aa8daaf648f2..16b98cad477d7af2d9534cc189aae43a5adc8d58 100644 +index 235596af3a4e210efe966782b29e2b1d4d41e36d..e52178abc7684dd3ca7cbbe23906f9f4b5f80376 100644 --- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java @@ -160,6 +160,18 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS @@ -51,7 +51,7 @@ index d2f0b14a0014802605b601e62d0eebddf06d3737..459a45f82c42b346a66bb1954e155a09 @Override diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index 02581f47d1ca58c2b8abffc478adf48343585c8b..bd04af6311ca64d81c8829e731ac39a6486ee789 100644 +index 267f49bf00f5bbd5541e25c938f727a5bafd8eb2..c4fd2adb2c32f355f23e7a9f002b275bee0bedd7 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java @@ -163,6 +163,23 @@ public class Frog extends Animal implements VariantHolder> { @@ -130,7 +130,7 @@ index 6061cd4fc38fef0895571ab767e495d5755f9fc8..0bc7856065fdc599890f18f5a4e2f6c2 @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java -index 5a62fe9c4f0cee9e8b4a48564f76afec609335b1..79b090030b716029cc4cfc8bf9d81af0b2202313 100644 +index cf231928bae5493b0684109c769d7da4dc36f872..065c7c5ad2f077ab8acd0f008867d42174ba20b4 100644 --- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java @@ -151,6 +151,23 @@ public class Warden extends Monster implements VibrationSystem { @@ -189,7 +189,7 @@ index 1f4cc08e84a23213bb9786ea09ad77caeec2d336..f888f1dd2e3c228b0a370fe920b63d54 @Override diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index 097f3c34d244b89e7dd9f8b6f2a3d8fdc67b36dc..3f4c94aada930e55dfe6a2dd6f3bfb51b2276b0d 100644 +index f29059798c9dc642187b4939dd917ee15cbe120d..7a482099a69759659038e10632e7dd4626c187a1 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -331,6 +331,7 @@ public class PurpurConfig { @@ -209,10 +209,10 @@ index 097f3c34d244b89e7dd9f8b6f2a3d8fdc67b36dc..3f4c94aada930e55dfe6a2dd6f3bfb51 org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27); enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index e55993e318b7f7292e22c4539bc2fd1447f67fa8..b67b6147e9175041539b01357dd8b1e94cfd6841 100644 +index 43ad38dadfe14b3dd0565c536b276eb3f9dbd813..474bab426175d8dece524faeffd8977a6e1bb074 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -1135,7 +1135,13 @@ public class PurpurWorldConfig { +@@ -1144,7 +1144,13 @@ public class PurpurWorldConfig { public boolean allayControllable = true; public double allayMaxHealth = 20.0D; public double allayScale = 1.0D; @@ -226,7 +226,7 @@ index e55993e318b7f7292e22c4539bc2fd1447f67fa8..b67b6147e9175041539b01357dd8b1e9 allayRidable = getBoolean("mobs.allay.ridable", allayRidable); allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater); allayControllable = getBoolean("mobs.allay.controllable", allayControllable); -@@ -1290,7 +1296,13 @@ public class PurpurWorldConfig { +@@ -1299,7 +1305,13 @@ public class PurpurWorldConfig { public double camelMovementSpeedMin = 0.09D; public double camelMovementSpeedMax = 0.09D; public int camelBreedingTicks = 6000; @@ -240,7 +240,7 @@ index e55993e318b7f7292e22c4539bc2fd1447f67fa8..b67b6147e9175041539b01357dd8b1e9 camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater); camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin); camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax); -@@ -1755,7 +1767,15 @@ public class PurpurWorldConfig { +@@ -1764,7 +1776,15 @@ public class PurpurWorldConfig { public boolean frogControllable = true; public float frogRidableJumpHeight = 0.65F; public int frogBreedingTicks = 6000; @@ -256,7 +256,7 @@ index e55993e318b7f7292e22c4539bc2fd1447f67fa8..b67b6147e9175041539b01357dd8b1e9 frogRidable = getBoolean("mobs.frog.ridable", frogRidable); frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater); frogControllable = getBoolean("mobs.frog.controllable", frogControllable); -@@ -2767,7 +2787,13 @@ public class PurpurWorldConfig { +@@ -2776,7 +2796,13 @@ public class PurpurWorldConfig { public double snifferMaxHealth = 14.0D; public double snifferScale = 1.0D; public int snifferBreedingTicks = 6000; @@ -270,7 +270,7 @@ index e55993e318b7f7292e22c4539bc2fd1447f67fa8..b67b6147e9175041539b01357dd8b1e9 snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable); snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater); snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable); -@@ -2875,7 +2901,15 @@ public class PurpurWorldConfig { +@@ -2884,7 +2910,15 @@ public class PurpurWorldConfig { public boolean tadpoleRidable = false; public boolean tadpoleRidableInWater = true; public boolean tadpoleControllable = true; @@ -286,7 +286,7 @@ index e55993e318b7f7292e22c4539bc2fd1447f67fa8..b67b6147e9175041539b01357dd8b1e9 tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable); tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater); tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable); -@@ -3107,7 +3141,15 @@ public class PurpurWorldConfig { +@@ -3116,7 +3150,15 @@ public class PurpurWorldConfig { public boolean wardenRidable = false; public boolean wardenRidableInWater = true; public boolean wardenControllable = true; diff --git a/patches/server/0018-Apply-various-optimizations.patch b/patches/server/0018-Apply-various-optimizations.patch index 0bf64a389..d0d5b5fd4 100644 --- a/patches/server/0018-Apply-various-optimizations.patch +++ b/patches/server/0018-Apply-various-optimizations.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Apply various optimizations Akarin - Swaps the predicate order of collision diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index aa171a1afb9800e6ec84f6b4f1b28e44177752f7..eaf53f5f4c33ca7a7a988e7bd04b7033e16f9529 100644 +index c59963369bf4add28a966ec24b67cb6e8b701dd2..1717c14e77ab9a26298c6990d45be16d32f3f3e6 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2309,8 +2309,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2332,8 +2332,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public void playerTouch(Player player) {} public void push(Entity entity) { @@ -21,7 +21,7 @@ index aa171a1afb9800e6ec84f6b4f1b28e44177752f7..eaf53f5f4c33ca7a7a988e7bd04b7033 if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper - Collision option for requiring a player participant double d0 = entity.getX() - this.getX(); double d1 = entity.getZ() - this.getZ(); -@@ -2338,8 +2339,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2361,8 +2362,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess entity.push(d0, 0.0D, d1); } } diff --git a/patches/server/0020-Add-option-to-disable-moved-to-quickly-check-for-spe.patch b/patches/server/0020-Add-option-to-disable-moved-to-quickly-check-for-spe.patch index 338d0a300..87f2a0b8f 100644 --- a/patches/server/0020-Add-option-to-disable-moved-to-quickly-check-for-spe.patch +++ b/patches/server/0020-Add-option-to-disable-moved-to-quickly-check-for-spe.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add option to disable moved to quickly check for specific diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9ae16e24013ea5664d4ea6d52ed7dd188404890f..91f161d27a45174b6f3c31440eea46ff81185203 100644 +index 8a468f0c09daf23cfbddb3c607a758c6411babfc..910a346f43dbd0ca8dfec5cb78ffa25caeeb1fa1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1695,7 +1695,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1749,7 +1749,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } diff --git a/patches/server/0027-Improve-SwingTime-ticking.patch b/patches/server/0027-Improve-SwingTime-ticking.patch index 96f6aced0..d44ee97b2 100644 --- a/patches/server/0027-Improve-SwingTime-ticking.patch +++ b/patches/server/0027-Improve-SwingTime-ticking.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Improve SwingTime ticking diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index f4604e543a980d6aeb485252da5a4e755aa12bfa..f2753cf51634479e501c1a3e7931d6d9882bc801 100644 +index 33fbe0f7a356dd847e546feffb468b2803c6744b..765435fa2bc9aa901453c0939a7b3acd27e15008 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2821,6 +2821,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2832,6 +2832,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } protected void updateSwingTime() { diff --git a/patches/server/0030-Use-Plazma-logo-instead-if-server-favicon-doesn-t-ex.patch b/patches/server/0030-Use-Plazma-logo-instead-if-server-favicon-doesn-t-ex.patch index 000624d82..eb1f48188 100644 --- a/patches/server/0030-Use-Plazma-logo-instead-if-server-favicon-doesn-t-ex.patch +++ b/patches/server/0030-Use-Plazma-logo-instead-if-server-favicon-doesn-t-ex.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use Plazma logo instead if server favicon doesn't exist diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 20266ef8f0974f47581e71175de4b01ea1a27bf0..54ef910938efb537a689dd5dbda119455bbf2a0e 100644 +index 63353cd8c896b58b356ff1d44359be63db1e0186..b2b2677c8919cb8e0bc4df2e290c1f246833673e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1627,29 +1627,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop loadStatusIcon() { diff --git a/patches/server/0037-Configurable-RandomSource-factory-provider.patch b/patches/server/0037-Configurable-RandomSource-factory-provider.patch index 606ee4935..f89d6cd15 100644 --- a/patches/server/0037-Configurable-RandomSource-factory-provider.patch +++ b/patches/server/0037-Configurable-RandomSource-factory-provider.patch @@ -240,10 +240,10 @@ index f1e0d3d7b1f458fcce83cf67762a16309123cdcb..6a8d5948f127ea87a0b4554ece4ad2c4 public boolean isIgnoreEntities() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 907fe00ab752ad124020755f211567af771b9d70..e041752bbcba5cefce0dde8db917510129d29987 100644 +index eb9bb689a52a7e9c95d6f2e07bb16799286e9057..a7853ce8028c2fc0c8fe71f767700fc624a8007c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -288,7 +288,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -289,7 +289,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { } // Paper end diff --git a/patches/server/0042-Remove-persist-isClientSide-flag.patch b/patches/work/0042-Remove-persist-isClientSide-flag.patch similarity index 94% rename from patches/server/0042-Remove-persist-isClientSide-flag.patch rename to patches/work/0042-Remove-persist-isClientSide-flag.patch index c861702d2..3b29b91a8 100644 --- a/patches/server/0042-Remove-persist-isClientSide-flag.patch +++ b/patches/work/0042-Remove-persist-isClientSide-flag.patch @@ -195,70 +195,6 @@ index 571db5f9bf94745a8afe2cd313e593fb15db5e37..43e42d265513feedc54f3780f37427a5 public ChunkAccess getAnyChunkNow(final int chunkX, final int chunkZ) { if (this.world == null) { -diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 8d82425ccbc30b3f4a59767ca72bf37311ddeda0..e137cc2e16a7b1532501bb3bb568236b427d171b 100644 ---- a/src/main/java/net/minecraft/commands/Commands.java -+++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -203,7 +203,7 @@ public class Commands { - SayCommand.register(this.dispatcher); - ScheduleCommand.register(this.dispatcher); - ScoreboardCommand.register(this.dispatcher, commandRegistryAccess); -- SeedCommand.register(this.dispatcher, environment != Commands.CommandSelection.INTEGRATED); -+ SeedCommand.register(this.dispatcher, true); // Plazma - Remove persist 'isClientSide' flag - SetBlockCommand.register(this.dispatcher, commandRegistryAccess); - SetSpawnCommand.register(this.dispatcher); - SetWorldSpawnCommand.register(this.dispatcher); -@@ -234,12 +234,12 @@ public class Commands { - WardenSpawnTrackerCommand.register(this.dispatcher); - SpawnArmorTrimsCommand.register(this.dispatcher); - ServerPackCommand.register(this.dispatcher); -- if (environment.includeDedicated) { -+ //if (environment.includeDedicated) { // Plazma - Remove persist 'isClientSide' flag - DebugConfigCommand.register(this.dispatcher); -- } -+ //} // Plazma - Remove persist 'isClientSide' flag - } - -- if (environment.includeDedicated) { -+ //if (environment.includeDedicated) { // Plazma - Remove persist 'isClientSide' flag - BanIpCommands.register(this.dispatcher); - BanListCommands.register(this.dispatcher); - BanPlayerCommands.register(this.dispatcher); -@@ -263,11 +263,13 @@ public class Commands { - org.purpurmc.purpur.command.CompassCommand.register(this.dispatcher); // Purpur - org.purpurmc.purpur.command.RamBarCommand.register(this.dispatcher); // Purpur - org.purpurmc.purpur.command.RamCommand.register(this.dispatcher); // Purpur -- } -+ //} // Plazma - Remove persist 'isClientSide' flag - -+ /* // Plazma - Remove persist 'isClientSide' flag - if (environment.includeIntegrated) { - PublishCommand.register(this.dispatcher); - } -+ */ // Plazma - Remove persist 'isClientSide' flag - - // Paper start - Vanilla command permission fixes - for (final CommandNode node : this.dispatcher.getRoot().getChildren()) { -@@ -731,18 +733,7 @@ public class Commands { - } - } - -- public static enum CommandSelection { -- -- ALL(true, true), DEDICATED(false, true), INTEGRATED(true, false); -- -- final boolean includeIntegrated; -- final boolean includeDedicated; -- -- private CommandSelection(final boolean flag, final boolean flag1) { -- this.includeIntegrated = flag; -- this.includeDedicated = flag1; -- } -- } -+ public enum CommandSelection { ALL, DEDICATED, INTEGRATED } // Plazma - Remove persist 'isClientSide' flag - - @FunctionalInterface - public interface ParseFunction { diff --git a/src/main/java/net/minecraft/core/cauldron/CauldronInteraction.java b/src/main/java/net/minecraft/core/cauldron/CauldronInteraction.java index ee2c4c5265d96afe592c5007b0b6ad7649ce5190..2495456fae536d83afd8023f531aeb65ec10bf82 100644 --- a/src/main/java/net/minecraft/core/cauldron/CauldronInteraction.java @@ -408,7 +344,7 @@ index ee2c4c5265d96afe592c5007b0b6ad7649ce5190..2495456fae536d83afd8023f531aeb65 return InteractionResult.SUCCESS; } diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index c6490554a3025f4de3f3218178fad76cd1848a19..e65245ab6c6c6f3fcb425f963f12cade3618e8e9 100644 +index cdd73bb35..81fd76add 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java @@ -542,7 +542,7 @@ public interface DispenseItemBehavior { @@ -470,7 +406,7 @@ index 65ed3d77a51b8299517e0c165403b0c5ac413475..5c7dbb218b6a9a7ccb2c9dbab93a7d8b return stack; } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6e9766aff9a9f2b578f5b8a6b42e206fb7ad1bc6..421b3c524a2828fdd8b0b95c37bce9b79fc7825d 100644 +index baf7324bb..f486ecab1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -270,8 +270,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> list = TagLoader.loadTagsForExistingRegistries(resourcemanager, this.registries.compositeAccess(), io.papermc.paper.plugin.lifecycle.event.registrar.ReloadableRegistrarEvent.Cause.RELOAD); // Paper - tag lifecycle - add cause - return ReloadableServerResources.loadResources(resourcemanager, this.registries, list, this.worldData.enabledFeatures(), this.isDedicatedServer() ? Commands.CommandSelection.DEDICATED : Commands.CommandSelection.INTEGRATED, this.getFunctionCompilationLevel(), this.executor, this).whenComplete((datapackresources, throwable) -> { -+ return ReloadableServerResources.loadResources(resourcemanager, this.registries, list, this.worldData.enabledFeatures(), Commands.CommandSelection.DEDICATED, this.getFunctionCompilationLevel(), this.executor, this).whenComplete((datapackresources, throwable) -> { // Plazma - Remove persist 'isClientSide' flag ++ return ReloadableServerResources.loadResources(resourcemanager, this.registries, list, this.worldData.enabledFeatures(), /*this.isDedicatedServer() ?*/ Commands.CommandSelection.DEDICATED /*: Commands.CommandSelection.INTEGRATED*/, this.getFunctionCompilationLevel(), this.executor, this).whenComplete((datapackresources, throwable) -> { // Plazma - Remove persist 'isClientSide' flag if (throwable != null) { resourcemanager.close(); } -@@ -2687,16 +2689,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { ++ this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, true /*this.isDedicatedServer()*/), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> { // Plazma - Remove persist 'isClientSide' flag + this.executeBlocking(() -> { + this.saveDebugReport(path.resolve("server")); + }); diff --git a/src/main/java/net/minecraft/server/commands/KickCommand.java b/src/main/java/net/minecraft/server/commands/KickCommand.java index 6468b3a25c7527a2fde6899e4812b5cb79ce4b1d..6630556c1849fb74156356c314f72078878c86cc 100644 --- a/src/main/java/net/minecraft/server/commands/KickCommand.java @@ -599,22 +554,22 @@ index 45fa867a22481bbba86e587767cfdb96d9691c49..5a9e2d55649679af44339afc8a1f8485 @Override public SampleLogger getTickTimeLogger() { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index a4421517b8136bb974e197eaa6dd0d83c2fdd0de..3a8b566aa44df367c6edacf371c0b7a2bd2548b6 100644 +index 774372b73..36dec4f9d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -679,9 +679,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -680,9 +680,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe this.prepareWeather(); this.getWorldBorder().setAbsoluteMaxSize(minecraftserver.getAbsoluteMaxWorldSize()); this.raids = (Raids) this.getDataStorage().computeIfAbsent(Raids.factory(this), Raids.getFileId(this.dimensionTypeRegistration())); - if (!minecraftserver.isSingleplayer()) { -+ //if (!minecraftserver.isSingleplayer()) { // Plazma - Completely remove Mojang profiler ++ //if (!minecraftserver.isSingleplayer()) { // Plazma - Remove persist 'isClientSide' flag iworlddataserver.setGameType(minecraftserver.getDefaultGameType()); - } -+ //} // Plazma - Completely remove Mojang profiler ++ //} // Plazma - Remove persist 'isClientSide' flag long l = minecraftserver.getWorldData().worldGenOptions().seed(); -@@ -1149,43 +1149,37 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1150,43 +1150,38 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } private void announceSleepStatus() { @@ -651,61 +606,41 @@ index a4421517b8136bb974e197eaa6dd0d83c2fdd0de..3a8b566aa44df367c6edacf371c0b7a2 - - while (iterator.hasNext()) { - ServerPlayer entityplayer = (ServerPlayer) iterator.next(); +- +- entityplayer.displayClientMessage(ichatmutablecomponent, true); +- } + int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); + Component ichatmutablecomponent; -- entityplayer.displayClientMessage(ichatmutablecomponent, true); -- } + if (this.sleepStatus.areEnoughSleeping(i)) { + // Purpur start -+ if (org.purpurmc.purpur.PurpurConfig.sleepSkippingNight.isBlank()) return; - ++ if (org.purpurmc.purpur.PurpurConfig.sleepSkippingNight.isBlank()) { ++ return; + } + if (!org.purpurmc.purpur.PurpurConfig.sleepSkippingNight.equalsIgnoreCase("default")) { + ichatmutablecomponent = io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(org.purpurmc.purpur.PurpurConfig.sleepSkippingNight)); -+ } else { -+ ichatmutablecomponent = Component.translatable("sleep.skipping_night"); - } ++ } else ++ ichatmutablecomponent = Component.translatable("sleep.skipping_night"); + } else { -+ if (org.purpurmc.purpur.PurpurConfig.sleepingPlayersPercent.isBlank()) return; ++ if (org.purpurmc.purpur.PurpurConfig.sleepingPlayersPercent.isBlank()) { ++ return; ++ } + if (!org.purpurmc.purpur.PurpurConfig.sleepingPlayersPercent.equalsIgnoreCase("default")) { + ichatmutablecomponent = io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(org.purpurmc.purpur.PurpurConfig.sleepingPlayersPercent, -+ net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.parsed("count", Integer.toString(this.sleepStatus.amountSleeping())), -+ net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.parsed("total", Integer.toString(this.sleepStatus.sleepersNeeded(i))))); -+ } else { -+ // Purpur end -+ ichatmutablecomponent = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(i)); -+ } ++ net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.parsed("count", Integer.toString(this.sleepStatus.amountSleeping())), ++ net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.parsed("total", Integer.toString(this.sleepStatus.sleepersNeeded(i))))); ++ } else ++ // Purpur end ++ ichatmutablecomponent = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(i)); + } + -+ for (final ServerPlayer player : this.players) { -+ player.displayClientMessage(ichatmutablecomponent, true); ++ for (final ServerPlayer entityplayer : this.players) { ++ entityplayer.displayClientMessage(ichatmutablecomponent, true); } + // Plazma end - Remove persist 'isClientSide' flag } public void updateSleepingPlayerList() { -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index e6001fadc04b63b82e20652bbb16cb1db5cf44bd..ba8ff8f39d3ba39db9c2ce6070cabe33381f4adb 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayer.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1014,7 +1014,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple - containerUpdateDelay = this.level().paperConfig().tickRates.containerUpdate; - } - // Paper end - Configurable container update tick rate -- if (!this.level().isClientSide && this.containerMenu != this.inventoryMenu && (this.isImmobile() || !this.containerMenu.stillValid(this))) { // Paper - Prevent opening inventories when frozen -+ if (/*!this.level().isClientSide &&*/ this.containerMenu != this.inventoryMenu && (this.isImmobile() || !this.containerMenu.stillValid(this))) { // Paper - Prevent opening inventories when frozen // Plazma - Remove persist 'isClientSide' flag - this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper - Inventory close reason - this.containerMenu = this.inventoryMenu; - } -@@ -1462,7 +1462,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple - } - } - // Purpur end -- boolean flag = this.server.isDedicatedServer() && this.isPvpAllowed() && source.is(DamageTypeTags.IS_FALL); -+ boolean flag = this.isPvpAllowed() && source.is(DamageTypeTags.IS_FALL); // Plazma - Remove persist 'isClientSide' flag - - if (!flag && this.spawnInvulnerableTime > 0 && !source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { - return false; diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java index a8484b9659f175cc20985bf66082616ceb31df4d..abd93a93e6c9367c022259d1ab3895e2764ac702 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java @@ -773,19 +708,19 @@ index 7d276c191b391bca24948ddb36b8b7d0f1f03b03..a71c220ea1c464c193029adb1a0d3e5c protected abstract GameProfile playerProfile(); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 91f161d27a45174b6f3c31440eea46ff81185203..ef7bc59e6b340c88a5379f9f4724b1c82bda4ef7 100644 +index 910a346f4..d148c2d25 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -590,7 +590,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -592,7 +592,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Paper end - Prevent moving into unloaded chunks - if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { -+ if (d10 - d9 > Math.max(100.0D, Math.pow(org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed, 2)) /*&& !this.isSingleplayerOwner()*/) { // Plazma - Remove persist 'isClientSide' flag ++ if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) /*&& !this.isSingleplayerOwner()*/) { // Plazma - Remove persist 'isClientSide' flag // CraftBukkit end ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); - this.send(new ClientboundMoveVehiclePacket(entity)); -@@ -825,7 +825,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + this.send(ClientboundMoveVehiclePacket.fromEntity(entity)); +@@ -823,7 +823,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async // CraftBukkit start @@ -794,7 +729,7 @@ index 91f161d27a45174b6f3c31440eea46ff81185203..ef7bc59e6b340c88a5379f9f4724b1c8 this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause // Paper - add proper async disconnect return; } -@@ -1702,9 +1702,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1756,9 +1756,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private boolean shouldCheckPlayerMovement0(boolean elytra) { // Plazma end - Add option to bypass moved to quickly check @@ -806,7 +741,7 @@ index 91f161d27a45174b6f3c31440eea46ff81185203..ef7bc59e6b340c88a5379f9f4724b1c8 return false; } else { GameRules gamerules = this.player.serverLevel().getGameRules(); -@@ -2654,7 +2655,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2717,7 +2718,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Spigot end // this.chatSpamThrottler.increment(); @@ -815,17 +750,16 @@ index 91f161d27a45174b6f3c31440eea46ff81185203..ef7bc59e6b340c88a5379f9f4724b1c8 // CraftBukkit end this.disconnectAsync((Component) Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause // Paper - add proper async disconnect } -@@ -3682,15 +3683,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3738,7 +3739,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); -+ /* // Plazma - Remove persist 'isClientSide' flag - if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) { +- if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) { ++ if (this.player.hasPermissions(2) /*|| this.isSingleplayerOwner()*/) { // Plazma - Remove persist 'isClientSide' flag // this.server.setDifficulty(packet.getDifficulty(), false); // Paper - per level difficulty; don't allow clients to change this } -+ */ // Plazma - Remove persist 'isClientSide' flag } - +@@ -3746,7 +3747,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleLockDifficulty(ServerboundLockDifficultyPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); @@ -957,7 +891,7 @@ index 653856d0b8dcf2baf4cc77a276f17c8cc1fa717e..1f2958d21c279ecb377b7c90ba643ea8 ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() { public void onProfileLookupSucceeded(GameProfile gameprofile) { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 579f81ed04eeb6373b25e6794d3bf0c403891011..e0b70bac3018dc39e6c8e47171060332ec2f63f2 100644 +index 085789778..70bb8a452 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -517,7 +517,7 @@ public abstract class PlayerList { @@ -2049,10 +1983,10 @@ index 9987d28ea145f6d0126cb4ea22001e0922fb51bd..45663e0d5ee361972b6c3ed9d3c8c294 return super.mobInteract(player, hand); diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index dc8df0912c1d18176e18a8f4dc43c4f60f81b659..6dec1720aea724baab541e26e14c9fa0646abdbf 100644 +index bfe3c1d58..467cedb90 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -576,7 +576,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -580,7 +580,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @Override public void aiStep() { super.aiStep(); @@ -2061,7 +1995,7 @@ index dc8df0912c1d18176e18a8f4dc43c4f60f81b659..6dec1720aea724baab541e26e14c9fa0 if (this.stayOutOfHiveCountdown > 0) { --this.stayOutOfHiveCountdown; } -@@ -595,7 +595,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -599,7 +599,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { if (this.tickCount % 20 == 0 && !this.isHiveValid()) { this.hivePos = null; } @@ -2087,10 +2021,10 @@ index 4eca5996a867086be22d22d99db81ab001467516..dff6c0615defa87e7b4e01c0df2d0a5f entity.discard(EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause return Optional.of(InteractionResult.SUCCESS); diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java -index 4aad4fdc80070f4000e929fff126714fc67050b0..721e450242a36b2c0998a78fa86a1cc40dcc9ee6 100644 +index a418ded30..a81470ada 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -451,22 +451,22 @@ public class Cat extends TamableAnimal implements VariantHolder { @@ -2182,35 +2116,20 @@ index ac044be03494c3d6bad6bbc22321445e04d430cc..f25ce3f42157d7303304c39e3b990f66 @Override public void aiStep() { - if (!this.level().isClientSide && this.isAlive() && this.isEffectiveAi()) { -+ if (/*!this.level().isClientSide &&*/ this.isAlive() /*&& this.isEffectiveAi()*/) { // Plazma - Remove persist 'isClientSide' flag ++ if (this.isAlive()) { // Plazma - Remove persist 'isClientSide' flag ++this.ticksSinceEaten; ItemStack itemstack = this.getItemBySlot(EquipmentSlot.MAINHAND); -@@ -559,14 +559,16 @@ public class Fox extends Animal implements VariantHolder { +@@ -559,7 +559,7 @@ public class Fox extends Animal implements VariantHolder { } private void spitOutItem(ItemStack stack) { - if (!stack.isEmpty() && !this.level().isClientSide) { -- ItemEntity entityitem = new ItemEntity(this.level(), this.getX() + this.getLookAngle().x, this.getY() + 1.0D, this.getZ() + this.getLookAngle().z, stack); -+ // Plazma start - Remove persist 'isClientSide' flag & Apply some optimizations -+ if (stack.isEmpty()) return; ++ if (!stack.isEmpty() /*&& !this.level().isClientSide*/) { // Plazma - Remove persist 'isClientSide' flag + ItemEntity entityitem = new ItemEntity(this.level(), this.getX() + this.getLookAngle().x, this.getY() + 1.0D, this.getZ() + this.getLookAngle().z, stack); -- entityitem.setPickUpDelay(40); -- entityitem.setThrower(this); -- this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F); -- this.spawnAtLocation((net.minecraft.server.level.ServerLevel) this.level(), entityitem); // Paper - Call EntityDropItemEvent -- } -+ ItemEntity entityitem = new ItemEntity(this.level(), this.getX() + this.getLookAngle().x, this.getY() + 1.0D, this.getZ() + this.getLookAngle().z, stack); -+ -+ entityitem.setPickUpDelay(40); -+ entityitem.setThrower(this); -+ this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F); -+ this.spawnAtLocation((net.minecraft.server.level.ServerLevel) this.level(), entityitem); // Paper - Call EntityDropItemEvent -+ // Plazma - Remove persist 'isClientSide' flag & Apply some optimizations - } - - private void dropItemStack(ItemStack stack) { -@@ -601,7 +603,7 @@ public class Fox extends Animal implements VariantHolder { + entityitem.setPickUpDelay(40); +@@ -601,7 +601,7 @@ public class Fox extends Animal implements VariantHolder { @Override public void tick() { super.tick(); @@ -2219,7 +2138,7 @@ index ac044be03494c3d6bad6bbc22321445e04d430cc..f25ce3f42157d7303304c39e3b990f66 boolean flag = this.isInWater(); if (flag || this.getTarget() != null || this.level().isThundering()) { -@@ -618,7 +620,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -618,7 +618,7 @@ public class Fox extends Animal implements VariantHolder { this.level().levelEvent(2001, blockposition, Block.getId(iblockdata)); } @@ -2352,10 +2271,10 @@ index 83372c86bd54eedd9b136ddfcbfc67d303058c0a..2df413fce51db6360c2a55fde7206113 private boolean canFindBamboo() { diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -index 28a9d267099f6c24f71dc5a11179d59c27265a88..a0a55f1da46f8e9be4e2a776678333eb5f8e42f6 100644 +index f14fe1c29..963c2158f 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -@@ -329,22 +329,22 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder { @@ -2470,10 +2389,10 @@ index b3a0146ccfcda9fa33b91d33458086b510bb4d7b..034dec437d6a6df5664185de77245bd1 } diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java -index 38f651ab5f8e25e6d653a86dcb9875990651542a..0503f936d0d7194f110069adabff984f51af0a3a 100644 +index 8ce4edbd7..f3c7422cb 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java +++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java -@@ -157,6 +157,7 @@ public class Sheep extends Animal implements Shearable { +@@ -150,6 +150,7 @@ public class Sheep extends Animal implements Shearable { super.customServerAiStep(world); } @@ -2481,7 +2400,7 @@ index 38f651ab5f8e25e6d653a86dcb9875990651542a..0503f936d0d7194f110069adabff984f @Override public void aiStep() { if (this.level().isClientSide) { -@@ -165,6 +166,7 @@ public class Sheep extends Animal implements Shearable { +@@ -158,6 +159,7 @@ public class Sheep extends Animal implements Shearable { super.aiStep(); } @@ -2490,7 +2409,7 @@ index 38f651ab5f8e25e6d653a86dcb9875990651542a..0503f936d0d7194f110069adabff984f public static AttributeSupplier.Builder createAttributes() { return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 8.0D).add(Attributes.MOVEMENT_SPEED, 0.23000000417232513D); diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java -index 36a56553702fa6e4a2ac92b3639c210c94faee73..012c2dafb5a4fc420a7fec58b472374b933c0ded 100644 +index 3ba2e4954..950b1f011 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Squid.java +++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java @@ -168,16 +168,18 @@ public class Squid extends AgeableWaterCreature { @@ -2581,7 +2500,7 @@ index c9e307452a097329c26893673055cfb72a43e4c7..388c0068905e2ad138d5125ba17734b1 this.move(MoverType.SELF, this.getDeltaMovement()); this.setDeltaMovement(this.getDeltaMovement().scale(0.9D)); diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -index 420345f130a40c4f59a021a4bdce3e218dc87cde..14d3e09e8eca665d186f5d356158052b118c6848 100644 +index 15b655fa1..1be6773df 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java +++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java @@ -370,16 +370,16 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder> { @@ -3018,7 +2932,7 @@ index 8401c7ae749f6300281cbd6b2bfc77f03d5eb9ea..818aa1e29392321533c0eb83b953a123 if (flag && !this.isSilent()) { diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java b/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java -index 1d765ad53a9d8dd388106bc0cb02f4919a1f8173..40437c169a06c7dbf4950afcb575dec8adef33fa 100644 +index cb881211f..e3415556c 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java @@ -138,9 +138,9 @@ public class TraderLlama extends Llama { @@ -3065,7 +2979,7 @@ index 0bc7856065fdc599890f18f5a4e2f6c2b3d94ba7..a108cba43a7272f53cd53b885dc03874 @Override protected void playStepSound(BlockPos pos, BlockState state) { diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index c9e3bb91ff506a35551a58f469ad2849e6058668..d779f62ef6cd4f396225317b24c601e0536a9a94 100644 +index eff4424fa..b6835fd62 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java @@ -221,6 +221,7 @@ public class EnderDragon extends Mob implements Enemy { @@ -3112,18 +3026,22 @@ index c9e3bb91ff506a35551a58f469ad2849e6058668..d779f62ef6cd4f396225317b24c601e0 this.yBodyRot = this.getYRot(); Vec3[] avec3d = new Vec3[this.subEntities.length]; -@@ -1132,9 +1136,11 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1144,6 +1148,7 @@ public class EnderDragon extends Mob implements Enemy { + this.phaseManager.getCurrentPhase().onCrystalDestroyed(crystal, pos, source, entityhuman); + } ++ /* // Plazma - Remove persist 'isClientSide' flag @Override public void onSyncedDataUpdated(EntityDataAccessor data) { -+ /* // Plazma - Remove persist 'isClientSide' flag if (EnderDragon.DATA_PHASE.equals(data) && this.level().isClientSide) { - this.phaseManager.setPhase(EnderDragonPhase.getById((Integer) this.getEntityData().get(EnderDragon.DATA_PHASE))); - } -+ */ // Plazma - Remove persist 'isClientSide' flag +@@ -1152,6 +1157,7 @@ public class EnderDragon extends Mob implements Enemy { super.onSyncedDataUpdated(data); } ++ */ // Plazma - Remove persist 'isClientSide' flag + + public EnderDragonPhaseManager getPhaseManager() { + return this.phaseManager; diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhaseManager.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhaseManager.java index 5ed84f4199698dfe41abd7b9fc804bc3419078ef..e17304fd16632d2f478cf89f90ca2da3537fefd8 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/EnderDragonPhaseManager.java @@ -3144,10 +3062,10 @@ index 5ed84f4199698dfe41abd7b9fc804bc3419078ef..e17304fd16632d2f478cf89f90ca2da3 } } diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -index 5e134b3cf939fe396c060797883613812ad73c31..05fb8b26369f7703c6a97f1764a71bd4c3fe1058 100644 +index a671d18a3..6f756f6f3 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -@@ -321,7 +321,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -320,7 +320,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { public void aiStep() { Vec3 vec3d = this.getDeltaMovement().multiply(1.0D, 0.6D, 1.0D); @@ -3203,7 +3121,7 @@ index 037586c0fdb42a02660aba89dd741a647c67e52b..6230b5acc495b998e508a937d1e4c388 @Override diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -index bd5e034ce58ebe53d2121209d76ae60134ce72fe..27f7a0abf77e94f15ff5f42e54e979377c94e63c 100644 +index fd1bd4fb8..ad3f17ee5 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java @@ -419,7 +419,7 @@ public class ItemFrame extends HangingEntity { @@ -3215,157 +3133,39 @@ index bd5e034ce58ebe53d2121209d76ae60134ce72fe..27f7a0abf77e94f15ff5f42e54e97937 if (!flag) { if (flag1 && !this.isRemoved()) { MapItemSavedData worldmap = MapItem.getSavedData(itemstack, this.level()); -@@ -454,9 +454,9 @@ public class ItemFrame extends HangingEntity { +@@ -454,8 +454,10 @@ public class ItemFrame extends HangingEntity { this.gameEvent(GameEvent.BLOCK_CHANGE, player); return InteractionResult.SUCCESS; } -- } else { -+ } /*else { // Plazma - Remove persist 'isClientSide' flag ++ /* // Plazma - Remove persist 'isClientSide' flag + } else { return (InteractionResult) (!flag && !flag1 ? InteractionResult.PASS : InteractionResult.SUCCESS); -- } -+ }*/ // Plazma - Remove persist 'isClientSide' flag ++ */ // Plazma - Remove persist 'isClientSide' flag + } } - public SoundEvent getRotateItemSound() { diff --git a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java -index d3a7953a3f42a0020342845e9107c6991637b050..650af7be38e9ba8e81ac991689ffa0a444e7f94b 100644 +index d06ec03ad..637d307c6 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java +++ b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java -@@ -75,80 +75,72 @@ public class LeashFenceKnotEntity extends BlockAttachedEntity { +@@ -75,9 +75,11 @@ public class LeashFenceKnotEntity extends BlockAttachedEntity { @Override public InteractionResult interact(Player player, InteractionHand hand) { -- if (this.level().isClientSide) { -- return InteractionResult.SUCCESS; -- } else { -- boolean flag = false; -- List list = LeadItem.leashableInArea(this.level(), this.getPos(), (leashable) -> { -- Entity entity = leashable.getLeashHolder(); -- -- return entity == player || entity == this; -- }); -- Iterator iterator = list.iterator(); -- -- while (iterator.hasNext()) { -- Leashable leashable = (Leashable) iterator.next(); -- -- if (leashable.getLeashHolder() == player) { -- // CraftBukkit start -- if (leashable instanceof Entity leashed) { -- if (CraftEventFactory.callPlayerLeashEntityEvent(leashed, this, player, hand).isCancelled()) { -- ((ServerPlayer) player).connection.send(new ClientboundSetEntityLinkPacket(leashed, leashable.getLeashHolder())); -- flag = true; // Also set true when the event is cancelled otherwise it tries to unleash the entities -- continue; -- } -- } -- // CraftBukkit end -- leashable.setLeashedTo(this, true); -- flag = true; -- } -+ // Plazma start - Remove persist 'isClientSide' flag & Apply some optimizations -+ boolean flag = false; -+ List list = LeadItem.leashableInArea(this.level(), this.getPos(), (leashable) -> { -+ Entity entity = leashable.getLeashHolder(); -+ -+ return entity == player || entity == this; -+ }); -+ -+ Iterator iterator = list.iterator(); -+ while (iterator.hasNext()) { -+ Leashable leashable = (Leashable) iterator.next(); -+ -+ if (leashable.getLeashHolder() != player) continue; -+ -+ // CraftBukkit start -+ if (leashable instanceof Entity entity && CraftEventFactory.callPlayerLeashEntityEvent(entity, this, player, hand).isCancelled()) { -+ ((ServerPlayer) player).connection.send(new ClientboundSetEntityLinkPacket(leashed, leashable.getLeashHolder())); -+ flag = true; // Also set true when the event is cancelled otherwise it tries to unleash the entities -+ continue; - } -+ // CraftBukkit end - -- boolean flag1 = false; -+ leashable.setLeashedTo(this, true); -+ flag = true; -+ } - -- if (!flag) { -- // CraftBukkit start - Move below -- // this.discard(); -- boolean die = true; -- // CraftBukkit end -- if (true || player.getAbilities().instabuild) { // CraftBukkit - Process for non-creative as well -- Iterator iterator1 = list.iterator(); -- -- while (iterator1.hasNext()) { -- Leashable leashable1 = (Leashable) iterator1.next(); -- -- if (leashable1.isLeashed() && leashable1.getLeashHolder() == this) { -- // CraftBukkit start -- boolean dropLeash = !player.hasInfiniteMaterials(); -- if (leashable1 instanceof Entity leashed) { -- // Paper start - Expand EntityUnleashEvent -- org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(leashed, player, hand, dropLeash); -- dropLeash = event.isDropLeash(); -- if (event.isCancelled()) { -- // Paper end - Expand EntityUnleashEvent -- die = false; -- continue; -- } -- } -- leashable1.dropLeash(true, dropLeash); // false -> survival mode boolean // Paper - Expand EntityUnleashEvent -- // CraftBukkit end -- flag1 = true; -- } -- } -- // CraftBukkit start -- if (die) { -- this.discard(EntityRemoveEvent.Cause.DROP); // CraftBukkit - add Bukkit remove cause -+ boolean flag1 = false; -+ if (!flag) { -+ // CraftBukkit start - Move below -+ // this.discard(); -+ boolean die = true; -+ // CraftBukkit end -+ -+ Iterator iterator1 = list.iterator(); -+ while (iterator1.hasNext()) { -+ Leashable leashable = (Leashable) iterator1.next(); -+ -+ if (!leashable.isLeashed() || leashable.getLeashHolder() != this) continue; -+ -+ // CraftBukkit start -+ boolean dropLeash = !player.hasInfiniteMaterials(); -+ if (leashable instanceof Entity entity) { -+ // Paper start - Expand EntityUnleashEvent -+ org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(entity, player, hand, dropLeash); -+ if (event.isCancelled()) { -+ die = false; -+ continue; - } -- // CraftBukkit end -+ -+ dropLeash = event.isDropLeash(); -+ // Paper end - Expand EntityUnleashEvent - } -- } - -- if (flag || flag1) { -- this.gameEvent(GameEvent.BLOCK_ATTACH, player); -+ leashable.dropLeash(true, dropLeash); // false -> survival mode boolean // Paper - Expand EntityUnleashEvent -+ // CraftBukkit end -+ -+ flag1 = true; ++ /* // Plazma - Remove persist 'isClientSide' flag + if (this.level().isClientSide) { + return InteractionResult.SUCCESS; + } else { ++ */ // Plazma - Remove persist 'isClientSide' flag + boolean flag = false; + List list = LeadItem.leashableInArea(this.level(), this.getPos(), (leashable) -> { + Entity entity = leashable.getLeashHolder(); +@@ -152,7 +154,7 @@ public class LeashFenceKnotEntity extends BlockAttachedEntity { } -- return InteractionResult.SUCCESS; -+ if (die) this.discard(EntityRemoveEvent.Cause.DROP); // CraftBukkit - add Bukkit remove cause - } -+ -+ if (flag || flag1) this.gameEvent(GameEvent.BLOCK_ATTACH, player); -+ -+ return InteractionResult.SUCCESS; -+ // Plazma end - Remove persist 'isClientSide' flag + return InteractionResult.SUCCESS; +- } ++ //} // Plazma - Remove persist 'isClientSide' flag } @Override @@ -3588,7 +3388,7 @@ index c63cf322e0d00b5ec9929db8c22d4a392049160f..8c5dff4e24c1366d583ba9c7c2c15ea1 } 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 287ba483614e79e78022e703ef891f59f41ac455..1273d5027d806f655e7c5e2d65b7a8e0182de185 100644 +index 6f1e21d6c..55d84e4c1 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java @@ -123,16 +123,18 @@ public class PrimedTnt extends Entity implements TraceableEntity { @@ -3613,10 +3413,10 @@ index 287ba483614e79e78022e703ef891f59f41ac455..1273d5027d806f655e7c5e2d65b7a8e0 // Paper start - Option to prevent TNT from moving in water diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -index 39d02cf0e31832e30c4f034b0b5385e3e0057e60..41c6b60a9d0210b7f2c660cc03999be9c9bc344e 100644 +index 0235488fa..89c1dd7dd 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -@@ -148,7 +148,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -150,7 +150,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo } public void reassessWeaponGoal() { @@ -3625,7 +3425,7 @@ index 39d02cf0e31832e30c4f034b0b5385e3e0057e60..41c6b60a9d0210b7f2c660cc03999be9 this.goalSelector.removeGoal(this.meleeGoal); this.goalSelector.removeGoal(this.bowGoal); ItemStack itemstack = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW)); -@@ -236,9 +236,9 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -243,9 +243,9 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @Override public void setItemSlot(EquipmentSlot slot, ItemStack stack, boolean silent) { // Paper - Fix silent equipment change super.setItemSlot(slot, stack, silent); // Paper - Fix silent equipment change @@ -3680,10 +3480,10 @@ index 38cbe2fce9c36195aa9bea2af26d14364b216825..3b2560ee1bb8c415eada619fc057d35c return InteractionResult.SUCCESS; } else { diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java -index 949207eda199c874f2f14074b5a4fff5462b86b9..19bc362ff8e28cd0e26ba357dda425bac24c5a56 100644 +index a28a4cd95..38cf26247 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java +++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java -@@ -279,7 +279,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -276,7 +276,7 @@ public class Drowned extends Zombie implements RangedAttackMob { @Override public void travel(Vec3 movementInput) { @@ -3692,7 +3492,7 @@ index 949207eda199c874f2f14074b5a4fff5462b86b9..19bc362ff8e28cd0e26ba357dda425ba this.moveRelative(0.01F, movementInput); this.move(MoverType.SELF, this.getDeltaMovement()); this.setDeltaMovement(this.getDeltaMovement().scale(0.9)); -@@ -290,15 +290,15 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -287,15 +287,15 @@ public class Drowned extends Zombie implements RangedAttackMob { @Override public void updateSwimming() { @@ -3712,22 +3512,26 @@ index 949207eda199c874f2f14074b5a4fff5462b86b9..19bc362ff8e28cd0e26ba357dda425ba @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index 476aaa0d9899eb56ea29b1fcf15565b58f78479d..d57f6b312341f6d83788bbb294cc65ee47361373 100644 +index 881b85506..fdc7c13e8 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -@@ -228,9 +228,11 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -225,6 +225,7 @@ public class EnderMan extends Monster implements NeutralMob { + } + ++ /* // Plazma - Remove persist 'isClientSide' flag @Override public void onSyncedDataUpdated(EntityDataAccessor data) { -+ /* // Plazma - Remove persist 'isClientSide' flag if (EnderMan.DATA_CREEPY.equals(data) && this.hasBeenStaredAt() && this.level().isClientSide) { - this.playStareSound(); - } -+ */ // Plazma - Remove persist 'isClientSide' flag +@@ -233,6 +234,7 @@ public class EnderMan extends Monster implements NeutralMob { super.onSyncedDataUpdated(data); } -@@ -277,16 +279,18 @@ public class EnderMan extends Monster implements NeutralMob { ++ */ // Plazma - Remove persist 'isClientSide' flag + + @Override + public void addAdditionalSaveData(CompoundTag nbt) { +@@ -276,16 +278,18 @@ public class EnderMan extends Monster implements NeutralMob { @Override public void aiStep() { @@ -3748,7 +3552,7 @@ index 476aaa0d9899eb56ea29b1fcf15565b58f78479d..d57f6b312341f6d83788bbb294cc65ee super.aiStep(); } -@@ -311,7 +315,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -310,7 +314,7 @@ public class EnderMan extends Monster implements NeutralMob { } public boolean teleport() { @@ -3863,7 +3667,7 @@ index 63caf20256a3deae98b9cd9f54650def172f0e57..ccb32a521160ffaf45b947422819629d @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java -index cda6cb5b10b895bab48d2212f259ba4ca40e1ed6..80647c433bd94450db2b6d48d6d5b952a8dd9a6c 100644 +index 23ca324c5..696ae870c 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java @@ -232,6 +232,7 @@ public class Phantom extends FlyingMob implements Enemy { @@ -3883,10 +3687,10 @@ index cda6cb5b10b895bab48d2212f259ba4ca40e1ed6..80647c433bd94450db2b6d48d6d5b952 if (level().purpurConfig.phantomFlamesOnSwoop && attackPhase == AttackPhase.SWOOP) shoot(); // Purpur } diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -index 98c1934b4895a86cd8748edf906aaa721a87a123..991d3eb79770c5809e92768bc8e51d42aab69e2e 100644 +index 17aaa3f37..c9da833c8 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -@@ -57,7 +57,7 @@ public class Ravager extends Raider { +@@ -55,7 +55,7 @@ public class Ravager extends Raider { return Ravager.ROAR_TARGET_WITH_GRIEFING.test(entity) && !entity.getType().equals(EntityType.ARMOR_STAND); }; private static final Predicate ROAR_TARGET_ON_CLIENT = (entityliving) -> { @@ -3896,7 +3700,7 @@ index 98c1934b4895a86cd8748edf906aaa721a87a123..991d3eb79770c5809e92768bc8e51d42 private static final double BASE_MOVEMENT_SPEED = 0.3D; private static final double ATTACK_MOVEMENT_SPEED = 0.35D; diff --git a/src/main/java/net/minecraft/world/entity/monster/Shulker.java b/src/main/java/net/minecraft/world/entity/monster/Shulker.java -index e3fefd52c83079fe3eab1a96dd81a183f718192b..2282b7d57a14c16f65afae7d084f0d42a6078165 100644 +index b940cb26d..85ebd8400 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Shulker.java +++ b/src/main/java/net/minecraft/world/entity/monster/Shulker.java @@ -229,7 +229,7 @@ public class Shulker extends AbstractGolem implements VariantHolder data) { -+ /* // Plazma - Remove persist 'isClientSide' flag if (Strider.DATA_BOOST_TIME.equals(data) && this.level().isClientSide) { - this.steering.onSynced(); - } -+ */ // Plazma - Remove persist 'isClientSide' flag +@@ -148,6 +149,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { super.onSyncedDataUpdated(data); } ++ */ // Plazma - Remove persist 'isClientSide' flag + + @Override + protected void defineSynchedData(SynchedEntityData.Builder builder) { @@ -502,9 +504,9 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { // Purpur end @@ -4164,7 +3972,7 @@ index 85b03e0bf7436cb846df13c575ad78ac6a17a151..6628efb0ec59e68810152a64309bc5f6 --this.conversionTime; // Paper - remove anti tick skipping measures / wall time if (this.conversionTime < 0) { diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java -index 6f6b32bf7f68d05e4173c31f2e631a409b858a05..27f1eaa5e7d11a6aae3f2af07942dbcee60d5216 100644 +index cd66ef1d9..399308324 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java @@ -207,7 +207,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @@ -4189,88 +3997,58 @@ index 6f6b32bf7f68d05e4173c31f2e631a409b858a05..27f1eaa5e7d11a6aae3f2af07942dbce return InteractionResult.SUCCESS_SERVER; } else { diff --git a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java -index 489644b66266257828fd216e4298bd6d33f7777b..2e39c65304fff182ee63e18f16b677b490af2837 100644 +index a7504c80b..0f2e655ea 100644 --- a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java +++ b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java -@@ -87,6 +87,7 @@ public class Breeze extends Monster { +@@ -85,6 +85,7 @@ public class Breeze extends Monster { + return Brain.provider(BreezeAi.MEMORY_TYPES, BreezeAi.SENSOR_TYPES); + } ++ /* // Plazma - Remove persist 'isClientSide' flag @Override public void onSyncedDataUpdated(EntityDataAccessor data) { -+ /* // Plazma - Remove persist 'isClientSide' flag if (this.level().isClientSide() && Breeze.DATA_POSE.equals(data)) { - this.resetAnimations(); - Pose entitypose = this.getPose(); -@@ -102,6 +103,7 @@ public class Breeze extends Monster { - this.slide.startIfStopped(this.tickCount); - } - } -+ */ // Plazma - Remove persist 'isClientSide' flag +@@ -105,6 +106,7 @@ public class Breeze extends Monster { super.onSyncedDataUpdated(data); } ++ */ // Plazma - Remove persist 'isClientSide' flag + + private void resetAnimations() { + this.shoot.stop(); diff --git a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java -index ea1655d2cbc631d80dd66f7e3e24998530df66a2..833667dfaff7f8de638238981adbf0b4a839ea04 100644 +index 57f07799e..9bc1af8fa 100644 --- a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java +++ b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java -@@ -157,7 +157,7 @@ public class Creaking extends Monster { - this.attackAnimationRemainingTicks--; +@@ -252,7 +252,7 @@ public class Creaking extends Monster { + --this.attackAnimationRemainingTicks; } - if (!this.level().isClientSide) { + //if (!this.level().isClientSide) { // Plazma - Remove persist 'isClientSide' flag - boolean bl = this.entityData.get(CAN_MOVE); - boolean bl2 = this.checkCanMove(); - if (bl2 != bl) { -@@ -171,11 +171,12 @@ public class Creaking extends Monster { + boolean flag = (Boolean) this.entityData.get(Creaking.CAN_MOVE); + boolean flag1 = this.checkCanMove(); + +@@ -267,14 +267,14 @@ public class Creaking extends Monster { } - this.entityData.set(CAN_MOVE, bl2); + this.entityData.set(Creaking.CAN_MOVE, flag1); - } + //} // Plazma - Remove persist 'isClientSide' flag super.aiStep(); } -+ /* // Plazma - Remove persist 'isClientSide' flag - @Override - public void tick() { - super.tick(); -@@ -183,6 +184,7 @@ public class Creaking extends Monster { - this.setupAnimationStates(); - } - } -+ */ // Plazma - Remove persist 'isClientSide' flag - - private void setupAnimationStates() { - this.attackAnimationState.animateWhen(this.attackAnimationRemainingTicks > 0, this.tickCount); -diff --git a/src/main/java/net/minecraft/world/entity/monster/creaking/CreakingTransient.java b/src/main/java/net/minecraft/world/entity/monster/creaking/CreakingTransient.java -index b57818cbe9ac6a2095da8a2ee6ccbd4c1804a502..c7e217a5ec2cb6d261ae9804ae125961f344a418 100644 ---- a/src/main/java/net/minecraft/world/entity/monster/creaking/CreakingTransient.java -+++ b/src/main/java/net/minecraft/world/entity/monster/creaking/CreakingTransient.java -@@ -44,9 +44,10 @@ public class CreakingTransient extends Creaking { - - @Override - public boolean hurtServer(ServerLevel world, DamageSource source, float amount) { -+ /* // Plazma - Remove persist 'isClientSide' flag - if (this.level().isClientSide) { - return super.hurtServer(world, source, amount); -- } else if (source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { -+ } else*/ if (source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { // Plazma - Remove persist 'isClientSide' flag - return super.hurtServer(world, source, amount); - } else if (!this.isInvulnerableTo(world, source) && this.invulnerabilityAnimationRemainingTicks <= 0) { - this.invulnerabilityAnimationRemainingTicks = 8; -@@ -82,7 +83,7 @@ public class CreakingTransient extends Creaking { - @Override public void tick() { - if (!this.level().isClientSide) { + //if (!this.level().isClientSide) { // Plazma - Remove persist 'isClientSide' flag - label18: - { - if (this.homePos != null) { -@@ -100,12 +101,14 @@ public class CreakingTransient extends Creaking { - this.setRemoved(Entity.RemovalReason.DISCARDED, null); // CraftBukkit - add Bukkit remove cause - return; + BlockPos blockposition = this.getHomePos(); + + if (blockposition != null) { +@@ -301,13 +301,15 @@ public class Creaking extends Monster { + this.setHealth(0.0F); + } } - } + //} // Plazma - Remove persist 'isClientSide' flag @@ -4279,11 +4057,21 @@ index b57818cbe9ac6a2095da8a2ee6ccbd4c1804a502..c7e217a5ec2cb6d261ae9804ae125961 + /* // Plazma - Remove persist 'isClientSide' flag if (this.level().isClientSide) { this.setupAnimationStates(); + this.checkEyeBlink(); } + */ // Plazma - Remove persist 'isClientSide' flag } +@@ -315,7 +317,7 @@ public class Creaking extends Monster { + protected void tickDeath() { + if (this.isHeartBound() && this.isTearingDown()) { + ++this.deathTime; +- if (!this.level().isClientSide() && this.deathTime > 45 && !this.isRemoved()) { ++ if (/*!this.level().isClientSide() &&*/ this.deathTime > 45 && !this.isRemoved()) { // Plazma - Remove persist 'isClientSide' flag + this.tearDown(); + } + } else { diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java index 6144613e834236ec0ebb12872ef9e47255b76b5b..28ca4b511ea37f6fd0eefc7a8d449c85075b855d 100644 --- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java @@ -4298,10 +4086,10 @@ index 6144613e834236ec0ebb12872ef9e47255b76b5b..28ca4b511ea37f6fd0eefc7a8d449c85 @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -index 20608fb46a0af85739e3c0caa843c1a9d45c9659..938b4025122f6d27382086445bc8f231f325b864 100644 +index a2d29cf85..edcba583e 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -@@ -312,14 +312,14 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -315,14 +315,14 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @Override public void setBaby(boolean baby) { this.getEntityData().set(Piglin.DATA_BABY_ID, baby); @@ -4318,7 +4106,7 @@ index 20608fb46a0af85739e3c0caa843c1a9d45c9659..938b4025122f6d27382086445bc8f231 } -@@ -485,7 +485,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -494,7 +494,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @Override protected SoundEvent getAmbientSound() { @@ -4328,7 +4116,7 @@ index 20608fb46a0af85739e3c0caa843c1a9d45c9659..938b4025122f6d27382086445bc8f231 @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java -index 79b090030b716029cc4cfc8bf9d81af0b2202313..6cce132f43ce7aad6f5ee2b351855c9b57b8f0c1 100644 +index 065c7c5ad..9bbf0eef3 100644 --- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java @@ -287,6 +287,7 @@ public class Warden extends Monster implements VibrationSystem { @@ -4348,7 +4136,7 @@ index 79b090030b716029cc4cfc8bf9d81af0b2202313..6cce132f43ce7aad6f5ee2b351855c9b } diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -index 6c74cf1dea99b3b967b8c3d76f405f823c881fb9..e57f95fb70c7482587acc134982caa22f7c67071 100644 +index e2b00681e..e7d93e7e2 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java @@ -124,16 +124,18 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa @@ -4396,7 +4184,7 @@ index 6c74cf1dea99b3b967b8c3d76f405f823c881fb9..e57f95fb70c7482587acc134982caa22 this.writeInventoryToTag(nbt, this.registryAccess()); } -@@ -308,8 +310,10 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa +@@ -308,10 +310,12 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa return this.getPosition(delta).add(vec3d.yRot(-f1)); } @@ -4406,9 +4194,11 @@ index 6c74cf1dea99b3b967b8c3d76f405f823c881fb9..e57f95fb70c7482587acc134982caa22 return this.level().isClientSide; } + */ // Plazma - Remove persist 'isClientSide' flag - } + + @Override + public boolean stillValid(Player player) { diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index 0ee456972923e90905732ffc5d77bb027cf6c0fc..68353a8b2a01fbf873c3751f3887dc0ec35c8327 100644 +index 15ddc44bb..c6d4a963a 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -323,13 +323,13 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -4510,19 +4300,19 @@ index 42c91e52060fad4a7a598f9e9ef88fd0e0ff8475..c348f049c0d51fc98d3b2dfbdde679fb } 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 c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf7e5c4495 100644 +index d19b1e127..afd70875e 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -238,7 +238,7 @@ public abstract class Player extends LivingEntity { +@@ -241,7 +241,7 @@ public abstract class Player extends LivingEntity { this.lastDeathLocation = Optional.empty(); this.setUUID(gameProfile.getId()); this.gameProfile = gameProfile; - this.inventoryMenu = new InventoryMenu(this.inventory, !world.isClientSide, this); -+ this.inventoryMenu = new InventoryMenu(this.inventory, this); // Plazma - Remove persist 'isClientSide' flag ++ this.inventoryMenu = new InventoryMenu(this.inventory, /*!world.isClientSide,*/ this); // Plazma - Remove persist 'isClientSide' flag this.containerMenu = this.inventoryMenu; this.moveTo((double) pos.getX() + 0.5D, (double) (pos.getY() + 1), (double) pos.getZ() + 0.5D, yaw, 0.0F); this.rotOffs = 180.0F; -@@ -303,7 +303,7 @@ public abstract class Player extends LivingEntity { +@@ -306,7 +306,7 @@ public abstract class Player extends LivingEntity { this.sleepCounter = 100; } @@ -4531,7 +4321,7 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf this.stopSleepInBed(false, true); } } else if (this.sleepCounter > 0) { -@@ -315,7 +315,7 @@ public abstract class Player extends LivingEntity { +@@ -318,7 +318,7 @@ public abstract class Player extends LivingEntity { this.updateIsUnderwater(); super.tick(); @@ -4540,7 +4330,7 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf this.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper - Inventory close reason this.containerMenu = this.inventoryMenu; } -@@ -599,7 +599,7 @@ public abstract class Player extends LivingEntity { +@@ -602,7 +602,7 @@ public abstract class Player extends LivingEntity { @Override public void rideTick() { @@ -4549,7 +4339,7 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf this.stopRiding(); // CraftBukkit start - SPIGOT-7316: no longer passenger, dismount and return if (!this.isPassenger()) { -@@ -676,7 +676,7 @@ public abstract class Player extends LivingEntity { +@@ -679,7 +679,7 @@ public abstract class Player extends LivingEntity { this.playShoulderEntityAmbientSound(this.getShoulderEntityLeft()); this.playShoulderEntityAmbientSound(this.getShoulderEntityRight()); @@ -4558,7 +4348,7 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf if (!this.level().paperConfig().entities.behavior.parrotsAreUnaffectedByPlayerMovement) // Paper - Add option to make parrots stay this.removeEntitiesOnShoulder(); } -@@ -723,10 +723,10 @@ public abstract class Player extends LivingEntity { +@@ -726,10 +726,10 @@ public abstract class Player extends LivingEntity { this.autoSpinAttackTicks = riptideTicks; this.autoSpinAttackDmg = riptideAttackDamage; this.autoSpinAttackItemStack = stack; @@ -4571,7 +4361,7 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf } -@@ -811,9 +811,11 @@ public abstract class Player extends LivingEntity { +@@ -814,9 +814,11 @@ public abstract class Player extends LivingEntity { @Nullable public ItemEntity drop(ItemStack itemstack, boolean flag, boolean flag1, boolean callEvent) { // CraftBukkit end @@ -4583,7 +4373,7 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf return null; } -@@ -1059,9 +1061,9 @@ public abstract class Player extends LivingEntity { +@@ -1062,9 +1064,9 @@ public abstract class Player extends LivingEntity { @Override protected void hurtCurrentlyUsedShield(float amount) { if (this.useItem.is(Items.SHIELD)) { @@ -4595,7 +4385,7 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf if (amount >= 3.0F) { int i = 1 + Mth.floor(amount); -@@ -1454,7 +1456,7 @@ public abstract class Player extends LivingEntity { +@@ -1457,7 +1459,7 @@ public abstract class Player extends LivingEntity { EnchantmentHelper.doPostAttackEffects(worldserver1, target, damagesource); } @@ -4604,7 +4394,7 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf if (flag5) { itemstack.postHurtEnemy((LivingEntity) object, this); } -@@ -1555,9 +1557,11 @@ public abstract class Player extends LivingEntity { +@@ -1558,9 +1560,11 @@ public abstract class Player extends LivingEntity { } @@ -4616,7 +4406,7 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf public GameProfile getGameProfile() { return this.gameProfile; -@@ -1895,14 +1899,14 @@ public abstract class Player extends LivingEntity { +@@ -1898,14 +1902,14 @@ public abstract class Player extends LivingEntity { public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) { // CraftBukkit end if (!this.abilities.invulnerable) { @@ -4633,7 +4423,7 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf } } -@@ -2098,7 +2102,7 @@ public abstract class Player extends LivingEntity { +@@ -2101,7 +2105,7 @@ public abstract class Player extends LivingEntity { private Entity respawnEntityOnShoulder0(CompoundTag nbttagcompound) { // CraftBukkit void->boolean // Paper end - release entity api - return entity - overload @@ -4643,10 +4433,10 @@ index c1d068fa99ec0fd5685bbb627a775e4d1587feab..f92b72ee0172cd878baef69b9710dbaf if (entity instanceof TamableAnimal) { ((TamableAnimal) entity).setOwnerUUID(this.uuid); diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 5006a59734c5fc7525fba86f7d74e74f8f1b54b0..3d4d1a247e14f97ddeab3c532341d0e8e89dc2e3 100644 +index e136738ed..8dfc26a94 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -@@ -229,13 +229,13 @@ public abstract class AbstractArrow extends Projectile { +@@ -231,13 +231,13 @@ public abstract class AbstractArrow extends Projectile { } if (this.isInGround() && flag) { @@ -4662,7 +4452,7 @@ index 5006a59734c5fc7525fba86f7d74e74f8f1b54b0..3d4d1a247e14f97ddeab3c532341d0e8 ++this.inGroundTime; if (this.isAlive()) { -@@ -486,7 +486,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -501,7 +501,7 @@ public abstract class AbstractArrow extends Projectile { if (entity instanceof LivingEntity) { LivingEntity entityliving1 = (LivingEntity) entity; @@ -4671,7 +4461,7 @@ index 5006a59734c5fc7525fba86f7d74e74f8f1b54b0..3d4d1a247e14f97ddeab3c532341d0e8 entityliving1.setArrowCount(entityliving1.getArrowCount() + 1); } -@@ -508,7 +508,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -523,7 +523,7 @@ public abstract class AbstractArrow extends Projectile { this.piercedAndKilledEntities.add(entityliving1); } @@ -4680,7 +4470,7 @@ index 5006a59734c5fc7525fba86f7d74e74f8f1b54b0..3d4d1a247e14f97ddeab3c532341d0e8 ServerPlayer entityplayer = (ServerPlayer) entity1; if (this.piercedAndKilledEntities != null) { -@@ -764,7 +764,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -779,7 +779,7 @@ public abstract class AbstractArrow extends Projectile { @Override public void playerTouch(Player player) { @@ -4689,20 +4479,20 @@ index 5006a59734c5fc7525fba86f7d74e74f8f1b54b0..3d4d1a247e14f97ddeab3c532341d0e8 // CraftBukkit start ItemStack itemstack = this.getPickupItem(); if (this.pickup == Pickup.ALLOWED && !itemstack.isEmpty() && player.getInventory().canHold(itemstack) > 0) { -@@ -888,7 +888,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -903,7 +903,7 @@ public abstract class AbstractArrow extends Projectile { } public boolean isNoPhysics() { - return !this.level().isClientSide ? this.noPhysics : ((Byte) this.entityData.get(AbstractArrow.ID_FLAGS) & 2) != 0; -+ return /*!this.level().isClientSide ?*/ this.noPhysics /*: ((Byte) this.entityData.get(AbstractArrow.ID_FLAGS) & 2) != 0*/; // Plazma - Remove persist 'isClientSide' flag ++ return /*!this.level().isClientSide ?*/ this.noPhysics; //: ((Byte) this.entityData.get(AbstractArrow.ID_FLAGS) & 2) != 0; // Plazma - Remove persist 'isClientSide' flag } @Override diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java -index a84dccc59f9dc5298b18f263dc779c30c9b7ddab..c496d825b42bb88e96e7e6aecbe2b3f2461e4238 100644 +index 19ff16e1b..6bfb7e4aa 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java -@@ -77,7 +77,7 @@ public abstract class AbstractHurtingProjectile extends Projectile { +@@ -73,7 +73,7 @@ public abstract class AbstractHurtingProjectile extends Projectile { Entity entity = this.getOwner(); this.applyInertia(); @@ -4853,7 +4643,7 @@ index 8a4e7e1c0c4919d2ee34121c14f9665b9ad95273..f07ad352ea991752625a5c6bdf6ae9cc super.handleEntityEvent(status); } 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 4daa69c6be6d48563e30343a7e40e4da9ec7e5ad..eb96b2fc32056275d3b9fe8e33162744a7b1870b 100644 +index 5e6ceb3c3..5af2f35d9 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java @@ -175,7 +175,7 @@ public class FishingHook extends Projectile { @@ -4898,18 +4688,22 @@ index 4daa69c6be6d48563e30343a7e40e4da9ec7e5ad..eb96b2fc32056275d3b9fe8e33162744 int i = 0; if (this.hookedIn != null) { -@@ -605,9 +605,11 @@ public class FishingHook extends Projectile { +@@ -603,6 +603,7 @@ public class FishingHook extends Projectile { + } + } ++ /* // Plazma - Remove persist 'isClientSide' flag @Override public void handleEntityEvent(byte status) { -+ /* // Plazma - Remove persist 'isClientSide' flag if (status == 31 && this.level().isClientSide && this.hookedIn instanceof net.minecraft.world.entity.player.Player && ((net.minecraft.world.entity.player.Player) this.hookedIn).isLocalPlayer()) { - this.pullEntity(this.hookedIn); - } -+ */ // Plazma - Remove persist 'isClientSide' flag +@@ -611,6 +612,7 @@ public class FishingHook extends Projectile { super.handleEntityEvent(status); } ++ */ // Plazma - Remove persist 'isClientSide' flag + + public void pullEntity(Entity entity) { + Entity entity1 = this.getOwner(); diff --git a/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java b/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java index 0b7f27a6cc6be58fa5b60002059c9fbb3b1b7b67..8b8977d9aadd929e2b1b4d8a1b76aa4f0b30352b 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java @@ -4927,7 +4721,7 @@ index 0b7f27a6cc6be58fa5b60002059c9fbb3b1b7b67..8b8977d9aadd929e2b1b4d8a1b76aa4f } diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index a7df9c2a3f210bc944cf76cdcc8d2a9484704bd1..4c65d1b1b1330b286dd32eb81bdf889c39a35166 100644 +index 40a151463..94a1246d9 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java @@ -383,7 +383,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { @@ -4999,7 +4793,7 @@ index 588b07ec4501924a49264183b414a7fd64bb6550..5bdd243b96042e301eed0d232b569b2a } } diff --git a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java -index 0db58e7d63a5c1b43a2224c247979f23a1d3f899..43e3bd03eb8378a80d1cd9a7804ac013c4333ea2 100644 +index 6fdacf2f6..32b3acba6 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java @@ -68,7 +68,7 @@ public class Snowball extends ThrowableItemProjectile { @@ -5119,7 +4913,7 @@ index e63b408594b5d2673148e39c1deafc8510537bee..7365dcde9d134bceeaed0b0fc16ea34c } diff --git a/src/main/java/net/minecraft/world/entity/projectile/windcharge/AbstractWindCharge.java b/src/main/java/net/minecraft/world/entity/projectile/windcharge/AbstractWindCharge.java -index a325a223d06e155c01f664562db0edd0b180e356..7fed147928ae3710808101ef3f9408af470452da 100644 +index 821c12369..e0afd713a 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/windcharge/AbstractWindCharge.java +++ b/src/main/java/net/minecraft/world/entity/projectile/windcharge/AbstractWindCharge.java @@ -108,23 +108,23 @@ public abstract class AbstractWindCharge extends AbstractHurtingProjectile imple diff --git a/patches/server/0043-Process-pathfinding-asynchronously.patch b/patches/work/0043-Process-pathfinding-asynchronously.patch similarity index 100% rename from patches/server/0043-Process-pathfinding-asynchronously.patch rename to patches/work/0043-Process-pathfinding-asynchronously.patch diff --git a/patches/server/0044-Implement-alternative-noise-chunk-generator.patch b/patches/work/0044-Implement-alternative-noise-chunk-generator.patch similarity index 100% rename from patches/server/0044-Implement-alternative-noise-chunk-generator.patch rename to patches/work/0044-Implement-alternative-noise-chunk-generator.patch diff --git a/patches/server/0045-Reduce-allocations.patch b/patches/work/0045-Reduce-allocations.patch similarity index 100% rename from patches/server/0045-Reduce-allocations.patch rename to patches/work/0045-Reduce-allocations.patch diff --git a/patches/server/0046-Hashed-rcon-password.patch b/patches/work/0046-Hashed-rcon-password.patch similarity index 100% rename from patches/server/0046-Hashed-rcon-password.patch rename to patches/work/0046-Hashed-rcon-password.patch diff --git a/patches/server/0047-Add-option-to-allow-shoot-fireball.patch b/patches/work/0047-Add-option-to-allow-shoot-fireball.patch similarity index 100% rename from patches/server/0047-Add-option-to-allow-shoot-fireball.patch rename to patches/work/0047-Add-option-to-allow-shoot-fireball.patch diff --git a/patches/server/0048-Remove-Mojang-Profiler-codes.patch b/patches/work/0048-Remove-Mojang-Profiler-codes.patch similarity index 100% rename from patches/server/0048-Remove-Mojang-Profiler-codes.patch rename to patches/work/0048-Remove-Mojang-Profiler-codes.patch diff --git a/patches/server/0049-Completely-remove-Mojang-profiler.patch b/patches/work/0049-Completely-remove-Mojang-profiler.patch similarity index 100% rename from patches/server/0049-Completely-remove-Mojang-profiler.patch rename to patches/work/0049-Completely-remove-Mojang-profiler.patch diff --git a/patches/server/0050-Port-minor-SparklyPaper-patches.patch b/patches/work/0050-Port-minor-SparklyPaper-patches.patch similarity index 100% rename from patches/server/0050-Port-minor-SparklyPaper-patches.patch rename to patches/work/0050-Port-minor-SparklyPaper-patches.patch diff --git a/patches/server/0051-SparklyPaper-Optimize-framed-map-tracker-ticking.patch b/patches/work/0051-SparklyPaper-Optimize-framed-map-tracker-ticking.patch similarity index 100% rename from patches/server/0051-SparklyPaper-Optimize-framed-map-tracker-ticking.patch rename to patches/work/0051-SparklyPaper-Optimize-framed-map-tracker-ticking.patch diff --git a/patches/server/0052-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch b/patches/work/0052-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch similarity index 100% rename from patches/server/0052-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch rename to patches/work/0052-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch diff --git a/patches/server/0053-SparklyPaper-MSPT-by-World.patch b/patches/work/0053-SparklyPaper-MSPT-by-World.patch similarity index 100% rename from patches/server/0053-SparklyPaper-MSPT-by-World.patch rename to patches/work/0053-SparklyPaper-MSPT-by-World.patch diff --git a/patches/server/0054-SparklyPaper-Optimize-farm-check.patch b/patches/work/0054-SparklyPaper-Optimize-farm-check.patch similarity index 100% rename from patches/server/0054-SparklyPaper-Optimize-farm-check.patch rename to patches/work/0054-SparklyPaper-Optimize-farm-check.patch diff --git a/patches/server/0055-SparklyPaper-Optimize-season-check.patch b/patches/work/0055-SparklyPaper-Optimize-season-check.patch similarity index 100% rename from patches/server/0055-SparklyPaper-Optimize-season-check.patch rename to patches/work/0055-SparklyPaper-Optimize-season-check.patch diff --git a/patches/server/0056-SparklyPaper-Optimize-tickingBlockEntity.patch b/patches/work/0056-SparklyPaper-Optimize-tickingBlockEntity.patch similarity index 100% rename from patches/server/0056-SparklyPaper-Optimize-tickingBlockEntity.patch rename to patches/work/0056-SparklyPaper-Optimize-tickingBlockEntity.patch diff --git a/patches/server/0057-Implement-CarpetFixes.patch b/patches/work/0057-Implement-CarpetFixes.patch similarity index 100% rename from patches/server/0057-Implement-CarpetFixes.patch rename to patches/work/0057-Implement-CarpetFixes.patch diff --git a/patches/server/0058-Ticking-Controller.patch b/patches/work/0058-Ticking-Controller.patch similarity index 100% rename from patches/server/0058-Ticking-Controller.patch rename to patches/work/0058-Ticking-Controller.patch diff --git a/patches/server/0059-Add-option-to-disable-beacon-effect-ambient.patch b/patches/work/0059-Add-option-to-disable-beacon-effect-ambient.patch similarity index 100% rename from patches/server/0059-Add-option-to-disable-beacon-effect-ambient.patch rename to patches/work/0059-Add-option-to-disable-beacon-effect-ambient.patch diff --git a/patches/server/0060-Tick-toggle-subcommand.patch b/patches/work/0060-Tick-toggle-subcommand.patch similarity index 100% rename from patches/server/0060-Tick-toggle-subcommand.patch rename to patches/work/0060-Tick-toggle-subcommand.patch